[Android] Revert "No media view is now a button to setup directories"

Geoffrey Métais git at videolan.org
Wed Apr 5 17:17:43 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Apr  5 17:14:15 2017 +0200| [b6e190583d1d251062806039e31c1543bada35a4] | committer: Geoffrey Métais

Revert "No media view is now a button to setup directories"

This reverts commit dbad9dc70e24e732023840f268cac86f4e480836.

> https://code.videolan.org/videolan/vlc-android/commit/b6e190583d1d251062806039e31c1543bada35a4
---

 vlc-android/res/layout/audio_browser.xml           | 34 ++++++++++------------
 vlc-android/res/layout/video_grid.xml              |  4 ---
 vlc-android/res/values/strings.xml                 |  2 +-
 .../vlc/gui/audio/AudioBrowserFragment.java        | 14 +--------
 .../videolan/vlc/gui/video/VideoGridFragment.java  | 12 +-------
 5 files changed, 18 insertions(+), 48 deletions(-)

diff --git a/vlc-android/res/layout/audio_browser.xml b/vlc-android/res/layout/audio_browser.xml
index 0885729..18decfe 100644
--- a/vlc-android/res/layout/audio_browser.xml
+++ b/vlc-android/res/layout/audio_browser.xml
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent">
 
@@ -17,6 +16,21 @@
         android:layout_marginRight="@dimen/default_margin"
         android:layout_marginEnd="@dimen/default_margin" />
 
+    <TextView
+        android:id="@+id/no_media"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@+id/header"
+        android:layout_centerInParent="true"
+        android:layout_margin="@dimen/default_margin"
+        android:drawableBottom="@drawable/ic_no_media"
+        android:drawablePadding="@dimen/default_margin"
+        android:gravity="center"
+        android:maxWidth="600dp"
+        android:text="@string/nomedia"
+        android:textSize="20sp"
+        android:visibility="gone" />
+
     <org.videolan.vlc.gui.view.SwipeRefreshLayout
         android:id="@+id/swipeLayout"
         android:layout_width="match_parent"
@@ -43,24 +57,6 @@
         android:layout_alignTop="@+id/swipeLayout"
         android:visibility="invisible"/>
 
-    <Button
-        android:id="@+id/no_media"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_below="@+id/header"
-        android:layout_centerInParent="true"
-        android:layout_margin="@dimen/default_margin"
-        android:drawableBottom="@drawable/ic_no_media"
-        android:drawablePadding="@dimen/default_margin"
-        android:gravity="center"
-        android:maxWidth="600dp"
-        tools:targetApi="11"
-        style="?android:attr/borderlessButtonStyle"
-        android:textAppearance="@style/Result.Title"
-        android:text="@string/nomedia"
-        android:textSize="20sp"
-        android:visibility="gone" />
-
     <include layout="@layout/shadow_top"
         android:layout_width="match_parent"
         android:layout_below="@+id/sliding_tabs"
diff --git a/vlc-android/res/layout/video_grid.xml b/vlc-android/res/layout/video_grid.xml
index 3ed1b67..2cf5612 100644
--- a/vlc-android/res/layout/video_grid.xml
+++ b/vlc-android/res/layout/video_grid.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
@@ -43,9 +42,6 @@
             android:drawablePadding="@dimen/default_margin"
             android:gravity="center"
             android:maxWidth="600dp"
-            tools:targetApi="11"
-            style="?android:attr/borderlessButtonStyle"
-            android:textAppearance="@style/Result.Title"
             android:text="@string/nomedia"
             android:textSize="20sp"
             android:visibility="visible" />
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 5a50c75..9a9027c 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -89,7 +89,7 @@
     <string name="directories">Directories</string>
     <string name="loading">Loading</string>
     <string name="please_wait">Please wait…</string>
-    <string name="nomedia">No media files found, please select directories to add to your medialibrary</string>
+    <string name="nomedia">No media files found, please transfer some files to your device or adjust your preferences.</string>
     <string name="noplaylist">No playlist found.</string>
     <string name="mediafiles">Media files</string>
     <string name="notavailable">not available</string>
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index 967412f..7c2b934 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -75,7 +75,7 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Random;
 
-public class AudioBrowserFragment extends BaseAudioBrowser implements DevicesDiscoveryCb, SwipeRefreshLayout.OnRefreshListener, MediaBrowser.EventListener, ViewPager.OnPageChangeListener, Medialibrary.ArtistsAddedCb, Medialibrary.ArtistsModifiedCb, Medialibrary.AlbumsAddedCb, Medialibrary.AlbumsModifiedCb, MediaAddedCb, MediaUpdatedCb, TabLayout.OnTabSelectedListener, Filterable, View.OnClickListener {
+public class AudioBrowserFragment extends BaseAudioBrowser implements DevicesDiscoveryCb, SwipeRefreshLayout.OnRefreshListener, MediaBrowser.EventListener, ViewPager.OnPageChangeListener, Medialibrary.ArtistsAddedCb, Medialibrary.ArtistsModifiedCb, Medialibrary.AlbumsAddedCb, Medialibrary.AlbumsModifiedCb, MediaAddedCb, MediaUpdatedCb, TabLayout.OnTabSelectedListener, Filterable {
     public final static String TAG = "VLC/AudioBrowserFragment";
 
     private MediaBrowser mMediaBrowser;
@@ -132,7 +132,6 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements DevicesDis
         View v = inflater.inflate(R.layout.audio_browser, container, false);
 
         mEmptyView = (TextView) v.findViewById(R.id.no_media);
-        mEmptyView.setOnClickListener(this);
 
         mViewPager = (ViewPager) v.findViewById(R.id.pager);
         mFastScroller = (FastScroller) v.findViewById(R.id.songs_fast_scroller);
@@ -675,15 +674,6 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements DevicesDis
         return mLists[mViewPager.getCurrentItem()];
     }
 
-    @Override
-    public void onClick(View v) {
-        if (v.getId() == R.id.no_media) {
-            Intent intent = new Intent(v.getContext(), SecondaryActivity.class);
-            intent.putExtra("fragment", SecondaryActivity.STORAGE_BROWSER);
-            startActivity(intent);
-        }
-    }
-
     private static class AudioBrowserHandler extends WeakHandler<AudioBrowserFragment> {
     AudioBrowserHandler(AudioBrowserFragment owner) {
         super(owner);
@@ -710,8 +700,6 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements DevicesDis
                 fragment.mSwipeRefreshLayout.setRefreshing(true);
                 break;
             case UNSET_REFRESHING:
-                removeMessages(SET_REFRESHING);
-                removeMessages(MSG_LOADING);
                 fragment.mSwipeRefreshLayout.setRefreshing(false);
                 break;
             case UPDATE_EMPTY_VIEW:
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 1f2cabf..758fe07 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -82,7 +82,7 @@ import org.videolan.vlc.util.VLCInstance;
 import java.util.ArrayList;
 import java.util.List;
 
-public class VideoGridFragment extends MediaBrowserFragment implements MediaUpdatedCb, ISortable, SwipeRefreshLayout.OnRefreshListener, DevicesDiscoveryCb, MediaAddedCb, Filterable, IEventsHandler, View.OnClickListener {
+public class VideoGridFragment extends MediaBrowserFragment implements MediaUpdatedCb, ISortable, SwipeRefreshLayout.OnRefreshListener, DevicesDiscoveryCb, MediaAddedCb, Filterable, IEventsHandler {
 
     public final static String TAG = "VLC/VideoListFragment";
 
@@ -124,7 +124,6 @@ public class VideoGridFragment extends MediaBrowserFragment implements MediaUpda
         mSearchButtonView = v.findViewById(R.id.searchButton);
 
         mSwipeRefreshLayout.setOnRefreshListener(this);
-        mTextViewNomedia.setOnClickListener(this);
 
         mDividerItemDecoration = new DividerItemDecoration(v.getContext(), DividerItemDecoration.VERTICAL);
         if (mVideoAdapter.isListMode())
@@ -652,13 +651,4 @@ public class VideoGridFragment extends MediaBrowserFragment implements MediaUpda
         updateEmptyView();
         setFabPlayVisibility(true);
     }
-
-    @Override
-    public void onClick(View v) {
-        if (v.getId() == R.id.textview_nomedia) {
-            Intent intent = new Intent(v.getContext(), SecondaryActivity.class);
-            intent.putExtra("fragment", SecondaryActivity.STORAGE_BROWSER);
-            startActivity(intent);
-        }
-    }
 }



More information about the Android mailing list