Commit b6014eab authored by Sébastien Toque's avatar Sébastien Toque

UI: Add resolution bellow the video title, and move the length beside it

parent 0caadc1e
......@@ -6,38 +6,33 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical">
<FrameLayout
<ImageView
android:id="@+id/ml_item_thumbnail"
android:layout_width="120dip"
android:layout_height="80dip">
<ImageView
android:id="@+id/ml_item_thumbnail"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="bottom|right"
android:padding="2dip">
<TextView
android:id="@+id/ml_item_length"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/video_list_length_bg"
android:textSize="12dip"
android:textColor="#CCCCCC" />
</LinearLayout>
</FrameLayout>
<TextView
android:id="@+id/ml_item_title"
android:layout_height="80dip"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="2"
android:textSize="17dip"
android:textColor="@color/video_list_title"
android:paddingLeft="12dip" />
android:orientation="vertical">
<TextView
android:id="@+id/ml_item_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:textSize="17dip"
android:textColor="@color/video_list_title"
android:paddingLeft="12dip" />
<TextView
android:id="@+id/ml_item_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14dip"
android:textColor="#888888"
android:paddingLeft="12dip" />
</LinearLayout>
<ImageView
android:id="@+id/ml_item_more"
android:layout_width="wrap_content"
......
......@@ -124,8 +124,8 @@ public class VideoListAdapter extends ArrayAdapter<Media>
holder = new ViewHolder();
holder.layout = (View) v.findViewById(R.id.layout_item);
holder.thumbnail = (ImageView) v.findViewById(R.id.ml_item_thumbnail);
holder.length = (TextView) v.findViewById(R.id.ml_item_length);
holder.title = (TextView) v.findViewById(R.id.ml_item_title);
holder.subtitle = (TextView) v.findViewById(R.id.ml_item_subtitle);
holder.more = (ImageView) v.findViewById(R.id.ml_item_more);
v.setTag(holder);
} else
......@@ -134,7 +134,6 @@ public class VideoListAdapter extends ArrayAdapter<Media>
Media media = getItem(position);
Util.setItemBackground(holder.layout, position);
holder.title.setText(media.getTitle());
holder.length.setText(" " + Util.millisToString(media.getLength()) + " ");
Bitmap thumbnail;
if (media.getPicture() != null) {
......@@ -147,6 +146,8 @@ public class VideoListAdapter extends ArrayAdapter<Media>
}
holder.title.setTextColor(media.getLocation().equals(mLastMRL) ? 0xFFF48B00 /* ORANGE */ : Color.WHITE);
holder.subtitle.setText(String.format("%s - %dx%d",
Util.millisToString(media.getLength()), media.getWidth(), media.getHeight()));
holder.more.setTag(media);
holder.more.setOnClickListener(moreClickListener);
......@@ -167,8 +168,8 @@ public class VideoListAdapter extends ArrayAdapter<Media>
static class ViewHolder {
View layout;
ImageView thumbnail;
TextView length;
TextView title;
TextView subtitle;
ImageView more;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment