aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/menu/abstract_top_menu.xml2
-rw-r--r--res/menu/empty.xml2
-rw-r--r--res/menu/select_album.xml2
-rw-r--r--res/menu/select_album_list.xml2
-rw-r--r--res/menu/select_artist.xml2
-rw-r--r--res/menu/select_podcast_episode.xml2
-rw-r--r--res/menu/select_podcasts.xml2
-rw-r--r--res/menu/select_song.xml2
-rw-r--r--res/menu/user.xml2
-rw-r--r--src/github/daneren2005/dsub/activity/SubsonicActivity.java13
-rw-r--r--src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java10
-rw-r--r--src/github/daneren2005/dsub/fragments/SubsonicFragment.java2
-rw-r--r--src/github/daneren2005/dsub/view/ChangeLog.java2
13 files changed, 29 insertions, 16 deletions
diff --git a/res/menu/abstract_top_menu.xml b/res/menu/abstract_top_menu.xml
index c2575794..830b167c 100644
--- a/res/menu/abstract_top_menu.xml
+++ b/res/menu/abstract_top_menu.xml
@@ -7,7 +7,7 @@
android:title="@string/menu.search"
compat:showAsAction="always|withText"/>
- <group android:id="@+id/tv">
+ <group android:id="@+id/not_touchscreen">
<item
android:id="@+id/menu_refresh"
android:icon="?attr/refresh"
diff --git a/res/menu/empty.xml b/res/menu/empty.xml
index 20a71d9b..eae036cf 100644
--- a/res/menu/empty.xml
+++ b/res/menu/empty.xml
@@ -2,7 +2,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:compat="http://schemas.android.com/apk/res-auto">
- <group android:id="@+id/tv">
+ <group android:id="@+id/not_touchscreen">
<item
android:id="@+id/menu_refresh"
android:icon="?attr/refresh"
diff --git a/res/menu/select_album.xml b/res/menu/select_album.xml
index 627b213c..3d2228e8 100644
--- a/res/menu/select_album.xml
+++ b/res/menu/select_album.xml
@@ -19,7 +19,7 @@
android:title="@string/menu.shuffle"
compat:showAsAction="ifRoom|withText"/>
- <group android:id="@+id/tv">
+ <group android:id="@+id/not_touchscreen">
<item
android:id="@+id/menu_refresh"
android:icon="?attr/refresh"
diff --git a/res/menu/select_album_list.xml b/res/menu/select_album_list.xml
index 68e2847e..a9196d1c 100644
--- a/res/menu/select_album_list.xml
+++ b/res/menu/select_album_list.xml
@@ -13,7 +13,7 @@
android:title="@string/menu.shuffle"
compat:showAsAction="ifRoom|withText"/>
- <group android:id="@+id/tv">
+ <group android:id="@+id/not_touchscreen">
<item
android:id="@+id/menu_refresh"
android:icon="?attr/refresh"
diff --git a/res/menu/select_artist.xml b/res/menu/select_artist.xml
index dbbc781d..603f0a3b 100644
--- a/res/menu/select_artist.xml
+++ b/res/menu/select_artist.xml
@@ -13,7 +13,7 @@
android:title="@string/menu.search"
compat:showAsAction="ifRoom|withText"/>
- <group android:id="@+id/tv">
+ <group android:id="@+id/not_touchscreen">
<item
android:id="@+id/menu_refresh"
android:icon="?attr/refresh"
diff --git a/res/menu/select_podcast_episode.xml b/res/menu/select_podcast_episode.xml
index 63259af3..65cb0555 100644
--- a/res/menu/select_podcast_episode.xml
+++ b/res/menu/select_podcast_episode.xml
@@ -2,7 +2,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:compat="http://schemas.android.com/apk/res-auto">
- <group android:id="@+id/tv">
+ <group android:id="@+id/not_touchscreen">
<item
android:id="@+id/menu_refresh"
android:icon="?attr/refresh"
diff --git a/res/menu/select_podcasts.xml b/res/menu/select_podcasts.xml
index 3fad1f84..f30429ce 100644
--- a/res/menu/select_podcasts.xml
+++ b/res/menu/select_podcasts.xml
@@ -13,7 +13,7 @@
android:title="@string/menu.add_podcast"
compat:showAsAction="always|withText"/>
- <group android:id="@+id/tv">
+ <group android:id="@+id/not_touchscreen">
<item
android:id="@+id/menu_refresh"
android:icon="?attr/refresh"
diff --git a/res/menu/select_song.xml b/res/menu/select_song.xml
index 4e3ae00d..fc4494cb 100644
--- a/res/menu/select_song.xml
+++ b/res/menu/select_song.xml
@@ -13,7 +13,7 @@
android:title="@string/menu.shuffle"
compat:showAsAction="ifRoom|withText"/>
- <group android:id="@+id/tv">
+ <group android:id="@+id/not_touchscreen">
<item
android:id="@+id/menu_refresh"
android:icon="?attr/refresh"
diff --git a/res/menu/user.xml b/res/menu/user.xml
index 6e406b77..9c335cec 100644
--- a/res/menu/user.xml
+++ b/res/menu/user.xml
@@ -14,7 +14,7 @@
android:icon="?attr/password"
compat:showAsAction="always|withText"/>
- <group android:id="@+id/tv">
+ <group android:id="@+id/not_touchscreen">
<item
android:id="@+id/menu_refresh"
android:icon="?attr/refresh"
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
index 46f7421f..90e7dda5 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();
+ }
}
}
}
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
index 8bd01cd6..b6b67a7b 100644
--- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
@@ -609,7 +609,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
}
protected void setupScrollList(final AbsListView listView) {
- if(context.isTv()) {
+ if(!context.isTouchscreen()) {
refreshLayout.setEnabled(false);
} else {
listView.setOnScrollListener(new AbsListView.OnScrollListener() {
diff --git a/src/github/daneren2005/dsub/view/ChangeLog.java b/src/github/daneren2005/dsub/view/ChangeLog.java
index 5a7850ff..096583c7 100644
--- a/src/github/daneren2005/dsub/view/ChangeLog.java
+++ b/src/github/daneren2005/dsub/view/ChangeLog.java
@@ -324,7 +324,7 @@ public class ChangeLog {
/**
* Write current version code to the preferences.
*/
- protected void updateVersionInPreferences() {
+ public void updateVersionInPreferences() {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
SharedPreferences.Editor editor = sp.edit();
editor.putInt(VERSION_KEY, mCurrentVersionCode);