From c1f37d85919686ea5ee1eef6cba695f63146d3fd Mon Sep 17 00:00:00 2001 From: devlearner Date: Sun, 16 Oct 2022 02:47:53 +0800 Subject: [PATCH] Also show toast in openDownloadDialog() and lengthened a bit to inform user to wait... --- .../org/schabi/newpipe/RouterActivity.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/RouterActivity.java b/app/src/main/java/org/schabi/newpipe/RouterActivity.java index 0c4cff8d1..4a26a7905 100644 --- a/app/src/main/java/org/schabi/newpipe/RouterActivity.java +++ b/app/src/main/java/org/schabi/newpipe/RouterActivity.java @@ -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,