diff options
author | Nils Rothaug <48482306+nproth@users.noreply.github.com> | 2022-04-09 11:54:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-09 11:54:18 +0200 |
commit | e7f23ad1c2eeac91132e03db4a213616a44483a1 (patch) | |
tree | 3ed6e59b497bca57fff170711632b0ef46e4e1ed /app/src/main | |
parent | 0c26eb6c04e41b6a61d0bd31ede237b5e635e0db (diff) | |
download | AntennaPod-e7f23ad1c2eeac91132e03db4a213616a44483a1.zip |
Show on-demand configuration popup for stream vs download only once (#5818)
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java | 12 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/preferences/PlaybackPreferencesFragment.java | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index 7d9814998..6a8bc2585 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -188,9 +188,9 @@ public class ItemFragment extends Fragment { } private void showOnDemandConfigBalloon(boolean offerStreaming) { - boolean isLocaleRtl = TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) + final boolean isLocaleRtl = TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL; - Balloon balloon = new Balloon.Builder(getContext()) + final Balloon balloon = new Balloon.Builder(getContext()) .setArrowOrientation(ArrowOrientation.TOP) .setArrowOrientationRules(ArrowOrientationRules.ALIGN_FIXED) .setArrowPosition(0.25f + ((isLocaleRtl ^ offerStreaming) ? 0f : 0.5f)) @@ -203,9 +203,9 @@ public class ItemFragment extends Fragment { .setDismissWhenTouchOutside(true) .setLifecycleOwner(this) .build(); - Button positiveButton = balloon.getContentView().findViewById(R.id.balloon_button_positive); - Button negativeButton = balloon.getContentView().findViewById(R.id.balloon_button_negative); - TextView message = balloon.getContentView().findViewById(R.id.balloon_message); + final Button positiveButton = balloon.getContentView().findViewById(R.id.balloon_button_positive); + final Button negativeButton = balloon.getContentView().findViewById(R.id.balloon_button_negative); + final TextView message = balloon.getContentView().findViewById(R.id.balloon_message); message.setText(offerStreaming ? R.string.on_demand_config_stream_text : R.string.on_demand_config_download_text); positiveButton.setOnClickListener(v1 -> { @@ -217,7 +217,7 @@ public class ItemFragment extends Fragment { balloon.dismiss(); }); negativeButton.setOnClickListener(v1 -> { - UsageStatistics.askAgainLater(UsageStatistics.ACTION_STREAM); // Type does not matter. Both are silenced. + UsageStatistics.doNotAskAgain(UsageStatistics.ACTION_STREAM); // Type does not matter. Both are silenced. balloon.dismiss(); }); balloon.showAlignBottom(butAction1, 0, (int) (-12 * getResources().getDisplayMetrics().density)); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/PlaybackPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/PlaybackPreferencesFragment.java index 933a7d456..15fdf5d97 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/PlaybackPreferencesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/PlaybackPreferencesFragment.java @@ -56,7 +56,8 @@ public class PlaybackPreferencesFragment extends PreferenceFragmentCompat { findPreference(PREF_PLAYBACK_PREFER_STREAMING).setOnPreferenceChangeListener((preference, newValue) -> { // Update all visible lists to reflect new streaming action button EventBus.getDefault().post(new UnreadItemsUpdateEvent()); - UsageStatistics.askAgainLater(UsageStatistics.ACTION_STREAM); + // User consciously decided whether to prefer the streaming button, disable suggestion to change that + UsageStatistics.doNotAskAgain(UsageStatistics.ACTION_STREAM); return true; }); |