aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-07-07 08:39:10 -0700
committerScott Jackson <daneren2005@gmail.com>2015-07-07 08:39:10 -0700
commit7bcf42f2c996b7777a999eef8c666a7f07d5f73e (patch)
tree5d2711db697bdd072a560dc9276dfafb703b05dc
parenta78354743c4862c8faac3e925176f86a78df9d63 (diff)
downloaddsub-7bcf42f2c996b7777a999eef8c666a7f07d5f73e.tar.gz
dsub-7bcf42f2c996b7777a999eef8c666a7f07d5f73e.tar.bz2
dsub-7bcf42f2c996b7777a999eef8c666a7f07d5f73e.zip
Fix Offline text while offline
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/MainFragment.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/MainFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/MainFragment.java
index 0e67b80d..5e9da68b 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/MainFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/MainFragment.java
@@ -98,11 +98,11 @@ public class MainFragment extends SelectRecyclerFragment<Integer> {
List<List<Integer>> sections = new ArrayList<>();
List<String> headers = new ArrayList<>();
- List<Integer> offline = Arrays.asList(R.string.main_offline);
- sections.add(offline);
- headers.add(null);
-
if (!Util.isOffline(context)) {
+ List<Integer> offline = Arrays.asList(R.string.main_offline);
+ sections.add(offline);
+ headers.add(null);
+
List<Integer> albums = new ArrayList<>();
albums.add(R.string.main_albums_newest);
albums.add(R.string.main_albums_random);
@@ -126,6 +126,10 @@ public class MainFragment extends SelectRecyclerFragment<Integer> {
sections.add(videos);
headers.add("videos");
}
+ } else {
+ List<Integer> online = Arrays.asList(R.string.main_online);
+ sections.add(online);
+ headers.add(null);
}
return new MainAdapter(context, headers, sections, this);
@@ -175,9 +179,6 @@ public class MainFragment extends SelectRecyclerFragment<Integer> {
SharedPreferences.Editor editor = Util.getPreferences(context).edit();
editor.putInt(Constants.PREFERENCES_KEY_RECENT_COUNT + Util.getActiveServer(context), 0);
editor.commit();
-
- // TODO: Clear immediately so doesn't still show when pressing back
- // setMostRecentCount(0);
}
SubsonicFragment fragment = new SelectDirectoryFragment();
@@ -379,7 +380,7 @@ public class MainFragment extends SelectRecyclerFragment<Integer> {
@Override
public void onItemClicked(Integer item) {
- if(item == R.string.main_offline) {
+ if(item == R.string.main_offline || item == R.string.main_online) {
toggleOffline();
} else if (item == R.string.main_albums_newest) {
showAlbumList("newest");