From 4470fd60a6c28ae3a6b2d35e30baec6834cc7c1d Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 26 Aug 2014 21:34:32 -0700 Subject: #391 Fix folder selection not showing if nothing in folder --- res/layout/abstract_list_fragment.xml | 4 ++-- .../dsub/fragments/SelectArtistFragment.java | 21 +++++++++++++++++++++ 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"/> - - + + \ 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 { } } + @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) { -- cgit v1.2.3