aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-04-02 17:19:23 -0700
committerScott Jackson <daneren2005@gmail.com>2015-04-02 17:19:23 -0700
commit4eb910bebf6cab6eca2a3e71f2f8fdea31bff38e (patch)
tree99bb5e8fb8d5b060f779a957113174f5886ea661 /src
parent7a92d63a368e9e284339ec669736bd1964189cb9 (diff)
downloaddsub-4eb910bebf6cab6eca2a3e71f2f8fdea31bff38e.tar.gz
dsub-4eb910bebf6cab6eca2a3e71f2f8fdea31bff38e.tar.bz2
dsub-4eb910bebf6cab6eca2a3e71f2f8fdea31bff38e.zip
Make pull to refresh be based on precense of touchscreen
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/activity/SubsonicActivity.java13
-rw-r--r--src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java10
2 files changed, 18 insertions, 5 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
index de0809db..fca60b5e 100644
--- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java
+++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
@@ -23,6 +23,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.Color;
@@ -89,6 +90,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
protected View primaryContainer;
protected View secondaryContainer;
protected boolean tv = false;
+ protected boolean touchscreen = true;
Spinner actionBarSpinner;
ArrayAdapter<CharSequence> spinnerAdapter;
ViewGroup rootView;
@@ -106,6 +108,10 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
tv = true;
}
+ PackageManager pm = getPackageManager();
+ if(!pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN)) {
+ touchscreen = false;
+ }
setUncaughtExceptionHandler();
applyTheme();
@@ -370,8 +376,8 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
currentFragment.setContext(this);
currentFragment.onCreateOptionsMenu(menu, menuInflater);
- if(!isTv()) {
- menu.setGroupVisible(R.id.tv, false);
+ if(isTouchscreen()) {
+ menu.setGroupVisible(R.id.not_touchscreen, false);
}
} catch(Exception e) {
Log.w(TAG, "Error on creating options menu", e);
@@ -796,6 +802,9 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
public boolean isTv() {
return tv;
}
+ public boolean isTouchscreen() {
+ return touchscreen;
+ }
private void setUncaughtExceptionHandler() {
Thread.UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler();
diff --git a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
index fde9ca77..21ed9893 100644
--- a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
+++ b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
@@ -252,9 +252,13 @@ public class SubsonicFragmentActivity extends SubsonicActivity {
ChangeLog changeLog = new ChangeLog(this, Util.getPreferences(this));
if(changeLog.isFirstRun()) {
- Dialog log = changeLog.getLogDialog();
- if(log != null) {
- log.show();
+ if(changeLog.isFirstRunEver()) {
+ changeLog.updateVersionInPreferences();
+ } else {
+ Dialog log = changeLog.getLogDialog();
+ if (log != null) {
+ log.show();
+ }
}
}
}