diff options
36 files changed, 765 insertions, 811 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java index f28d023a..97b86e19 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -26,7 +26,6 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.TypedArray;
-import android.graphics.Color;
import android.media.AudioManager;
import android.os.Build;
import android.os.Bundle;
@@ -61,7 +60,6 @@ import java.io.PrintWriter; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import java.util.Locale;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.ServerInfo;
@@ -71,7 +69,7 @@ import github.daneren2005.dsub.service.HeadphoneListenerService; import github.daneren2005.dsub.util.Constants;
import github.daneren2005.dsub.util.ImageLoader;
import github.daneren2005.dsub.util.Util;
-import github.daneren2005.dsub.view.DrawerAdapter;
+import github.daneren2005.dsub.adapter.DrawerAdapter;
import github.daneren2005.dsub.view.UpdateView;
import github.daneren2005.dsub.util.UserUtil;
diff --git a/src/github/daneren2005/dsub/view/AlbumGridAdapter.java b/src/github/daneren2005/dsub/adapter/AlbumGridAdapter.java index 3347002c..eb187569 100644 --- a/src/github/daneren2005/dsub/view/AlbumGridAdapter.java +++ b/src/github/daneren2005/dsub/adapter/AlbumGridAdapter.java @@ -1,72 +1,73 @@ -/*
- This file is part of Subsonic.
- Subsonic is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- Subsonic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with Subsonic. If not, see <http://www.gnu.org/licenses/>.
- Copyright 2014 (C) Scott Jackson
-*/
-
-package github.daneren2005.dsub.view;
-
-import android.content.Context;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-
-import java.util.List;
-
-import github.daneren2005.dsub.domain.MusicDirectory;
-import github.daneren2005.dsub.util.ImageLoader;
-
-public class AlbumGridAdapter extends ArrayAdapter<MusicDirectory.Entry> {
- private final static String TAG = AlbumGridAdapter.class.getSimpleName();
- private final Context activity;
- private final ImageLoader imageLoader;
- private List<MusicDirectory.Entry> entries;
- private boolean showArtist;
-
- public AlbumGridAdapter(Context activity, ImageLoader imageLoader, List<MusicDirectory.Entry> entries, boolean showArtist) {
- super(activity, android.R.layout.simple_list_item_1, entries);
- this.entries = entries;
- this.activity = activity;
- this.imageLoader = imageLoader;
-
- // Always show artist if they aren't all the same
- if(!showArtist) {
- String artist = null;
- for(MusicDirectory.Entry entry: entries) {
- if(artist == null) {
- artist = entry.getArtist();
- }
-
- if(artist != null && !artist.equals(entry.getArtist())) {
- showArtist = true;
- }
- }
- }
- this.showArtist = showArtist;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- MusicDirectory.Entry entry = getItem(position);
-
- AlbumCell view;
- if(convertView instanceof AlbumCell) {
- view = (AlbumCell) convertView;
- } else {
- view = new AlbumCell(activity);
- }
-
- view.setShowArtist(showArtist);
- view.setObject(entry, imageLoader);
- return view;
- }
-}
+/* + This file is part of Subsonic. + Subsonic is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + Subsonic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with Subsonic. If not, see <http://www.gnu.org/licenses/>. + Copyright 2014 (C) Scott Jackson +*/ + +package github.daneren2005.dsub.adapter; + +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; + +import java.util.List; + +import github.daneren2005.dsub.domain.MusicDirectory; +import github.daneren2005.dsub.util.ImageLoader; +import github.daneren2005.dsub.view.AlbumCell; + +public class AlbumGridAdapter extends ArrayAdapter<MusicDirectory.Entry> { + private final static String TAG = AlbumGridAdapter.class.getSimpleName(); + private final Context activity; + private final ImageLoader imageLoader; + private List<MusicDirectory.Entry> entries; + private boolean showArtist; + + public AlbumGridAdapter(Context activity, ImageLoader imageLoader, List<MusicDirectory.Entry> entries, boolean showArtist) { + super(activity, android.R.layout.simple_list_item_1, entries); + this.entries = entries; + this.activity = activity; + this.imageLoader = imageLoader; + + // Always show artist if they aren't all the same + if(!showArtist) { + String artist = null; + for(MusicDirectory.Entry entry: entries) { + if(artist == null) { + artist = entry.getArtist(); + } + + if(artist != null && !artist.equals(entry.getArtist())) { + showArtist = true; + } + } + } + this.showArtist = showArtist; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + MusicDirectory.Entry entry = getItem(position); + + AlbumCell view; + if(convertView instanceof AlbumCell) { + view = (AlbumCell) convertView; + } else { + view = new AlbumCell(activity); + } + + view.setShowArtist(showArtist); + view.setObject(entry, imageLoader); + return view; + } +} diff --git a/src/github/daneren2005/dsub/view/AlbumListAdapter.java b/src/github/daneren2005/dsub/adapter/AlbumListAdapter.java index 6c3b2f73..2e91d949 100644 --- a/src/github/daneren2005/dsub/view/AlbumListAdapter.java +++ b/src/github/daneren2005/dsub/adapter/AlbumListAdapter.java @@ -1,84 +1,84 @@ -/*
- This file is part of Subsonic.
-
- Subsonic is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Subsonic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Subsonic. If not, see <http://www.gnu.org/licenses/>.
-
- Copyright 2010 (C) Sindre Mehus
- */
-package github.daneren2005.dsub.view;
-
-import android.content.Context;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import com.commonsware.cwac.endless.EndlessAdapter;
-import github.daneren2005.dsub.R;
-import github.daneren2005.dsub.domain.MusicDirectory;
-import github.daneren2005.dsub.domain.ServerInfo;
-import github.daneren2005.dsub.service.MusicService;
-import github.daneren2005.dsub.service.MusicServiceFactory;
-import github.daneren2005.dsub.util.Util;
-
-import java.util.List;
-
-public class AlbumListAdapter extends EndlessAdapter {
- Context context;
- ArrayAdapter<MusicDirectory.Entry> adapter;
- String type;
- String extra;
- int size;
- int offset;
- List<MusicDirectory.Entry> entries;
-
- public AlbumListAdapter(Context context, ArrayAdapter<MusicDirectory.Entry> adapter, String type, String extra, int size) {
- super(adapter);
- this.context = context;
- this.adapter = adapter;
- this.type = type;
- this.extra = extra;
- this.size = size;
- this.offset = size;
- }
-
- @Override
- protected boolean cacheInBackground() throws Exception {
- MusicService service = MusicServiceFactory.getMusicService(context);
- MusicDirectory result;
- if(("genres".equals(type) && ServerInfo.checkServerVersion(context, "1.10.0")) || "years".equals(type)) {
- result = service.getAlbumList(type, extra, size, offset, context, null);
- } else if("genres".equals(type) || "genres-songs".equals(type)) {
- result = service.getSongsByGenre(extra, size, offset, context, null);
- } else {
- result = service.getAlbumList(type, size, offset, context, null);
- }
- entries = result.getChildren();
- return entries.size() > 0;
- }
-
- @Override
- protected void appendCachedData() {
- for(MusicDirectory.Entry entry: entries) {
- adapter.add(entry);
- }
- offset += entries.size();
- }
-
- @Override
- protected View getPendingView(ViewGroup parent) {
- View progress = LayoutInflater.from(context).inflate(R.layout.tab_progress, null);
- progress.setVisibility(View.VISIBLE);
- return progress;
- }
-}
+/* + This file is part of Subsonic. + + Subsonic is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Subsonic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Subsonic. If not, see <http://www.gnu.org/licenses/>. + + Copyright 2010 (C) Sindre Mehus + */ +package github.daneren2005.dsub.adapter; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import com.commonsware.cwac.endless.EndlessAdapter; +import github.daneren2005.dsub.R; +import github.daneren2005.dsub.domain.MusicDirectory; +import github.daneren2005.dsub.domain.ServerInfo; +import github.daneren2005.dsub.service.MusicService; +import github.daneren2005.dsub.service.MusicServiceFactory; +import github.daneren2005.dsub.util.Util; + +import java.util.List; + +public class AlbumListAdapter extends EndlessAdapter { + Context context; + ArrayAdapter<MusicDirectory.Entry> adapter; + String type; + String extra; + int size; + int offset; + List<MusicDirectory.Entry> entries; + + public AlbumListAdapter(Context context, ArrayAdapter<MusicDirectory.Entry> adapter, String type, String extra, int size) { + super(adapter); + this.context = context; + this.adapter = adapter; + this.type = type; + this.extra = extra; + this.size = size; + this.offset = size; + } + + @Override + protected boolean cacheInBackground() throws Exception { + MusicService service = MusicServiceFactory.getMusicService(context); + MusicDirectory result; + if(("genres".equals(type) && ServerInfo.checkServerVersion(context, "1.10.0")) || "years".equals(type)) { + result = service.getAlbumList(type, extra, size, offset, context, null); + } else if("genres".equals(type) || "genres-songs".equals(type)) { + result = service.getSongsByGenre(extra, size, offset, context, null); + } else { + result = service.getAlbumList(type, size, offset, context, null); + } + entries = result.getChildren(); + return entries.size() > 0; + } + + @Override + protected void appendCachedData() { + for(MusicDirectory.Entry entry: entries) { + adapter.add(entry); + } + offset += entries.size(); + } + + @Override + protected View getPendingView(ViewGroup parent) { + View progress = LayoutInflater.from(context).inflate(R.layout.tab_progress, null); + progress.setVisibility(View.VISIBLE); + return progress; + } +} diff --git a/src/github/daneren2005/dsub/view/ArtistAdapter.java b/src/github/daneren2005/dsub/adapter/ArtistAdapter.java index 1998eaed..4d469faf 100644 --- a/src/github/daneren2005/dsub/view/ArtistAdapter.java +++ b/src/github/daneren2005/dsub/adapter/ArtistAdapter.java @@ -16,7 +16,7 @@ Copyright 2010 (C) Sindre Mehus */ -package github.daneren2005.dsub.view; +package github.daneren2005.dsub.adapter; import android.content.Context; import github.daneren2005.dsub.R; @@ -26,6 +26,8 @@ import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.SectionIndexer; import github.daneren2005.dsub.domain.Artist; +import github.daneren2005.dsub.view.ArtistView; + import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.Set; diff --git a/src/github/daneren2005/dsub/view/BookmarkAdapter.java b/src/github/daneren2005/dsub/adapter/BookmarkAdapter.java index ea585744..26d3e16a 100644 --- a/src/github/daneren2005/dsub/view/BookmarkAdapter.java +++ b/src/github/daneren2005/dsub/adapter/BookmarkAdapter.java @@ -17,7 +17,7 @@ Copyright 2010 (C) Sindre Mehus */ -package github.daneren2005.dsub.view; +package github.daneren2005.dsub.adapter; import android.content.Context; @@ -31,6 +31,7 @@ import github.daneren2005.dsub.R; import github.daneren2005.dsub.domain.Bookmark; import github.daneren2005.dsub.domain.MusicDirectory; import github.daneren2005.dsub.util.Util; +import github.daneren2005.dsub.view.SongView; public class BookmarkAdapter extends ArrayAdapter<MusicDirectory.Entry> { private final static String TAG = BookmarkAdapter.class.getSimpleName(); diff --git a/src/github/daneren2005/dsub/view/ChatAdapter.java b/src/github/daneren2005/dsub/adapter/ChatAdapter.java index 0ce757a9..0c116d39 100644 --- a/src/github/daneren2005/dsub/view/ChatAdapter.java +++ b/src/github/daneren2005/dsub/adapter/ChatAdapter.java @@ -1,109 +1,109 @@ -package github.daneren2005.dsub.view;
-
-import android.text.method.LinkMovementMethod;
-import android.text.util.Linkify;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import android.widget.ImageView;
-import android.widget.TextView;
-import github.daneren2005.dsub.R;
-import github.daneren2005.dsub.activity.SubsonicActivity;
-import github.daneren2005.dsub.domain.ChatMessage;
-import github.daneren2005.dsub.util.ImageLoader;
-import github.daneren2005.dsub.util.UserUtil;
-import github.daneren2005.dsub.util.Util;
-
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.regex.Pattern;
-
-public class ChatAdapter extends ArrayAdapter<ChatMessage> {
-
- private final SubsonicActivity activity;
- private ArrayList<ChatMessage> messages;
- private final ImageLoader imageLoader;
-
- private static final String phoneRegex = "1?\\W*([2-9][0-8][0-9])\\W*([2-9][0-9]{2})\\W*([0-9]{4})"; //you can just place your support phone here
- private static final Pattern phoneMatcher = Pattern.compile(phoneRegex);
-
- public ChatAdapter(SubsonicActivity activity, ArrayList<ChatMessage> messages, ImageLoader imageLoader) {
- super(activity, R.layout.chat_item, messages);
- this.activity = activity;
- this.messages = messages;
- this.imageLoader = imageLoader;
- }
-
- @Override
- public int getCount() {
- return messages.size();
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- ChatMessage message = this.getItem(position);
-
- ViewHolder holder;
- int layout;
-
- String messageUser = message.getUsername();
- Date messageTime = new java.util.Date(message.getTime());
- String messageText = message.getMessage();
-
- String me = UserUtil.getCurrentUsername(activity);
-
- if (messageUser.equals(me)) {
- layout = R.layout.chat_item_reverse;
- } else {
- layout = R.layout.chat_item;
- }
-
- if (convertView == null)
- {
- holder = new ViewHolder();
-
- convertView = LayoutInflater.from(activity).inflate(layout, parent, false);
-
- TextView usernameView = (TextView) convertView.findViewById(R.id.chat_username);
- TextView timeView = (TextView) convertView.findViewById(R.id.chat_time);
- TextView messageView = (TextView) convertView.findViewById(R.id.chat_message);
-
- messageView.setMovementMethod(LinkMovementMethod.getInstance());
- Linkify.addLinks(messageView, Linkify.EMAIL_ADDRESSES);
- Linkify.addLinks(messageView, Linkify.WEB_URLS);
- Linkify.addLinks(messageView, phoneMatcher, "tel:");
-
- holder.message = messageView;
- holder.username = usernameView;
- holder.time = timeView;
- holder.avatar = (ImageView) convertView.findViewById(R.id.chat_avatar);
-
- convertView.setTag(holder);
- }
- else
- {
- holder = (ViewHolder) convertView.getTag();
- }
-
- DateFormat timeFormat = android.text.format.DateFormat.getTimeFormat(activity);
- String messageTimeFormatted = String.format("[%s]", timeFormat.format(messageTime));
-
- holder.username.setText(messageUser);
- holder.message.setText(messageText);
- holder.time.setText(messageTimeFormatted);
-
- imageLoader.loadAvatar(activity, holder.avatar, messageUser);
-
- return convertView;
- }
-
- private static class ViewHolder
- {
- TextView message;
- TextView username;
- TextView time;
- ImageView avatar;
- }
-}
+package github.daneren2005.dsub.adapter; + +import android.text.method.LinkMovementMethod; +import android.text.util.Linkify; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.ImageView; +import android.widget.TextView; +import github.daneren2005.dsub.R; +import github.daneren2005.dsub.activity.SubsonicActivity; +import github.daneren2005.dsub.domain.ChatMessage; +import github.daneren2005.dsub.util.ImageLoader; +import github.daneren2005.dsub.util.UserUtil; +import github.daneren2005.dsub.util.Util; + +import java.text.DateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.regex.Pattern; + +public class ChatAdapter extends ArrayAdapter<ChatMessage> { + + private final SubsonicActivity activity; + private ArrayList<ChatMessage> messages; + private final ImageLoader imageLoader; + + private static final String phoneRegex = "1?\\W*([2-9][0-8][0-9])\\W*([2-9][0-9]{2})\\W*([0-9]{4})"; //you can just place your support phone here + private static final Pattern phoneMatcher = Pattern.compile(phoneRegex); + + public ChatAdapter(SubsonicActivity activity, ArrayList<ChatMessage> messages, ImageLoader imageLoader) { + super(activity, R.layout.chat_item, messages); + this.activity = activity; + this.messages = messages; + this.imageLoader = imageLoader; + } + + @Override + public int getCount() { + return messages.size(); + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + ChatMessage message = this.getItem(position); + + ViewHolder holder; + int layout; + + String messageUser = message.getUsername(); + Date messageTime = new java.util.Date(message.getTime()); + String messageText = message.getMessage(); + + String me = UserUtil.getCurrentUsername(activity); + + if (messageUser.equals(me)) { + layout = R.layout.chat_item_reverse; + } else { + layout = R.layout.chat_item; + } + + if (convertView == null) + { + holder = new ViewHolder(); + + convertView = LayoutInflater.from(activity).inflate(layout, parent, false); + + TextView usernameView = (TextView) convertView.findViewById(R.id.chat_username); + TextView timeView = (TextView) convertView.findViewById(R.id.chat_time); + TextView messageView = (TextView) convertView.findViewById(R.id.chat_message); + + messageView.setMovementMethod(LinkMovementMethod.getInstance()); + Linkify.addLinks(messageView, Linkify.EMAIL_ADDRESSES); + Linkify.addLinks(messageView, Linkify.WEB_URLS); + Linkify.addLinks(messageView, phoneMatcher, "tel:"); + + holder.message = messageView; + holder.username = usernameView; + holder.time = timeView; + holder.avatar = (ImageView) convertView.findViewById(R.id.chat_avatar); + + convertView.setTag(holder); + } + else + { + holder = (ViewHolder) convertView.getTag(); + } + + DateFormat timeFormat = android.text.format.DateFormat.getTimeFormat(activity); + String messageTimeFormatted = String.format("[%s]", timeFormat.format(messageTime)); + + holder.username.setText(messageUser); + holder.message.setText(messageText); + holder.time.setText(messageTimeFormatted); + + imageLoader.loadAvatar(activity, holder.avatar, messageUser); + + return convertView; + } + + private static class ViewHolder + { + TextView message; + TextView username; + TextView time; + ImageView avatar; + } +} diff --git a/src/github/daneren2005/dsub/view/DownloadFileAdapter.java b/src/github/daneren2005/dsub/adapter/DownloadFileAdapter.java index f535acef..be9b4cb9 100644 --- a/src/github/daneren2005/dsub/view/DownloadFileAdapter.java +++ b/src/github/daneren2005/dsub/adapter/DownloadFileAdapter.java @@ -1,48 +1,49 @@ -/*
- This file is part of Subsonic.
- Subsonic is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- Subsonic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with Subsonic. If not, see <http://www.gnu.org/licenses/>.
- Copyright 2014 (C) Scott Jackson
-*/
-
-package github.daneren2005.dsub.view;
-
-import android.content.Context;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-
-import java.util.List;
-
-import github.daneren2005.dsub.service.DownloadFile;
-
-public class DownloadFileAdapter extends ArrayAdapter<DownloadFile> {
- Context context;
-
- public DownloadFileAdapter(Context context, List<DownloadFile> entries) {
- super(context, android.R.layout.simple_list_item_1, entries);
- this.context = context;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- SongView view;
- if (convertView != null && convertView instanceof SongView) {
- view = (SongView) convertView;
- } else {
- view = new SongView(context);
- }
- DownloadFile downloadFile = getItem(position);
- view.setObject(downloadFile.getSong(), false);
- view.setDownloadFile(downloadFile);
- return view;
- }
-}
+/* + This file is part of Subsonic. + Subsonic is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + Subsonic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with Subsonic. If not, see <http://www.gnu.org/licenses/>. + Copyright 2014 (C) Scott Jackson +*/ + +package github.daneren2005.dsub.adapter; + +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; + +import java.util.List; + +import github.daneren2005.dsub.service.DownloadFile; +import github.daneren2005.dsub.view.SongView; + +public class DownloadFileAdapter extends ArrayAdapter<DownloadFile> { + Context context; + + public DownloadFileAdapter(Context context, List<DownloadFile> entries) { + super(context, android.R.layout.simple_list_item_1, entries); + this.context = context; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + SongView view; + if (convertView != null && convertView instanceof SongView) { + view = (SongView) convertView; + } else { + view = new SongView(context); + } + DownloadFile downloadFile = getItem(position); + view.setObject(downloadFile.getSong(), false); + view.setDownloadFile(downloadFile); + return view; + } +} diff --git a/src/github/daneren2005/dsub/view/DrawerAdapter.java b/src/github/daneren2005/dsub/adapter/DrawerAdapter.java index 1f2c7f4f..b0a4a33d 100644 --- a/src/github/daneren2005/dsub/view/DrawerAdapter.java +++ b/src/github/daneren2005/dsub/adapter/DrawerAdapter.java @@ -1,128 +1,126 @@ -/*
- This file is part of Subsonic.
-
- Subsonic is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Subsonic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Subsonic. If not, see <http://www.gnu.org/licenses/>.
-
- Copyright 2009 (C) Sindre Mehus
-*/
-package github.daneren2005.dsub.view;
-
-import android.content.Context;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import github.daneren2005.dsub.R;
-
-/**
- * Created by Scott on 11/8/13.
- */
-public class DrawerAdapter extends ArrayAdapter<String> {
- private static String TAG = DrawerAdapter.class.getSimpleName();
- private Context context;
- private List<String> items;
- private List<Integer> icons;
- private List<Boolean> visible;
- private int selectedPosition = -1;
-
- public DrawerAdapter(Context context, List<String> items, List<Integer> icons, List<Boolean> visible) {
- super(context, R.layout.drawer_list_item, items);
-
- this.context = context;
- this.items = items;
- this.icons = icons;
- this.visible = visible;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- position = getActualPosition(position);
- String item = items.get(position);
- Integer icon = icons.get(position);
-
- if(convertView == null) {
- convertView = LayoutInflater.from(context).inflate(R.layout.drawer_list_item, null);
- }
-
- TextView textView = (TextView) convertView.findViewById(R.id.drawer_name);
- textView.setText(item);
-
- if(selectedPosition == position) {
- textView.setTextAppearance(context, R.style.DSub_TextViewStyle_Bold);
- selectedPosition = -1;
- }
-
- ImageView iconView = (ImageView) convertView.findViewById(R.id.drawer_icon);
- iconView.setImageResource(icon);
-
- return convertView;
- }
-
- @Override
- public int getCount() {
- int count = 0;
- for(int i = 0; i < visible.size(); i++) {
- if(visible.get(i)) {
- count++;
- }
- }
-
- return count;
- }
-
- public int getActualPosition(int position) {
- for(int i = 0; i <= position; i++) {
- if(!visible.get(i)) {
- position++;
- }
- }
-
- return position;
- }
- public int getAdapterPosition(int position) {
- if(!visible.get(position)) {
- visible.set(position, true);
- notifyDataSetChanged();
- }
-
- for(int i = position; i >= 0; i--) {
- if(!visible.get(i)) {
- position--;
- }
- }
-
- return position;
- }
-
- public void setItemVisible(int position, boolean visible) {
- if(this.visible.get(position) != visible) {
- this.visible.set(position, visible);
- notifyDataSetInvalidated();
- }
- }
- public void setDownloadVisible(boolean visible) {
- setItemVisible(items.size() - 2, visible);
- }
-
- public void setSelectedPosition(int position) {
- selectedPosition = position;
- }
-}
+/* + This file is part of Subsonic. + + Subsonic is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Subsonic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Subsonic. If not, see <http://www.gnu.org/licenses/>. + + Copyright 2009 (C) Sindre Mehus +*/ +package github.daneren2005.dsub.adapter; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.ImageView; +import android.widget.TextView; + +import java.util.List; + +import github.daneren2005.dsub.R; + +/** + * Created by Scott on 11/8/13. + */ +public class DrawerAdapter extends ArrayAdapter<String> { + private static String TAG = DrawerAdapter.class.getSimpleName(); + private Context context; + private List<String> items; + private List<Integer> icons; + private List<Boolean> visible; + private int selectedPosition = -1; + + public DrawerAdapter(Context context, List<String> items, List<Integer> icons, List<Boolean> visible) { + super(context, R.layout.drawer_list_item, items); + + this.context = context; + this.items = items; + this.icons = icons; + this.visible = visible; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + position = getActualPosition(position); + String item = items.get(position); + Integer icon = icons.get(position); + + if(convertView == null) { + convertView = LayoutInflater.from(context).inflate(R.layout.drawer_list_item, null); + } + + TextView textView = (TextView) convertView.findViewById(R.id.drawer_name); + textView.setText(item); + + if(selectedPosition == position) { + textView.setTextAppearance(context, R.style.DSub_TextViewStyle_Bold); + selectedPosition = -1; + } + + ImageView iconView = (ImageView) convertView.findViewById(R.id.drawer_icon); + iconView.setImageResource(icon); + + return convertView; + } + + @Override + public int getCount() { + int count = 0; + for(int i = 0; i < visible.size(); i++) { + if(visible.get(i)) { + count++; + } + } + + return count; + } + + public int getActualPosition(int position) { + for(int i = 0; i <= position; i++) { + if(!visible.get(i)) { + position++; + } + } + + return position; + } + public int getAdapterPosition(int position) { + if(!visible.get(position)) { + visible.set(position, true); + notifyDataSetChanged(); + } + + for(int i = position; i >= 0; i--) { + if(!visible.get(i)) { + position--; + } + } + + return position; + } + + public void setItemVisible(int position, boolean visible) { + if(this.visible.get(position) != visible) { + this.visible.set(position, visible); + notifyDataSetInvalidated(); + } + } + public void setDownloadVisible(boolean visible) { + setItemVisible(items.size() - 2, visible); + } + + public void setSelectedPosition(int position) { + selectedPosition = position; + } +} diff --git a/src/github/daneren2005/dsub/view/EntryAdapter.java b/src/github/daneren2005/dsub/adapter/EntryAdapter.java index e9611692..9e506e5a 100644 --- a/src/github/daneren2005/dsub/view/EntryAdapter.java +++ b/src/github/daneren2005/dsub/adapter/EntryAdapter.java @@ -16,7 +16,7 @@ Copyright 2010 (C) Sindre Mehus */ -package github.daneren2005.dsub.view; +package github.daneren2005.dsub.adapter; import android.content.Context; @@ -27,6 +27,9 @@ import android.view.ViewGroup; import android.widget.ArrayAdapter; import github.daneren2005.dsub.domain.MusicDirectory; import github.daneren2005.dsub.util.ImageLoader; +import github.daneren2005.dsub.view.AlbumView; +import github.daneren2005.dsub.view.ArtistEntryView; +import github.daneren2005.dsub.view.SongView; /** * @author Sindre Mehus diff --git a/src/github/daneren2005/dsub/view/GenreAdapter.java b/src/github/daneren2005/dsub/adapter/GenreAdapter.java index 05cc0da9..abb208c9 100644 --- a/src/github/daneren2005/dsub/view/GenreAdapter.java +++ b/src/github/daneren2005/dsub/adapter/GenreAdapter.java @@ -1,59 +1,60 @@ -/*
- This file is part of Subsonic.
-
- Subsonic is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Subsonic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Subsonic. If not, see <http://www.gnu.org/licenses/>.
-
- Copyright 2010 (C) Sindre Mehus
- */
-package github.daneren2005.dsub.view;
-
-import android.widget.ArrayAdapter;
-import android.widget.SectionIndexer;
-import android.content.Context;
-import android.view.View;
-import android.view.ViewGroup;
-import github.daneren2005.dsub.R;
-import github.daneren2005.dsub.domain.Genre;
-
-import java.util.List;
-import java.util.Set;
-import java.util.LinkedHashSet;
-import java.util.ArrayList;
-
-/**
- * @author Sindre Mehus
-*/
-public class GenreAdapter extends ArrayAdapter<Genre>{
- private Context activity;
- private List<Genre> genres;
-
- public GenreAdapter(Context context, List<Genre> genres) {
- super(context, android.R.layout.simple_list_item_1, genres);
- this.activity = context;
- this.genres = genres;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- Genre genre = genres.get(position);
- GenreView view;
- if (convertView != null && convertView instanceof GenreView) {
- view = (GenreView) convertView;
- } else {
- view = new GenreView(activity);
- }
- view.setObject(genre);
- return view;
- }
-}
+/* + This file is part of Subsonic. + + Subsonic is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Subsonic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Subsonic. If not, see <http://www.gnu.org/licenses/>. + + Copyright 2010 (C) Sindre Mehus + */ +package github.daneren2005.dsub.adapter; + +import android.widget.ArrayAdapter; +import android.widget.SectionIndexer; +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; +import github.daneren2005.dsub.R; +import github.daneren2005.dsub.domain.Genre; +import github.daneren2005.dsub.view.GenreView; + +import java.util.List; +import java.util.Set; +import java.util.LinkedHashSet; +import java.util.ArrayList; + +/** + * @author Sindre Mehus +*/ +public class GenreAdapter extends ArrayAdapter<Genre>{ + private Context activity; + private List<Genre> genres; + + public GenreAdapter(Context context, List<Genre> genres) { + super(context, android.R.layout.simple_list_item_1, genres); + this.activity = context; + this.genres = genres; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + Genre genre = genres.get(position); + GenreView view; + if (convertView != null && convertView instanceof GenreView) { + view = (GenreView) convertView; + } else { + view = new GenreView(activity); + } + view.setObject(genre); + return view; + } +} diff --git a/src/github/daneren2005/dsub/view/MergeAdapter.java b/src/github/daneren2005/dsub/adapter/MergeAdapter.java index bfe777ea..a2db4cf0 100644 --- a/src/github/daneren2005/dsub/view/MergeAdapter.java +++ b/src/github/daneren2005/dsub/adapter/MergeAdapter.java @@ -13,7 +13,7 @@ limitations under the License. */ -package github.daneren2005.dsub.view; +package github.daneren2005.dsub.adapter; import android.database.DataSetObserver; import android.view.View; @@ -25,8 +25,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Arrays; -import github.daneren2005.dsub.view.SackOfViewsAdapter; - /** * Adapter that merges multiple child adapters and views * into a single contiguous whole. diff --git a/src/github/daneren2005/dsub/view/PlaylistAdapter.java b/src/github/daneren2005/dsub/adapter/PlaylistAdapter.java index ff0294b7..d56a6b97 100644 --- a/src/github/daneren2005/dsub/view/PlaylistAdapter.java +++ b/src/github/daneren2005/dsub/adapter/PlaylistAdapter.java @@ -16,7 +16,7 @@ Copyright 2010 (C) Sindre Mehus */ -package github.daneren2005.dsub.view; +package github.daneren2005.dsub.adapter; import android.content.Context; import github.daneren2005.dsub.R; @@ -25,6 +25,8 @@ import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import github.daneren2005.dsub.domain.Playlist; +import github.daneren2005.dsub.view.PlaylistView; + import java.util.Collections; import java.util.Comparator; diff --git a/src/github/daneren2005/dsub/view/PodcastChannelAdapter.java b/src/github/daneren2005/dsub/adapter/PodcastChannelAdapter.java index 3a7ab922..8ee39a10 100644 --- a/src/github/daneren2005/dsub/view/PodcastChannelAdapter.java +++ b/src/github/daneren2005/dsub/adapter/PodcastChannelAdapter.java @@ -1,59 +1,60 @@ -/*
- This file is part of Subsonic.
-
- Subsonic is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Subsonic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Subsonic. If not, see <http://www.gnu.org/licenses/>.
-
- Copyright 2010 (C) Sindre Mehus
- */
-package github.daneren2005.dsub.view;
-
-import android.widget.ArrayAdapter;
-import android.widget.SectionIndexer;
-import android.content.Context;
-import android.view.View;
-import android.view.ViewGroup;
-import github.daneren2005.dsub.R;
-import github.daneren2005.dsub.domain.PodcastChannel;
-
-import java.util.List;
-import java.util.Set;
-import java.util.LinkedHashSet;
-import java.util.ArrayList;
-
-/**
- * @author Sindre Mehus
-*/
-public class PodcastChannelAdapter extends ArrayAdapter<PodcastChannel>{
- private Context activity;
- private List<PodcastChannel> podcasts;
-
- public PodcastChannelAdapter(Context context, List<PodcastChannel> podcasts) {
- super(context, android.R.layout.simple_list_item_1, podcasts);
- this.activity = context;
- this.podcasts = podcasts;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- PodcastChannel podcast = podcasts.get(position);
- PodcastChannelView view;
- if (convertView != null && convertView instanceof PodcastChannelView) {
- view = (PodcastChannelView) convertView;
- } else {
- view = new PodcastChannelView(activity);
- }
- view.setObject(podcast);
- return view;
- }
-}
+/* + This file is part of Subsonic. + + Subsonic is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Subsonic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Subsonic. If not, see <http://www.gnu.org/licenses/>. + + Copyright 2010 (C) Sindre Mehus + */ +package github.daneren2005.dsub.adapter; + +import android.widget.ArrayAdapter; +import android.widget.SectionIndexer; +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; +import github.daneren2005.dsub.R; +import github.daneren2005.dsub.domain.PodcastChannel; +import github.daneren2005.dsub.view.PodcastChannelView; + +import java.util.List; +import java.util.Set; +import java.util.LinkedHashSet; +import java.util.ArrayList; + +/** + * @author Sindre Mehus +*/ +public class PodcastChannelAdapter extends ArrayAdapter<PodcastChannel>{ + private Context activity; + private List<PodcastChannel> podcasts; + + public PodcastChannelAdapter(Context context, List<PodcastChannel> podcasts) { + super(context, android.R.layout.simple_list_item_1, podcasts); + this.activity = context; + this.podcasts = podcasts; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + PodcastChannel podcast = podcasts.get(position); + PodcastChannelView view; + if (convertView != null && convertView instanceof PodcastChannelView) { + view = (PodcastChannelView) convertView; + } else { + view = new PodcastChannelView(activity); + } + view.setObject(podcast); + return view; + } +} diff --git a/src/github/daneren2005/dsub/view/SackOfViewsAdapter.java b/src/github/daneren2005/dsub/adapter/SackOfViewsAdapter.java index ff2280c1..e4744cc5 100644 --- a/src/github/daneren2005/dsub/view/SackOfViewsAdapter.java +++ b/src/github/daneren2005/dsub/adapter/SackOfViewsAdapter.java @@ -12,7 +12,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package github.daneren2005.dsub.view; +package github.daneren2005.dsub.adapter; import android.view.View; import android.view.ViewGroup; diff --git a/src/github/daneren2005/dsub/view/SettingsAdapter.java b/src/github/daneren2005/dsub/adapter/SettingsAdapter.java index ce6c12ed..45c3ead1 100644 --- a/src/github/daneren2005/dsub/view/SettingsAdapter.java +++ b/src/github/daneren2005/dsub/adapter/SettingsAdapter.java @@ -1,58 +1,59 @@ -/*
- This file is part of Subsonic.
- Subsonic is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- Subsonic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with Subsonic. If not, see <http://www.gnu.org/licenses/>.
- Copyright 2014 (C) Scott Jackson
-*/
-
-package github.daneren2005.dsub.view;
-
-import android.content.Context;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-
-import java.util.List;
-
-import github.daneren2005.dsub.R;
-import github.daneren2005.dsub.domain.User;
-
-import static github.daneren2005.dsub.domain.User.Setting;
-
-public class SettingsAdapter extends ArrayAdapter<Setting> {
- private final Context context;
- private final boolean editable;
-
- public SettingsAdapter(Context context, User user, boolean editable) {
- super(context, R.layout.basic_list_item, user.getSettings());
- this.context = context;
- this.editable = editable;
- }
-
- public SettingsAdapter(Context context, List<Setting> settings, boolean editable) {
- super(context, R.layout.basic_list_item, settings);
- this.context = context;
- this.editable = editable;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- Setting entry = getItem(position);
- SettingView view;
- if (convertView != null && convertView instanceof SettingView) {
- view = (SettingView) convertView;
- } else {
- view = new SettingView(context);
- }
- view.setObject(entry, editable);
- return view;
- }
-}
+/* + This file is part of Subsonic. + Subsonic is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + Subsonic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with Subsonic. If not, see <http://www.gnu.org/licenses/>. + Copyright 2014 (C) Scott Jackson +*/ + +package github.daneren2005.dsub.adapter; + +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; + +import java.util.List; + +import github.daneren2005.dsub.R; +import github.daneren2005.dsub.domain.User; +import github.daneren2005.dsub.view.SettingView; + +import static github.daneren2005.dsub.domain.User.Setting; + +public class SettingsAdapter extends ArrayAdapter<Setting> { + private final Context context; + private final boolean editable; + + public SettingsAdapter(Context context, User user, boolean editable) { + super(context, R.layout.basic_list_item, user.getSettings()); + this.context = context; + this.editable = editable; + } + + public SettingsAdapter(Context context, List<Setting> settings, boolean editable) { + super(context, R.layout.basic_list_item, settings); + this.context = context; + this.editable = editable; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + Setting entry = getItem(position); + SettingView view; + if (convertView != null && convertView instanceof SettingView) { + view = (SettingView) convertView; + } else { + view = new SettingView(context); + } + view.setObject(entry, editable); + return view; + } +} diff --git a/src/github/daneren2005/dsub/view/ShareAdapter.java b/src/github/daneren2005/dsub/adapter/ShareAdapter.java index 362e1c83..4121a85a 100644 --- a/src/github/daneren2005/dsub/view/ShareAdapter.java +++ b/src/github/daneren2005/dsub/adapter/ShareAdapter.java @@ -1,55 +1,56 @@ -/*
- This file is part of Subsonic.
-
- Subsonic is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Subsonic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Subsonic. If not, see <http://www.gnu.org/licenses/>.
-
- Copyright 2010 (C) Sindre Mehus
- */
-package github.daneren2005.dsub.view;
-
-import android.content.Context;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-
-import java.util.List;
-
-import github.daneren2005.dsub.domain.Share;
-
-/**
- * @author Sindre Mehus
-*/
-public class ShareAdapter extends ArrayAdapter<Share>{
- private Context activity;
- private List<Share> shares;
-
- public ShareAdapter(Context context, List<Share> shares) {
- super(context, android.R.layout.simple_list_item_1, shares);
- this.activity = context;
- this.shares = shares;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- Share share = shares.get(position);
- ShareView view;
- if (convertView != null && convertView instanceof ShareView) {
- view = (ShareView) convertView;
- } else {
- view = new ShareView(activity);
- }
- view.setObject(share);
- return view;
- }
-}
+/* + This file is part of Subsonic. + + Subsonic is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Subsonic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Subsonic. If not, see <http://www.gnu.org/licenses/>. + + Copyright 2010 (C) Sindre Mehus + */ +package github.daneren2005.dsub.adapter; + +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; + +import java.util.List; + +import github.daneren2005.dsub.domain.Share; +import github.daneren2005.dsub.view.ShareView; + +/** + * @author Sindre Mehus +*/ +public class ShareAdapter extends ArrayAdapter<Share>{ + private Context activity; + private List<Share> shares; + + public ShareAdapter(Context context, List<Share> shares) { + super(context, android.R.layout.simple_list_item_1, shares); + this.activity = context; + this.shares = shares; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + Share share = shares.get(position); + ShareView view; + if (convertView != null && convertView instanceof ShareView) { + view = (ShareView) convertView; + } else { + view = new ShareView(activity); + } + view.setObject(share); + return view; + } +} diff --git a/src/github/daneren2005/dsub/view/UserAdapter.java b/src/github/daneren2005/dsub/adapter/UserAdapter.java index 70a1748a..f0f78d97 100644 --- a/src/github/daneren2005/dsub/view/UserAdapter.java +++ b/src/github/daneren2005/dsub/adapter/UserAdapter.java @@ -1,51 +1,52 @@ -/*
- This file is part of Subsonic.
- Subsonic is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- Subsonic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with Subsonic. If not, see <http://www.gnu.org/licenses/>.
- Copyright 2014 (C) Scott Jackson
-*/
-
-package github.daneren2005.dsub.view;
-
-import android.content.Context;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-
-import java.util.List;
-
-import github.daneren2005.dsub.R;
-import github.daneren2005.dsub.domain.User;
-import github.daneren2005.dsub.util.ImageLoader;
-
-public class UserAdapter extends ArrayAdapter<User> {
- private final Context activity;
- private final ImageLoader imageLoader;
-
- public UserAdapter(Context activity, List<User> users, ImageLoader imageLoader) {
- super(activity, R.layout.basic_list_item, users);
- this.activity = activity;
- this.imageLoader = imageLoader;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- User entry = getItem(position);
- UserView view;
- if (convertView != null && convertView instanceof UserView) {
- view = (UserView) convertView;
- } else {
- view = new UserView(activity);
- }
- view.setObject(entry, imageLoader);
- return view;
- }
+/* + This file is part of Subsonic. + Subsonic is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + Subsonic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with Subsonic. If not, see <http://www.gnu.org/licenses/>. + Copyright 2014 (C) Scott Jackson +*/ + +package github.daneren2005.dsub.adapter; + +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; + +import java.util.List; + +import github.daneren2005.dsub.R; +import github.daneren2005.dsub.domain.User; +import github.daneren2005.dsub.util.ImageLoader; +import github.daneren2005.dsub.view.UserView; + +public class UserAdapter extends ArrayAdapter<User> { + private final Context activity; + private final ImageLoader imageLoader; + + public UserAdapter(Context activity, List<User> users, ImageLoader imageLoader) { + super(activity, R.layout.basic_list_item, users); + this.activity = activity; + this.imageLoader = imageLoader; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + User entry = getItem(position); + UserView view; + if (convertView != null && convertView instanceof UserView) { + view = (UserView) convertView; + } else { + view = new UserView(activity); + } + view.setObject(entry, imageLoader); + return view; + } }
\ No newline at end of file diff --git a/src/github/daneren2005/dsub/fragments/AdminFragment.java b/src/github/daneren2005/dsub/fragments/AdminFragment.java index 021e80d1..d59526b6 100644 --- a/src/github/daneren2005/dsub/fragments/AdminFragment.java +++ b/src/github/daneren2005/dsub/fragments/AdminFragment.java @@ -15,17 +15,13 @@ package github.daneren2005.dsub.fragments;
-import android.app.AlertDialog;
-import android.content.DialogInterface;
import android.os.Bundle;
-import android.util.Log;
import android.view.ContextMenu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
-import android.widget.TextView;
import java.io.File;
import java.util.ArrayList;
@@ -34,16 +30,12 @@ import java.util.List; import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.User;
import github.daneren2005.dsub.service.MusicService;
-import github.daneren2005.dsub.service.MusicServiceFactory;
-import github.daneren2005.dsub.service.OfflineException;
-import github.daneren2005.dsub.service.ServerTooOldException;
import github.daneren2005.dsub.service.parser.SubsonicRESTException;
import github.daneren2005.dsub.util.Constants;
import github.daneren2005.dsub.util.ProgressListener;
-import github.daneren2005.dsub.util.SilentBackgroundTask;
import github.daneren2005.dsub.util.UserUtil;
import github.daneren2005.dsub.util.Util;
-import github.daneren2005.dsub.view.UserAdapter;
+import github.daneren2005.dsub.adapter.UserAdapter;
public class AdminFragment extends SelectListFragment<User> {
private static String TAG = AdminFragment.class.getSimpleName();
diff --git a/src/github/daneren2005/dsub/fragments/ChatFragment.java b/src/github/daneren2005/dsub/fragments/ChatFragment.java index d51be830..5d017fa7 100644 --- a/src/github/daneren2005/dsub/fragments/ChatFragment.java +++ b/src/github/daneren2005/dsub/fragments/ChatFragment.java @@ -12,7 +12,6 @@ import android.os.Handler; import android.support.v4.widget.SwipeRefreshLayout;
import android.text.Editable;
import android.text.TextWatcher;
-import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -20,10 +19,8 @@ import android.view.MenuInflater; import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
-import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
-import android.widget.AbsListView;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ListView;
@@ -35,7 +32,7 @@ import github.daneren2005.dsub.service.MusicServiceFactory; import github.daneren2005.dsub.util.BackgroundTask;
import github.daneren2005.dsub.util.TabBackgroundTask;
import github.daneren2005.dsub.util.Util;
-import github.daneren2005.dsub.view.ChatAdapter;
+import github.daneren2005.dsub.adapter.ChatAdapter;
import github.daneren2005.dsub.util.Constants;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
diff --git a/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/src/github/daneren2005/dsub/fragments/DownloadFragment.java index a72ef8da..24c9d303 100644 --- a/src/github/daneren2005/dsub/fragments/DownloadFragment.java +++ b/src/github/daneren2005/dsub/fragments/DownloadFragment.java @@ -18,7 +18,6 @@ package github.daneren2005.dsub.fragments; import android.content.DialogInterface;
import android.os.Handler;
import android.view.ContextMenu;
-import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
@@ -38,9 +37,7 @@ import github.daneren2005.dsub.service.MusicService; import github.daneren2005.dsub.util.ProgressListener;
import github.daneren2005.dsub.util.SilentBackgroundTask;
import github.daneren2005.dsub.util.Util;
-import github.daneren2005.dsub.view.DownloadFileAdapter;
-
-import static github.daneren2005.dsub.domain.MusicDirectory.Entry;
+import github.daneren2005.dsub.adapter.DownloadFileAdapter;
public class DownloadFragment extends SelectListFragment<DownloadFile> {
private long currentRevision;
diff --git a/src/github/daneren2005/dsub/fragments/MainFragment.java b/src/github/daneren2005/dsub/fragments/MainFragment.java index 0e1b587e..ebe84d77 100644 --- a/src/github/daneren2005/dsub/fragments/MainFragment.java +++ b/src/github/daneren2005/dsub/fragments/MainFragment.java @@ -30,7 +30,7 @@ import github.daneren2005.dsub.util.FileUtil; import github.daneren2005.dsub.util.LoadingTask;
import github.daneren2005.dsub.util.Pair;
import github.daneren2005.dsub.util.UserUtil;
-import github.daneren2005.dsub.view.MergeAdapter;
+import github.daneren2005.dsub.adapter.MergeAdapter;
import github.daneren2005.dsub.util.Util;
import github.daneren2005.dsub.service.MusicService;
import github.daneren2005.dsub.service.MusicServiceFactory;
diff --git a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java index c0f528de..198e1779 100644 --- a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java +++ b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java @@ -25,7 +25,6 @@ import android.content.DialogInterface; import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
-import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
@@ -68,7 +67,7 @@ import github.daneren2005.dsub.service.OfflineException; import github.daneren2005.dsub.service.ServerTooOldException;
import github.daneren2005.dsub.util.Constants;
import github.daneren2005.dsub.util.SilentBackgroundTask;
-import github.daneren2005.dsub.view.DownloadFileAdapter;
+import github.daneren2005.dsub.adapter.DownloadFileAdapter;
import github.daneren2005.dsub.view.FadeOutAnimation;
import github.daneren2005.dsub.view.UpdateView;
import github.daneren2005.dsub.util.Util;
diff --git a/src/github/daneren2005/dsub/fragments/SearchFragment.java b/src/github/daneren2005/dsub/fragments/SearchFragment.java index f73989fb..066a940f 100644 --- a/src/github/daneren2005/dsub/fragments/SearchFragment.java +++ b/src/github/daneren2005/dsub/fragments/SearchFragment.java @@ -13,7 +13,6 @@ import android.view.Menu; import android.view.MenuInflater;
import android.view.View;
import android.view.MenuItem;
-import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ListAdapter;
import android.widget.ListView;
@@ -27,11 +26,11 @@ import github.daneren2005.dsub.domain.SearchResult; import github.daneren2005.dsub.service.MusicService;
import github.daneren2005.dsub.service.MusicServiceFactory;
import github.daneren2005.dsub.service.DownloadService;
-import github.daneren2005.dsub.view.ArtistAdapter;
+import github.daneren2005.dsub.adapter.ArtistAdapter;
import github.daneren2005.dsub.util.BackgroundTask;
import github.daneren2005.dsub.util.Constants;
-import github.daneren2005.dsub.view.EntryAdapter;
-import github.daneren2005.dsub.view.MergeAdapter;
+import github.daneren2005.dsub.adapter.EntryAdapter;
+import github.daneren2005.dsub.adapter.MergeAdapter;
import github.daneren2005.dsub.util.TabBackgroundTask;
import github.daneren2005.dsub.util.Util;
diff --git a/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java b/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java index 9b6e86d3..1c3f06a4 100644 --- a/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java @@ -1,10 +1,8 @@ package github.daneren2005.dsub.fragments;
import android.annotation.TargetApi;
-import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
-import android.util.Log;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -25,7 +23,7 @@ import github.daneren2005.dsub.service.MusicService; import github.daneren2005.dsub.util.Constants;
import github.daneren2005.dsub.util.ProgressListener;
import github.daneren2005.dsub.util.Util;
-import github.daneren2005.dsub.view.ArtistAdapter;
+import github.daneren2005.dsub.adapter.ArtistAdapter;
import java.io.Serializable;
import java.util.ArrayList;
diff --git a/src/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java b/src/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java index 85895dd2..c71d99f6 100644 --- a/src/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java @@ -18,8 +18,6 @@ */ package github.daneren2005.dsub.fragments; -import android.content.DialogInterface; -import android.util.Log; import android.view.ContextMenu; import android.view.MenuInflater; import android.view.MenuItem; @@ -30,21 +28,13 @@ import github.daneren2005.dsub.R; import github.daneren2005.dsub.activity.DownloadActivity; import github.daneren2005.dsub.domain.Bookmark; import github.daneren2005.dsub.domain.MusicDirectory; -import github.daneren2005.dsub.service.DownloadFile; import github.daneren2005.dsub.service.DownloadService; import github.daneren2005.dsub.service.MusicService; -import github.daneren2005.dsub.service.MusicServiceFactory; -import github.daneren2005.dsub.service.OfflineException; -import github.daneren2005.dsub.service.ServerTooOldException; -import github.daneren2005.dsub.util.LoadingTask; import github.daneren2005.dsub.util.ProgressListener; import github.daneren2005.dsub.util.SilentBackgroundTask; import github.daneren2005.dsub.util.Util; -import github.daneren2005.dsub.view.BookmarkAdapter; -import github.daneren2005.dsub.view.SongView; +import github.daneren2005.dsub.adapter.BookmarkAdapter; -import java.text.Format; -import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.List; diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 327f1828..7b6a7261 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -5,18 +5,14 @@ import android.app.AlertDialog; import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
-import android.graphics.Canvas;
-import android.graphics.Paint;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.text.Html;
-import android.text.Layout;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
-import android.text.style.LeadingMarginSpan;
import android.util.Log;
import android.view.ContextMenu;
import android.view.Display;
@@ -28,7 +24,6 @@ import android.view.View; import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
-import android.widget.FrameLayout;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.ImageView;
@@ -44,8 +39,8 @@ import github.daneren2005.dsub.domain.ServerInfo; import github.daneren2005.dsub.domain.Share;
import github.daneren2005.dsub.service.DownloadService;
import github.daneren2005.dsub.util.ImageLoader;
-import github.daneren2005.dsub.view.AlbumGridAdapter;
-import github.daneren2005.dsub.view.EntryAdapter;
+import github.daneren2005.dsub.adapter.AlbumGridAdapter;
+import github.daneren2005.dsub.adapter.EntryAdapter;
import java.io.Serializable;
import java.util.Iterator;
@@ -63,7 +58,7 @@ import github.daneren2005.dsub.util.Pair; import github.daneren2005.dsub.util.TabBackgroundTask;
import github.daneren2005.dsub.util.UserUtil;
import github.daneren2005.dsub.util.Util;
-import github.daneren2005.dsub.view.AlbumListAdapter;
+import github.daneren2005.dsub.adapter.AlbumListAdapter;
import github.daneren2005.dsub.view.HeaderGridView;
import github.daneren2005.dsub.view.MyLeadingMarginSpan2;
diff --git a/src/github/daneren2005/dsub/fragments/SelectGenreFragment.java b/src/github/daneren2005/dsub/fragments/SelectGenreFragment.java index 9cf505b3..4068dca2 100644 --- a/src/github/daneren2005/dsub/fragments/SelectGenreFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectGenreFragment.java @@ -27,7 +27,7 @@ import github.daneren2005.dsub.domain.Genre; import github.daneren2005.dsub.service.MusicService;
import github.daneren2005.dsub.util.Constants;
import github.daneren2005.dsub.util.ProgressListener;
-import github.daneren2005.dsub.view.GenreAdapter;
+import github.daneren2005.dsub.adapter.GenreAdapter;
import java.util.List;
diff --git a/src/github/daneren2005/dsub/fragments/SelectListFragment.java b/src/github/daneren2005/dsub/fragments/SelectListFragment.java index 3329e848..749ef842 100644 --- a/src/github/daneren2005/dsub/fragments/SelectListFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectListFragment.java @@ -27,11 +27,8 @@ import android.view.MenuInflater; import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.AbsListView;
-import android.widget.Adapter;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
-import android.widget.ListAdapter;
import android.widget.ListView;
import java.io.Serializable;
@@ -39,14 +36,12 @@ import java.util.ArrayList; import java.util.List;
import github.daneren2005.dsub.R;
-import github.daneren2005.dsub.domain.Genre;
import github.daneren2005.dsub.service.MusicService;
import github.daneren2005.dsub.service.MusicServiceFactory;
import github.daneren2005.dsub.util.BackgroundTask;
import github.daneren2005.dsub.util.Constants;
import github.daneren2005.dsub.util.ProgressListener;
import github.daneren2005.dsub.util.TabBackgroundTask;
-import github.daneren2005.dsub.view.GenreAdapter;
public abstract class SelectListFragment<T> extends SubsonicFragment implements AdapterView.OnItemClickListener {
private static final String TAG = SelectListFragment.class.getSimpleName();
diff --git a/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java b/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java index 8c16edd5..af372076 100644 --- a/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java @@ -29,7 +29,7 @@ import github.daneren2005.dsub.util.Constants; import github.daneren2005.dsub.util.LoadingTask;
import github.daneren2005.dsub.util.UserUtil;
import github.daneren2005.dsub.util.Util;
-import github.daneren2005.dsub.view.PlaylistAdapter;
+import github.daneren2005.dsub.adapter.PlaylistAdapter;
import java.util.List;
diff --git a/src/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java b/src/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java index 73a415ba..09307476 100644 --- a/src/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java @@ -41,7 +41,7 @@ import github.daneren2005.dsub.util.LoadingTask; import github.daneren2005.dsub.util.SilentBackgroundTask;
import github.daneren2005.dsub.util.UserUtil;
import github.daneren2005.dsub.util.Util;
-import github.daneren2005.dsub.view.PodcastChannelAdapter;
+import github.daneren2005.dsub.adapter.PodcastChannelAdapter;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/github/daneren2005/dsub/fragments/SelectShareFragment.java b/src/github/daneren2005/dsub/fragments/SelectShareFragment.java index 692df7d0..d15f170d 100644 --- a/src/github/daneren2005/dsub/fragments/SelectShareFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectShareFragment.java @@ -26,7 +26,7 @@ import github.daneren2005.dsub.util.Constants; import github.daneren2005.dsub.util.LoadingTask;
import github.daneren2005.dsub.util.ProgressListener;
import github.daneren2005.dsub.util.Util;
-import github.daneren2005.dsub.view.ShareAdapter;
+import github.daneren2005.dsub.adapter.ShareAdapter;
/**
* Created by Scott on 12/28/13.
diff --git a/src/github/daneren2005/dsub/fragments/SelectVideoFragment.java b/src/github/daneren2005/dsub/fragments/SelectVideoFragment.java index 0c8519e8..b4d34ff9 100644 --- a/src/github/daneren2005/dsub/fragments/SelectVideoFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectVideoFragment.java @@ -27,7 +27,7 @@ import github.daneren2005.dsub.R; import github.daneren2005.dsub.domain.MusicDirectory; import github.daneren2005.dsub.service.MusicService; import github.daneren2005.dsub.util.ProgressListener; -import github.daneren2005.dsub.view.EntryAdapter; +import github.daneren2005.dsub.adapter.EntryAdapter; public class SelectVideoFragment extends SelectListFragment<MusicDirectory.Entry> { @Override diff --git a/src/github/daneren2005/dsub/fragments/SimilarArtistFragment.java b/src/github/daneren2005/dsub/fragments/SimilarArtistFragment.java index 06427a5d..b87db495 100644 --- a/src/github/daneren2005/dsub/fragments/SimilarArtistFragment.java +++ b/src/github/daneren2005/dsub/fragments/SimilarArtistFragment.java @@ -15,17 +15,12 @@ package github.daneren2005.dsub.fragments; -import android.app.AlertDialog; import android.os.Bundle; -import android.text.method.LinkMovementMethod; import android.view.ContextMenu; -import android.view.Menu; -import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; -import android.widget.TextView; import github.daneren2005.dsub.R; import github.daneren2005.dsub.domain.Artist; @@ -37,7 +32,7 @@ import github.daneren2005.dsub.service.MusicServiceFactory; import github.daneren2005.dsub.util.Constants; import github.daneren2005.dsub.util.ProgressListener; import github.daneren2005.dsub.util.Util; -import github.daneren2005.dsub.view.ArtistAdapter; +import github.daneren2005.dsub.adapter.ArtistAdapter; import java.net.URLEncoder; import java.util.LinkedList; diff --git a/src/github/daneren2005/dsub/fragments/UserFragment.java b/src/github/daneren2005/dsub/fragments/UserFragment.java index 2391762e..2fa804cc 100644 --- a/src/github/daneren2005/dsub/fragments/UserFragment.java +++ b/src/github/daneren2005/dsub/fragments/UserFragment.java @@ -16,8 +16,6 @@ package github.daneren2005.dsub.fragments;
import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.LayoutInflater;
@@ -34,16 +32,10 @@ import github.daneren2005.dsub.R; import github.daneren2005.dsub.activity.SubsonicActivity;
import github.daneren2005.dsub.domain.ServerInfo;
import github.daneren2005.dsub.domain.User;
-import github.daneren2005.dsub.service.MusicService;
-import github.daneren2005.dsub.service.MusicServiceFactory;
-import github.daneren2005.dsub.service.OfflineException;
-import github.daneren2005.dsub.service.ServerTooOldException;
import github.daneren2005.dsub.util.Constants;
import github.daneren2005.dsub.util.ImageLoader;
-import github.daneren2005.dsub.util.SilentBackgroundTask;
import github.daneren2005.dsub.util.UserUtil;
-import github.daneren2005.dsub.util.Util;
-import github.daneren2005.dsub.view.SettingsAdapter;
+import github.daneren2005.dsub.adapter.SettingsAdapter;
public class UserFragment extends SubsonicFragment{
private ListView listView;
diff --git a/src/github/daneren2005/dsub/service/parser/PlaylistsParser.java b/src/github/daneren2005/dsub/service/parser/PlaylistsParser.java index ee978167..6f01d510 100644 --- a/src/github/daneren2005/dsub/service/parser/PlaylistsParser.java +++ b/src/github/daneren2005/dsub/service/parser/PlaylistsParser.java @@ -19,10 +19,10 @@ package github.daneren2005.dsub.service.parser; import android.content.Context; -import github.daneren2005.dsub.R; + import github.daneren2005.dsub.domain.Playlist; import github.daneren2005.dsub.util.ProgressListener; -import github.daneren2005.dsub.view.PlaylistAdapter; +import github.daneren2005.dsub.adapter.PlaylistAdapter; import org.xmlpull.v1.XmlPullParser; import java.io.Reader; diff --git a/src/github/daneren2005/dsub/util/UserUtil.java b/src/github/daneren2005/dsub/util/UserUtil.java index 19e8b918..c5da93d3 100644 --- a/src/github/daneren2005/dsub/util/UserUtil.java +++ b/src/github/daneren2005/dsub/util/UserUtil.java @@ -20,17 +20,13 @@ import android.app.AlertDialog; import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
-import android.os.Build;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.View;
-import android.widget.Adapter;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
-import java.io.File;
-
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.User;
import github.daneren2005.dsub.fragments.SubsonicFragment;
@@ -39,7 +35,7 @@ import github.daneren2005.dsub.service.MusicService; import github.daneren2005.dsub.service.MusicServiceFactory;
import github.daneren2005.dsub.service.OfflineException;
import github.daneren2005.dsub.service.ServerTooOldException;
-import github.daneren2005.dsub.view.SettingsAdapter;
+import github.daneren2005.dsub.adapter.SettingsAdapter;
public final class UserUtil {
private static final String TAG = UserUtil.class.getSimpleName();
|