diff options
-rw-r--r-- | res/layout/abstract_list_fragment.xml | 4 | ||||
-rw-r--r-- | src/github/daneren2005/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"/>
- <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) {
|