[Android] [PATCH 2/4] Cardview for video browsing
Geoffrey Métais
geoffrey.metais at gmail.com
Mon Nov 3 16:21:46 CET 2014
---
.../drawable-hdpi/ic_more_vert_grey600_24dp.png | Bin 0 -> 221 bytes
.../drawable-mdpi/ic_more_vert_grey600_24dp.png | Bin 0 -> 202 bytes
.../drawable-xhdpi/ic_more_vert_grey600_24dp.png | Bin 0 -> 252 bytes
vlc-android/res/layout/video_grid_card.xml | 73 +++++++++++++++++++++
vlc-android/res/layout/video_grid_item.xml | 61 -----------------
vlc-android/res/layout/video_list_card.xml | 73 +++++++++++++++++++++
vlc-android/res/layout/video_list_item.xml | 67 -------------------
vlc-android/res/values-land/booleans.xml | 4 ++
vlc-android/res/values-sw600dp/booleans.xml | 4 ++
vlc-android/res/values-sw600dp/dimens.xml | 8 +++
vlc-android/res/values/booleans.xml | 4 ++
vlc-android/res/values/dimens.xml | 6 ++
.../videolan/vlc/gui/video/VideoGridFragment.java | 37 ++---------
.../videolan/vlc/gui/video/VideoListAdapter.java | 8 +--
14 files changed, 181 insertions(+), 164 deletions(-)
create mode 100644 vlc-android/res/drawable-hdpi/ic_more_vert_grey600_24dp.png
create mode 100644 vlc-android/res/drawable-mdpi/ic_more_vert_grey600_24dp.png
create mode 100644 vlc-android/res/drawable-xhdpi/ic_more_vert_grey600_24dp.png
create mode 100644 vlc-android/res/layout/video_grid_card.xml
delete mode 100644 vlc-android/res/layout/video_grid_item.xml
create mode 100644 vlc-android/res/layout/video_list_card.xml
delete mode 100644 vlc-android/res/layout/video_list_item.xml
create mode 100644 vlc-android/res/values-land/booleans.xml
create mode 100644 vlc-android/res/values-sw600dp/booleans.xml
create mode 100644 vlc-android/res/values-sw600dp/dimens.xml
create mode 100644 vlc-android/res/values/booleans.xml
diff --git a/vlc-android/res/drawable-hdpi/ic_more_vert_grey600_24dp.png b/vlc-android/res/drawable-hdpi/ic_more_vert_grey600_24dp.png
new file mode 100644
index 0000000000000000000000000000000000000000..e141502a69bd1442b49b6a5cc1b35fe71be48ebe
GIT binary patch
literal 221
zcmeAS at N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K;Lb6AYF9SoB8UsT^3j at P1pisjL
z28L1t28LG&3=CE?7#PG0=Ijcz0ZK3>dAqwX{BQ3+vmeOgEbxddW?<k3n!+v2$S`Y;
z1W+*4)5S5w<M`W4J9!T%2(Vu4<>B?0_fWX?B;$bJn%o3gg`e4<#CsF(r!<{wG at 5&M
z(Zr;H=XI+MGptRLFBD}QS at 0~N)3NhZO27`2C2dzGNCi1(o%rv-|4 at I)+XZ<SS%DTX
Nc)I$ztaD0e0ss#AMoj<!
literal 0
HcmV?d00001
diff --git a/vlc-android/res/drawable-mdpi/ic_more_vert_grey600_24dp.png b/vlc-android/res/drawable-mdpi/ic_more_vert_grey600_24dp.png
new file mode 100644
index 0000000000000000000000000000000000000000..4ed34354b293bc21ded8fdc063f68280a9627ab8
GIT binary patch
literal 202
zcmeAS at N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1g=CK)Uj~LMH3o);76yi2K%s^g
z3=E|P3=FRl7#OT(FffQ0%-I!a1C(G&@^*J&_}|`tW<QX}S>O=~G=W<fgc%uT%>kM1
z<muuVVsScICsl#hfKQayk;ho_pYal-9F?%c*=&LeKf4^~MDVVcaA|zv&BmEz`os7P
olXd3j42|BlOCPvZv$7Z%OvN<?C-YS80h-3(>FVdQ&MBb at 0ROQx761SM
literal 0
HcmV?d00001
diff --git a/vlc-android/res/drawable-xhdpi/ic_more_vert_grey600_24dp.png b/vlc-android/res/drawable-xhdpi/ic_more_vert_grey600_24dp.png
new file mode 100644
index 0000000000000000000000000000000000000000..7bc63a511de28fa7260348468d9523e8a42413fe
GIT binary patch
literal 252
zcmeAS at N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}tg=CK)Uj~LMH3o);76yi2K%s^g
z3=E|}g|8AA7_4S6Fo+k-*%fF5lweBoc6VX;-`;;_Kaj^+;1OBOz`!jG!i)^F=12eq
zOFUg1Ln02py<*69KtaGI&|mn- at 4v;KM~YdSqh_l~ywTahdHCDsSx=?U+%slk`NLh{
zqSe}Pm(e2cR(0mQ8SF{(^G(iub&ze?Bd4*u(SV`OHo>#@-=iBJmra}ObL{+iZPBcW
rQA@;Dx-wl++UlVjq{YJV;~itF^yUaYL$~)p`x!i4{an^LB{Ts5+|g0{
literal 0
HcmV?d00001
diff --git a/vlc-android/res/layout/video_grid_card.xml b/vlc-android/res/layout/video_grid_card.xml
new file mode 100644
index 0000000..2bd11ce
--- /dev/null
+++ b/vlc-android/res/layout/video_grid_card.xml
@@ -0,0 +1,73 @@
+<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:card_view="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/card_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ card_view:cardUseCompatPadding="true"
+ card_view:cardElevation="1sp" >
+
+ <RelativeLayout
+ android:id="@+id/layout_item"
+ android:layout_width="@dimen/grid_card_width"
+ android:layout_height="@dimen/grid_card_height"
+ android:gravity="center_vertical"
+ android:orientation="vertical" >
+
+ <ImageView
+ android:id="@+id/ml_item_thumbnail"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/grid_card_thumb_height"
+ android:layout_alignParentTop="true"
+ android:scaleType="fitCenter" />
+
+ <TextView
+ android:id="@+id/ml_item_title"
+ android:textSize="@dimen/grid_card_title_text_size"
+ android:textColor="?attr/list_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/ml_item_thumbnail"
+ android:layout_toLeftOf="@+id/item_more"
+ android:layout_marginTop="5dp"
+ android:ellipsize="end"
+ android:gravity="center_horizontal"
+ android:maxLines="2" />
+
+ <ImageView
+ android:id="@+id/item_more"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_below="@id/ml_item_thumbnail"
+ android:layout_marginTop="10dp"
+ android:layout_marginRight="7dp"
+ android:clickable="true"
+ android:src="@drawable/ic_more_vert_grey600_24dp" />
+
+ <TextView
+ android:id="@+id/ml_item_subtitle"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_marginBottom="3dp"
+ android:gravity="center_horizontal"
+ android:singleLine="true"
+ android:textSize="@dimen/grid_card_subtitle_text_size"
+ android:textColor="?attr/list_subtitle" />
+
+ <ProgressBar
+ android:id="@+id/ml_item_progress"
+ style="@style/Widget.AppCompat.ProgressBar.Horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:focusable="false"
+ android:indeterminate="false"
+ android:maxHeight="3dip"
+ android:minHeight="3dip"
+ android:progressDrawable="@drawable/gridview_progressbar" />
+
+ </RelativeLayout>
+
+</android.support.v7.widget.CardView>
\ No newline at end of file
diff --git a/vlc-android/res/layout/video_grid_item.xml b/vlc-android/res/layout/video_grid_item.xml
deleted file mode 100644
index efc8506..0000000
--- a/vlc-android/res/layout/video_grid_item.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/layout_item"
- android:layout_width="160dip"
- android:layout_height="150dip"
- android:orientation="vertical"
- android:gravity="center_vertical">
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:orientation="vertical">
- <ImageView
- android:id="@+id/ml_item_thumbnail"
- android:layout_width="160dip"
- android:layout_height="100dip"
- android:scaleType="fitCenter"
- android:layout_gravity="center_horizontal" />
- <ProgressBar
- style="@android:style/Widget.ProgressBar.Horizontal"
- android:id="@+id/ml_item_progress"
- android:layout_height="wrap_content"
- android:layout_width="fill_parent"
- android:minHeight="2dip"
- android:maxHeight="2dip"
- android:progressDrawable="@drawable/gridview_progressbar"
- android:focusable="false"
- android:indeterminate="false" />
- </LinearLayout>
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:orientation="vertical">
- <TextView
- android:id="@+id/ml_item_title"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:ellipsize="end"
- android:maxLines="2"
- android:textSize="12sp"
- android:textColor="?attr/list_title" />
- <TextView
- android:id="@+id/ml_item_subtitle"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:textSize="10sp"
- android:textColor="?attr/list_subtitle" />
- </LinearLayout>
- <ImageView
- android:id="@+id/item_more"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_more"
- android:layout_alignParentBottom="true"
- android:layout_alignParentRight="true"
- android:clickable="true" />
-</RelativeLayout>
\ No newline at end of file
diff --git a/vlc-android/res/layout/video_list_card.xml b/vlc-android/res/layout/video_list_card.xml
new file mode 100644
index 0000000..51b84df
--- /dev/null
+++ b/vlc-android/res/layout/video_list_card.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:card_view="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/layout_item"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ card_view:cardUseCompatPadding="true"
+ card_view:cardElevation="1sp" >
+
+ <RelativeLayout
+ android:id="@+id/ml_item_layout_thumbnail"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <ImageView
+ android:id="@+id/ml_item_thumbnail"
+ android:layout_width="120dip"
+ android:layout_height="75dip"
+ android:scaleType="fitCenter"
+ android:layout_alignParentLeft="true" />
+
+ <TextView
+ android:id="@+id/ml_item_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toRightOf="@id/ml_item_thumbnail"
+ android:layout_toLeftOf="@+id/item_more"
+ android:ellipsize="end"
+ android:maxLines="2"
+ android:paddingLeft="12dip"
+ android:textColor="?attr/list_title"
+ android:textSize="17sp" />
+
+ <TextView
+ android:id="@+id/ml_item_subtitle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/ml_item_title"
+ android:layout_alignLeft="@id/ml_item_title"
+ android:paddingLeft="12dip"
+ android:textColor="?attr/list_subtitle"
+ android:textSize="14sp" />
+
+ <ProgressBar
+ android:id="@+id/ml_item_progress"
+ style="@android:style/Widget.ProgressBar.Horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_toRightOf="@id/ml_item_thumbnail"
+ android:layout_marginRight="20dip"
+ android:layout_marginLeft="10dip"
+ android:paddingBottom="3dip"
+ android:focusable="false"
+ android:indeterminate="false"
+ android:maxHeight="3dip"
+ android:minHeight="3dip"
+ android:progressDrawable="@drawable/gridview_progressbar" />
+
+ <ImageView
+ android:id="@+id/item_more"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:layout_marginTop="10dip"
+ android:layout_alignParentRight="true"
+ android:clickable="true"
+ android:src="@drawable/ic_more_vert_grey600_24dp" />
+
+ </RelativeLayout>
+
+</android.support.v7.widget.CardView>
\ No newline at end of file
diff --git a/vlc-android/res/layout/video_list_item.xml b/vlc-android/res/layout/video_list_item.xml
deleted file mode 100644
index 6fdc4b4..0000000
--- a/vlc-android/res/layout/video_list_item.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/layout_item"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:gravity="center_vertical">
- <LinearLayout
- android:id="@+id/ml_item_layout_thumbnail"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:orientation="vertical">
- <ImageView
- android:id="@+id/ml_item_thumbnail"
- android:layout_width="120dip"
- android:layout_height="75dip"
- android:scaleType="fitCenter" />
- <ProgressBar
- style="@android:style/Widget.ProgressBar.Horizontal"
- android:id="@+id/ml_item_progress"
- android:layout_height="wrap_content"
- android:layout_width="fill_parent"
- android:minHeight="2dip"
- android:maxHeight="2dip"
- android:progressDrawable="@drawable/gridview_progressbar"
- android:focusable="false"
- android:indeterminate="false" />
- </LinearLayout>
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toRightOf="@+id/ml_item_layout_thumbnail"
- android:layout_centerVertical="true"
- 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="17sp"
- android:textColor="?attr/list_title"
- android:paddingLeft="12dip" />
- <TextView
- android:id="@+id/ml_item_subtitle"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textSize="14sp"
- android:textColor="?attr/list_subtitle"
- android:paddingLeft="12dip" />
- </LinearLayout>
- <ImageView
- android:id="@+id/item_more"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_more"
- android:layout_alignParentBottom="true"
- android:layout_alignParentRight="true"
- android:clickable="true" />
- <View
- android:layout_width="wrap_content"
- android:layout_height="1dp"
- android:layout_below="@+id/ml_item_layout_thumbnail"
- android:background="?attr/item_footer" />
-</RelativeLayout>
\ No newline at end of file
diff --git a/vlc-android/res/values-land/booleans.xml b/vlc-android/res/values-land/booleans.xml
new file mode 100644
index 0000000..75fa6c1
--- /dev/null
+++ b/vlc-android/res/values-land/booleans.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <bool name="list_mode">false</bool>
+</resources>
\ No newline at end of file
diff --git a/vlc-android/res/values-sw600dp/booleans.xml b/vlc-android/res/values-sw600dp/booleans.xml
new file mode 100644
index 0000000..75fa6c1
--- /dev/null
+++ b/vlc-android/res/values-sw600dp/booleans.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <bool name="list_mode">false</bool>
+</resources>
\ No newline at end of file
diff --git a/vlc-android/res/values-sw600dp/dimens.xml b/vlc-android/res/values-sw600dp/dimens.xml
new file mode 100644
index 0000000..bad3a26
--- /dev/null
+++ b/vlc-android/res/values-sw600dp/dimens.xml
@@ -0,0 +1,8 @@
+<resources>
+ <dimen name="grid_card_width">200dp</dimen>
+ <dimen name="grid_card_height">200dp</dimen>
+ <dimen name="grid_card_thumb_height">120dp</dimen>
+ <dimen name="grid_card_title_text_size">16sp</dimen>
+ <dimen name="grid_card_subtitle_text_size">12sp</dimen>
+ <dimen name="grid_card_vertical_spacing">10dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/vlc-android/res/values/booleans.xml b/vlc-android/res/values/booleans.xml
new file mode 100644
index 0000000..9d519cd
--- /dev/null
+++ b/vlc-android/res/values/booleans.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <bool name="list_mode">true</bool>
+</resources>
\ No newline at end of file
diff --git a/vlc-android/res/values/dimens.xml b/vlc-android/res/values/dimens.xml
index ffdd68e..6ee2770 100644
--- a/vlc-android/res/values/dimens.xml
+++ b/vlc-android/res/values/dimens.xml
@@ -3,4 +3,10 @@
<dimen name="widget_margin">10dp</dimen>
<dimen name="audio_browser_item_size">50dp</dimen>
<dimen name="listview_bottom_padding">50dp</dimen>
+ <dimen name="grid_card_width">160dp</dimen>
+ <dimen name="grid_card_height">160dp</dimen>
+ <dimen name="grid_card_thumb_height">100dp</dimen>
+ <dimen name="grid_card_title_text_size">12sp</dimen>
+ <dimen name="grid_card_subtitle_text_size">10sp</dimen>
+ <dimen name="grid_card_vertical_spacing">0dp</dimen>
</resources>
\ No newline at end of file
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index 1b4cad2..8de4cbe 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -50,6 +50,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
+import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
@@ -81,14 +82,7 @@ public class VideoGridFragment extends SherlockGridFragment implements ISortable
protected static final String ACTION_SCAN_STOP = "org.videolan.vlc.gui.ScanStop";
protected static final int UPDATE_ITEM = 0;
- /* Constants used to switch from Grid to List and vice versa */
- //FIXME If you know a way to do this in pure XML please do it!
- private static final int GRID_ITEM_WIDTH_DP = 156;
- private static final int GRID_HORIZONTAL_SPACING_DP = 20;
- private static final int GRID_VERTICAL_SPACING_DP = 20;
private static final int GRID_STRETCH_MODE = GridView.STRETCH_COLUMN_WIDTH;
- private static final int LIST_HORIZONTAL_SPACING_DP = 0;
- private static final int LIST_VERTICAL_SPACING_DP = 10;
private static final int LIST_STRETCH_MODE = GridView.STRETCH_COLUMN_WIDTH;
protected LinearLayout mLayoutFlipperLoading;
@@ -207,29 +201,13 @@ public class VideoGridFragment extends SherlockGridFragment implements ISortable
mVideoAdapter.clear();
}
- private boolean hasSpaceForGrid(View v) {
- final Activity activity = getActivity();
- if (activity == null)
- return true;
-
- DisplayMetrics outMetrics = new DisplayMetrics();
- activity.getWindowManager().getDefaultDisplay().getMetrics(outMetrics);
-
- final int itemWidth = Util.convertDpToPx(GRID_ITEM_WIDTH_DP);
- final int horizontalspacing = Util.convertDpToPx(GRID_HORIZONTAL_SPACING_DP);
- final int width = mGridView.getPaddingLeft() + mGridView.getPaddingRight()
- + horizontalspacing + (itemWidth * 2);
- if (width < outMetrics.widthPixels)
- return true;
- return false;
- }
-
private void updateViewMode() {
if (getView() == null || getActivity() == null) {
Log.w(TAG, "Unable to setup the view");
return;
}
+ Resources res = getResources();
// Compute the left/right padding dynamically
DisplayMetrics outMetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(outMetrics);
@@ -239,20 +217,15 @@ public class VideoGridFragment extends SherlockGridFragment implements ISortable
sidePadding, mGridView.getPaddingBottom());
// Select between grid or list
- if (hasSpaceForGrid(getView())) {
- Log.d(TAG, "Switching to grid mode");
+ if (!res.getBoolean(R.bool.list_mode)) {
mGridView.setNumColumns(GridView.AUTO_FIT);
mGridView.setStretchMode(GRID_STRETCH_MODE);
- mGridView.setHorizontalSpacing(Util.convertDpToPx(GRID_HORIZONTAL_SPACING_DP));
- mGridView.setVerticalSpacing(Util.convertDpToPx(GRID_VERTICAL_SPACING_DP));
- mGridView.setColumnWidth(Util.convertDpToPx(GRID_ITEM_WIDTH_DP));
+ mGridView.setColumnWidth(res.getDimensionPixelSize(R.dimen.grid_card_width));
+ mGridView.setVerticalSpacing(res.getDimensionPixelSize(R.dimen.grid_card_vertical_spacing));
mVideoAdapter.setListMode(false);
} else {
- Log.d(TAG, "Switching to list mode");
mGridView.setNumColumns(1);
mGridView.setStretchMode(LIST_STRETCH_MODE);
- mGridView.setHorizontalSpacing(LIST_HORIZONTAL_SPACING_DP);
- mGridView.setVerticalSpacing(Util.convertDpToPx(LIST_VERTICAL_SPACING_DP));
mVideoAdapter.setListMode(true);
}
}
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
index 243c04d..70ec8bc 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
@@ -139,9 +139,9 @@ public class VideoListAdapter extends ArrayAdapter<Media>
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (!mListMode)
- v = inflater.inflate(R.layout.video_grid_item, parent, false);
+ v = inflater.inflate(R.layout.video_grid_card, parent, false);
else
- v = inflater.inflate(R.layout.video_list_item, parent, false);
+ v = inflater.inflate(R.layout.video_list_card, parent, false);
holder = new ViewHolder();
holder.layout = v.findViewById(R.id.layout_item);
@@ -203,7 +203,7 @@ public class VideoListAdapter extends ArrayAdapter<Media>
holder.subtitle.setText(text);
holder.title.setText(media.getTitle() + "\u2026"); // ellipsis
holder.more.setVisibility(View.INVISIBLE);
- holder.progress.setVisibility(View.GONE);
+ holder.progress.setVisibility(View.INVISIBLE);
}
private void fillVideoView(ViewHolder holder, Media media) {
@@ -219,7 +219,7 @@ public class VideoListAdapter extends ArrayAdapter<Media>
holder.progress.setProgress((int) (lastTime / 1000));
} else {
text = Strings.millisToText(media.getLength());
- holder.progress.setVisibility(View.GONE);
+ holder.progress.setVisibility(View.INVISIBLE);
}
if (media.getWidth() > 0 && media.getHeight() > 0) {
--
1.9.1
More information about the Android
mailing list