android:columnWidth="@dimen/album_set_item_width"
android:stretchMode="columnWidth"
android:drawSelectorOnTop="true"
- android:padding="10dp"
- android:horizontalSpacing="10dp"
- android:verticalSpacing="10dp" />
+ android:background="#E5E5E5"
+ android:paddingLeft="10dp"
+ android:paddingRight="10dp"
+ android:horizontalSpacing="6dp"
+ android:verticalSpacing="6dp" />
<TextView
android:id="@id/android:empty"
<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:background="#FFF" >
+ android:orientation="vertical"
+ android:background="?android:attr/activatedBackgroundIndicator"
+ android:padding="2dp" >
- <TextView
- android:id="@+id/album_set_item_title"
- android:layout_width="wrap_content"
+ <LinearLayout
android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:layout_marginLeft="10dp"
- android:layout_marginTop="10dp"
- android:ellipsize="end"
- android:singleLine="true"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:padding="10dp"
+ android:background="#FFF" >
- <TextView
- android:id="@+id/album_set_item_date"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignLeft="@+id/album_set_item_title"
- android:layout_below="@+id/album_set_item_title"
- android:layout_marginBottom="10dp"
- android:textAppearance="?android:attr/textAppearanceSmall" />
+ <TextView
+ android:id="@+id/album_set_item_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ <TextView
+ android:id="@+id/album_set_item_count"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="#AAA" />
+ </LinearLayout>
<ImageView
android:id="@+id/album_set_item_image"
android:layout_width="match_parent"
android:layout_height="@dimen/album_set_item_image_height"
- android:layout_below="@+id/album_set_item_date"
android:scaleType="centerCrop" />
-
- <ProgressBar
- android:id="@+id/album_set_item_upload_progress"
- style="?android:attr/progressBarStyleHorizontal"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="invisible"
- android:layout_alignParentBottom="true" />
-</RelativeLayout>
\ No newline at end of file
+</LinearLayout>
\ No newline at end of file
public void setDrawableFactory(LoaderCompatShim<Cursor> factory) {
mDrawableFactory = factory;
}
- private Date mDate = new Date(); // Used for converting timestamps for display
public AlbumSetCursorAdapter(Context context) {
super(context, null, false);
R.id.album_set_item_title);
titleTextView.setText(cursor.getString(AlbumSetLoader.INDEX_TITLE));
- TextView dateTextView = (TextView) v.findViewById(
- R.id.album_set_item_date);
- long timestamp = cursor.getLong(AlbumSetLoader.INDEX_TIMESTAMP);
- if (timestamp > 0) {
- mDate.setTime(timestamp);
- dateTextView.setText(DateFormat.getMediumDateFormat(context).format(mDate));
- } else {
- dateTextView.setText(null);
- }
-
- ProgressBar uploadProgressBar = (ProgressBar) v.findViewById(
- R.id.album_set_item_upload_progress);
- if (cursor.getInt(AlbumSetLoader.INDEX_COUNT_PENDING_UPLOAD) > 0) {
- uploadProgressBar.setVisibility(View.VISIBLE);
- uploadProgressBar.setProgress(50);
- } else {
- uploadProgressBar.setVisibility(View.INVISIBLE);
- }
+ TextView countTextView = (TextView) v.findViewById(
+ R.id.album_set_item_count);
+ int count = cursor.getInt(AlbumSetLoader.INDEX_COUNT);
+ countTextView.setText(context.getResources().getQuantityString(
+ R.plurals.number_of_photos, count, count));
ImageView thumbImageView = (ImageView) v.findViewById(
R.id.album_set_item_image);