aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-11-14 20:35:22 -0800
committerScott Jackson <daneren2005@gmail.com>2013-11-14 20:35:22 -0800
commitb0b15157e0d9d3ef4840ad28ad2f8f5e3468b51e (patch)
tree5aa29502c54de6aa78a874662a04b7df16049e17 /src/github
parent32579cff0a929c7d7ad0f44615f3c7a03b62e1d6 (diff)
parentcbf69f5d274fd11381da725fbe8e6fee709c4b04 (diff)
downloaddsub-b0b15157e0d9d3ef4840ad28ad2f8f5e3468b51e.tar.gz
dsub-b0b15157e0d9d3ef4840ad28ad2f8f5e3468b51e.tar.bz2
dsub-b0b15157e0d9d3ef4840ad28ad2f8f5e3468b51e.zip
Merge branch 'master' of https://github.com/daneren2005/Subsonic
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/fragments/DownloadFragment.java17
-rw-r--r--src/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java2
-rw-r--r--src/github/daneren2005/dsub/util/Util.java32
-rw-r--r--src/github/daneren2005/dsub/view/PlaylistView.java7
4 files changed, 42 insertions, 16 deletions
diff --git a/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/src/github/daneren2005/dsub/fragments/DownloadFragment.java
index 91fda9b1..a35e7c42 100644
--- a/src/github/daneren2005/dsub/fragments/DownloadFragment.java
+++ b/src/github/daneren2005/dsub/fragments/DownloadFragment.java
@@ -986,6 +986,11 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
setSubtitle(context.getResources().getString(R.string.download_playing_out_of, currentPlayingIndex, size));
onDownloadListChangedTask = null;
+ if(onCurrentChangedTask != null) {
+ onCurrentChangedTask.execute();
+ } else if(onProgressChangedTask != null) {
+ onProgressChangedTask.execute();
+ }
}
};
onDownloadListChangedTask.execute();
@@ -1024,9 +1029,15 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
setSubtitle(null);
}
onCurrentChangedTask = null;
+ if(onProgressChangedTask != null) {
+ onProgressChangedTask.execute();
+ }
}
};
- onCurrentChangedTask.execute();
+
+ if(onDownloadListChangedTask == null) {
+ onCurrentChangedTask.execute();
+ }
}
private void onProgressChanged() {
@@ -1119,7 +1130,9 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
onProgressChangedTask = null;
}
};
- onProgressChangedTask.execute();
+ if(onDownloadListChangedTask == null && onCurrentChangedTask == null) {
+ onProgressChangedTask.execute();
+ }
}
private void changeProgress(final int ms) {
diff --git a/src/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java b/src/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java
index 47069266..fce31414 100644
--- a/src/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java
@@ -194,7 +194,7 @@ public class SelectBookmarkFragment extends SubsonicFragment implements AdapterV
bookmark.getEntry().getTitle(), Util.formatDuration(bookmark.getPosition() / 1000),
formatter.format(bookmark.getCreated()), formatter.format(bookmark.getChanged()), comment);
- Util.info(context, R.string.bookmark_details_title, msg);
+ Util.info(context, R.string.bookmark_details_title, msg, false);
}
private void deleteBookmark(final Bookmark bookmark) {
final MusicDirectory.Entry entry = bookmark.getEntry();
diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java
index 7ff551de..c4f51e5c 100644
--- a/src/github/daneren2005/dsub/util/Util.java
+++ b/src/github/daneren2005/dsub/util/Util.java
@@ -786,24 +786,44 @@ public final class Util {
}
public static void info(Context context, int titleId, int messageId) {
- showDialog(context, android.R.drawable.ic_dialog_info, titleId, messageId);
+ info(context, titleId, messageId, true);
}
public static void info(Context context, int titleId, String message) {
- showDialog(context, android.R.drawable.ic_dialog_info, titleId, message);
+ info(context, titleId, message, true);
}
public static void info(Context context, String title, String message) {
- showDialog(context, android.R.drawable.ic_dialog_info, title, message);
+ info(context, title, message);
+ }
+ public static void info(Context context, int titleId, int messageId, boolean linkify) {
+ showDialog(context, android.R.drawable.ic_dialog_info, titleId, messageId, linkify);
+ }
+ public static void info(Context context, int titleId, String message, boolean linkify) {
+ showDialog(context, android.R.drawable.ic_dialog_info, titleId, message, linkify);
+ }
+ public static void info(Context context, String title, String message, boolean linkify) {
+ showDialog(context, android.R.drawable.ic_dialog_info, title, message, linkify);
}
private static void showDialog(Context context, int icon, int titleId, int messageId) {
- showDialog(context, icon, context.getResources().getString(titleId), context.getResources().getString(messageId));
+ showDialog(context, icon, titleId, messageId, true);
}
private static void showDialog(Context context, int icon, int titleId, String message) {
- showDialog(context, icon, context.getResources().getString(titleId), message);
+ showDialog(context, icon, titleId, message, true);
}
private static void showDialog(Context context, int icon, String title, String message) {
+ showDialog(context, icon, title, message, true);
+ }
+ private static void showDialog(Context context, int icon, int titleId, int messageId, boolean linkify) {
+ showDialog(context, icon, context.getResources().getString(titleId), context.getResources().getString(messageId), linkify);
+ }
+ private static void showDialog(Context context, int icon, int titleId, String message, boolean linkify) {
+ showDialog(context, icon, context.getResources().getString(titleId), message, linkify);
+ }
+ private static void showDialog(Context context, int icon, String title, String message, boolean linkify) {
SpannableString ss = new SpannableString(message);
- Linkify.addLinks(ss, Linkify.ALL);
+ if(linkify) {
+ Linkify.addLinks(ss, Linkify.ALL);
+ }
AlertDialog dialog = new AlertDialog.Builder(context)
.setIcon(icon)
diff --git a/src/github/daneren2005/dsub/view/PlaylistView.java b/src/github/daneren2005/dsub/view/PlaylistView.java
index b5034493..c75f8ad7 100644
--- a/src/github/daneren2005/dsub/view/PlaylistView.java
+++ b/src/github/daneren2005/dsub/view/PlaylistView.java
@@ -40,7 +40,6 @@ public class PlaylistView extends UpdateView {
private Context context;
private Playlist playlist;
- private File file;
private TextView titleView;
@@ -63,11 +62,5 @@ public class PlaylistView extends UpdateView {
protected void setObjectImpl(Object obj) {
this.playlist = (Playlist) obj;
titleView.setText(playlist.getName());
- file = FileUtil.getPlaylistFile(Util.getServerName(context), playlist.getName());
- }
-
- @Override
- protected void updateBackground() {
- exists = file.exists();
}
}