[Android] UI : Rework media information view
Alexandre Perraud
git at videolan.org
Thu Mar 5 17:19:08 CET 2015
vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Thu Mar 5 17:16:46 2015 +0100| [9c9e35be68c87389d8008c16384638fa9ea1b051] | committer: Alexandre Perraud
UI : Rework media information view
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=9c9e35be68c87389d8008c16384638fa9ea1b051
---
vlc-android/res/layout-land/media_info.xml | 24 ++++++++---------
vlc-android/res/layout/media_info.xml | 28 +++++++++-----------
vlc-android/res/values/dimens.xml | 4 +++
.../videolan/vlc/gui/video/MediaInfoFragment.java | 6 ++---
4 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/vlc-android/res/layout-land/media_info.xml b/vlc-android/res/layout-land/media_info.xml
index d5cc2e5..22546f0 100644
--- a/vlc-android/res/layout-land/media_info.xml
+++ b/vlc-android/res/layout-land/media_info.xml
@@ -29,7 +29,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
- android:layout_marginBottom="25dp"
+ android:layout_marginBottom="36dp"
android:scaleType="centerCrop" />
<ImageButton
@@ -38,7 +38,7 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_marginRight="10dip"
- android:background="@drawable/ic_play_circle"
+ android:background="@drawable/ic_fab_play"
android:visibility="invisible" />
<TextView
@@ -46,8 +46,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|left"
- android:layout_marginLeft="10dip"
- android:layout_marginBottom="25dp"
+ android:layout_marginLeft="@dimen/default_margin"
+ android:layout_marginBottom="36dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/white"
android:visibility="invisible" />
@@ -56,6 +56,7 @@
android:id="@+id/info_path"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/default_margin"
android:layout_marginBottom="10dp"
android:layout_below="@+id/image_container"/>
<TextView
@@ -63,6 +64,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/file_size"
+ android:layout_marginLeft="@dimen/default_margin"
android:layout_marginRight="5dp"
android:layout_below="@+id/info_path"
android:layout_alignBottom="@+id/info_delete"
@@ -79,25 +81,23 @@
android:gravity="center_vertical"/>
<ImageView
android:id="@+id/info_subtitles"
- android:layout_width="20dp"
- android:layout_height="20dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_below="@+id/info_path"
android:layout_toRightOf="@+id/size_value"
android:src="@drawable/ic_audiosub_circle_normal_o"
android:visibility="invisible"/>
- <Button
+ <ImageButton
android:id="@+id/info_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/info_path"
android:layout_alignParentRight="true"
+ android:layout_marginRight="@dimen/default_margin"
android:clickable="true"
- android:text="@string/delete"
- android:textColor="@color/blue"
- android:textAllCaps="true"
- tools:targetApi="11"
- style="?android:attr/borderlessButtonStyle"/>
+ android:background="?attr/ic_trash_small_normal"
+ tools:targetApi="11"/>
</RelativeLayout>
<ListView
android:id="@id/android:list"
diff --git a/vlc-android/res/layout/media_info.xml b/vlc-android/res/layout/media_info.xml
index a9f57e9..5565d14 100644
--- a/vlc-android/res/layout/media_info.xml
+++ b/vlc-android/res/layout/media_info.xml
@@ -24,7 +24,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
- android:layout_marginBottom="25dp"
+ android:layout_marginBottom="36dp"
android:scaleType="fitCenter" />
<ImageButton
@@ -32,8 +32,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
- android:layout_marginRight="10dip"
- android:background="@drawable/ic_play_circle"
+ android:layout_marginRight="10dp"
+ android:background="@drawable/ic_fab_play"
android:visibility="invisible" />
<TextView
@@ -41,26 +41,27 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|left"
- android:layout_marginLeft="10dip"
- android:layout_marginBottom="25dp"
+ android:layout_marginLeft="@dimen/default_margin"
+ android:layout_marginBottom="36dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/white"
+ android:text="length"
android:visibility="invisible" />
</FrameLayout>
<TextView
android:id="@+id/info_path"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:layout_marginRight="10dp"
+ android:layout_marginLeft="@dimen/default_margin"
android:layout_marginBottom="5dp"
+ android:text="info_path"
android:layout_below="@+id/image_container"/>
<TextView
android:id="@+id/size_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/file_size"
- android:layout_marginLeft="10dp"
+ android:layout_marginLeft="@dimen/default_margin"
android:layout_marginRight="5dp"
android:layout_below="@+id/info_path"/>
<TextView
@@ -78,19 +79,16 @@
android:layout_toRightOf="@+id/size_value"
android:src="@drawable/ic_audiosub_circle_normal_o"
android:visibility="invisible"/>
- <Button
+ <ImageButton
android:id="@+id/info_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginRight="@dimen/default_margin"
android:layout_below="@+id/info_path"
android:layout_alignParentRight="true"
- android:layout_marginRight="10dp"
android:clickable="true"
- android:text="@string/delete"
- android:textColor="@color/blue"
- android:textAllCaps="true"
- tools:targetApi="11"
- style="?android:attr/borderlessButtonStyle"/>
+ android:background="?attr/ic_trash_small_normal"
+ tools:targetApi="11"/>
</RelativeLayout>
<ListView
diff --git a/vlc-android/res/values/dimens.xml b/vlc-android/res/values/dimens.xml
index ef4f530..4106c87 100644
--- a/vlc-android/res/values/dimens.xml
+++ b/vlc-android/res/values/dimens.xml
@@ -27,4 +27,8 @@
<dimen name="media_ctrl_margin_top">20dp</dimen>
<dimen name="tv_overscan_vertical">0dp</dimen>
<dimen name="tv_overscan_horizontal">0dp</dimen>
+
+ <!-- Default -->
+ <dimen name="default_margin">16dp</dimen>
+
</resources>
\ No newline at end of file
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
index c8edac5..53af358 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
@@ -71,7 +71,7 @@ public class MediaInfoFragment extends ListFragment {
private TextView mSizeView;
private TextView mPathView;
private ImageButton mPlayButton;
- private Button mDelete;
+ private ImageButton mDelete;
private ImageView mSubtitles;
private Media mMedia;
private MediaInfoAdapter mAdapter;
@@ -92,10 +92,8 @@ public class MediaInfoFragment extends ListFragment {
mSizeView = (TextView) v.findViewById(R.id.size_value);
mPathView = (TextView) v.findViewById(R.id.info_path);
mPlayButton = (ImageButton) v.findViewById(R.id.play);
- mDelete = (Button) v.findViewById(R.id.info_delete);
+ mDelete = (ImageButton) v.findViewById(R.id.info_delete);
mSubtitles = (ImageView) v.findViewById(R.id.info_subtitles);
- if (!LibVlcUtil.isICSOrLater())
- mDelete.setText(getString(R.string.delete).toUpperCase(Locale.getDefault()));
mPathView.setText(mItem == null ? "" : Uri.decode(mItem.getLocation().substring(7)));
mPlayButton.setOnClickListener(new OnClickListener() {
More information about the Android
mailing list