diff options
author | ByteHamster <info@bytehamster.com> | 2020-08-15 19:48:23 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2020-08-15 19:48:23 +0200 |
commit | d8674e8050fd98961f7eaa9fa844eb03d8bbfb48 (patch) | |
tree | 14c3cf71186072ce6383610d2a07c57988af01ee /app/src/main/java/de/danoeh/antennapod/dialog | |
parent | 5a4cb23877c4d7a33b578ab8b726774586c7c851 (diff) | |
parent | 06315821d52d6b66d4c3c0adeac16ee627bfe782 (diff) | |
download | AntennaPod-d8674e8050fd98961f7eaa9fa844eb03d8bbfb48.zip |
Merge branch 'master' into develop
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/dialog')
-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(); + } } |