[Android] Refactior focusHelper

Geoffrey Métais git at videolan.org
Mon Apr 27 10:57:47 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Apr 27 10:53:35 2015 +0200| [1ea515d7eebf99bcc1ed9b6cc3ac9762803a5ce7] | committer: Geoffrey Métais

Refactior focusHelper

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=1ea515d7eebf99bcc1ed9b6cc3ac9762803a5ce7
---

 .../org/videolan/vlc/gui/browser/BaseBrowserFragment.java    |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
index 44209a3..bfe6e1b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -278,7 +278,7 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
         }
         mAdapter.notifyDataSetChanged();
         parseSubDirectories();
-        focusHelper(mAdapter.isEmpty());
+        focusHelper();
     }
 
     @Override
@@ -316,13 +316,13 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
         }
     }
 
-    protected void focusHelper(boolean idIsEmpty) {
+    protected void focusHelper() {
         if (getActivity() == null)
             return;
+        boolean isEmpty = mAdapter.isEmpty();
         MainActivity main = (MainActivity)getActivity();
-        View parent = View.inflate(main, R.layout.directory_view, null);
-        main.setMenuFocusDown(idIsEmpty, R.id.network_list);
-        main.setSearchAsFocusDown(idIsEmpty, parent, R.id.network_list);
+        main.setMenuFocusDown(isEmpty, R.id.network_list);
+        main.setSearchAsFocusDown(isEmpty, getView(), R.id.network_list);
     }
 
     public void clear(){



More information about the Android mailing list