[Android] Suppress inflate lint warnings

Geoffrey Métais git at videolan.org
Thu Feb 12 17:12:32 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb 12 11:56:23 2015 +0100| [626ee210850d017e0e20e0d421b05a6d41d82843] | committer: Geoffrey Métais

Suppress inflate lint warnings

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

 .../src/org/videolan/vlc/gui/AboutFragment.java    |    2 ++
 .../src/org/videolan/vlc/gui/MainActivity.java     |   25 +++++++++-----------
 .../vlc/gui/audio/AudioAlbumsSongsFragment.java    |    2 ++
 3 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/AboutFragment.java b/vlc-android/src/org/videolan/vlc/gui/AboutFragment.java
index 0bdf1a6..028004f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/AboutFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/AboutFragment.java
@@ -24,6 +24,7 @@ import org.videolan.vlc.R;
 import org.videolan.vlc.util.Util;
 import org.videolan.vlc.widget.FlingViewGroup;
 
+import android.annotation.SuppressLint;
 import android.content.Context;
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager.NameNotFoundException;
@@ -149,6 +150,7 @@ public class AboutFragment extends Fragment {
         tabHost.addTab(tabSpec);
     }
 
+    @SuppressLint("InflateParams")
     private View getNewTabIndicator(Context context, String title) {
         View v = LayoutInflater.from(context).inflate(R.layout.tab_layout, null);
         TextView tv = (TextView) v.findViewById(R.id.textView);
diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index 605b166..a801213 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -194,14 +194,13 @@ public class MainActivity extends ActionBarActivity implements OnItemClickListen
 
         applyTheme();
 
-        View v_main = LayoutInflater.from(this).inflate(R.layout.main, null);
-        setContentView(v_main);
+        setContentView(R.layout.main);
 
-        mSlidingPane = (SlidingPaneLayout) v_main.findViewById(R.id.pane);
+        mSlidingPane = (SlidingPaneLayout) findViewById(R.id.pane);
         mSlidingPane.setPanelSlideListener(mPanelSlideListener);
 
-        mSideMenu = v_main.findViewById(R.id.side_menu);
-        mListView = (ListView)v_main.findViewById(R.id.sidelist);
+        mSideMenu = findViewById(R.id.side_menu);
+        mListView = (ListView)findViewById(R.id.sidelist);
         mListView.setFooterDividersEnabled(true);
         mSidebarAdapter = new SidebarAdapter(this);
         mListView.setAdapter(mSidebarAdapter);
@@ -214,11 +213,11 @@ public class MainActivity extends ActionBarActivity implements OnItemClickListen
 
 
         /* Initialize UI variables */
-        mInfoLayout = v_main.findViewById(R.id.info_layout);
-        mInfoProgress = (ProgressBar) v_main.findViewById(R.id.info_progress);
-        mInfoText = (TextView) v_main.findViewById(R.id.info_text);
-        mAudioPlayerFilling = v_main.findViewById(R.id.audio_player_filling);
-        mRootContainer = (DrawerLayout) v_main.findViewById(R.id.root_container);
+        mInfoLayout = findViewById(R.id.info_layout);
+        mInfoProgress = (ProgressBar) findViewById(R.id.info_progress);
+        mInfoText = (TextView) findViewById(R.id.info_text);
+        mAudioPlayerFilling = findViewById(R.id.audio_player_filling);
+        mRootContainer = (DrawerLayout) findViewById(R.id.root_container);
 
         /* Set up the action bar */
         prepareActionBar();
@@ -710,17 +709,15 @@ public class MainActivity extends ActionBarActivity implements OnItemClickListen
         }
     }
 
-    public void setSearchAsFocusDown(boolean idIsEmpty, View parentView,
-        int id) {
+    public void setSearchAsFocusDown(boolean idIsEmpty, View parentView, int id) {
         View playPause = findViewById(R.id.header_play_pause);
-        View v_main = LayoutInflater.from(this).inflate(R.layout.main, null);
 
         if (!idIsEmpty) {
             View list = null;
             int pane = mSlidingPane.getState();
 
             if (parentView == null)
-                list = v_main.findViewById(id);
+                list = findViewById(id);
             else
 			    list = parentView.findViewById(id);
 
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 3873246..eb20a3c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
@@ -37,6 +37,7 @@ import org.videolan.vlc.util.Util;
 import org.videolan.vlc.util.VLCRunnable;
 import org.videolan.vlc.widget.FlingViewGroup;
 
+import android.annotation.SuppressLint;
 import android.annotation.TargetApi;
 import android.app.Activity;
 import android.app.AlertDialog;
@@ -221,6 +222,7 @@ public class AudioAlbumsSongsFragment extends BrowserFragment implements SwipeRe
         tabHost.addTab(tabSpec);
     }
 
+    @SuppressLint("InflateParams")
     private View getNewTabIndicator(Context context, String title) {
         View v = LayoutInflater.from(context).inflate(R.layout.tab_layout, null);
         TextView tv = (TextView) v.findViewById(R.id.textView);



More information about the Android mailing list