From c68f2f75ca3246e2a1ff0395dbbf97d3b3e9dcc8 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 31 Aug 2019 00:17:35 +0200 Subject: Displaying buffer state with ExoPlayer --- .../core/service/playback/ExoPlayerWrapper.java | 30 ++++++++++++++++++++-- .../core/service/playback/LocalPSMP.java | 1 + 2 files changed, 29 insertions(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java index f20525f73..7af33f8f9 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java @@ -2,6 +2,7 @@ package de.danoeh.antennapod.core.service.playback; import android.content.Context; import android.net.Uri; +import android.os.Handler; import android.view.SurfaceHolder; import com.google.android.exoplayer2.C; @@ -27,7 +28,6 @@ import com.google.android.exoplayer2.util.Util; import org.antennapod.audio.MediaPlayer; import de.danoeh.antennapod.core.util.playback.IPlayer; - public class ExoPlayerWrapper implements IPlayer { private final Context mContext; private SimpleExoPlayer mExoPlayer; @@ -35,15 +35,35 @@ public class ExoPlayerWrapper implements IPlayer { private MediaPlayer.OnSeekCompleteListener audioSeekCompleteListener; private MediaPlayer.OnCompletionListener audioCompletionListener; private MediaPlayer.OnErrorListener audioErrorListener; + private MediaPlayer.OnBufferingUpdateListener bufferingUpdateListener; + private boolean shouldCheckBufferingUpdates = true; + ExoPlayerWrapper(Context context) { mContext = context; mExoPlayer = createPlayer(); + + Handler handler = new Handler(); // Main thread + handler.postDelayed(new Runnable() { + @Override + public void run() { + if (bufferingUpdateListener != null) { + bufferingUpdateListener.onBufferingUpdate(null, mExoPlayer.getBufferedPercentage()); + } + if (shouldCheckBufferingUpdates) { + handler.postDelayed(this, 2000); + } + } + }, 2000); } private SimpleExoPlayer createPlayer() { + DefaultLoadControl.Builder loadControl = new DefaultLoadControl.Builder(); + loadControl.setBufferDurationsMs(30000, 120000, + DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_MS, + DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS); SimpleExoPlayer p = ExoPlayerFactory.newSimpleInstance(mContext, new DefaultRenderersFactory(mContext), - new DefaultTrackSelector(), new DefaultLoadControl()); + new DefaultTrackSelector(), loadControl.createDefaultLoadControl()); p.setSeekParameters(SeekParameters.PREVIOUS_SYNC); p.addListener(new Player.EventListener() { @Override @@ -148,12 +168,14 @@ public class ExoPlayerWrapper implements IPlayer { @Override public void release() { + shouldCheckBufferingUpdates = false; if (mExoPlayer != null) { mExoPlayer.release(); } audioSeekCompleteListener = null; audioCompletionListener = null; audioErrorListener = null; + bufferingUpdateListener = null; } @Override @@ -247,4 +269,8 @@ public class ExoPlayerWrapper implements IPlayer { } return mExoPlayer.getVideoFormat().height; } + + void setOnBufferingUpdateListener(MediaPlayer.OnBufferingUpdateListener bufferingUpdateListener) { + this.bufferingUpdateListener = bufferingUpdateListener; + } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java index 6bd736de7..ffe11f39b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java @@ -1013,6 +1013,7 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { ExoPlayerWrapper ap = (ExoPlayerWrapper) mp; ap.setOnCompletionListener(audioCompletionListener); ap.setOnSeekCompleteListener(audioSeekCompleteListener); + ap.setOnBufferingUpdateListener(audioBufferingUpdateListener); ap.setOnErrorListener(audioErrorListener); } else { Log.w(TAG, "Unknown media player: " + mp); -- cgit v1.2.3 From 11e68419f024aaf9aab39b16c3986222b7ab692c Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Mon, 2 Sep 2019 14:57:30 +0200 Subject: Added playback speed icon --- core/src/main/res/drawable/ic_playback_speed_dark.xml | 8 ++++++++ core/src/main/res/drawable/ic_playback_speed_white.xml | 8 ++++++++ core/src/main/res/values/attrs.xml | 1 + core/src/main/res/values/styles.xml | 2 ++ 4 files changed, 19 insertions(+) create mode 100644 core/src/main/res/drawable/ic_playback_speed_dark.xml create mode 100644 core/src/main/res/drawable/ic_playback_speed_white.xml (limited to 'core/src/main') diff --git a/core/src/main/res/drawable/ic_playback_speed_dark.xml b/core/src/main/res/drawable/ic_playback_speed_dark.xml new file mode 100644 index 000000000..7c7d1cf8c --- /dev/null +++ b/core/src/main/res/drawable/ic_playback_speed_dark.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/core/src/main/res/drawable/ic_playback_speed_white.xml b/core/src/main/res/drawable/ic_playback_speed_white.xml new file mode 100644 index 000000000..cc6af0d55 --- /dev/null +++ b/core/src/main/res/drawable/ic_playback_speed_white.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index 5b0bf5717..737ff98a6 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -9,6 +9,7 @@ + diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index fb69e54e7..d3676a888 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -23,6 +23,7 @@ @drawable/ic_fast_forward_grey600_24dp @drawable/ic_pause_grey600_24dp @drawable/ic_play_arrow_grey600_24dp + @drawable/ic_playback_speed_dark @drawable/ic_fast_rewind_grey600_24dp @drawable/ic_delete_grey600_24dp @drawable/ic_add_grey600_24dp @@ -108,6 +109,7 @@ @drawable/ic_fast_forward_white_24dp @drawable/ic_pause_white_24dp @drawable/ic_play_arrow_white_24dp + @drawable/ic_playback_speed_white @drawable/ic_fast_rewind_white_24dp @drawable/ic_delete_white_24dp @drawable/ic_add_white_24dp -- cgit v1.2.3 From c4c1780da4fee4365ea6c72019aba7cfdce6b890 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Tue, 10 Sep 2019 23:36:43 +0200 Subject: Add option to follow system theme --- .../antennapod/core/preferences/UserPreferences.java | 15 ++++++++++----- core/src/main/res/values/arrays.xml | 3 +++ core/src/main/res/values/strings.xml | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index b8ab1c888..07a72e1c9 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -2,6 +2,7 @@ package de.danoeh.antennapod.core.preferences; import android.content.Context; import android.content.SharedPreferences; +import android.content.res.Configuration; import android.preference.PreferenceManager; import android.support.annotation.IntRange; import android.support.annotation.NonNull; @@ -164,7 +165,7 @@ public class UserPreferences { * @return R.style.Theme_AntennaPod_Light or R.style.Theme_AntennaPod_Dark */ public static int getTheme() { - return readThemeValue(prefs.getString(PREF_THEME, "0")); + return readThemeValue(prefs.getString(PREF_THEME, "system")); } public static int getNoTitleTheme() { @@ -672,14 +673,18 @@ public class UserPreferences { } private static int readThemeValue(String valueFromPrefs) { - switch (Integer.parseInt(valueFromPrefs)) { - case 0: + switch (valueFromPrefs) { + case "0": return R.style.Theme_AntennaPod_Light; - case 1: + case "1": return R.style.Theme_AntennaPod_Dark; - case 2: + case "2": return R.style.Theme_AntennaPod_TrueBlack; default: + int nightMode = context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; + if (nightMode == Configuration.UI_MODE_NIGHT_YES) { + return R.style.Theme_AntennaPod_Dark; + } return R.style.Theme_AntennaPod_Light; } } diff --git a/core/src/main/res/values/arrays.xml b/core/src/main/res/values/arrays.xml index 0eaf0e5e7..3ba4d7b2d 100644 --- a/core/src/main/res/values/arrays.xml +++ b/core/src/main/res/values/arrays.xml @@ -164,11 +164,14 @@ + @string/pref_theme_title_use_system @string/pref_theme_title_light @string/pref_theme_title_dark @string/pref_theme_title_trueblack + + system 0 1 2 diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index c9c6506a9..25898f151 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -424,6 +424,7 @@ Parallel Downloads Episode Cache Total number of downloaded episodes cached on the device. Automatic download will be suspended if this number is reached. + Use system theme Light Dark Black (AMOLED ready) -- cgit v1.2.3 From facc5dccf5a6328ba7f86996836e410aa8bf62f4 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 11 Sep 2019 22:33:16 +0200 Subject: Added warning when locking queue --- core/src/main/res/values/strings.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/src/main') diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index c9c6506a9..52f2d014d 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -293,6 +293,8 @@ Unlock Queue Queue locked Queue unlocked + If you lock the queue, you can no longer swipe or reorder episodes. + Do not show again Clear Queue Undo Item removed -- cgit v1.2.3 From 5f01e5045a9bf628f5c8d50b08936d8fe88a6b26 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 11 Sep 2019 23:29:58 +0200 Subject: Added screen that shows crash info --- core/src/main/res/values/strings.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index c9c6506a9..7cdcbea85 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -476,8 +476,10 @@ Image Cache Size Size of the disk cache for images. Crash Report - Send the latest crash report via e-mail - Send e-mail + View details about last crash + Open bug tracker + Copy to clipboard + Copied to clipboard Experimental Select which media player to use to play files Current value: %1$s -- cgit v1.2.3 From 983b5ea0606d0d96420f7ddf03bb17f5c7f2ee27 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 14 Sep 2019 18:24:07 +0200 Subject: Removed unused icons --- .../main/res/drawable-hdpi/ic_cast_disabled_light.png | Bin 770 -> 0 bytes core/src/main/res/drawable-hdpi/ic_cast_light.png | Bin 975 -> 0 bytes core/src/main/res/drawable-hdpi/ic_cast_off_light.png | Bin 867 -> 0 bytes core/src/main/res/drawable-hdpi/ic_cast_on_0_light.png | Bin 961 -> 0 bytes core/src/main/res/drawable-hdpi/ic_cast_on_1_light.png | Bin 979 -> 0 bytes core/src/main/res/drawable-hdpi/ic_cast_on_2_light.png | Bin 976 -> 0 bytes core/src/main/res/drawable-hdpi/ic_cast_on_light.png | Bin 982 -> 0 bytes core/src/main/res/drawable-hdpi/ic_close_light.png | Bin 493 -> 0 bytes core/src/main/res/drawable-hdpi/ic_pause_light.png | Bin 191 -> 0 bytes core/src/main/res/drawable-hdpi/ic_play_light.png | Bin 562 -> 0 bytes .../main/res/drawable-mdpi/ic_cast_disabled_light.png | Bin 536 -> 0 bytes core/src/main/res/drawable-mdpi/ic_cast_light.png | Bin 693 -> 0 bytes core/src/main/res/drawable-mdpi/ic_cast_off_light.png | Bin 635 -> 0 bytes core/src/main/res/drawable-mdpi/ic_cast_on_0_light.png | Bin 684 -> 0 bytes core/src/main/res/drawable-mdpi/ic_cast_on_1_light.png | Bin 696 -> 0 bytes core/src/main/res/drawable-mdpi/ic_cast_on_2_light.png | Bin 690 -> 0 bytes core/src/main/res/drawable-mdpi/ic_cast_on_light.png | Bin 694 -> 0 bytes core/src/main/res/drawable-mdpi/ic_close_light.png | Bin 379 -> 0 bytes core/src/main/res/drawable-mdpi/ic_pause_light.png | Bin 280 -> 0 bytes core/src/main/res/drawable-mdpi/ic_play_light.png | Bin 447 -> 0 bytes .../main/res/drawable-xhdpi/ic_cast_disabled_light.png | Bin 976 -> 0 bytes core/src/main/res/drawable-xhdpi/ic_cast_light.png | Bin 1328 -> 0 bytes core/src/main/res/drawable-xhdpi/ic_cast_off_light.png | Bin 1161 -> 0 bytes core/src/main/res/drawable-xhdpi/ic_cast_on_0_light.png | Bin 1286 -> 0 bytes core/src/main/res/drawable-xhdpi/ic_cast_on_1_light.png | Bin 1308 -> 0 bytes core/src/main/res/drawable-xhdpi/ic_cast_on_2_light.png | Bin 1309 -> 0 bytes core/src/main/res/drawable-xhdpi/ic_cast_on_light.png | Bin 1331 -> 0 bytes core/src/main/res/drawable-xhdpi/ic_close_light.png | Bin 526 -> 0 bytes core/src/main/res/drawable-xhdpi/ic_pause_light.png | Bin 221 -> 0 bytes core/src/main/res/drawable-xhdpi/ic_play_light.png | Bin 678 -> 0 bytes .../main/res/drawable-xxhdpi/ic_cast_disabled_light.png | Bin 1429 -> 0 bytes core/src/main/res/drawable-xxhdpi/ic_cast_light.png | Bin 1952 -> 0 bytes core/src/main/res/drawable-xxhdpi/ic_cast_off_light.png | Bin 1679 -> 0 bytes core/src/main/res/drawable-xxhdpi/ic_cast_on_0_light.png | Bin 1832 -> 0 bytes core/src/main/res/drawable-xxhdpi/ic_cast_on_1_light.png | Bin 1893 -> 0 bytes core/src/main/res/drawable-xxhdpi/ic_cast_on_2_light.png | Bin 1910 -> 0 bytes core/src/main/res/drawable-xxhdpi/ic_cast_on_light.png | Bin 1944 -> 0 bytes core/src/main/res/drawable-xxhdpi/ic_close_light.png | Bin 673 -> 0 bytes core/src/main/res/drawable-xxhdpi/ic_pause_light.png | Bin 317 -> 0 bytes core/src/main/res/drawable-xxhdpi/ic_play_light.png | Bin 955 -> 0 bytes .../ic_baseline_question_answer_white_24db.png | Bin 310 -> 0 bytes .../ic_baseline_question_answer_white_24dp.png | Bin 0 -> 310 bytes core/src/main/res/drawable-xxxhdpi/ic_close_light.png | Bin 805 -> 0 bytes core/src/main/res/drawable-xxxhdpi/ic_pause_light.png | Bin 400 -> 0 bytes core/src/main/res/drawable-xxxhdpi/ic_play_light.png | Bin 1190 -> 0 bytes 45 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 core/src/main/res/drawable-hdpi/ic_cast_disabled_light.png delete mode 100644 core/src/main/res/drawable-hdpi/ic_cast_light.png delete mode 100644 core/src/main/res/drawable-hdpi/ic_cast_off_light.png delete mode 100644 core/src/main/res/drawable-hdpi/ic_cast_on_0_light.png delete mode 100644 core/src/main/res/drawable-hdpi/ic_cast_on_1_light.png delete mode 100644 core/src/main/res/drawable-hdpi/ic_cast_on_2_light.png delete mode 100644 core/src/main/res/drawable-hdpi/ic_cast_on_light.png delete mode 100644 core/src/main/res/drawable-hdpi/ic_close_light.png delete mode 100644 core/src/main/res/drawable-hdpi/ic_pause_light.png delete mode 100644 core/src/main/res/drawable-hdpi/ic_play_light.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_cast_disabled_light.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_cast_light.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_cast_off_light.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_cast_on_0_light.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_cast_on_1_light.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_cast_on_2_light.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_cast_on_light.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_close_light.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_pause_light.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_play_light.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_cast_disabled_light.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_cast_light.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_cast_off_light.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_cast_on_0_light.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_cast_on_1_light.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_cast_on_2_light.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_cast_on_light.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_close_light.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_pause_light.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_play_light.png delete mode 100644 core/src/main/res/drawable-xxhdpi/ic_cast_disabled_light.png delete mode 100644 core/src/main/res/drawable-xxhdpi/ic_cast_light.png delete mode 100644 core/src/main/res/drawable-xxhdpi/ic_cast_off_light.png delete mode 100644 core/src/main/res/drawable-xxhdpi/ic_cast_on_0_light.png delete mode 100644 core/src/main/res/drawable-xxhdpi/ic_cast_on_1_light.png delete mode 100644 core/src/main/res/drawable-xxhdpi/ic_cast_on_2_light.png delete mode 100644 core/src/main/res/drawable-xxhdpi/ic_cast_on_light.png delete mode 100644 core/src/main/res/drawable-xxhdpi/ic_close_light.png delete mode 100644 core/src/main/res/drawable-xxhdpi/ic_pause_light.png delete mode 100644 core/src/main/res/drawable-xxhdpi/ic_play_light.png delete mode 100755 core/src/main/res/drawable-xxxhdpi/ic_baseline_question_answer_white_24db.png create mode 100644 core/src/main/res/drawable-xxxhdpi/ic_baseline_question_answer_white_24dp.png delete mode 100644 core/src/main/res/drawable-xxxhdpi/ic_close_light.png delete mode 100644 core/src/main/res/drawable-xxxhdpi/ic_pause_light.png delete mode 100644 core/src/main/res/drawable-xxxhdpi/ic_play_light.png (limited to 'core/src/main') diff --git a/core/src/main/res/drawable-hdpi/ic_cast_disabled_light.png b/core/src/main/res/drawable-hdpi/ic_cast_disabled_light.png deleted file mode 100644 index c0a55d555..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_cast_disabled_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-hdpi/ic_cast_light.png b/core/src/main/res/drawable-hdpi/ic_cast_light.png deleted file mode 100644 index b0c581a0e..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_cast_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-hdpi/ic_cast_off_light.png b/core/src/main/res/drawable-hdpi/ic_cast_off_light.png deleted file mode 100644 index 5f3c0179c..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_cast_off_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-hdpi/ic_cast_on_0_light.png b/core/src/main/res/drawable-hdpi/ic_cast_on_0_light.png deleted file mode 100644 index e872693a4..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_cast_on_0_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-hdpi/ic_cast_on_1_light.png b/core/src/main/res/drawable-hdpi/ic_cast_on_1_light.png deleted file mode 100644 index d8be1ebc6..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_cast_on_1_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-hdpi/ic_cast_on_2_light.png b/core/src/main/res/drawable-hdpi/ic_cast_on_2_light.png deleted file mode 100644 index 27cda9e9d..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_cast_on_2_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-hdpi/ic_cast_on_light.png b/core/src/main/res/drawable-hdpi/ic_cast_on_light.png deleted file mode 100644 index 4ee525875..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_cast_on_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-hdpi/ic_close_light.png b/core/src/main/res/drawable-hdpi/ic_close_light.png deleted file mode 100644 index 93187e450..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_close_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-hdpi/ic_pause_light.png b/core/src/main/res/drawable-hdpi/ic_pause_light.png deleted file mode 100644 index 0c505d1c8..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_pause_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-hdpi/ic_play_light.png b/core/src/main/res/drawable-hdpi/ic_play_light.png deleted file mode 100644 index 7957dff5b..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_play_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_cast_disabled_light.png b/core/src/main/res/drawable-mdpi/ic_cast_disabled_light.png deleted file mode 100644 index 7940a0332..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_cast_disabled_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_cast_light.png b/core/src/main/res/drawable-mdpi/ic_cast_light.png deleted file mode 100644 index 1f5bec20b..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_cast_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_cast_off_light.png b/core/src/main/res/drawable-mdpi/ic_cast_off_light.png deleted file mode 100644 index 963db27d4..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_cast_off_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_cast_on_0_light.png b/core/src/main/res/drawable-mdpi/ic_cast_on_0_light.png deleted file mode 100644 index a90d9e305..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_cast_on_0_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_cast_on_1_light.png b/core/src/main/res/drawable-mdpi/ic_cast_on_1_light.png deleted file mode 100644 index bb2cf30bf..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_cast_on_1_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_cast_on_2_light.png b/core/src/main/res/drawable-mdpi/ic_cast_on_2_light.png deleted file mode 100644 index 3ed59e55b..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_cast_on_2_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_cast_on_light.png b/core/src/main/res/drawable-mdpi/ic_cast_on_light.png deleted file mode 100644 index 713427b97..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_cast_on_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_close_light.png b/core/src/main/res/drawable-mdpi/ic_close_light.png deleted file mode 100644 index 2c52c9b0f..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_close_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_pause_light.png b/core/src/main/res/drawable-mdpi/ic_pause_light.png deleted file mode 100644 index 6218a774f..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_pause_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_play_light.png b/core/src/main/res/drawable-mdpi/ic_play_light.png deleted file mode 100644 index 1e0ccaf80..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_play_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_cast_disabled_light.png b/core/src/main/res/drawable-xhdpi/ic_cast_disabled_light.png deleted file mode 100644 index fbb3e062c..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_cast_disabled_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_cast_light.png b/core/src/main/res/drawable-xhdpi/ic_cast_light.png deleted file mode 100644 index f2713e20e..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_cast_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_cast_off_light.png b/core/src/main/res/drawable-xhdpi/ic_cast_off_light.png deleted file mode 100644 index f4f8aaea8..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_cast_off_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_cast_on_0_light.png b/core/src/main/res/drawable-xhdpi/ic_cast_on_0_light.png deleted file mode 100644 index 247fc95ba..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_cast_on_0_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_cast_on_1_light.png b/core/src/main/res/drawable-xhdpi/ic_cast_on_1_light.png deleted file mode 100644 index ecf4b4723..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_cast_on_1_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_cast_on_2_light.png b/core/src/main/res/drawable-xhdpi/ic_cast_on_2_light.png deleted file mode 100644 index 60e3afa5d..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_cast_on_2_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_cast_on_light.png b/core/src/main/res/drawable-xhdpi/ic_cast_on_light.png deleted file mode 100644 index 40ce9d4f2..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_cast_on_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_close_light.png b/core/src/main/res/drawable-xhdpi/ic_close_light.png deleted file mode 100644 index 49faa429a..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_close_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_pause_light.png b/core/src/main/res/drawable-xhdpi/ic_pause_light.png deleted file mode 100644 index 40cd79f14..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_pause_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_play_light.png b/core/src/main/res/drawable-xhdpi/ic_play_light.png deleted file mode 100644 index 33f6a5919..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_play_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_cast_disabled_light.png b/core/src/main/res/drawable-xxhdpi/ic_cast_disabled_light.png deleted file mode 100644 index e94df3889..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_cast_disabled_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_cast_light.png b/core/src/main/res/drawable-xxhdpi/ic_cast_light.png deleted file mode 100644 index c5722a6eb..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_cast_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_cast_off_light.png b/core/src/main/res/drawable-xxhdpi/ic_cast_off_light.png deleted file mode 100644 index 92ac67b34..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_cast_off_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_cast_on_0_light.png b/core/src/main/res/drawable-xxhdpi/ic_cast_on_0_light.png deleted file mode 100644 index 2742fcb4a..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_cast_on_0_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_cast_on_1_light.png b/core/src/main/res/drawable-xxhdpi/ic_cast_on_1_light.png deleted file mode 100644 index 405178e64..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_cast_on_1_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_cast_on_2_light.png b/core/src/main/res/drawable-xxhdpi/ic_cast_on_2_light.png deleted file mode 100644 index dfe52428d..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_cast_on_2_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_cast_on_light.png b/core/src/main/res/drawable-xxhdpi/ic_cast_on_light.png deleted file mode 100644 index 7e69a0864..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_cast_on_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_close_light.png b/core/src/main/res/drawable-xxhdpi/ic_close_light.png deleted file mode 100644 index be519bfcb..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_close_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_pause_light.png b/core/src/main/res/drawable-xxhdpi/ic_pause_light.png deleted file mode 100644 index a36d4d11e..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_pause_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_play_light.png b/core/src/main/res/drawable-xxhdpi/ic_play_light.png deleted file mode 100644 index b1424874a..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_play_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxxhdpi/ic_baseline_question_answer_white_24db.png b/core/src/main/res/drawable-xxxhdpi/ic_baseline_question_answer_white_24db.png deleted file mode 100755 index 0d697e0f9..000000000 Binary files a/core/src/main/res/drawable-xxxhdpi/ic_baseline_question_answer_white_24db.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxxhdpi/ic_baseline_question_answer_white_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_baseline_question_answer_white_24dp.png new file mode 100644 index 000000000..0d697e0f9 Binary files /dev/null and b/core/src/main/res/drawable-xxxhdpi/ic_baseline_question_answer_white_24dp.png differ diff --git a/core/src/main/res/drawable-xxxhdpi/ic_close_light.png b/core/src/main/res/drawable-xxxhdpi/ic_close_light.png deleted file mode 100644 index 679c2a4d5..000000000 Binary files a/core/src/main/res/drawable-xxxhdpi/ic_close_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxxhdpi/ic_pause_light.png b/core/src/main/res/drawable-xxxhdpi/ic_pause_light.png deleted file mode 100644 index 7de2ef4ed..000000000 Binary files a/core/src/main/res/drawable-xxxhdpi/ic_pause_light.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxxhdpi/ic_play_light.png b/core/src/main/res/drawable-xxxhdpi/ic_play_light.png deleted file mode 100644 index 4428c8477..000000000 Binary files a/core/src/main/res/drawable-xxxhdpi/ic_play_light.png and /dev/null differ -- cgit v1.2.3 From b805b41dd615e914e7e8a71848d27c0c33aef762 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 14 Sep 2019 18:35:14 +0200 Subject: Using a single notification icon --- .../main/res/drawable-hdpi/ic_stat_antenna_default.png | Bin 541 -> 0 bytes .../main/res/drawable-ldpi/ic_stat_antenna_default.png | Bin 259 -> 0 bytes .../main/res/drawable-mdpi/ic_stat_antenna_default.png | Bin 349 -> 0 bytes .../main/res/drawable-xhdpi/ic_stat_antenna_default.png | Bin 783 -> 0 bytes core/src/main/res/drawable/ic_antenna.xml | 6 ++++++ core/src/main/res/drawable/ic_notification.png | Bin 3887 -> 0 bytes 6 files changed, 6 insertions(+) delete mode 100644 core/src/main/res/drawable-hdpi/ic_stat_antenna_default.png delete mode 100644 core/src/main/res/drawable-ldpi/ic_stat_antenna_default.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_stat_antenna_default.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_stat_antenna_default.png create mode 100644 core/src/main/res/drawable/ic_antenna.xml delete mode 100644 core/src/main/res/drawable/ic_notification.png (limited to 'core/src/main') diff --git a/core/src/main/res/drawable-hdpi/ic_stat_antenna_default.png b/core/src/main/res/drawable-hdpi/ic_stat_antenna_default.png deleted file mode 100644 index af99f4b3b..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_stat_antenna_default.png and /dev/null differ diff --git a/core/src/main/res/drawable-ldpi/ic_stat_antenna_default.png b/core/src/main/res/drawable-ldpi/ic_stat_antenna_default.png deleted file mode 100644 index ddf545c0b..000000000 Binary files a/core/src/main/res/drawable-ldpi/ic_stat_antenna_default.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_stat_antenna_default.png b/core/src/main/res/drawable-mdpi/ic_stat_antenna_default.png deleted file mode 100644 index 41fd20655..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_stat_antenna_default.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_stat_antenna_default.png b/core/src/main/res/drawable-xhdpi/ic_stat_antenna_default.png deleted file mode 100644 index 30431ed6a..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_stat_antenna_default.png and /dev/null differ diff --git a/core/src/main/res/drawable/ic_antenna.xml b/core/src/main/res/drawable/ic_antenna.xml new file mode 100644 index 000000000..9fcfab000 --- /dev/null +++ b/core/src/main/res/drawable/ic_antenna.xml @@ -0,0 +1,6 @@ + + + diff --git a/core/src/main/res/drawable/ic_notification.png b/core/src/main/res/drawable/ic_notification.png deleted file mode 100644 index 8bd22b54a..000000000 Binary files a/core/src/main/res/drawable/ic_notification.png and /dev/null differ -- cgit v1.2.3 From 6f530d9c7d01f53cd8bcae317d8a2fa09cf6b13c Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 14 Sep 2019 18:39:55 +0200 Subject: Removed unused colors and dimens --- core/src/main/res/values-large/dimens.xml | 1 - core/src/main/res/values-v19/colors.xml | 1 - core/src/main/res/values/arrays.xml | 7 ------- core/src/main/res/values/colors.xml | 6 ------ core/src/main/res/values/dimens.xml | 3 --- core/src/main/res/values/integers.xml | 1 - 6 files changed, 19 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/res/values-large/dimens.xml b/core/src/main/res/values-large/dimens.xml index 2da283c5b..2d107eef0 100644 --- a/core/src/main/res/values-large/dimens.xml +++ b/core/src/main/res/values-large/dimens.xml @@ -4,5 +4,4 @@ 170dp 64dp 64dp - @dimen/text_size_medium \ No newline at end of file diff --git a/core/src/main/res/values-v19/colors.xml b/core/src/main/res/values-v19/colors.xml index 16c065d75..4154280e8 100644 --- a/core/src/main/res/values-v19/colors.xml +++ b/core/src/main/res/values-v19/colors.xml @@ -1,5 +1,4 @@ #484B4D - #E3E3E3 \ No newline at end of file diff --git a/core/src/main/res/values/arrays.xml b/core/src/main/res/values/arrays.xml index 0eaf0e5e7..7c9811bc7 100644 --- a/core/src/main/res/values/arrays.xml +++ b/core/src/main/res/values/arrays.xml @@ -156,13 +156,6 @@ 4.00 - - N/A - - - 0 - - @string/pref_theme_title_light @string/pref_theme_title_dark diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index 0e4533977..fea7da4a4 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -2,22 +2,16 @@ #FFFFFF - #808080 #757575 #bfbfbf #000000 #33B5E5 #0099CC - #858585 - #DDDDDD #669900 #CC0000 #E033B5E5 - #E0EE5F52 #2C2C2C #FFFFFF - #EDEDED - #060708 #669900 #80000000 #50000000 diff --git a/core/src/main/res/values/dimens.xml b/core/src/main/res/values/dimens.xml index cdde0027d..02c398b62 100644 --- a/core/src/main/res/values/dimens.xml +++ b/core/src/main/res/values/dimens.xml @@ -10,7 +10,6 @@ 16sp 18sp 22sp - 32dp 64dp 64dp 64dp @@ -21,7 +20,6 @@ 280dp 48dp 16dp - 16dp 16dp 8dp @@ -29,7 +27,6 @@ 16dp 8dp - 8dp 16dp 16dp diff --git a/core/src/main/res/values/integers.xml b/core/src/main/res/values/integers.xml index 33501d9fb..73d90cf98 100644 --- a/core/src/main/res/values/integers.xml +++ b/core/src/main/res/values/integers.xml @@ -1,4 +1,3 @@ - 5000 -1 -- cgit v1.2.3 From b54849d459f8ac2ab4c13c82e9eaf9c0dd09a292 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 14 Sep 2019 18:49:08 +0200 Subject: Removed unused strings --- core/src/main/res/values/strings.xml | 38 +----------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index c9c6506a9..7ef2028d7 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -27,10 +27,8 @@ gpodder.net Synchronize with other devices gpodder.net Login - %1$s free Episode cache full The episode cache limit has been reached. You can increase the cache size in the Settings. - Synchronizing… Total time of podcasts played: @@ -73,7 +71,6 @@ Author(s) Language URL - Settings Picture Error An error occurred: @@ -82,14 +79,9 @@ No external storage is available. Please make sure that external storage is mounted so that the app can work properly. Chapters Duration: %1$s - Shownotes Description - Most recent episode:\u0020 \u0020episodes - Length:\u0020 - Size:\u0020 Processing - Loading… Save username and password Close Retry @@ -119,8 +111,6 @@ Feed URL www.example.com/feed Add Podcast by URL - Find Podcast in Directory - For new podcasts, you can search iTunes or fyyd, or browse gpodder.net by name, category or popularity. Browse gpodder.net Discover more » @@ -149,7 +139,6 @@ Please confirm that you want to delete the podcast \"%1$s\" and ALL its episodes (including downloaded episodes). Removing podcast Refresh complete podcast - Hide Episodes Batch edit Select all above Select all below @@ -174,9 +163,7 @@ Play Pause - Stop Stream - Remove Delete Unable to delete file. Rebooting the device could help. Delete Episode @@ -221,14 +208,12 @@ successful - failed Download pending Download running Details %1$s \n\nFile URL:\n%2$s Storage Device not found Insufficient Space - File Error HTTP Data Error Unknown Error Parser Exception @@ -238,7 +223,6 @@ Authentication Error File Type Error Forbidden - Cancel all downloads Download canceled Download canceled\nDisabled Auto Download for this item Downloads completed with error(s) @@ -257,7 +241,6 @@ Unknown Title Feed Media file - Image An error occurred when trying to download the file:\u0020 No podcast was provided that could be shown. Authentication required @@ -285,7 +268,6 @@ 00:00:00 Buffering Picture-in-picture mode - Playing podcast AntennaPod - Unknown media key: %1$d @@ -295,7 +277,6 @@ Queue unlocked Clear Queue Undo - Item removed Move to top Move to bottom Sort @@ -322,7 +303,6 @@ No queued episodes Add an episode by downloading it, or long press an episode and select \"Add to queue\". - You haven\'t subscribed to any podcasts yet. This episode has no shownotes. No downloads running You can download episodes on the podcast details screen. @@ -344,7 +324,6 @@ Storage Project - Other About Queue Integrations @@ -388,9 +367,7 @@ Set Time of Day every %1$s at %1$s - Download media files only over WiFi Continuous Playback - WiFi media download Headphones Disconnect Headphones Reconnect Bluetooth Reconnect @@ -401,11 +378,8 @@ Auto download Episode download Streaming - Refreshing User Interface Select Theme - Customize Navigation Drawer - Customize the appearance of the navigation drawer. Set Navigation Drawer items Change which items appear in the navigation drawer. Set Subscription Order @@ -417,8 +391,6 @@ Configure the automatic download of episodes. Enable Wi-Fi filter Allow automatic download only for selected Wi-Fi networks. - Download on mobile connection - Allow automatic download over the mobile data connection. Download when not charging Allow automatic download when the battery is not charging Parallel Downloads @@ -443,7 +415,6 @@ Sync all subscriptions and episode states with gpodder.net. Last sync attempt: %1$s (%2$s) Sync started - Full sync started %1$s with device %2$s]]> Show sync error notifications This setting does not apply to authentication errors. @@ -525,21 +496,16 @@ No results were found for \"%1$s\" - OPML files allow you to move your podcasts from one podcatcher to another. Option %1$d Choose a specific file path from the local filesystem. - Use an external applications like Dropbox, Google Drive or your favourite file manager to open an OPML file. - Many applications like Google Mail, Dropbox, Google Drive and most file managers can open OPML files with AntennaPod. Start import + Many applications like Google Mail, Dropbox, Google Drive and most file managers can open OPML files with AntennaPod. OPML Import - ERROR! Reading OPML file An error has occurred while reading the OPML document: No file selected! Select all Deselect all - Select… From local filesystem - Use external application OPML export HTML export Exporting… @@ -638,7 +604,6 @@ Subscribe - Subscribed Downloading… @@ -761,7 +726,6 @@ Failed to set the volume No connection to the cast device is present Connection to the cast device has been lost. Application is trying to re-establish the connection, if possible. Please wait for a few seconds and try again. - Failed to perform the action Failed to sync up with the cast device Failed to seek to the new position on the cast device Receiver player has encountered a severe error -- cgit v1.2.3 From 498f4759cb8df2ffbf86bfe06fa5f02548649297 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 14 Sep 2019 18:55:52 +0200 Subject: Removed unused themes --- core/src/main/res/drawable/white_circle.xml | 11 ----------- core/src/main/res/values-land/styles.xml | 6 ------ core/src/main/res/values-v16/styles.xml | 8 -------- core/src/main/res/values/styles.xml | 17 ----------------- 4 files changed, 42 deletions(-) delete mode 100644 core/src/main/res/drawable/white_circle.xml delete mode 100644 core/src/main/res/values-land/styles.xml (limited to 'core/src/main') diff --git a/core/src/main/res/drawable/white_circle.xml b/core/src/main/res/drawable/white_circle.xml deleted file mode 100644 index 597b70a2d..000000000 --- a/core/src/main/res/drawable/white_circle.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/core/src/main/res/values-land/styles.xml b/core/src/main/res/values-land/styles.xml deleted file mode 100644 index d964ef3d4..000000000 --- a/core/src/main/res/values-land/styles.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/core/src/main/res/values-v16/styles.xml b/core/src/main/res/values-v16/styles.xml index a92790152..947e43f38 100644 --- a/core/src/main/res/values-v16/styles.xml +++ b/core/src/main/res/values-v16/styles.xml @@ -6,12 +6,4 @@ ?android:attr/textColorPrimary sans-serif-light - - \ No newline at end of file diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index fb69e54e7..a107d3082 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -258,13 +258,6 @@ end - - - - -- cgit v1.2.3 From 29f429f897409efb124ca8583a60c7507d735f7a Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 14 Sep 2019 19:28:03 +0200 Subject: Fixed indonesian translation folder --- core/src/main/res/values-id/strings.xml | 155 -------------------------------- core/src/main/res/values-in/strings.xml | 155 ++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+), 155 deletions(-) delete mode 100644 core/src/main/res/values-id/strings.xml create mode 100644 core/src/main/res/values-in/strings.xml (limited to 'core/src/main') diff --git a/core/src/main/res/values-id/strings.xml b/core/src/main/res/values-id/strings.xml deleted file mode 100644 index 2f1ffecea..000000000 --- a/core/src/main/res/values-id/strings.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - - Tambah Podcast - Kisah - Semua - Favorit - Baru - Pengaturan - Unduhan - Abonemen - Daftar Abonemen - Batal\nUnduhan - gpodder.net - - - Buka daftar - Tutup daftar - Nomor kisah baru dan kisah yang belum diputar - Nomor kisah baru - Nomor kisah yang belum diputar - - Salin URL - Bagikan URL - - - Batal - Ya - Tidak - Penulis - Bahasa - URL - Pengaturan - Gambar - Segarkan - Deskripsi - Kisah terbaru:\u0020 - \u0020kisah - Simpan nama pengguna dan kata sandi - Tutup - Kirim… - - - Tandai semua diputar - Tandai semua Kisah diputar - Tandai semua dilihat - Hapus Podcast - Bagikan... - Bagikan Tautan - Tidak diputar - Diputar - Diantri - Tidak diantri - Diunduh - Tidak diunduh - - Unduh - Putar - Henti - Hapus - Hapus Episode - Tandai diputar - Ditandai diputar - Ditandai belum diputar - Tambah ke Antrian - Ditambah ke Antrian - Hapus dari Antrian - Tambah ke Favorit - Ditambah ke Favorit - Hapus dari Favorit - Dihapus dari Favorit - Flattr ini - - Batalkan semua unduhan - Unduhan dibatalkan - Gambar - Tambah ke antrian - - - Hapus Antrian - Tanggal - - - - - - Tentang - Antrian - Flattr - Menyegarkan - Pengaturan Flattr - Flattr Aplikasi ini - jam - jam - Masuk - Keluar - Sinkronkan dimulai - - - Telusur - - Pilih semua - Pilih... - - Getar - detik - menit - jam - - %d detik - - - %d menit - - - %d jam - - - Telusur gpodder.net - Masuk - Masuk - Nama pengguna - Kata sandi - - Direktori dipilih: - Buat direktori - Pilih Direktori Data - Direktori baru dibuat - - Mengunduh... - - - - - Telusur iTunes - - Semua - Semua episode dipilih - Diputar - Tidak diputar - Diunduh - Tidak diunduh - Diantri - Tidak diantri - - - - Kiri - Kanan - - - - - - diff --git a/core/src/main/res/values-in/strings.xml b/core/src/main/res/values-in/strings.xml new file mode 100644 index 000000000..2f1ffecea --- /dev/null +++ b/core/src/main/res/values-in/strings.xml @@ -0,0 +1,155 @@ + + + + Tambah Podcast + Kisah + Semua + Favorit + Baru + Pengaturan + Unduhan + Abonemen + Daftar Abonemen + Batal\nUnduhan + gpodder.net + + + Buka daftar + Tutup daftar + Nomor kisah baru dan kisah yang belum diputar + Nomor kisah baru + Nomor kisah yang belum diputar + + Salin URL + Bagikan URL + + + Batal + Ya + Tidak + Penulis + Bahasa + URL + Pengaturan + Gambar + Segarkan + Deskripsi + Kisah terbaru:\u0020 + \u0020kisah + Simpan nama pengguna dan kata sandi + Tutup + Kirim… + + + Tandai semua diputar + Tandai semua Kisah diputar + Tandai semua dilihat + Hapus Podcast + Bagikan... + Bagikan Tautan + Tidak diputar + Diputar + Diantri + Tidak diantri + Diunduh + Tidak diunduh + + Unduh + Putar + Henti + Hapus + Hapus Episode + Tandai diputar + Ditandai diputar + Ditandai belum diputar + Tambah ke Antrian + Ditambah ke Antrian + Hapus dari Antrian + Tambah ke Favorit + Ditambah ke Favorit + Hapus dari Favorit + Dihapus dari Favorit + Flattr ini + + Batalkan semua unduhan + Unduhan dibatalkan + Gambar + Tambah ke antrian + + + Hapus Antrian + Tanggal + + + + + + Tentang + Antrian + Flattr + Menyegarkan + Pengaturan Flattr + Flattr Aplikasi ini + jam + jam + Masuk + Keluar + Sinkronkan dimulai + + + Telusur + + Pilih semua + Pilih... + + Getar + detik + menit + jam + + %d detik + + + %d menit + + + %d jam + + + Telusur gpodder.net + Masuk + Masuk + Nama pengguna + Kata sandi + + Direktori dipilih: + Buat direktori + Pilih Direktori Data + Direktori baru dibuat + + Mengunduh... + + + + + Telusur iTunes + + Semua + Semua episode dipilih + Diputar + Tidak diputar + Diunduh + Tidak diunduh + Diantri + Tidak diantri + + + + Kiri + Kanan + + + + + + -- cgit v1.2.3 From 3a150bdb638782d88e4e3bcfdf13fec14aa5515e Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 14 Sep 2019 19:33:23 +0200 Subject: Updated key notification icon Notification icons must be white and square --- .../antennapod/core/service/download/DownloadService.java | 2 +- .../src/main/res/drawable-hdpi/ic_stat_authentication.png | Bin 371 -> 0 bytes .../src/main/res/drawable-mdpi/ic_stat_authentication.png | Bin 244 -> 0 bytes .../main/res/drawable-xhdpi/ic_stat_authentication.png | Bin 418 -> 0 bytes .../main/res/drawable-xxhdpi/ic_stat_authentication.png | Bin 848 -> 0 bytes core/src/main/res/drawable/ic_notification_key.xml | 5 +++++ 6 files changed, 6 insertions(+), 1 deletion(-) delete mode 100644 core/src/main/res/drawable-hdpi/ic_stat_authentication.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_stat_authentication.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_stat_authentication.png delete mode 100755 core/src/main/res/drawable-xxhdpi/ic_stat_authentication.png create mode 100644 core/src/main/res/drawable/ic_notification_key.xml (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java index 787d465d8..e4dedc23b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java @@ -546,7 +546,7 @@ public class DownloadService extends Service { .setContentText(getText(R.string.authentication_notification_msg)) .setStyle(new NotificationCompat.BigTextStyle().bigText(getText(R.string.authentication_notification_msg) + ": " + resourceTitle)) - .setSmallIcon(R.drawable.ic_stat_authentication) + .setSmallIcon(R.drawable.ic_notification_key) .setAutoCancel(true) .setContentIntent(ClientConfig.downloadServiceCallbacks.getAuthentificationNotificationContentIntent(DownloadService.this, downloadRequest)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { diff --git a/core/src/main/res/drawable-hdpi/ic_stat_authentication.png b/core/src/main/res/drawable-hdpi/ic_stat_authentication.png deleted file mode 100644 index 398dffa4b..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_stat_authentication.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_stat_authentication.png b/core/src/main/res/drawable-mdpi/ic_stat_authentication.png deleted file mode 100644 index 550b56b33..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_stat_authentication.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_stat_authentication.png b/core/src/main/res/drawable-xhdpi/ic_stat_authentication.png deleted file mode 100644 index e83cbc333..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_stat_authentication.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_stat_authentication.png b/core/src/main/res/drawable-xxhdpi/ic_stat_authentication.png deleted file mode 100755 index 965fabc57..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_stat_authentication.png and /dev/null differ diff --git a/core/src/main/res/drawable/ic_notification_key.xml b/core/src/main/res/drawable/ic_notification_key.xml new file mode 100644 index 000000000..b1e2f9b8c --- /dev/null +++ b/core/src/main/res/drawable/ic_notification_key.xml @@ -0,0 +1,5 @@ + + + -- cgit v1.2.3 From 9a716ba4ac070c502dd85967056a0474e0315fee Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 14 Sep 2019 20:52:27 +0200 Subject: Calling apply() on preferences edit --- .../danoeh/antennapod/core/service/playback/PlaybackService.java | 9 +++------ .../de/danoeh/antennapod/core/util/playback/ExternalMedia.java | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index e479a7711..ace89e40a 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -1086,7 +1086,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { editor.putInt( PlaybackPreferences.PREF_CURRENT_PLAYER_STATUS, playerStatus); - editor.commit(); + editor.apply(); } private void writePlayerStatusPlaybackPreferences() { @@ -1095,11 +1095,8 @@ public class PlaybackService extends MediaBrowserServiceCompat { SharedPreferences.Editor editor = PreferenceManager .getDefaultSharedPreferences(getApplicationContext()).edit(); int playerStatus = getCurrentPlayerStatusAsInt(mediaPlayer.getPlayerStatus()); - - editor.putInt( - PlaybackPreferences.PREF_CURRENT_PLAYER_STATUS, playerStatus); - - editor.commit(); + editor.putInt(PlaybackPreferences.PREF_CURRENT_PLAYER_STATUS, playerStatus); + editor.apply(); } private void sendNotificationBroadcast(int type, int code) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java index 645bae5f3..9b644c3ba 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java @@ -182,7 +182,7 @@ public class ExternalMedia implements Playable { editor.putLong(PREF_LAST_PLAYED_TIME, timestamp); position = newPosition; lastPlayedTime = timestamp; - editor.commit(); + editor.apply(); } @Override -- cgit v1.2.3 From 79c94112ef722f807cb633bc2987a8a688d06f9b Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 14 Sep 2019 21:14:16 +0200 Subject: Removed unused code --- .../antennapod/core/event/FeedMediaEvent.java | 23 ---- .../core/preferences/UserPreferences.java | 7 -- .../core/service/download/DownloadStatus.java | 4 - .../de/danoeh/antennapod/core/storage/DBTasks.java | 5 - .../antennapod/core/storage/DownloadRequester.java | 5 - .../antennapod/core/storage/PodDBAdapter.java | 13 --- .../de/danoeh/antennapod/core/util/DuckType.java | 117 --------------------- .../danoeh/antennapod/core/util/FeedItemUtil.java | 38 ------- .../antennapod/core/util/FeedtitleComparator.java | 15 --- .../comparator/SearchResultValueComparator.java | 27 ----- 10 files changed, 254 deletions(-) delete mode 100644 core/src/main/java/de/danoeh/antennapod/core/event/FeedMediaEvent.java delete mode 100644 core/src/main/java/de/danoeh/antennapod/core/util/DuckType.java delete mode 100644 core/src/main/java/de/danoeh/antennapod/core/util/FeedtitleComparator.java delete mode 100644 core/src/main/java/de/danoeh/antennapod/core/util/comparator/SearchResultValueComparator.java (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/event/FeedMediaEvent.java b/core/src/main/java/de/danoeh/antennapod/core/event/FeedMediaEvent.java deleted file mode 100644 index 4a591c996..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/event/FeedMediaEvent.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.danoeh.antennapod.core.event; - -import de.danoeh.antennapod.core.feed.FeedMedia; - -public class FeedMediaEvent { - - public enum Action { - UPDATE - } - - private final Action action; - private final FeedMedia media; - - private FeedMediaEvent(Action action, FeedMedia media) { - this.action = action; - this.media = media; - } - - public static FeedMediaEvent update(FeedMedia media) { - return new FeedMediaEvent(Action.UPDATE, media); - } - -} diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index b8ab1c888..6d614f039 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -890,13 +890,6 @@ public class UserPreferences { } } - /** - * Reads episode cache size as it is saved in the episode_cache_size_values array. - */ - public static int readEpisodeCacheSize(String valueFromPrefs) { - return readEpisodeCacheSizeInternal(valueFromPrefs); - } - /** * Evaluates whether Cast support (Chromecast, Audio Cast, etc) is enabled on the preferences. */ diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java index 5debc6d05..d88eb63f4 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java @@ -193,10 +193,6 @@ public class DownloadStatus { this.cancelled = true; } - public void setCompletionDate(Date completionDate) { - this.completionDate = (Date) completionDate.clone(); - } - public void setId(long id) { this.id = id; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java index e68bff16e..0fb181299 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java @@ -193,11 +193,6 @@ public final class DBTasks { }).start(); } - public static long getLastRefreshAllFeedsTimeMillis(final Context context) { - SharedPreferences prefs = context.getSharedPreferences(DBTasks.PREF_NAME, MODE_PRIVATE); - return prefs.getLong(DBTasks.PREF_LAST_REFRESH, 0); - } - /** * @param context * @param feedList the list of feeds to refresh diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java index 892a4675a..9c48f31dd 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java @@ -34,7 +34,6 @@ import de.danoeh.antennapod.core.util.URLChecker; public class DownloadRequester { private static final String TAG = "DownloadRequester"; - public static final String IMAGE_DOWNLOADPATH = "images/"; private static final String FEED_DOWNLOADPATH = "cache/"; private static final String MEDIA_DOWNLOADPATH = "media/"; @@ -274,10 +273,6 @@ public class DownloadRequester { return item.getDownload_url() != null && downloads.containsKey(item.getDownload_url()); } - public synchronized DownloadRequest getDownload(String downloadUrl) { - return downloads.get(downloadUrl); - } - /** * Checks if feedfile with the given download url is in the downloads list */ diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index 13ea9daf0..a3271bcf9 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -55,16 +55,10 @@ public class PodDBAdapter { */ private static final int IN_OPERATOR_MAXIMUM = 800; - /** - * Maximum number of entries per search request. - */ - public static final int SEARCH_LIMIT = 30; - // Key-constants public static final String KEY_ID = "id"; public static final String KEY_TITLE = "title"; public static final String KEY_CUSTOM_TITLE = "custom_title"; - public static final String KEY_NAME = "name"; public static final String KEY_LINK = "link"; public static final String KEY_DESCRIPTION = "description"; public static final String KEY_FILE_URL = "file_url"; @@ -1400,13 +1394,6 @@ public class PodDBAdapter { return db.rawQuery(query, null); } - - public static final int IDX_FEEDSTATISTICS_FEED = 0; - public static final int IDX_FEEDSTATISTICS_NUM_ITEMS = 1; - public static final int IDX_FEEDSTATISTICS_NEW_ITEMS = 2; - public static final int IDX_FEEDSTATISTICS_LATEST_EPISODE = 3; - public static final int IDX_FEEDSTATISTICS_IN_PROGRESS_EPISODES = 4; - /** * Select number of items, new items, the date of the latest episode and the number of episodes in progress. The result * is sorted by the title of the feed. diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/DuckType.java b/core/src/main/java/de/danoeh/antennapod/core/util/DuckType.java deleted file mode 100644 index 69dc38895..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/util/DuckType.java +++ /dev/null @@ -1,117 +0,0 @@ -/* Adapted from: http://thinking-in-code.blogspot.com/2008/11/duck-typing-in-java-using-dynamic.html */ - -package de.danoeh.antennapod.core.util; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - -import de.danoeh.antennapod.core.BuildConfig; - -/** - * Allows "duck typing" or dynamic invocation based on method signature rather - * than type hierarchy. In other words, rather than checking whether something - * IS-a duck, check whether it WALKS-like-a duck or QUACKS-like a duck. - * - * To use first use the coerce static method to indicate the object you want to - * do Duck Typing for, then specify an interface to the to method which you want - * to coerce the type to, e.g: - * - * public interface Foo { void aMethod(); } class Bar { ... public void - * aMethod() { ... } ... } Bar bar = ...; Foo foo = - * DuckType.coerce(bar).to(Foo.class); foo.aMethod(); - * - * - */ -public class DuckType { - - private final Object objectToCoerce; - - private DuckType(Object objectToCoerce) { - this.objectToCoerce = objectToCoerce; - } - - private class CoercedProxy implements InvocationHandler { - @Override - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - Method delegateMethod = findMethodBySignature(method); - assert delegateMethod != null; - return delegateMethod.invoke(DuckType.this.objectToCoerce, args); - } - } - - /** - * Specify the duck typed object to coerce. - * - * @param object - * the object to coerce - * @return - */ - public static DuckType coerce(Object object) { - return new DuckType(object); - } - - /** - * Coerce the Duck Typed object to the given interface providing it - * implements all the necessary methods. - * - * @param - * @param iface - * @return an instance of the given interface that wraps the duck typed - * class - * @throws ClassCastException - * if the object being coerced does not implement all the - * methods in the given interface. - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - public T to(Class iface) { - if (BuildConfig.DEBUG && !iface.isInterface()) throw new AssertionError("cannot coerce object to a class, must be an interface"); - if (isA(iface)) { - return (T) iface.cast(objectToCoerce); - } - if (quacksLikeA(iface)) { - return generateProxy(iface); - } - throw new ClassCastException("Could not coerce object of type " + objectToCoerce.getClass() + " to " + iface); - } - - @SuppressWarnings("rawtypes") - private boolean isA(Class iface) { - return objectToCoerce.getClass().isInstance(iface); - } - - /** - * Determine whether the duck typed object can be used with the given - * interface. - * - * @param Type - * of the interface to check. - * @param iface - * Interface class to check - * @return true if the object will support all the methods in the interface, - * false otherwise. - */ - @SuppressWarnings("rawtypes") - private boolean quacksLikeA(Class iface) { - for (Method method : iface.getMethods()) { - if (findMethodBySignature(method) == null) { - return false; - } - } - return true; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - private T generateProxy(Class iface) { - return (T) Proxy.newProxyInstance(iface.getClassLoader(), new Class[] { iface }, new CoercedProxy()); - } - - private Method findMethodBySignature(Method method) { - try { - return objectToCoerce.getClass().getMethod(method.getName(), method.getParameterTypes()); - } catch (NoSuchMethodException e) { - return null; - } - } - -} \ No newline at end of file diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java b/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java index 826c06822..a8206d3bd 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java @@ -7,19 +7,6 @@ import de.danoeh.antennapod.core.feed.FeedItem; public class FeedItemUtil { private FeedItemUtil(){} - public static int indexOfItemWithDownloadUrl(List items, String downloadUrl) { - if(items == null) { - return -1; - } - for(int i=0; i < items.size(); i++) { - FeedItem item = items.get(i); - if(item.hasMedia() && item.getMedia().getDownload_url().equals(downloadUrl)) { - return i; - } - } - return -1; - } - public static int indexOfItemWithId(List items, long id) { for(int i=0; i < items.size(); i++) { FeedItem item = items.get(i); @@ -40,17 +27,6 @@ public class FeedItemUtil { return -1; } - public static long[] getIds(FeedItem... items) { - if(items == null || items.length == 0) { - return new long[0]; - } - long[] result = new long[items.length]; - for(int i=0; i < items.length; i++) { - result[i] = items[i].getId(); - } - return result; - } - public static long[] getIds(List items) { if(items == null || items.size() == 0) { return new long[0]; @@ -62,20 +38,6 @@ public class FeedItemUtil { return result; } - public static boolean containsAnyId(List items, long[] ids) { - if(items == null || items.size() == 0) { - return false; - } - for(FeedItem item : items) { - for(long id : ids) { - if(item.getId() == id) { - return true; - } - } - } - return false; - } - /** * Get the link for the feed item for the purpose of Share. It fallbacks to * use the feed's link if the named feed item has no link. diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/FeedtitleComparator.java b/core/src/main/java/de/danoeh/antennapod/core/util/FeedtitleComparator.java deleted file mode 100644 index 29d095cd2..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/util/FeedtitleComparator.java +++ /dev/null @@ -1,15 +0,0 @@ -package de.danoeh.antennapod.core.util; - -import java.util.Comparator; - -import de.danoeh.antennapod.core.feed.Feed; - -/** Compares the title of two feeds for sorting. */ -class FeedtitleComparator implements Comparator { - - @Override - public int compare(Feed lhs, Feed rhs) { - return lhs.getTitle().compareToIgnoreCase(rhs.getTitle()); - } - -} diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/comparator/SearchResultValueComparator.java b/core/src/main/java/de/danoeh/antennapod/core/util/comparator/SearchResultValueComparator.java deleted file mode 100644 index 56a684475..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/util/comparator/SearchResultValueComparator.java +++ /dev/null @@ -1,27 +0,0 @@ -package de.danoeh.antennapod.core.util.comparator; - -import java.util.Comparator; - -import de.danoeh.antennapod.core.feed.FeedItem; -import de.danoeh.antennapod.core.feed.SearchResult; - -public class SearchResultValueComparator implements Comparator { - - /** - * Compare items based, first, on where they were found (ie. title, chapters, or show notes). - * If they were found in the same section, then compare based on the title, in lexicographic - * order. This is still not ideal since, for example, "#12 Example A" would be considered - * before "#8 Example B" due to the fact that "8" has a larger unicode value than "1" - */ - @Override - public int compare(SearchResult lhs, SearchResult rhs) { - int value = rhs.getValue() - lhs.getValue(); - if (value == 0 && lhs.getComponent() instanceof FeedItem && rhs.getComponent() instanceof FeedItem) { - String lhsTitle = ((FeedItem) lhs.getComponent()).getTitle(); - String rhsTitle = ((FeedItem) rhs.getComponent()).getTitle(); - return lhsTitle.compareTo(rhsTitle); - } - return value; - } - -} -- cgit v1.2.3 From d5130b21e35486a48554e47091db8a538339437f Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 20 Sep 2019 22:49:03 +0200 Subject: Update playback speed button if service is not running --- .../de/danoeh/antennapod/core/util/playback/PlaybackController.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java index 0cfaaab3c..ac5418dd0 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java @@ -728,6 +728,8 @@ public class PlaybackController { public void setPlaybackSpeed(float speed) { if (playbackService != null) { playbackService.setSpeed(speed); + } else { + onPlaybackSpeedChange(); } } public void setSkipSilence(boolean skipSilence) { -- cgit v1.2.3 From 9609eb69778a2614011961bf8008d90e95c0981b Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 20 Sep 2019 23:17:29 +0200 Subject: Removed link to known issues --- .../ic_format_list_bulleted_grey600_24dp.png | Bin 492 -> 0 bytes .../drawable-hdpi/ic_format_list_bulleted_white_24dp.png | Bin 459 -> 0 bytes .../ic_format_list_bulleted_grey600_24dp.png | Bin 423 -> 0 bytes .../drawable-mdpi/ic_format_list_bulleted_white_24dp.png | Bin 406 -> 0 bytes .../ic_format_list_bulleted_grey600_24dp.png | Bin 504 -> 0 bytes .../drawable-xhdpi/ic_format_list_bulleted_white_24dp.png | Bin 462 -> 0 bytes .../ic_format_list_bulleted_grey600_24dp.png | Bin 631 -> 0 bytes .../ic_format_list_bulleted_white_24dp.png | Bin 594 -> 0 bytes .../ic_format_list_bulleted_grey600_24dp.png | Bin 738 -> 0 bytes .../ic_format_list_bulleted_white_24dp.png | Bin 666 -> 0 bytes core/src/main/res/values/attrs.xml | 1 - core/src/main/res/values/strings.xml | 1 - core/src/main/res/values/styles.xml | 2 -- 13 files changed, 4 deletions(-) delete mode 100644 core/src/main/res/drawable-hdpi/ic_format_list_bulleted_grey600_24dp.png delete mode 100644 core/src/main/res/drawable-hdpi/ic_format_list_bulleted_white_24dp.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_format_list_bulleted_grey600_24dp.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_format_list_bulleted_white_24dp.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_format_list_bulleted_grey600_24dp.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_format_list_bulleted_white_24dp.png delete mode 100644 core/src/main/res/drawable-xxhdpi/ic_format_list_bulleted_grey600_24dp.png delete mode 100644 core/src/main/res/drawable-xxhdpi/ic_format_list_bulleted_white_24dp.png delete mode 100644 core/src/main/res/drawable-xxxhdpi/ic_format_list_bulleted_grey600_24dp.png delete mode 100644 core/src/main/res/drawable-xxxhdpi/ic_format_list_bulleted_white_24dp.png (limited to 'core/src/main') diff --git a/core/src/main/res/drawable-hdpi/ic_format_list_bulleted_grey600_24dp.png b/core/src/main/res/drawable-hdpi/ic_format_list_bulleted_grey600_24dp.png deleted file mode 100644 index 3668c9a00..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_format_list_bulleted_grey600_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-hdpi/ic_format_list_bulleted_white_24dp.png b/core/src/main/res/drawable-hdpi/ic_format_list_bulleted_white_24dp.png deleted file mode 100644 index a1a2c5b68..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_format_list_bulleted_white_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_format_list_bulleted_grey600_24dp.png b/core/src/main/res/drawable-mdpi/ic_format_list_bulleted_grey600_24dp.png deleted file mode 100644 index 726eae499..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_format_list_bulleted_grey600_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_format_list_bulleted_white_24dp.png b/core/src/main/res/drawable-mdpi/ic_format_list_bulleted_white_24dp.png deleted file mode 100644 index 0cc401dff..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_format_list_bulleted_white_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_format_list_bulleted_grey600_24dp.png b/core/src/main/res/drawable-xhdpi/ic_format_list_bulleted_grey600_24dp.png deleted file mode 100644 index 322adb6e0..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_format_list_bulleted_grey600_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_format_list_bulleted_white_24dp.png b/core/src/main/res/drawable-xhdpi/ic_format_list_bulleted_white_24dp.png deleted file mode 100644 index c25860017..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_format_list_bulleted_white_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_format_list_bulleted_grey600_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_format_list_bulleted_grey600_24dp.png deleted file mode 100644 index 87f8073ea..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_format_list_bulleted_grey600_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_format_list_bulleted_white_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_format_list_bulleted_white_24dp.png deleted file mode 100644 index da3433c61..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_format_list_bulleted_white_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxxhdpi/ic_format_list_bulleted_grey600_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_format_list_bulleted_grey600_24dp.png deleted file mode 100644 index c56590fe0..000000000 Binary files a/core/src/main/res/drawable-xxxhdpi/ic_format_list_bulleted_grey600_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxxhdpi/ic_format_list_bulleted_white_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_format_list_bulleted_white_24dp.png deleted file mode 100644 index 5deea3286..000000000 Binary files a/core/src/main/res/drawable-xxxhdpi/ic_format_list_bulleted_white_24dp.png and /dev/null differ diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index 5b0bf5717..c6ff4f58d 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -58,7 +58,6 @@ - diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index bf805a19e..44420645f 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -459,7 +459,6 @@ Proxy Set a network proxy FAQ - Known issues No web browser found. Chromecast support Enable support for remote media playback on Cast devices (such as Chromecast, Audio Speakers or Android TV) diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index a107d3082..fd2893594 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -70,7 +70,6 @@ @drawable/ic_cellphone_text_grey600_24dp @drawable/ic_forum_grey600_24dp @drawable/ic_bug_grey600_24dp - @drawable/ic_format_list_bulleted_grey600_24dp @drawable/ic_bookmark_grey600_24dp @drawable/ic_fab_edit_white @color/master_switch_background_light @@ -155,7 +154,6 @@ @drawable/ic_cellphone_text_white_24dp @drawable/ic_baseline_question_answer_white_24dp @drawable/ic_bug_white_24dp - @drawable/ic_format_list_bulleted_white_24dp @drawable/ic_bookmark_white_24dp @drawable/ic_fab_edit_white @color/master_switch_background_dark -- cgit v1.2.3 From b931828736a16b59ae6bc7ee381da9b0f9281887 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 20 Sep 2019 23:21:27 +0200 Subject: Renamed crash report to bug report --- core/src/main/res/values/strings.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 44420645f..4facb89d9 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -448,8 +448,7 @@ Disabled Image Cache Size Size of the disk cache for images. - Crash Report - View details about last crash + Report bug Open bug tracker Copy to clipboard Copied to clipboard -- cgit v1.2.3 From 742bbc5c9275f64445aa3c6e4029f307b11d8be9 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 20 Sep 2019 23:28:27 +0200 Subject: Updated FAQ icon and text --- .../ic_baseline_question_answer_white_24dp.png | Bin 187 -> 0 bytes core/src/main/res/drawable-hdpi/ic_forum_grey600_24dp.png | Bin 601 -> 0 bytes .../ic_baseline_question_answer_white_24dp.png | Bin 139 -> 0 bytes core/src/main/res/drawable-mdpi/ic_forum_grey600_24dp.png | Bin 488 -> 0 bytes .../ic_baseline_question_answer_white_24dp.png | Bin 212 -> 0 bytes .../src/main/res/drawable-xhdpi/ic_forum_grey600_24dp.png | Bin 602 -> 0 bytes .../ic_baseline_question_answer_white_24dp.png | Bin 276 -> 0 bytes .../main/res/drawable-xxhdpi/ic_forum_grey600_24dp.png | Bin 766 -> 0 bytes .../ic_baseline_question_answer_white_24dp.png | Bin 310 -> 0 bytes .../main/res/drawable-xxxhdpi/ic_forum_grey600_24dp.png | Bin 900 -> 0 bytes core/src/main/res/drawable/ic_questionmark_grey600.xml | 5 +++++ core/src/main/res/drawable/ic_questionmark_white.xml | 5 +++++ core/src/main/res/values/attrs.xml | 2 +- core/src/main/res/values/strings.xml | 2 +- core/src/main/res/values/styles.xml | 4 ++-- 15 files changed, 14 insertions(+), 4 deletions(-) delete mode 100755 core/src/main/res/drawable-hdpi/ic_baseline_question_answer_white_24dp.png delete mode 100644 core/src/main/res/drawable-hdpi/ic_forum_grey600_24dp.png delete mode 100755 core/src/main/res/drawable-mdpi/ic_baseline_question_answer_white_24dp.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_forum_grey600_24dp.png delete mode 100755 core/src/main/res/drawable-xhdpi/ic_baseline_question_answer_white_24dp.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_forum_grey600_24dp.png delete mode 100755 core/src/main/res/drawable-xxhdpi/ic_baseline_question_answer_white_24dp.png delete mode 100644 core/src/main/res/drawable-xxhdpi/ic_forum_grey600_24dp.png delete mode 100644 core/src/main/res/drawable-xxxhdpi/ic_baseline_question_answer_white_24dp.png delete mode 100644 core/src/main/res/drawable-xxxhdpi/ic_forum_grey600_24dp.png create mode 100644 core/src/main/res/drawable/ic_questionmark_grey600.xml create mode 100644 core/src/main/res/drawable/ic_questionmark_white.xml (limited to 'core/src/main') diff --git a/core/src/main/res/drawable-hdpi/ic_baseline_question_answer_white_24dp.png b/core/src/main/res/drawable-hdpi/ic_baseline_question_answer_white_24dp.png deleted file mode 100755 index 67924a5a2..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_baseline_question_answer_white_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-hdpi/ic_forum_grey600_24dp.png b/core/src/main/res/drawable-hdpi/ic_forum_grey600_24dp.png deleted file mode 100644 index da5398d15..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_forum_grey600_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_baseline_question_answer_white_24dp.png b/core/src/main/res/drawable-mdpi/ic_baseline_question_answer_white_24dp.png deleted file mode 100755 index e87df752e..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_baseline_question_answer_white_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_forum_grey600_24dp.png b/core/src/main/res/drawable-mdpi/ic_forum_grey600_24dp.png deleted file mode 100644 index d3bcfe7b6..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_forum_grey600_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_baseline_question_answer_white_24dp.png b/core/src/main/res/drawable-xhdpi/ic_baseline_question_answer_white_24dp.png deleted file mode 100755 index 731f89c83..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_baseline_question_answer_white_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_forum_grey600_24dp.png b/core/src/main/res/drawable-xhdpi/ic_forum_grey600_24dp.png deleted file mode 100644 index ac6876140..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_forum_grey600_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_baseline_question_answer_white_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_baseline_question_answer_white_24dp.png deleted file mode 100755 index 255b82707..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_baseline_question_answer_white_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_forum_grey600_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_forum_grey600_24dp.png deleted file mode 100644 index 7a3204693..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_forum_grey600_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxxhdpi/ic_baseline_question_answer_white_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_baseline_question_answer_white_24dp.png deleted file mode 100644 index 0d697e0f9..000000000 Binary files a/core/src/main/res/drawable-xxxhdpi/ic_baseline_question_answer_white_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxxhdpi/ic_forum_grey600_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_forum_grey600_24dp.png deleted file mode 100644 index 0ae33696b..000000000 Binary files a/core/src/main/res/drawable-xxxhdpi/ic_forum_grey600_24dp.png and /dev/null differ diff --git a/core/src/main/res/drawable/ic_questionmark_grey600.xml b/core/src/main/res/drawable/ic_questionmark_grey600.xml new file mode 100644 index 000000000..0907fcdec --- /dev/null +++ b/core/src/main/res/drawable/ic_questionmark_grey600.xml @@ -0,0 +1,5 @@ + + + diff --git a/core/src/main/res/drawable/ic_questionmark_white.xml b/core/src/main/res/drawable/ic_questionmark_white.xml new file mode 100644 index 000000000..69b42fef8 --- /dev/null +++ b/core/src/main/res/drawable/ic_questionmark_white.xml @@ -0,0 +1,5 @@ + + + diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index c6ff4f58d..e9e110b0c 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -56,7 +56,7 @@ - + diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 4facb89d9..ece0ec881 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -457,7 +457,7 @@ Current value: %1$s Proxy Set a network proxy - FAQ + Frequently Asked Questions No web browser found. Chromecast support Enable support for remote media playback on Cast devices (such as Chromecast, Audio Speakers or Android TV) diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index fd2893594..50e303437 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -68,7 +68,7 @@ @drawable/ic_create_new_folder_grey600_24dp @drawable/ic_cast_disconnect_grey600_36dp @drawable/ic_cellphone_text_grey600_24dp - @drawable/ic_forum_grey600_24dp + @drawable/ic_questionmark_grey600 @drawable/ic_bug_grey600_24dp @drawable/ic_bookmark_grey600_24dp @drawable/ic_fab_edit_white @@ -152,7 +152,7 @@ @drawable/ic_create_new_folder_white_24dp @drawable/ic_cast_disconnect_white_36dp @drawable/ic_cellphone_text_white_24dp - @drawable/ic_baseline_question_answer_white_24dp + @drawable/ic_questionmark_white @drawable/ic_bug_white_24dp @drawable/ic_bookmark_white_24dp @drawable/ic_fab_edit_white -- cgit v1.2.3 From 2dce723a8d4e451d0f74f3feb249621b5468717a Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 20 Sep 2019 23:38:13 +0200 Subject: Added button to view mailing list --- core/src/main/res/drawable/ic_chat_grey600.xml | 5 +++++ core/src/main/res/drawable/ic_chat_white.xml | 5 +++++ core/src/main/res/values/attrs.xml | 1 + core/src/main/res/values/strings.xml | 1 + core/src/main/res/values/styles.xml | 2 ++ 5 files changed, 14 insertions(+) create mode 100644 core/src/main/res/drawable/ic_chat_grey600.xml create mode 100644 core/src/main/res/drawable/ic_chat_white.xml (limited to 'core/src/main') diff --git a/core/src/main/res/drawable/ic_chat_grey600.xml b/core/src/main/res/drawable/ic_chat_grey600.xml new file mode 100644 index 000000000..ebae2dbed --- /dev/null +++ b/core/src/main/res/drawable/ic_chat_grey600.xml @@ -0,0 +1,5 @@ + + + diff --git a/core/src/main/res/drawable/ic_chat_white.xml b/core/src/main/res/drawable/ic_chat_white.xml new file mode 100644 index 000000000..45691c525 --- /dev/null +++ b/core/src/main/res/drawable/ic_chat_white.xml @@ -0,0 +1,5 @@ + + + diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index e9e110b0c..d0419bb38 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -57,6 +57,7 @@ + diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index ece0ec881..517f4b81c 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -448,6 +448,7 @@ Disabled Image Cache Size Size of the disk cache for images. + View mailing list Report bug Open bug tracker Copy to clipboard diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index 50e303437..b589d4f20 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -69,6 +69,7 @@ @drawable/ic_cast_disconnect_grey600_36dp @drawable/ic_cellphone_text_grey600_24dp @drawable/ic_questionmark_grey600 + @drawable/ic_chat_grey600 @drawable/ic_bug_grey600_24dp @drawable/ic_bookmark_grey600_24dp @drawable/ic_fab_edit_white @@ -153,6 +154,7 @@ @drawable/ic_cast_disconnect_white_36dp @drawable/ic_cellphone_text_white_24dp @drawable/ic_questionmark_white + @drawable/ic_chat_white @drawable/ic_bug_white_24dp @drawable/ic_bookmark_white_24dp @drawable/ic_fab_edit_white -- cgit v1.2.3 From 39b202ff45e94c87e2b50998536a8faa705dcf8e Mon Sep 17 00:00:00 2001 From: orionlee Date: Mon, 2 Sep 2019 14:54:22 -0700 Subject: #2977 fix incorrect "share podcast url" label --- core/src/main/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'core/src/main') diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 2049f7ac4..c7bd2d2a2 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -133,6 +133,7 @@ Share Episode URL Share Episode URL with Position Share File + Share Website URL Share Feed URL Share Media File URL Share Media File URL with Position -- cgit v1.2.3 From 6cae7df9bdf0d233d0c35b021cbc43dfa5e4a4b5 Mon Sep 17 00:00:00 2001 From: orionlee Date: Mon, 23 Sep 2019 14:13:20 -0700 Subject: SSL fix On Android 4.4 for certain web sites. --- .../core/service/download/AntennapodHttpClient.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java index 97007a214..e6886c655 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java @@ -16,7 +16,9 @@ import java.net.Socket; import java.net.SocketAddress; import java.security.GeneralSecurityException; import java.security.KeyStore; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import java.util.concurrent.TimeUnit; import javax.net.ssl.SSLContext; @@ -28,6 +30,8 @@ import javax.net.ssl.X509TrustManager; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.storage.DBWriter; +import okhttp3.CipherSuite; +import okhttp3.ConnectionSpec; import okhttp3.Credentials; import okhttp3.HttpUrl; import okhttp3.JavaNetCookieJar; @@ -141,6 +145,21 @@ public class AntennapodHttpClient { if(16 <= Build.VERSION.SDK_INT && Build.VERSION.SDK_INT < 21) { builder.sslSocketFactory(new CustomSslSocketFactory(), trustManager()); } + + if(Build.VERSION.SDK_INT < 21) { + // workaround for Android 4.x for certain web sites. + // see: https://github.com/square/okhttp/issues/4053#issuecomment-402579554 + List cipherSuites = new ArrayList<>(); + cipherSuites.addAll(ConnectionSpec.MODERN_TLS.cipherSuites()); + cipherSuites.add(CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA); + cipherSuites.add(CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA); + + ConnectionSpec legacyTls = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS) + .cipherSuites(cipherSuites.toArray(new CipherSuite[0])) + .build(); + builder.connectionSpecs(Arrays.asList(legacyTls, ConnectionSpec.CLEARTEXT)); + } + return builder; } -- cgit v1.2.3 From c41c8765b691bed6a04bd262025cdde5f245535c Mon Sep 17 00:00:00 2001 From: orionlee Date: Mon, 23 Sep 2019 14:22:16 -0700 Subject: SSL android 4 fix - fix code styles --- .../danoeh/antennapod/core/service/download/AntennapodHttpClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java index e6886c655..04a6d5882 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java @@ -142,11 +142,11 @@ public class AntennapodHttpClient { }); } } - if(16 <= Build.VERSION.SDK_INT && Build.VERSION.SDK_INT < 21) { + if (16 <= Build.VERSION.SDK_INT && Build.VERSION.SDK_INT < 21) { builder.sslSocketFactory(new CustomSslSocketFactory(), trustManager()); } - if(Build.VERSION.SDK_INT < 21) { + if (Build.VERSION.SDK_INT < 21) { // workaround for Android 4.x for certain web sites. // see: https://github.com/square/okhttp/issues/4053#issuecomment-402579554 List cipherSuites = new ArrayList<>(); -- cgit v1.2.3 From 58348908ea5821af5e6e8be823e43bdd4450b006 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Tue, 24 Sep 2019 11:27:08 +0200 Subject: Fixed checkstyle violations --- .../java/de/danoeh/antennapod/core/glide/ApOkHttpUrlLoader.java | 8 ++++++-- .../danoeh/antennapod/core/service/download/DownloadService.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/glide/ApOkHttpUrlLoader.java b/core/src/main/java/de/danoeh/antennapod/core/glide/ApOkHttpUrlLoader.java index b75e1630c..bb34e2c0f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/glide/ApOkHttpUrlLoader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/glide/ApOkHttpUrlLoader.java @@ -21,8 +21,12 @@ import de.danoeh.antennapod.core.service.download.AntennapodHttpClient; import de.danoeh.antennapod.core.service.download.HttpDownloader; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.util.NetworkUtils; -import okhttp3.*; -import okhttp3.internal.http.RealResponseBody; +import okhttp3.Interceptor; +import okhttp3.OkHttpClient; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; /** * @see com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java index e4dedc23b..0f346893e 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java @@ -1076,7 +1076,7 @@ public class DownloadService extends Service { private static String compileNotificationString(List downloads) { List lines = new ArrayList<>(downloads.size()); for (Downloader downloader : downloads) { - StringBuilder line = new StringBuilder("\u2022 "); + StringBuilder line = new StringBuilder("• "); DownloadRequest request = downloader.getDownloadRequest(); switch (request.getFeedfileType()) { case Feed.FEEDFILETYPE_FEED: -- cgit v1.2.3 From 907867652f94cdaad11d02a54cd39da8996ba213 Mon Sep 17 00:00:00 2001 From: orionlee Date: Sat, 31 Aug 2019 16:10:07 -0700 Subject: Refactor automatic feed update - remove extra threads no longer necessary. --- .../core/receiver/FeedUpdateReceiver.java | 6 ++-- .../antennapod/core/service/FeedUpdateWorker.java | 26 +++++++++++++--- .../antennapod/core/util/FeedUpdateUtils.java | 36 ---------------------- .../core/util/download/AutoUpdateManager.java | 24 +++++++++++++-- 4 files changed, 46 insertions(+), 46 deletions(-) delete mode 100644 core/src/main/java/de/danoeh/antennapod/core/util/FeedUpdateUtils.java (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java b/core/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java index 126f12247..cc5f49dc1 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java +++ b/core/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java @@ -6,8 +6,7 @@ import android.content.Intent; import android.util.Log; import de.danoeh.antennapod.core.ClientConfig; -import de.danoeh.antennapod.core.preferences.UserPreferences; -import de.danoeh.antennapod.core.util.FeedUpdateUtils; +import de.danoeh.antennapod.core.util.download.AutoUpdateManager; /** * Refreshes all feeds when it receives an intent @@ -20,7 +19,8 @@ public class FeedUpdateReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { Log.d(TAG, "Received intent"); ClientConfig.initialize(context); - FeedUpdateUtils.startAutoUpdate(context, null); + + AutoUpdateManager.runImmediate(); } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java index efdb96dc1..f551ffa39 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java @@ -2,17 +2,26 @@ package de.danoeh.antennapod.core.service; import android.content.Context; import android.support.annotation.NonNull; +import android.util.Log; + import androidx.work.Worker; import androidx.work.WorkerParameters; -import de.danoeh.antennapod.core.ClientConfig; -import de.danoeh.antennapod.core.preferences.UserPreferences; -import de.danoeh.antennapod.core.util.FeedUpdateUtils; + import org.awaitility.Awaitility; import java.util.concurrent.atomic.AtomicBoolean; +import de.danoeh.antennapod.core.ClientConfig; +import de.danoeh.antennapod.core.preferences.UserPreferences; +import de.danoeh.antennapod.core.storage.DBTasks; +import de.danoeh.antennapod.core.util.NetworkUtils; + public class FeedUpdateWorker extends Worker { + private static final String TAG = "FeedUpdateWorker"; + + public static final String PARAM_RUN_IMMEDIATE = "runImmediate"; + public FeedUpdateWorker(@NonNull Context context, @NonNull WorkerParameters params) { super(context, params); } @@ -20,13 +29,20 @@ public class FeedUpdateWorker extends Worker { @Override @NonNull public Result doWork() { + final boolean isImmediate = getInputData() != null ? + getInputData().getBoolean(PARAM_RUN_IMMEDIATE, false) : false; + Log.d(TAG, "doWork() : isImmediate = " + isImmediate); ClientConfig.initialize(getApplicationContext()); AtomicBoolean finished = new AtomicBoolean(false); - FeedUpdateUtils.startAutoUpdate(getApplicationContext(), () -> finished.set(true)); + if (NetworkUtils.networkAvailable() && NetworkUtils.isFeedRefreshAllowed()) { + DBTasks.refreshAllFeeds(getApplicationContext(), null, () -> finished.set(true)); + } else { + Log.d(TAG, "Blocking automatic update: no wifi available / no mobile updates allowed"); + } Awaitility.await().until(finished::get); - if (UserPreferences.isAutoUpdateTimeOfDay()) { + if (!isImmediate && UserPreferences.isAutoUpdateTimeOfDay()) { // WorkManager does not allow to set specific time for repeated tasks. // We repeatedly schedule a OneTimeWorkRequest instead. UserPreferences.restartUpdateAlarm(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/FeedUpdateUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/FeedUpdateUtils.java deleted file mode 100644 index b425687ae..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/util/FeedUpdateUtils.java +++ /dev/null @@ -1,36 +0,0 @@ -package de.danoeh.antennapod.core.util; - -import android.content.Context; -import android.util.Log; - -import org.awaitility.core.ConditionTimeoutException; - -import java.util.concurrent.TimeUnit; - -import de.danoeh.antennapod.core.storage.DBTasks; - -import static org.awaitility.Awaitility.with; - -public class FeedUpdateUtils { - private static final String TAG = "FeedUpdateUtils"; - - private FeedUpdateUtils() {} - - public static void startAutoUpdate(Context context, Runnable callback) { - // the network check is blocking for possibly a long time: so run the logic - // in a separate thread to prevent the code blocking the callers - final Runnable runnable = () -> { - try { - with().pollInterval(1, TimeUnit.SECONDS) - .await() - .atMost(10, TimeUnit.SECONDS) - .until(() -> NetworkUtils.networkAvailable() && NetworkUtils.isFeedRefreshAllowed()); - DBTasks.refreshAllFeeds(context, null, callback); - } catch (ConditionTimeoutException ignore) { - Log.d(TAG, "Blocking automatic update: no wifi available / no mobile updates allowed"); - } - }; - new Thread(runnable).start(); - } - -} diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java b/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java index 412b150fa..6bf3631e7 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java @@ -1,21 +1,25 @@ package de.danoeh.antennapod.core.util.download; import android.util.Log; + import androidx.work.Constraints; +import androidx.work.Data; import androidx.work.ExistingPeriodicWorkPolicy; import androidx.work.ExistingWorkPolicy; import androidx.work.NetworkType; import androidx.work.OneTimeWorkRequest; import androidx.work.PeriodicWorkRequest; import androidx.work.WorkManager; -import de.danoeh.antennapod.core.preferences.UserPreferences; -import de.danoeh.antennapod.core.service.FeedUpdateWorker; import java.util.Calendar; import java.util.concurrent.TimeUnit; +import de.danoeh.antennapod.core.preferences.UserPreferences; +import de.danoeh.antennapod.core.service.FeedUpdateWorker; + public class AutoUpdateManager { private static final String WORK_ID_FEED_UPDATE = FeedUpdateWorker.class.getName(); + private static final String WORK_ID_FEED_UPDATE_IMMEDIATE = FeedUpdateWorker.class.getName() +"Immediate"; private static final String TAG = "AutoUpdateManager"; private AutoUpdateManager() { @@ -60,6 +64,22 @@ public class AutoUpdateManager { WorkManager.getInstance().enqueueUniqueWork(WORK_ID_FEED_UPDATE, ExistingWorkPolicy.REPLACE, workRequest); } + public static void runImmediate() { + Log.d(TAG, "Run auto update immediately."); + + OneTimeWorkRequest workRequest = new OneTimeWorkRequest.Builder(FeedUpdateWorker.class) + .setConstraints(getConstraints()) + .setInitialDelay(0L, TimeUnit.MILLISECONDS) + .setInputData(new Data.Builder() + .putBoolean(FeedUpdateWorker.PARAM_RUN_IMMEDIATE, true) + .build() + ) + .build(); + + WorkManager.getInstance().enqueueUniqueWork(WORK_ID_FEED_UPDATE_IMMEDIATE, ExistingWorkPolicy.REPLACE, workRequest); + + } + public static void disableAutoUpdate() { WorkManager.getInstance().cancelUniqueWork(WORK_ID_FEED_UPDATE); } -- cgit v1.2.3 From 366146d22e1d29ea51e6a275d9c7cf8bd351a429 Mon Sep 17 00:00:00 2001 From: orionlee Date: Sun, 1 Sep 2019 09:46:25 -0700 Subject: prevent deadlock in case auto feed update is blocked per review. --- .../main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java index f551ffa39..da3bfe734 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java @@ -34,13 +34,13 @@ public class FeedUpdateWorker extends Worker { Log.d(TAG, "doWork() : isImmediate = " + isImmediate); ClientConfig.initialize(getApplicationContext()); - AtomicBoolean finished = new AtomicBoolean(false); if (NetworkUtils.networkAvailable() && NetworkUtils.isFeedRefreshAllowed()) { + AtomicBoolean finished = new AtomicBoolean(false); DBTasks.refreshAllFeeds(getApplicationContext(), null, () -> finished.set(true)); + Awaitility.await().until(finished::get); } else { Log.d(TAG, "Blocking automatic update: no wifi available / no mobile updates allowed"); } - Awaitility.await().until(finished::get); if (!isImmediate && UserPreferences.isAutoUpdateTimeOfDay()) { // WorkManager does not allow to set specific time for repeated tasks. -- cgit v1.2.3 From ce96eeafb6a8945536cecb2476173e7991126754 Mon Sep 17 00:00:00 2001 From: orionlee Date: Sun, 1 Sep 2019 09:51:31 -0700 Subject: simplify param logic (getInputData() is @NonNull) --- .../main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java index da3bfe734..364e3c638 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java @@ -29,8 +29,7 @@ public class FeedUpdateWorker extends Worker { @Override @NonNull public Result doWork() { - final boolean isImmediate = getInputData() != null ? - getInputData().getBoolean(PARAM_RUN_IMMEDIATE, false) : false; + final boolean isImmediate = getInputData().getBoolean(PARAM_RUN_IMMEDIATE, false); Log.d(TAG, "doWork() : isImmediate = " + isImmediate); ClientConfig.initialize(getApplicationContext()); -- cgit v1.2.3 From 608b874057df09571e8ea93b75ca07f1a41edb00 Mon Sep 17 00:00:00 2001 From: orionlee Date: Sun, 1 Sep 2019 10:02:36 -0700 Subject: Make feed update work IDs not dependent on classname to avoid accidental changing of IDs due to class refactoring. --- .../de/danoeh/antennapod/core/util/download/AutoUpdateManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java b/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java index 6bf3631e7..a92c4b740 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java @@ -18,8 +18,8 @@ import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.service.FeedUpdateWorker; public class AutoUpdateManager { - private static final String WORK_ID_FEED_UPDATE = FeedUpdateWorker.class.getName(); - private static final String WORK_ID_FEED_UPDATE_IMMEDIATE = FeedUpdateWorker.class.getName() +"Immediate"; + private static final String WORK_ID_FEED_UPDATE = "de.danoeh.antennapod.core.service.FeedUpdateWorker"; + private static final String WORK_ID_FEED_UPDATE_IMMEDIATE = WORK_ID_FEED_UPDATE + "Immediate"; private static final String TAG = "AutoUpdateManager"; private AutoUpdateManager() { -- cgit v1.2.3 From 0ddda3a0d2719d4bae701ff8106501ade8bf4984 Mon Sep 17 00:00:00 2001 From: orionlee Date: Sun, 1 Sep 2019 10:56:42 -0700 Subject: remove unnecessary thread DBTasks.refreshAllFeeds(): it is invoked by FeedUpdateWorker in background only. --- .../antennapod/core/service/FeedUpdateWorker.java | 8 +--- .../de/danoeh/antennapod/core/storage/DBTasks.java | 56 ++++++++-------------- 2 files changed, 21 insertions(+), 43 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java index 364e3c638..27f3c310a 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java @@ -7,10 +7,6 @@ import android.util.Log; import androidx.work.Worker; import androidx.work.WorkerParameters; -import org.awaitility.Awaitility; - -import java.util.concurrent.atomic.AtomicBoolean; - import de.danoeh.antennapod.core.ClientConfig; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.storage.DBTasks; @@ -34,9 +30,7 @@ public class FeedUpdateWorker extends Worker { ClientConfig.initialize(getApplicationContext()); if (NetworkUtils.networkAvailable() && NetworkUtils.isFeedRefreshAllowed()) { - AtomicBoolean finished = new AtomicBoolean(false); - DBTasks.refreshAllFeeds(getApplicationContext(), null, () -> finished.set(true)); - Awaitility.await().until(finished::get); + DBTasks.refreshAllFeeds(getApplicationContext()); } else { Log.d(TAG, "Blocking automatic update: no wifi available / no mobile updates allowed"); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java index 0fb181299..cd5a83f48 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java @@ -3,7 +3,7 @@ package de.danoeh.antennapod.core.storage; import android.content.Context; import android.content.SharedPreferences; import android.database.Cursor; -import android.support.annotation.Nullable; +import android.os.Looper; import android.util.Log; import java.util.ArrayList; @@ -144,53 +144,37 @@ public final class DBTasks { private static final AtomicBoolean isRefreshing = new AtomicBoolean(false); /** - * Refreshes a given list of Feeds in a separate Thread. This method might ignore subsequent calls if it is still + * Refreshes all feeds. + * It must not be from the main thread. + * This method might ignore subsequent calls if it is still * enqueuing Feeds for download from a previous call * * @param context Might be used for accessing the database - * @param feeds List of Feeds that should be refreshed. */ - public static void refreshAllFeeds(final Context context, final List feeds) { - refreshAllFeeds(context, feeds, null); - } - - /** - * Refreshes a given list of Feeds in a separate Thread. This method might ignore subsequent calls if it is still - * enqueuing Feeds for download from a previous call - * - * @param context Might be used for accessing the database - * @param feeds List of Feeds that should be refreshed. - * @param callback Called after everything was added enqueued for download. Might be null. - */ - public static void refreshAllFeeds(final Context context, final List feeds, @Nullable Runnable callback) { + public static void refreshAllFeeds(final Context context) { if (!isRefreshing.compareAndSet(false, true)) { Log.d(TAG, "Ignoring request to refresh all feeds: Refresh lock is locked"); return; } - new Thread(() -> { - if (feeds != null) { - refreshFeeds(context, feeds); - } else { - refreshFeeds(context, DBReader.getFeedList()); - } - isRefreshing.set(false); + if (Looper.myLooper() == Looper.getMainLooper()) { + Log.wtf(TAG, "DBTasks.refreshAllFeeds() must not be called from the main thread"); + return; + } - SharedPreferences prefs = context.getSharedPreferences(PREF_NAME, MODE_PRIVATE); - prefs.edit().putLong(PREF_LAST_REFRESH, System.currentTimeMillis()).apply(); + refreshFeeds(context, DBReader.getFeedList()); + isRefreshing.set(false); - if (ClientConfig.gpodnetCallbacks.gpodnetEnabled()) { - GpodnetSyncService.sendSyncIntent(context); - } - // Note: automatic download of episodes will be done but not here. - // Instead it is done after all feeds have been refreshed (asynchronously), - // in DownloadService.onDestroy() - // See Issue #2577 for the details of the rationale + SharedPreferences prefs = context.getSharedPreferences(PREF_NAME, MODE_PRIVATE); + prefs.edit().putLong(PREF_LAST_REFRESH, System.currentTimeMillis()).apply(); - if (callback != null) { - callback.run(); - } - }).start(); + if (ClientConfig.gpodnetCallbacks.gpodnetEnabled()) { + GpodnetSyncService.sendSyncIntent(context); + } + // Note: automatic download of episodes will be done but not here. + // Instead it is done after all feeds have been refreshed (asynchronously), + // in DownloadService.onDestroy() + // See Issue #2577 for the details of the rationale } /** -- cgit v1.2.3 From 8dc9939736b3b1381a8e550c05adc853de4833b5 Mon Sep 17 00:00:00 2001 From: orionlee Date: Sun, 1 Sep 2019 13:15:02 -0700 Subject: change refreshAllFeeds() main thread call guard to exception. --- core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java index cd5a83f48..4c15f5f00 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java @@ -158,8 +158,7 @@ public final class DBTasks { } if (Looper.myLooper() == Looper.getMainLooper()) { - Log.wtf(TAG, "DBTasks.refreshAllFeeds() must not be called from the main thread"); - return; + throw new IllegalStateException("DBTasks.refreshAllFeeds() must not be called from the main thread."); } refreshFeeds(context, DBReader.getFeedList()); -- cgit v1.2.3 From 33eddaa2565aef9d82da795549f780d122c9f44f Mon Sep 17 00:00:00 2001 From: orionlee Date: Tue, 24 Sep 2019 11:02:49 -0700 Subject: auto feed update - make the calls from UI use background thread rather than WorkManager to ensure the updates are immediate. --- .../core/receiver/FeedUpdateReceiver.java | 2 +- .../antennapod/core/service/FeedUpdateWorker.java | 8 +++--- .../core/util/download/AutoUpdateManager.java | 32 ++++++++++++++++++---- 3 files changed, 32 insertions(+), 10 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java b/core/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java index cc5f49dc1..af0a0d426 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java +++ b/core/src/main/java/de/danoeh/antennapod/core/receiver/FeedUpdateReceiver.java @@ -20,7 +20,7 @@ public class FeedUpdateReceiver extends BroadcastReceiver { Log.d(TAG, "Received intent"); ClientConfig.initialize(context); - AutoUpdateManager.runImmediate(); + AutoUpdateManager.runOnce(); } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java index 27f3c310a..92d43cea2 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java @@ -16,7 +16,7 @@ public class FeedUpdateWorker extends Worker { private static final String TAG = "FeedUpdateWorker"; - public static final String PARAM_RUN_IMMEDIATE = "runImmediate"; + public static final String PARAM_RUN_ONCE = "runOnce"; public FeedUpdateWorker(@NonNull Context context, @NonNull WorkerParameters params) { super(context, params); @@ -25,8 +25,8 @@ public class FeedUpdateWorker extends Worker { @Override @NonNull public Result doWork() { - final boolean isImmediate = getInputData().getBoolean(PARAM_RUN_IMMEDIATE, false); - Log.d(TAG, "doWork() : isImmediate = " + isImmediate); + final boolean isRunOnce = getInputData().getBoolean(PARAM_RUN_ONCE, false); + Log.d(TAG, "doWork() : isRunOnce = " + isRunOnce); ClientConfig.initialize(getApplicationContext()); if (NetworkUtils.networkAvailable() && NetworkUtils.isFeedRefreshAllowed()) { @@ -35,7 +35,7 @@ public class FeedUpdateWorker extends Worker { Log.d(TAG, "Blocking automatic update: no wifi available / no mobile updates allowed"); } - if (!isImmediate && UserPreferences.isAutoUpdateTimeOfDay()) { + if (!isRunOnce && UserPreferences.isAutoUpdateTimeOfDay()) { // WorkManager does not allow to set specific time for repeated tasks. // We repeatedly schedule a OneTimeWorkRequest instead. UserPreferences.restartUpdateAlarm(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java b/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java index a92c4b740..e3cb03077 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java @@ -1,5 +1,7 @@ package de.danoeh.antennapod.core.util.download; +import android.content.Context; +import android.support.annotation.NonNull; import android.util.Log; import androidx.work.Constraints; @@ -16,10 +18,11 @@ import java.util.concurrent.TimeUnit; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.service.FeedUpdateWorker; +import de.danoeh.antennapod.core.storage.DBTasks; public class AutoUpdateManager { private static final String WORK_ID_FEED_UPDATE = "de.danoeh.antennapod.core.service.FeedUpdateWorker"; - private static final String WORK_ID_FEED_UPDATE_IMMEDIATE = WORK_ID_FEED_UPDATE + "Immediate"; + private static final String WORK_ID_FEED_UPDATE_ONCE = WORK_ID_FEED_UPDATE + "Once"; private static final String TAG = "AutoUpdateManager"; private AutoUpdateManager() { @@ -64,20 +67,39 @@ public class AutoUpdateManager { WorkManager.getInstance().enqueueUniqueWork(WORK_ID_FEED_UPDATE, ExistingWorkPolicy.REPLACE, workRequest); } - public static void runImmediate() { - Log.d(TAG, "Run auto update immediately."); + /** + * Run auto feed refresh once in background, as soon as what OS scheduling allows. + * + * Callers from UI should use {@link #runImmediate(Context)}, as it will guarantee + * the refresh be run immediately. + */ + public static void runOnce() { + Log.d(TAG, "Run auto update once, as soon as OS allows."); OneTimeWorkRequest workRequest = new OneTimeWorkRequest.Builder(FeedUpdateWorker.class) .setConstraints(getConstraints()) .setInitialDelay(0L, TimeUnit.MILLISECONDS) .setInputData(new Data.Builder() - .putBoolean(FeedUpdateWorker.PARAM_RUN_IMMEDIATE, true) + .putBoolean(FeedUpdateWorker.PARAM_RUN_ONCE, true) .build() ) .build(); - WorkManager.getInstance().enqueueUniqueWork(WORK_ID_FEED_UPDATE_IMMEDIATE, ExistingWorkPolicy.REPLACE, workRequest); + WorkManager.getInstance().enqueueUniqueWork(WORK_ID_FEED_UPDATE_ONCE, ExistingWorkPolicy.REPLACE, workRequest); + + } + /** + /** + * Run auto feed refresh once in background immediately, using its own thread. + * + * Callers where the additional threads is not suitable should use {@link #runOnce()} + */ + public static void runImmediate(@NonNull Context context) { + Log.d(TAG, "Run auto update immediately in background."); + new Thread(() -> { + DBTasks.refreshAllFeeds(context.getApplicationContext()); + }, "ManualRefreshAllFeeds").start(); } public static void disableAutoUpdate() { -- cgit v1.2.3 From 26b7f6c30088bbcf61a6224f59936c118ce50d02 Mon Sep 17 00:00:00 2001 From: orionlee Date: Tue, 24 Sep 2019 11:14:35 -0700 Subject: auto feed update mini-refactor: move periodic update entry point method from UserPreference to AutoUpdateManager --- .../core/preferences/UserPreferences.java | 17 ++--------------- .../antennapod/core/service/FeedUpdateWorker.java | 3 ++- .../core/util/download/AutoUpdateManager.java | 22 ++++++++++++++++++++-- 3 files changed, 24 insertions(+), 18 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index a06047229..787e32ccc 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -622,7 +622,7 @@ public class UserPreferences { .apply(); // when updating with an interval, we assume the user wants // to update *now* and then every 'hours' interval thereafter. - restartUpdateAlarm(); + AutoUpdateManager.restartUpdateAlarm(); } /** @@ -632,7 +632,7 @@ public class UserPreferences { prefs.edit() .putString(PREF_UPDATE_INTERVAL, hourOfDay + ":" + minute) .apply(); - restartUpdateAlarm(); + AutoUpdateManager.restartUpdateAlarm(); } public static void disableAutoUpdate() { @@ -882,19 +882,6 @@ public class UserPreferences { return getUpdateTimeOfDay().length == 2; } - public static void restartUpdateAlarm() { - if (isAutoUpdateDisabled()) { - AutoUpdateManager.disableAutoUpdate(); - } else if (isAutoUpdateTimeOfDay()) { - int[] timeOfDay = getUpdateTimeOfDay(); - Log.d(TAG, "timeOfDay: " + Arrays.toString(timeOfDay)); - AutoUpdateManager.restartUpdateTimeOfDayAlarm(timeOfDay[0], timeOfDay[1]); - } else { - long milliseconds = getUpdateInterval(); - AutoUpdateManager.restartUpdateIntervalAlarm(milliseconds); - } - } - /** * Evaluates whether Cast support (Chromecast, Audio Cast, etc) is enabled on the preferences. */ diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java index 92d43cea2..87c18227b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java @@ -11,6 +11,7 @@ import de.danoeh.antennapod.core.ClientConfig; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.util.NetworkUtils; +import de.danoeh.antennapod.core.util.download.AutoUpdateManager; public class FeedUpdateWorker extends Worker { @@ -38,7 +39,7 @@ public class FeedUpdateWorker extends Worker { if (!isRunOnce && UserPreferences.isAutoUpdateTimeOfDay()) { // WorkManager does not allow to set specific time for repeated tasks. // We repeatedly schedule a OneTimeWorkRequest instead. - UserPreferences.restartUpdateAlarm(); + AutoUpdateManager.restartUpdateAlarm(); } return Result.success(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java b/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java index e3cb03077..ebeec058d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java @@ -13,6 +13,7 @@ import androidx.work.OneTimeWorkRequest; import androidx.work.PeriodicWorkRequest; import androidx.work.WorkManager; +import java.util.Arrays; import java.util.Calendar; import java.util.concurrent.TimeUnit; @@ -29,10 +30,26 @@ public class AutoUpdateManager { } + /** + * Start / restart periodic auto feed refresh + */ + public static void restartUpdateAlarm() { + if (UserPreferences.isAutoUpdateDisabled()) { + disableAutoUpdate(); + } else if (UserPreferences.isAutoUpdateTimeOfDay()) { + int[] timeOfDay = UserPreferences.getUpdateTimeOfDay(); + Log.d(TAG, "timeOfDay: " + Arrays.toString(timeOfDay)); + restartUpdateTimeOfDayAlarm(timeOfDay[0], timeOfDay[1]); + } else { + long milliseconds = UserPreferences.getUpdateInterval(); + restartUpdateIntervalAlarm(milliseconds); + } + } + /** * Sets the interval in which the feeds are refreshed automatically */ - public static void restartUpdateIntervalAlarm(long intervalMillis) { + private static void restartUpdateIntervalAlarm(long intervalMillis) { Log.d(TAG, "Restarting update alarm."); PeriodicWorkRequest workRequest = new PeriodicWorkRequest.Builder(FeedUpdateWorker.class, @@ -47,7 +64,7 @@ public class AutoUpdateManager { /** * Sets time of day the feeds are refreshed automatically */ - public static void restartUpdateTimeOfDayAlarm(int hoursOfDay, int minute) { + private static void restartUpdateTimeOfDayAlarm(int hoursOfDay, int minute) { Log.d(TAG, "Restarting update alarm."); Calendar now = Calendar.getInstance(); @@ -116,4 +133,5 @@ public class AutoUpdateManager { } return constraints.build(); } + } -- cgit v1.2.3 From b65c688b53779f436062d33517f95b2c0a29733c Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 25 Sep 2019 15:00:33 +0200 Subject: Fixed crash if there is no browser installed --- .../java/de/danoeh/antennapod/core/util/IntentUtils.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java index e81ab47ed..656b518bf 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java @@ -1,13 +1,20 @@ package de.danoeh.antennapod.core.util; +import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; +import android.net.Uri; +import android.util.Log; +import android.widget.Toast; +import de.danoeh.antennapod.core.R; import java.util.List; public class IntentUtils { + private static final String TAG = "IntentUtils"; + private IntentUtils(){} /* @@ -28,4 +35,13 @@ public class IntentUtils { context.sendBroadcast(new Intent(action).setPackage(context.getPackageName())); } + public static void openInBrowser(Context context, String url) { + try { + Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); + context.startActivity(myIntent); + } catch (ActivityNotFoundException e) { + Toast.makeText(context, R.string.pref_no_browser_found, Toast.LENGTH_LONG).show(); + Log.e(TAG, Log.getStackTraceString(e)); + } + } } -- cgit v1.2.3 From 72d5c65c4f696b74dd7d217eb45bef5ad1bd619d Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 25 Sep 2019 15:24:23 +0200 Subject: Removed transparent notification button outline --- .../playback/PlaybackServiceNotificationBuilder.java | 12 ++++++------ .../main/res/drawable-hdpi/ic_media_cast_disconnect.png | Bin 2355 -> 0 bytes .../main/res/drawable-mdpi/ic_media_cast_disconnect.png | Bin 1467 -> 0 bytes .../main/res/drawable-xhdpi/ic_media_cast_disconnect.png | Bin 4496 -> 0 bytes .../res/drawable-xxhdpi/ic_media_cast_disconnect.png | Bin 7096 -> 0 bytes core/src/main/res/drawable/ic_notification_cast_off.xml | 5 +++++ .../main/res/drawable/ic_notification_fast_forward.xml | 5 +++++ .../main/res/drawable/ic_notification_fast_rewind.xml | 5 +++++ core/src/main/res/drawable/ic_notification_key.xml | 9 +++++---- core/src/main/res/drawable/ic_notification_pause.xml | 5 +++++ core/src/main/res/drawable/ic_notification_play.xml | 5 +++++ core/src/main/res/drawable/ic_notification_skip.xml | 5 +++++ 12 files changed, 41 insertions(+), 10 deletions(-) delete mode 100644 core/src/main/res/drawable-hdpi/ic_media_cast_disconnect.png delete mode 100644 core/src/main/res/drawable-mdpi/ic_media_cast_disconnect.png delete mode 100644 core/src/main/res/drawable-xhdpi/ic_media_cast_disconnect.png delete mode 100644 core/src/main/res/drawable-xxhdpi/ic_media_cast_disconnect.png create mode 100644 core/src/main/res/drawable/ic_notification_cast_off.xml create mode 100644 core/src/main/res/drawable/ic_notification_fast_forward.xml create mode 100644 core/src/main/res/drawable/ic_notification_fast_rewind.xml create mode 100644 core/src/main/res/drawable/ic_notification_pause.xml create mode 100644 core/src/main/res/drawable/ic_notification_play.xml create mode 100644 core/src/main/res/drawable/ic_notification_skip.xml (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceNotificationBuilder.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceNotificationBuilder.java index 0e7339ac4..1a13fe5a7 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceNotificationBuilder.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceNotificationBuilder.java @@ -115,7 +115,7 @@ public class PlaybackServiceNotificationBuilder extends NotificationCompat.Build stopCastingIntent.putExtra(PlaybackService.EXTRA_CAST_DISCONNECT, true); PendingIntent stopCastingPendingIntent = PendingIntent.getService(context, numActions, stopCastingIntent, PendingIntent.FLAG_UPDATE_CURRENT); - addAction(R.drawable.ic_media_cast_disconnect, + addAction(R.drawable.ic_notification_cast_off, context.getString(R.string.cast_disconnect_label), stopCastingPendingIntent); numActions++; @@ -124,7 +124,7 @@ public class PlaybackServiceNotificationBuilder extends NotificationCompat.Build // always let them rewind PendingIntent rewindButtonPendingIntent = getPendingIntentForMediaAction( KeyEvent.KEYCODE_MEDIA_REWIND, numActions); - addAction(android.R.drawable.ic_media_rew, context.getString(R.string.rewind_label), rewindButtonPendingIntent); + addAction(R.drawable.ic_notification_fast_rewind, context.getString(R.string.rewind_label), rewindButtonPendingIntent); if (UserPreferences.showRewindOnCompactNotification()) { compactActionList.add(numActions); } @@ -133,14 +133,14 @@ public class PlaybackServiceNotificationBuilder extends NotificationCompat.Build if (playerStatus == PlayerStatus.PLAYING) { PendingIntent pauseButtonPendingIntent = getPendingIntentForMediaAction( KeyEvent.KEYCODE_MEDIA_PAUSE, numActions); - addAction(android.R.drawable.ic_media_pause, //pause action + addAction(R.drawable.ic_notification_pause, //pause action context.getString(R.string.pause_label), pauseButtonPendingIntent); compactActionList.add(numActions++); } else { PendingIntent playButtonPendingIntent = getPendingIntentForMediaAction( KeyEvent.KEYCODE_MEDIA_PLAY, numActions); - addAction(android.R.drawable.ic_media_play, //play action + addAction(R.drawable.ic_notification_play, //play action context.getString(R.string.play_label), playButtonPendingIntent); compactActionList.add(numActions++); @@ -149,7 +149,7 @@ public class PlaybackServiceNotificationBuilder extends NotificationCompat.Build // ff follows play, then we have skip (if it's present) PendingIntent ffButtonPendingIntent = getPendingIntentForMediaAction( KeyEvent.KEYCODE_MEDIA_FAST_FORWARD, numActions); - addAction(android.R.drawable.ic_media_ff, context.getString(R.string.fast_forward_label), ffButtonPendingIntent); + addAction(R.drawable.ic_notification_fast_forward, context.getString(R.string.fast_forward_label), ffButtonPendingIntent); if (UserPreferences.showFastForwardOnCompactNotification()) { compactActionList.add(numActions); } @@ -158,7 +158,7 @@ public class PlaybackServiceNotificationBuilder extends NotificationCompat.Build if (UserPreferences.isFollowQueue()) { PendingIntent skipButtonPendingIntent = getPendingIntentForMediaAction( KeyEvent.KEYCODE_MEDIA_NEXT, numActions); - addAction(android.R.drawable.ic_media_next, + addAction(R.drawable.ic_notification_skip, context.getString(R.string.skip_episode_label), skipButtonPendingIntent); if (UserPreferences.showSkipOnCompactNotification()) { diff --git a/core/src/main/res/drawable-hdpi/ic_media_cast_disconnect.png b/core/src/main/res/drawable-hdpi/ic_media_cast_disconnect.png deleted file mode 100644 index 700c116e5..000000000 Binary files a/core/src/main/res/drawable-hdpi/ic_media_cast_disconnect.png and /dev/null differ diff --git a/core/src/main/res/drawable-mdpi/ic_media_cast_disconnect.png b/core/src/main/res/drawable-mdpi/ic_media_cast_disconnect.png deleted file mode 100644 index 767f420df..000000000 Binary files a/core/src/main/res/drawable-mdpi/ic_media_cast_disconnect.png and /dev/null differ diff --git a/core/src/main/res/drawable-xhdpi/ic_media_cast_disconnect.png b/core/src/main/res/drawable-xhdpi/ic_media_cast_disconnect.png deleted file mode 100644 index 740867129..000000000 Binary files a/core/src/main/res/drawable-xhdpi/ic_media_cast_disconnect.png and /dev/null differ diff --git a/core/src/main/res/drawable-xxhdpi/ic_media_cast_disconnect.png b/core/src/main/res/drawable-xxhdpi/ic_media_cast_disconnect.png deleted file mode 100644 index 2d2ec9035..000000000 Binary files a/core/src/main/res/drawable-xxhdpi/ic_media_cast_disconnect.png and /dev/null differ diff --git a/core/src/main/res/drawable/ic_notification_cast_off.xml b/core/src/main/res/drawable/ic_notification_cast_off.xml new file mode 100644 index 000000000..63a21fbe2 --- /dev/null +++ b/core/src/main/res/drawable/ic_notification_cast_off.xml @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/core/src/main/res/drawable/ic_notification_fast_forward.xml b/core/src/main/res/drawable/ic_notification_fast_forward.xml new file mode 100644 index 000000000..bf564977c --- /dev/null +++ b/core/src/main/res/drawable/ic_notification_fast_forward.xml @@ -0,0 +1,5 @@ + + + diff --git a/core/src/main/res/drawable/ic_notification_fast_rewind.xml b/core/src/main/res/drawable/ic_notification_fast_rewind.xml new file mode 100644 index 000000000..847159cc5 --- /dev/null +++ b/core/src/main/res/drawable/ic_notification_fast_rewind.xml @@ -0,0 +1,5 @@ + + + diff --git a/core/src/main/res/drawable/ic_notification_key.xml b/core/src/main/res/drawable/ic_notification_key.xml index b1e2f9b8c..c8a817eeb 100644 --- a/core/src/main/res/drawable/ic_notification_key.xml +++ b/core/src/main/res/drawable/ic_notification_key.xml @@ -1,5 +1,6 @@ - - + + diff --git a/core/src/main/res/drawable/ic_notification_pause.xml b/core/src/main/res/drawable/ic_notification_pause.xml new file mode 100644 index 000000000..d46efb2f5 --- /dev/null +++ b/core/src/main/res/drawable/ic_notification_pause.xml @@ -0,0 +1,5 @@ + + + diff --git a/core/src/main/res/drawable/ic_notification_play.xml b/core/src/main/res/drawable/ic_notification_play.xml new file mode 100644 index 000000000..d571460c6 --- /dev/null +++ b/core/src/main/res/drawable/ic_notification_play.xml @@ -0,0 +1,5 @@ + + + diff --git a/core/src/main/res/drawable/ic_notification_skip.xml b/core/src/main/res/drawable/ic_notification_skip.xml new file mode 100644 index 000000000..0c65448cc --- /dev/null +++ b/core/src/main/res/drawable/ic_notification_skip.xml @@ -0,0 +1,5 @@ + + + -- cgit v1.2.3 From 56d08c429119a288a6f8f8eddc41b80f2559ffb3 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Thu, 26 Sep 2019 18:49:39 +0200 Subject: Using RxJava to update buffering --- .../core/service/playback/ExoPlayerWrapper.java | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java index 7af33f8f9..af86db633 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java @@ -2,7 +2,6 @@ package de.danoeh.antennapod.core.service.playback; import android.content.Context; import android.net.Uri; -import android.os.Handler; import android.view.SurfaceHolder; import com.google.android.exoplayer2.C; @@ -25,36 +24,36 @@ import com.google.android.exoplayer2.upstream.DataSource; import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; import com.google.android.exoplayer2.util.Util; +import io.reactivex.Observable; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.disposables.Disposable; import org.antennapod.audio.MediaPlayer; import de.danoeh.antennapod.core.util.playback.IPlayer; +import java.util.concurrent.TimeUnit; + public class ExoPlayerWrapper implements IPlayer { private final Context mContext; + private final Disposable bufferingUpdateDisposable; private SimpleExoPlayer mExoPlayer; private MediaSource mediaSource; private MediaPlayer.OnSeekCompleteListener audioSeekCompleteListener; private MediaPlayer.OnCompletionListener audioCompletionListener; private MediaPlayer.OnErrorListener audioErrorListener; private MediaPlayer.OnBufferingUpdateListener bufferingUpdateListener; - private boolean shouldCheckBufferingUpdates = true; ExoPlayerWrapper(Context context) { mContext = context; mExoPlayer = createPlayer(); - Handler handler = new Handler(); // Main thread - handler.postDelayed(new Runnable() { - @Override - public void run() { - if (bufferingUpdateListener != null) { - bufferingUpdateListener.onBufferingUpdate(null, mExoPlayer.getBufferedPercentage()); - } - if (shouldCheckBufferingUpdates) { - handler.postDelayed(this, 2000); - } - } - }, 2000); + bufferingUpdateDisposable = Observable.interval(2, TimeUnit.SECONDS) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(aLong -> { + if (bufferingUpdateListener != null) { + bufferingUpdateListener.onBufferingUpdate(null, mExoPlayer.getBufferedPercentage()); + } + }); } private SimpleExoPlayer createPlayer() { @@ -168,7 +167,7 @@ public class ExoPlayerWrapper implements IPlayer { @Override public void release() { - shouldCheckBufferingUpdates = false; + bufferingUpdateDisposable.dispose(); if (mExoPlayer != null) { mExoPlayer.release(); } -- cgit v1.2.3 From 8b53268bfe89ef174411ca6adfa19cbd418c8440 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Thu, 26 Sep 2019 19:06:26 +0200 Subject: Refactored method for readability --- core/src/main/java/de/danoeh/antennapod/core/event/DownloadEvent.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/event/DownloadEvent.java b/core/src/main/java/de/danoeh/antennapod/core/event/DownloadEvent.java index 124fd3e64..24a71ec96 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/event/DownloadEvent.java +++ b/core/src/main/java/de/danoeh/antennapod/core/event/DownloadEvent.java @@ -25,4 +25,8 @@ public class DownloadEvent { "update=" + update + '}'; } + + public boolean hasChangedFeedUpdateStatus(boolean oldStatus) { + return oldStatus != update.feedIds.length > 0; + } } -- cgit v1.2.3 From d80daee37e0e56573802a793b3dde6d1dc89fa0e Mon Sep 17 00:00:00 2001 From: orionlee Date: Thu, 12 Sep 2019 09:12:28 -0700 Subject: #3387 new permission for WiFi filter UI be compatible with Android 10+ --- core/src/main/AndroidManifest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/AndroidManifest.xml b/core/src/main/AndroidManifest.xml index 7d84bdddb..c57696072 100644 --- a/core/src/main/AndroidManifest.xml +++ b/core/src/main/AndroidManifest.xml @@ -9,11 +9,11 @@ - - + Date: Fri, 13 Sep 2019 12:00:22 -0700 Subject: #3387 ask for location permission for Wi-Fi filter UI on Android 10+. --- core/src/main/res/values/strings.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/src/main') diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index c7bd2d2a2..adf938d75 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -394,6 +394,8 @@ Configure the automatic download of episodes. Enable Wi-Fi filter Allow automatic download only for selected Wi-Fi networks. + Permission required + Location permission is required for Wi-Fi filter. Tap to grant the permission. Download when not charging Allow automatic download when the battery is not charging Parallel Downloads -- cgit v1.2.3 From d559a8b9067d4efefd3ffcd45439909b1ac616ca Mon Sep 17 00:00:00 2001 From: orionlee Date: Fri, 13 Sep 2019 12:53:59 -0700 Subject: #3387 use ACCESS_FINE_LOCATION per Google feedback https://issuetracker.google.com/issues/140696830 --- core/src/main/AndroidManifest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/AndroidManifest.xml b/core/src/main/AndroidManifest.xml index c57696072..7d84bdddb 100644 --- a/core/src/main/AndroidManifest.xml +++ b/core/src/main/AndroidManifest.xml @@ -9,11 +9,11 @@ - - + Date: Sat, 14 Sep 2019 13:14:57 -0700 Subject: #3387 permission prompt - add warning icon to make it stand out. --- core/src/main/res/drawable/ic_warning_red.xml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 core/src/main/res/drawable/ic_warning_red.xml (limited to 'core/src/main') diff --git a/core/src/main/res/drawable/ic_warning_red.xml b/core/src/main/res/drawable/ic_warning_red.xml new file mode 100644 index 000000000..475a41bbb --- /dev/null +++ b/core/src/main/res/drawable/ic_warning_red.xml @@ -0,0 +1,5 @@ + + + -- cgit v1.2.3 From 3041336b92f84f902c75e897316aa19075f9a34d Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 28 Sep 2019 13:04:40 +0200 Subject: Do not notify cancelled downloads --- .../antennapod/core/service/download/DownloadService.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java index 0f346893e..37d778fd6 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java @@ -1058,7 +1058,13 @@ public class DownloadService extends Service { private final Runnable postDownloaderTask = new Runnable() { @Override public void run() { - List list = Collections.unmodifiableList(downloads); + List runningDownloads = new ArrayList<>(); + for (Downloader downloader : downloads) { + if (!downloader.cancelled) { + runningDownloads.add(downloader); + } + } + List list = Collections.unmodifiableList(runningDownloads); EventBus.getDefault().postSticky(DownloadEvent.refresh(list)); postHandler.postDelayed(postDownloaderTask, 1500); } @@ -1076,6 +1082,9 @@ public class DownloadService extends Service { private static String compileNotificationString(List downloads) { List lines = new ArrayList<>(downloads.size()); for (Downloader downloader : downloads) { + if (downloader.cancelled) { + continue; + } StringBuilder line = new StringBuilder("• "); DownloadRequest request = downloader.getDownloadRequest(); switch (request.getFeedfileType()) { -- cgit v1.2.3 From 66cf4a8a438a740ca521b91b0a03a73bdc5d43fc Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 28 Sep 2019 14:20:57 +0200 Subject: Sending event if download was cancelled --- .../core/service/download/DownloadService.java | 28 ++++++++++++++++------ 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java index 37d778fd6..ce61bff68 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java @@ -13,6 +13,7 @@ import android.os.Build; import android.os.Handler; import android.os.IBinder; import android.support.annotation.NonNull; +import android.support.annotation.Nullable; import android.support.v4.app.NotificationCompat; import android.text.TextUtils; import android.util.Log; @@ -190,10 +191,8 @@ public class DownloadService extends Service { handleFailedDownload(status, downloader.getDownloadRequest()); if (type == FeedMedia.FEEDFILETYPE_FEEDMEDIA) { - long id = status.getFeedfileId(); - FeedMedia media = DBReader.getFeedMedia(id); - FeedItem item; - if (media == null || (item = media.getItem()) == null) { + FeedItem item = getFeedItemFromId(status.getFeedfileId()); + if (item == null) { return; } boolean httpNotFound = status.getReason() == DownloadError.ERROR_HTTP_DATA_ERROR @@ -213,9 +212,8 @@ public class DownloadService extends Service { // if FeedMedia download has been canceled, fake FeedItem update // so that lists reload that it if (status.getFeedfileType() == FeedMedia.FEEDFILETYPE_FEEDMEDIA) { - FeedMedia media = DBReader.getFeedMedia(status.getFeedfileId()); - FeedItem item; - if (media == null || (item = media.getItem()) == null) { + FeedItem item = getFeedItemFromId(status.getFeedfileId()); + if (item == null) { return; } EventBus.getDefault().post(FeedItemEvent.updated(item)); @@ -386,6 +384,12 @@ public class DownloadService extends Service { Downloader d = getDownloader(url); if (d != null) { d.cancel(); + DownloadRequester.getInstance().removeDownload(d.getDownloadRequest()); + + FeedItem item = getFeedItemFromId(d.getDownloadRequest().getFeedfileId()); + if (item != null) { + EventBus.getDefault().post(FeedItemEvent.updated(item)); + } } else { Log.e(TAG, "Could not cancel download with url " + url); } @@ -578,6 +582,16 @@ public class DownloadService extends Service { syncExecutor.execute(new FailedDownloadHandler(status, request)); } + @Nullable + private FeedItem getFeedItemFromId(long id) { + FeedMedia media = DBReader.getFeedMedia(id); + if (media != null) { + return media.getItem(); + } else { + return null; + } + } + /** * Takes a single Feed, parses the corresponding file and refreshes * information in the manager -- cgit v1.2.3 From 28a816b16cdc21e212fcae78b1d1ae92081b82b5 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 28 Sep 2019 17:23:36 +0200 Subject: Enabled more checkstyle rules --- core/src/main/java/de/danoeh/antennapod/core/util/Optional.java | 2 +- .../java/de/danoeh/antennapod/core/util/id3reader/ChapterReader.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/Optional.java b/core/src/main/java/de/danoeh/antennapod/core/util/Optional.java index 0fe11ec53..37f12c01c 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/Optional.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/Optional.java @@ -77,7 +77,7 @@ public final class Optional { * @param Type of the non-existent value * @return an empty {@code Optional} */ - public static Optional empty() { + public static Optional empty() { @SuppressWarnings("unchecked") Optional t = (Optional) EMPTY; return t; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ChapterReader.java b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ChapterReader.java index d22d08e09..a3f747e09 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ChapterReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ChapterReader.java @@ -72,7 +72,7 @@ public class ChapterReader extends ID3Reader { String decodedLink = URLDecoder.decode(link.toString(), "UTF-8"); currentChapter.setLink(decodedLink); Log.d(TAG, "Found link: " + currentChapter.getLink()); - } catch (IllegalArgumentException _iae) { + } catch (IllegalArgumentException iae) { Log.w(TAG, "Bad URL found in ID3 data"); } -- cgit v1.2.3