aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-05-11 15:25:17 -0700
committerScott Jackson <daneren2005@gmail.com>2013-05-11 15:25:17 -0700
commite6c6e1749deaa800b8da021b2e29fbd295a656cc (patch)
tree0301abe23fb45212985bcc52ec0b3444f791c811
parentad8547948760ae0f17200517673494b751dbc16b (diff)
downloaddsub-e6c6e1749deaa800b8da021b2e29fbd295a656cc.tar.gz
dsub-e6c6e1749deaa800b8da021b2e29fbd295a656cc.tar.bz2
dsub-e6c6e1749deaa800b8da021b2e29fbd295a656cc.zip
Fix > 2 nested DirectoryFragments not working
-rw-r--r--subsonic-android/res/layout/select_album.xml52
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java21
2 files changed, 48 insertions, 25 deletions
diff --git a/subsonic-android/res/layout/select_album.xml b/subsonic-android/res/layout/select_album.xml
index 0bf5367f..4fddf330 100644
--- a/subsonic-android/res/layout/select_album.xml
+++ b/subsonic-android/res/layout/select_album.xml
@@ -1,32 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/select_album_layout"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
- <View
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
android:layout_width="fill_parent"
- android:layout_height="1px"
- android:background="@color/dividerColor"/>
+ android:layout_height="fill_parent">
- <include layout="@layout/tab_progress"/>
+ <View
+ android:layout_width="fill_parent"
+ android:layout_height="1px"
+ android:background="@color/dividerColor"/>
- <TextView
- android:id="@+id/select_album_empty"
- android:text="@string/select_album.empty"
- android:visibility="gone"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:padding="10dip"/>
+ <include layout="@layout/tab_progress"/>
- <com.mobeta.android.dslv.DragSortListView
- style="@style/DragDropListView"
- android:id="@+id/select_album_entries"
- android:textFilterEnabled="true"
- android:layout_width="fill_parent"
- android:layout_height="0dip"
- android:layout_weight="1.0"
- android:fastScrollEnabled="true"/>
+ <TextView
+ android:id="@+id/select_album_empty"
+ android:text="@string/select_album.empty"
+ android:visibility="gone"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:padding="10dip"/>
-</LinearLayout> \ No newline at end of file
+ <com.mobeta.android.dslv.DragSortListView
+ style="@style/DragDropListView"
+ android:id="@+id/select_album_entries"
+ android:textFilterEnabled="true"
+ android:layout_width="fill_parent"
+ android:layout_height="0dip"
+ android:layout_weight="1.0"
+ android:fastScrollEnabled="true"/>
+ </LinearLayout>
+</FrameLayout> \ No newline at end of file
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
index 209e22b2..1d7c0073 100644
--- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
+++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
@@ -72,6 +72,9 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
rootView = inflater.inflate(R.layout.select_album, container, false);
+ if(!primaryFragment) {
+ ((ViewGroup)rootView).getChildAt(0).setVisibility(View.GONE);
+ }
entryList = (DragSortListView) rootView.findViewById(R.id.select_album_entries);
footer = LayoutInflater.from(context).inflate(R.layout.select_album_footer, entryList, false);
@@ -106,7 +109,11 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
albumListType = args.getString(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TYPE);
albumListSize = args.getInt(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_SIZE, 0);
}
- load(false);
+ if(primaryFragment) {
+ load(false);
+ } else {
+ invalidated = true;
+ }
return rootView;
}
@@ -233,6 +240,18 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
}
}
}
+
+ @Override
+ public void setPrimaryFragment(boolean primary) {
+ super.setPrimaryFragment(primary);
+ if(rootView != null) {
+ if(primary) {
+ ((ViewGroup)rootView).getChildAt(0).setVisibility(View.VISIBLE);
+ } else {
+ ((ViewGroup)rootView).getChildAt(0).setVisibility(View.GONE);
+ }
+ }
+ }
@Override
protected void refresh(boolean refresh) {