From 32354e91a9f2186d062b704fab7c6d7a40458d23 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 5 Mar 2015 17:14:30 -0800 Subject: #462 Add albums by alphabetical --- src/github/daneren2005/dsub/fragments/MainFragment.java | 6 ++++++ src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 2 ++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/github/daneren2005/dsub/fragments/MainFragment.java b/src/github/daneren2005/dsub/fragments/MainFragment.java index 911fd757..ac29b274 100644 --- a/src/github/daneren2005/dsub/fragments/MainFragment.java +++ b/src/github/daneren2005/dsub/fragments/MainFragment.java @@ -163,6 +163,7 @@ public class MainFragment extends SubsonicFragment { final View albumsStarredButton = buttons.findViewById(R.id.main_albums_starred); final View albumsGenresButton = buttons.findViewById(R.id.main_albums_genres); final View albumsYearButton = buttons.findViewById(R.id.main_albums_year); + final View albumsAlphabeticalButton = buttons.findViewById(R.id.main_albums_alphabetical); final View dummyView = rootView.findViewById(R.id.main_dummy); @@ -193,6 +194,9 @@ public class MainFragment extends SubsonicFragment { if (!Util.isOffline(context)) { adapter.addView(albumsTitle, false); adapter.addViews(Arrays.asList(albumsNewestButton, albumsRandomButton), true); + if(ServerInfo.checkServerVersion(context, "1.8")) { + adapter.addView(albumsAlphabeticalButton, true); + } if(!Util.isTagBrowsing(context)) { adapter.addView(albumsHighestButton, true); } @@ -224,6 +228,8 @@ public class MainFragment extends SubsonicFragment { showAlbumList("genres"); } else if(view == albumsYearButton) { showAlbumList("years"); + } else if(view == albumsAlphabeticalButton) { + showAlbumList("alphabeticalByName"); } } }); diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 08ccac33..b83d2134 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -642,6 +642,8 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter setTitle(R.string.main_albums_starred); } else if("genres".equals(albumListType) || "years".equals(albumListType)) { setTitle(albumListExtra); + } else if("albumsAlphabeticalButton".equals(albumListType)) { + setTitle(R.string.main_albums_alphabetical); } new LoadTask(true) { -- cgit v1.2.3