Also show toast in openDownloadDialog()

and lengthened a bit to inform user to wait...
pull/9135/head
devlearner 2022-10-16 02:47:53 +08:00 zatwierdzone przez Stypox
rodzic b175774ad8
commit c1f37d8591
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4BDF1B40A49FDD23
1 zmienionych plików z 13 dodań i 7 usunięć

Wyświetl plik

@ -669,13 +669,7 @@ public class RouterActivity extends AppCompatActivity {
}
private void openAddToPlaylistDialog() {
// Getting the stream info usually takes a moment
// Notifying the user here to ensure that no confusion arises
Toast.makeText(
getApplicationContext(),
getString(R.string.processing_may_take_a_moment),
Toast.LENGTH_SHORT)
.show();
pleaseWait();
disposables.add(ExtractorHelper.getStreamInfo(currentServiceId, currentUrl, false)
.subscribeOn(Schedulers.io())
@ -705,6 +699,8 @@ public class RouterActivity extends AppCompatActivity {
@SuppressLint("CheckResult")
private void openDownloadDialog() {
pleaseWait();
disposables.add(ExtractorHelper.getStreamInfo(currentServiceId, currentUrl, true)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
@ -719,6 +715,16 @@ public class RouterActivity extends AppCompatActivity {
}, throwable -> showUnsupportedUrlDialog(currentUrl)));
}
private void pleaseWait() {
// Getting the stream info usually takes a moment
// Notifying the user here to ensure that no confusion arises
Toast.makeText(
getApplicationContext(),
getString(R.string.processing_may_take_a_moment),
Toast.LENGTH_LONG)
.show();
}
@Override
public void onRequestPermissionsResult(final int requestCode,
@NonNull final String[] permissions,