[Android] Better syntax

Geoffrey Métais git at videolan.org
Thu May 7 16:29:25 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu May  7 12:04:38 2015 +0200| [816be027fa0bedf7b2ba0f6d09bbae2eba790e77] | committer: Geoffrey Métais

Better syntax

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

 vlc-android/src/com/android/widget/SlidingTabLayout.java          |    2 +-
 .../src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java  |    2 +-
 .../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java      |    5 ++---
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/vlc-android/src/com/android/widget/SlidingTabLayout.java b/vlc-android/src/com/android/widget/SlidingTabLayout.java
index 47fcc3d..eae7044 100644
--- a/vlc-android/src/com/android/widget/SlidingTabLayout.java
+++ b/vlc-android/src/com/android/widget/SlidingTabLayout.java
@@ -184,7 +184,7 @@ public class SlidingTabLayout extends HorizontalScrollView {
             if (tabView == null) {
                 tabView = createDefaultTabView(getContext());
             }
-            if (tabTitleView == null && TextView.class.isInstance(tabView)) {
+            if (tabTitleView == null && tabView instanceof TextView) {
                 tabTitleView = (TextView) tabView;
             }
             if (mDistributeEvenly) {
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
index 7ccf122..f3c667c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
@@ -230,7 +230,7 @@ public class AudioAlbumsSongsFragment extends Fragment implements SwipeRefreshLa
         boolean useAllItems = id == R.id.audio_list_browser_play_all;
         boolean append = id == R.id.audio_list_browser_append;
 
-        if (ExpandableListContextMenuInfo.class.isInstance(menuInfo)) {
+        if (menuInfo instanceof ExpandableListContextMenuInfo) {
             ExpandableListContextMenuInfo info = (ExpandableListContextMenuInfo) menuInfo;
             groupPosition = ExpandableListView.getPackedPositionGroup(info.packedPosition);
         }
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 db29b96..f04b2e3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -420,11 +420,10 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements SwipeR
         boolean useAllItems = id == R.id.audio_list_browser_play_all;
         boolean append = id == R.id.audio_list_browser_append;
 
-        if (ExpandableListContextMenuInfo.class.isInstance(menuInfo)) {
+        if (menuInfo instanceof ExpandableListContextMenuInfo) {
             ExpandableListContextMenuInfo info = (ExpandableListContextMenuInfo) menuInfo;
             groupPosition = ExpandableListView.getPackedPositionGroup(info.packedPosition);
-        }
-        else
+        } else
             groupPosition = position;
 
         if (id == R.id.audio_list_browser_delete) {



More information about the Android mailing list