[Android] [PATCH 2/2] Hide Tips for non touch devices

Geoffrey Métais geoffrey.metais at gmail.com
Thu Oct 16 15:38:00 CEST 2014


---
 vlc-android/src/org/videolan/vlc/gui/MainActivity.java              | 2 +-
 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index af8cad4..8ccb3b2 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -1020,7 +1020,7 @@ public class MainActivity extends ActionBarActivity {
      * @param settingKey the setting key to check if the view must be displayed or not.
      */
     public void showTipViewIfNeeded(final int layoutId, final String settingKey) {
-        if (!mSettings.getBoolean(settingKey, false)) {
+        if (!mSettings.getBoolean(settingKey, false) && getPackageManager().hasSystemFeature("android.hardware.touchscreen")) {
             removeTipViewIfDisplayed();
             View v = LayoutInflater.from(this).inflate(layoutId, null);
             mRootContainer.addView(v,
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index c8df820..9fc0591 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -447,7 +447,7 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
                     : getScreenOrientation());
             // Tips
             mOverlayTips = findViewById(R.id.player_overlay_tips);
-            if(mSettings.getBoolean(PREF_TIPS_SHOWN, false))
+            if(mSettings.getBoolean(PREF_TIPS_SHOWN, false) || !getPackageManager().hasSystemFeature("android.hardware.touchscreen"))
                 mOverlayTips.setVisibility(View.GONE);
             else {
                 mOverlayTips.bringToFront();
-- 
1.9.1



More information about the Android mailing list