diff options
author | ByteHamster <info@bytehamster.com> | 2020-07-27 11:33:25 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2020-07-27 11:33:53 +0200 |
commit | d86121746aa845e95ad0dfe16d58bc7ea6fca83e (patch) | |
tree | f4a062f648657ce51a8cbc2f4468b0115dce5d5a /app/src | |
parent | 4ddee0321465835b2a9edae1e93dafcceb3c5cdc (diff) | |
download | AntennaPod-d86121746aa845e95ad0dfe16d58bc7ea6fca83e.zip |
Make mobile streaming dialog easier to understand
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/dialog/StreamingConfirmationDialog.java | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/StreamingConfirmationDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/StreamingConfirmationDialog.java index 81e86e217..46095604c 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/StreamingConfirmationDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/StreamingConfirmationDialog.java @@ -1,8 +1,6 @@ package de.danoeh.antennapod.dialog; import android.content.Context; -import android.view.View; -import android.widget.CheckBox; import androidx.appcompat.app.AlertDialog; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.preferences.UserPreferences; @@ -19,25 +17,24 @@ public class StreamingConfirmationDialog { } public void show() { - View view = View.inflate(context, R.layout.checkbox_do_not_show_again, null); - CheckBox checkDoNotShowAgain = view.findViewById(R.id.checkbox_do_not_show_again); - new AlertDialog.Builder(context) .setTitle(R.string.stream_label) .setMessage(R.string.confirm_mobile_streaming_notification_message) - .setView(view) - .setPositiveButton(R.string.stream_label, (dialog, which) -> { - if (checkDoNotShowAgain.isChecked()) { - UserPreferences.setAllowMobileStreaming(true); - } - new PlaybackServiceStarter(context, playable) - .callEvenIfRunning(true) - .startWhenPrepared(true) - .shouldStream(true) - .shouldStreamThisTime(true) - .start(); + .setPositiveButton(R.string.stream_label, (dialog, which) -> stream()) + .setNegativeButton(R.string.confirm_mobile_streaming_button_always, (dialog, which) -> { + UserPreferences.setAllowMobileStreaming(true); + stream(); }) - .setNegativeButton(R.string.cancel_label, null) + .setNeutralButton(R.string.cancel_label, null) .show(); } + + private void stream() { + new PlaybackServiceStarter(context, playable) + .callEvenIfRunning(true) + .startWhenPrepared(true) + .shouldStream(true) + .shouldStreamThisTime(true) + .start(); + } } |