diff options
Diffstat (limited to 'src')
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();
}
}
|