aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-08-26 21:34:32 -0700
committerScott Jackson <daneren2005@gmail.com>2014-08-26 21:34:32 -0700
commit4470fd60a6c28ae3a6b2d35e30baec6834cc7c1d (patch)
tree0939397205092a48649d4ccdb9ac734f61e73669
parent2ec34f5ccec6335d080ca373b1858ecce897ac2d (diff)
downloaddsub-4470fd60a6c28ae3a6b2d35e30baec6834cc7c1d.tar.gz
dsub-4470fd60a6c28ae3a6b2d35e30baec6834cc7c1d.tar.bz2
dsub-4470fd60a6c28ae3a6b2d35e30baec6834cc7c1d.zip
#391 Fix folder selection not showing if nothing in folder
-rw-r--r--res/layout/abstract_list_fragment.xml4
-rw-r--r--src/github/daneren2005/dsub/fragments/SelectArtistFragment.java21
2 files changed, 23 insertions, 2 deletions
diff --git a/res/layout/abstract_list_fragment.xml b/res/layout/abstract_list_fragment.xml
index 4440c526..8d586105 100644
--- a/res/layout/abstract_list_fragment.xml
+++ b/res/layout/abstract_list_fragment.xml
@@ -15,13 +15,13 @@
android:layout_height="1px"
android:background="@color/dividerColor"/>
- <include layout="@layout/tab_progress" />
-
<ListView
android:id="@+id/fragment_list"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1.0"
android:fastScrollEnabled="true"/>
+
+ <include layout="@layout/tab_progress" />
</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout> \ No newline at end of file
diff --git a/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java b/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java
index a06adca2..d0ea96b3 100644
--- a/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java
@@ -14,6 +14,7 @@ import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
+import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import github.daneren2005.dsub.R;
@@ -205,6 +206,26 @@ public class SelectArtistFragment extends SelectListFragment<Artist> {
}
}
+ @Override
+ public void setEmpty(boolean empty) {
+ super.setEmpty(empty);
+
+ if(empty && !Util.isOffline(context)) {
+ createMusicFolderButton();
+ setMusicFolders();
+
+ objects.clear();
+ listView.setAdapter(new ArtistAdapter(context, objects));
+ listView.setVisibility(View.VISIBLE);
+
+ View view = rootView.findViewById(R.id.tab_progress);
+ LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) view.getLayoutParams();
+ params.height = 0;
+ params.weight = 5;
+ view.setLayoutParams(params);
+ }
+ }
+
private void setMusicFolders() {
// Display selected music folder
if (musicFolders != null) {