Commit 1804eec1 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Detect TSP, and hide tips for non touch devices

parent 36d2510c
......@@ -42,6 +42,7 @@ import org.videolan.vlc.gui.video.VideoGridFragment;
import org.videolan.vlc.gui.video.VideoListAdapter;
import org.videolan.vlc.interfaces.IRefreshable;
import org.videolan.vlc.interfaces.ISortable;
import org.videolan.vlc.util.AndroidDevices;
import org.videolan.vlc.util.Util;
import org.videolan.vlc.util.VLCInstance;
import org.videolan.vlc.util.WeakHandler;
......@@ -1020,7 +1021,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) && AndroidDevices.hasTsp()) {
removeTipViewIfDisplayed();
View v = LayoutInflater.from(this).inflate(layoutId, null);
mRootContainer.addView(v,
......
......@@ -451,7 +451,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(!AndroidDevices.hasTsp() || mSettings.getBoolean(PREF_TIPS_SHOWN, false))
mOverlayTips.setVisibility(View.GONE);
else {
mOverlayTips.bringToFront();
......
......@@ -45,6 +45,7 @@ public class AndroidDevices {
public final static String TAG = "VLC/Util/AndroidDevices";
final static boolean hasNavBar;
final static boolean hasTsp;
static {
HashSet<String> devicesWithoutNavBar = new HashSet<String>();
......@@ -54,6 +55,7 @@ public class AndroidDevices {
devicesWithoutNavBar.add("HTC One XL");
hasNavBar = LibVlcUtil.isJellyBeanMR1OrLater() || (LibVlcUtil.isICSOrLater()
&& !devicesWithoutNavBar.contains(android.os.Build.MODEL));
hasTsp = VLCApplication.getAppContext().getPackageManager().hasSystemFeature("android.hardware.touchscreen");
}
public static boolean hasExternalStorage() {
......@@ -81,6 +83,10 @@ public class AndroidDevices {
}
}
public static boolean hasTsp(){
return hasTsp;
}
public static String[] getStorageDirectories() {
String[] dirs = null;
BufferedReader bufReader = null;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment