[Android] Fix the no-media view behaviour
Alexandre Perraud
git at videolan.org
Tue Jun 21 16:10:29 CEST 2016
vlc-android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Tue Jun 21 15:58:07 2016 +0200| [2dbd0d01991d1c352e97c2e2d6579a9e72f5869e] | committer: Alexandre Perraud
Fix the no-media view behaviour
> https://code.videolan.org/videolan/vlc-android/commit/2dbd0d01991d1c352e97c2e2d6579a9e72f5869e
---
assets/images/svg/ic_no_media.svg | 12 ++++++------
vlc-android/res/drawable-hdpi/ic_no_media.png | Bin 6609 -> 3219 bytes
vlc-android/res/drawable-ldpi/ic_no_media.png | Bin 2941 -> 1617 bytes
vlc-android/res/drawable-mdpi/ic_no_media.png | Bin 4385 -> 2235 bytes
vlc-android/res/drawable-xhdpi/ic_no_media.png | Bin 9008 -> 4383 bytes
.../org/videolan/vlc/gui/video/VideoGridFragment.java | 6 ++----
6 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/assets/images/svg/ic_no_media.svg b/assets/images/svg/ic_no_media.svg
index 0d94a7c..90f7009 100644
--- a/assets/images/svg/ic_no_media.svg
+++ b/assets/images/svg/ic_no_media.svg
@@ -10,8 +10,8 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="96"
- height="96"
+ width="48"
+ height="48"
id="svg3075"
version="1.1"
inkscape:version="0.91 r13725"
@@ -216,8 +216,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="11.2"
- inkscape:cx="41.945225"
- inkscape:cy="66.860488"
+ inkscape:cx="20.028429"
+ inkscape:cy="31.471067"
inkscape:document-units="px"
inkscape:current-layer="g3158"
showgrid="true"
@@ -252,13 +252,13 @@
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
- transform="translate(0,-956.3622)">
+ transform="translate(0,-1004.3622)">
<g
id="g3158"
transform="matrix(3.2814457,0,0,3.2814457,1.9860072,-2409.9574)">
<g
id="g3192"
- transform="matrix(0.05258323,0,0,0.05258323,-37.288627,957.04367)"
+ transform="matrix(0.02629162,0,0,0.02629162,-18.94693,1006.0819)"
inkscape:export-filename="/home/corbax/Dev/Design/Icons/test2.png"
inkscape:export-xdpi="600"
inkscape:export-ydpi="600">
diff --git a/vlc-android/res/drawable-hdpi/ic_no_media.png b/vlc-android/res/drawable-hdpi/ic_no_media.png
index df1fe33..c9ac381 100644
Binary files a/vlc-android/res/drawable-hdpi/ic_no_media.png and b/vlc-android/res/drawable-hdpi/ic_no_media.png differ
diff --git a/vlc-android/res/drawable-ldpi/ic_no_media.png b/vlc-android/res/drawable-ldpi/ic_no_media.png
index aa13150..a7fee44 100644
Binary files a/vlc-android/res/drawable-ldpi/ic_no_media.png and b/vlc-android/res/drawable-ldpi/ic_no_media.png differ
diff --git a/vlc-android/res/drawable-mdpi/ic_no_media.png b/vlc-android/res/drawable-mdpi/ic_no_media.png
index e2a8763..20abbb0 100644
Binary files a/vlc-android/res/drawable-mdpi/ic_no_media.png and b/vlc-android/res/drawable-mdpi/ic_no_media.png differ
diff --git a/vlc-android/res/drawable-xhdpi/ic_no_media.png b/vlc-android/res/drawable-xhdpi/ic_no_media.png
index fc22911..67ee8f6 100644
Binary files a/vlc-android/res/drawable-xhdpi/ic_no_media.png and b/vlc-android/res/drawable-xhdpi/ic_no_media.png differ
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 eeba467..43242fa 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -182,7 +182,7 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
if (refresh)
updateList();
else {
- mViewNomedia.setVisibility(View.GONE);
+ mViewNomedia.setVisibility(mVideoAdapter.getItemCount() > 0 ? View.GONE : View.VISIBLE);
}
//Get & set times
ArrayMap<String, Long> times = MediaDatabase.getInstance().getVideoTimes();
@@ -382,7 +382,7 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
if (item.getType() != MediaWrapper.TYPE_VIDEO)
return;
mVideoAdapter.update(item);
- mViewNomedia.setVisibility(View.GONE);
+ mViewNomedia.setVisibility(mVideoAdapter.getItemCount() > 0 ? View.GONE : View.VISIBLE);
}
public void updateList() {
@@ -496,10 +496,8 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
if (action.equalsIgnoreCase(MediaUtils.ACTION_SCAN_START)) {
mLayoutFlipperLoading.setVisibility(View.VISIBLE);
- mTextViewNomedia.setVisibility(View.INVISIBLE);
} else if (action.equalsIgnoreCase(MediaUtils.ACTION_SCAN_STOP)) {
mLayoutFlipperLoading.setVisibility(View.INVISIBLE);
- mTextViewNomedia.setVisibility(View.VISIBLE);
}
}
};
More information about the Android
mailing list