aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-03-16 18:05:52 -0700
committerScott Jackson <daneren2005@gmail.com>2013-03-16 18:05:52 -0700
commitebf090d1a6ce40f582625340d072a8428446dde7 (patch)
treec96b848fc008376e618ad9de5fa059017656bdb0
parentbfef1d147657ce579ef52841201719b62f68c406 (diff)
downloaddsub-ebf090d1a6ce40f582625340d072a8428446dde7.tar.gz
dsub-ebf090d1a6ce40f582625340d072a8428446dde7.tar.bz2
dsub-ebf090d1a6ce40f582625340d072a8428446dde7.zip
Removed bottom tabs + added clicks in Directory fragment
-rw-r--r--subsonic-android/res/layout/home.xml5
-rw-r--r--subsonic-android/res/layout/select_album.xml38
-rw-r--r--subsonic-android/res/layout/select_artist.xml2
-rw-r--r--subsonic-android/res/layout/select_playlist.xml2
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java89
5 files changed, 71 insertions, 65 deletions
diff --git a/subsonic-android/res/layout/home.xml b/subsonic-android/res/layout/home.xml
index 7f5d1255..018061fa 100644
--- a/subsonic-android/res/layout/home.xml
+++ b/subsonic-android/res/layout/home.xml
@@ -19,10 +19,5 @@
<View android:id="@+id/main_dummy"
android:layout_width="0px"
android:layout_height="0px"/>
-
- <include
- layout="@layout/button_bar"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"/>
</LinearLayout>
diff --git a/subsonic-android/res/layout/select_album.xml b/subsonic-android/res/layout/select_album.xml
index b688a95b..0bf5367f 100644
--- a/subsonic-android/res/layout/select_album.xml
+++ b/subsonic-android/res/layout/select_album.xml
@@ -1,25 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:id="@+id/select_album_layout"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
- <View
- android:layout_width="fill_parent"
- android:layout_height="1px"
- android:background="@color/dividerColor"/>
+ <View
+ android:layout_width="fill_parent"
+ android:layout_height="1px"
+ android:background="@color/dividerColor"/>
- <include layout="@layout/tab_progress"/>
+ <include layout="@layout/tab_progress"/>
- <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"/>
+ <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"/>
- <com.mobeta.android.dslv.DragSortListView
+ <com.mobeta.android.dslv.DragSortListView
style="@style/DragDropListView"
android:id="@+id/select_album_entries"
android:textFilterEnabled="true"
@@ -28,7 +29,4 @@
android:layout_weight="1.0"
android:fastScrollEnabled="true"/>
- <include layout="@layout/button_bar"/>
-
-</LinearLayout>
-
+</LinearLayout> \ No newline at end of file
diff --git a/subsonic-android/res/layout/select_artist.xml b/subsonic-android/res/layout/select_artist.xml
index 4dd3471f..fef51d3c 100644
--- a/subsonic-android/res/layout/select_artist.xml
+++ b/subsonic-android/res/layout/select_artist.xml
@@ -18,7 +18,5 @@
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1.0"/>
-
- <include layout="@layout/button_bar"/>
</LinearLayout>
diff --git a/subsonic-android/res/layout/select_playlist.xml b/subsonic-android/res/layout/select_playlist.xml
index 07c818b5..e18283bd 100644
--- a/subsonic-android/res/layout/select_playlist.xml
+++ b/subsonic-android/res/layout/select_playlist.xml
@@ -26,7 +26,5 @@
android:layout_weight="1.0"
android:fastScrollEnabled="true"/>
- <include layout="@layout/button_bar"/>
-
</LinearLayout>
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
index b393521b..392bf1c8 100644
--- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
+++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
@@ -2,6 +2,7 @@ package github.daneren2005.dsub.fragments;
import android.content.Intent;
import android.os.Bundle;
+import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -35,6 +36,14 @@ public class SelectDirectoryFragment extends SubsonicTabFragment implements Adap
private boolean showHeader = true;
private EntryAdapter entryAdapter;
private List<MusicDirectory.Entry> entries;
+
+ String id;
+ String name;
+ String playlistId;
+ String playlistName;
+ String albumListType;
+ int albumListSize;
+ int albumListOffset;
@Override
public void onCreate(Bundle bundle) {
@@ -68,6 +77,17 @@ public class SelectDirectoryFragment extends SubsonicTabFragment implements Adap
emptyView = rootView.findViewById(R.id.select_album_empty);
registerForContextMenu(entryList);
+
+ Bundle args = getArguments();
+ if(args != null) {
+ id = args.getString(Constants.INTENT_EXTRA_NAME_ID);
+ name = args.getString(Constants.INTENT_EXTRA_NAME_NAME);
+ playlistId = args.getString(Constants.INTENT_EXTRA_NAME_PLAYLIST_ID);
+ playlistName = args.getString(Constants.INTENT_EXTRA_NAME_PLAYLIST_NAME);
+ albumListType = args.getString(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TYPE);
+ albumListSize = args.getInt(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_SIZE, 0);
+ albumListOffset = args.getInt(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_OFFSET, 0);
+ }
load(false);
return rootView;
@@ -77,18 +97,24 @@ public class SelectDirectoryFragment extends SubsonicTabFragment implements Adap
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (position >= 0) {
MusicDirectory.Entry entry = (MusicDirectory.Entry) parent.getItemAtPosition(position);
- /*if (entry.isDirectory()) {
- Intent intent = new Intent(SelectAlbumActivity.this, SelectAlbumActivity.class);
- intent.putExtra(Constants.INTENT_EXTRA_NAME_ID, entry.getId());
- intent.putExtra(Constants.INTENT_EXTRA_NAME_NAME, entry.getTitle());
- Util.startActivityWithoutTransition(SelectAlbumActivity.this, intent);
+ if (entry.isDirectory()) {
+ SubsonicTabFragment fragment = new SelectDirectoryFragment();
+ Bundle args = new Bundle();
+ args.putString(Constants.INTENT_EXTRA_NAME_ID, entry.getId());
+ args.putString(Constants.INTENT_EXTRA_NAME_NAME, entry.getTitle());
+ fragment.setArguments(args);
+
+ final FragmentTransaction trans = getFragmentManager().beginTransaction();
+ trans.replace(R.id.select_album_layout, fragment);
+ trans.addToBackStack(null);
+ trans.commit();
} else if (entry.isVideo()) {
- if(entryExists(entry)) {
+ /*if(entryExists(entry)) {
playExternalPlayer(entry);
} else {
streamExternalPlayer(entry);
- }
- }*/
+ }*/
+ }
}
}
@@ -98,23 +124,14 @@ public class SelectDirectoryFragment extends SubsonicTabFragment implements Adap
}
private void load(boolean refresh) {
- Bundle args = getArguments();
- if(args != null) {
- String id = args.getString(Constants.INTENT_EXTRA_NAME_ID);
- String name = args.getString(Constants.INTENT_EXTRA_NAME_NAME);
- String playlistId = args.getString(Constants.INTENT_EXTRA_NAME_PLAYLIST_ID);
- String playlistName = args.getString(Constants.INTENT_EXTRA_NAME_PLAYLIST_NAME);
- String albumListType = args.getString(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TYPE);
- int albumListSize = args.getInt(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_SIZE, 0);
- int albumListOffset = args.getInt(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_OFFSET, 0);
-
- if (playlistId != null) {
- getPlaylist(playlistId, playlistName);
- } else if (albumListType != null) {
- getAlbumList(albumListType, albumListSize, albumListOffset);
- } else {
- getMusicDirectory(id, name, refresh);
- }
+ entryList.setVisibility(View.INVISIBLE);
+ emptyView.setVisibility(View.INVISIBLE);
+ if (playlistId != null) {
+ getPlaylist(playlistId, playlistName);
+ } else if (albumListType != null) {
+ getAlbumList(albumListType, albumListSize, albumListOffset);
+ } else {
+ getMusicDirectory(id, name, refresh);
}
}
@@ -174,21 +191,16 @@ public class SelectDirectoryFragment extends SubsonicTabFragment implements Adap
if (!result.getFirst().getChildren().isEmpty()) {
if (!("starred".equals(albumListType))) {
moreButton.setVisibility(View.VISIBLE);
- entryList.addFooterView(footer);
+ if(entryList.getFooterViewsCount() == 0) {
+ entryList.addFooterView(footer);
+ }
}
moreButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- /*Intent intent = new Intent(SelectAlbumActivity.this, SelectAlbumActivity.class);
- String type = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TYPE);
- int size = getIntent().getIntExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_SIZE, 0);
- int offset = getIntent().getIntExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_OFFSET, 0) + size;
-
- intent.putExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TYPE, type);
- intent.putExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_SIZE, size);
- intent.putExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_OFFSET, offset);
- Util.startActivityWithoutTransition(SelectAlbumActivity.this, intent);*/
+ albumListOffset += albumListSize;
+ refresh();
}
});
}
@@ -234,6 +246,7 @@ public class SelectDirectoryFragment extends SubsonicTabFragment implements Adap
emptyView.setVisibility(entries.isEmpty() ? View.VISIBLE : View.GONE);
entryList.setAdapter(entryAdapter = new EntryAdapter(context, getImageLoader(), entries, true));
+ entryList.setVisibility(View.VISIBLE);
licenseValid = result.getSecond();
// invalidateOptionsMenu();
@@ -251,7 +264,11 @@ public class SelectDirectoryFragment extends SubsonicTabFragment implements Adap
getImageLoader().loadImage(coverArtView, entries.get(0), true, true);
TextView titleView = (TextView) header.findViewById(R.id.select_album_title);
- // titleView.setText(getTitle());
+ if(playlistName != null) {
+ titleView.setText(playlistName);
+ } else if(name != null) {
+ titleView.setText(name);
+ }
int songCount = 0;