1
0
Fork 0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2025-10-05 10:49:26 +02:00

Refactor creation of DownloadDialog

This commit is contained in:
Stypox 2022-06-18 17:40:22 +02:00
parent e3c2aea3cc
commit 7ba79171c7
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23
3 changed files with 39 additions and 120 deletions

View file

@ -70,7 +70,6 @@ import org.schabi.newpipe.player.playqueue.SinglePlayQueue;
import org.schabi.newpipe.util.Constants;
import org.schabi.newpipe.util.DeviceUtils;
import org.schabi.newpipe.util.ExtractorHelper;
import org.schabi.newpipe.util.ListHelper;
import org.schabi.newpipe.util.Localization;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.PermissionHelper;
@ -676,9 +675,7 @@ public class RouterActivity extends AppCompatActivity {
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(result -> {
final DownloadDialog downloadDialog = DownloadDialog.newInstance(this, result);
downloadDialog.setSelectedVideoStream(ListHelper.getDefaultResolutionIndex(
this, downloadDialog.wrappedVideoStreams.getStreamsList()));
final DownloadDialog downloadDialog = new DownloadDialog(this, result);
downloadDialog.setOnDismissListener(dialog -> finish());
final FragmentManager fm = getSupportFragmentManager();