Merge pull request #4324 from ByteHamster/streaming-confirmation-dialog
Make mobile streaming dialog easier to understand
This commit is contained in:
commit
8fa1a9c03c
@ -1,8 +1,6 @@
|
|||||||
package de.danoeh.antennapod.dialog;
|
package de.danoeh.antennapod.dialog;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.View;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import de.danoeh.antennapod.R;
|
import de.danoeh.antennapod.R;
|
||||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||||
@ -19,25 +17,24 @@ public class StreamingConfirmationDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void show() {
|
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)
|
new AlertDialog.Builder(context)
|
||||||
.setTitle(R.string.stream_label)
|
.setTitle(R.string.stream_label)
|
||||||
.setMessage(R.string.confirm_mobile_streaming_notification_message)
|
.setMessage(R.string.confirm_mobile_streaming_notification_message)
|
||||||
.setView(view)
|
.setPositiveButton(R.string.stream_label, (dialog, which) -> stream())
|
||||||
.setPositiveButton(R.string.stream_label, (dialog, which) -> {
|
.setNegativeButton(R.string.confirm_mobile_streaming_button_always, (dialog, which) -> {
|
||||||
if (checkDoNotShowAgain.isChecked()) {
|
UserPreferences.setAllowMobileStreaming(true);
|
||||||
UserPreferences.setAllowMobileStreaming(true);
|
stream();
|
||||||
}
|
|
||||||
new PlaybackServiceStarter(context, playable)
|
|
||||||
.callEvenIfRunning(true)
|
|
||||||
.startWhenPrepared(true)
|
|
||||||
.shouldStream(true)
|
|
||||||
.shouldStreamThisTime(true)
|
|
||||||
.start();
|
|
||||||
})
|
})
|
||||||
.setNegativeButton(R.string.cancel_label, null)
|
.setNeutralButton(R.string.cancel_label, null)
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void stream() {
|
||||||
|
new PlaybackServiceStarter(context, playable)
|
||||||
|
.callEvenIfRunning(true)
|
||||||
|
.startWhenPrepared(true)
|
||||||
|
.shouldStream(true)
|
||||||
|
.shouldStreamThisTime(true)
|
||||||
|
.start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user