From 8e65694b7d6b05ba8ec6d50a4810aca028856154 Mon Sep 17 00:00:00 2001 From: Ojas Gupta Date: Sun, 20 Oct 2024 12:39:26 +1100 Subject: [PATCH 1/7] Added feature. --- .../schabi/newpipe/download/DownloadDialog.java | 12 +++++++++++- app/src/main/res/layout/download_dialog.xml | 14 ++++++++++++++ build.gradle | 5 ++++- settings.gradle | 10 +++++----- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java b/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java index db2066b2782..0b0f7649d81 100644 --- a/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java +++ b/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java @@ -20,6 +20,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; +import android.widget.Button; import android.widget.RadioGroup; import android.widget.SeekBar; import android.widget.Toast; @@ -331,6 +332,14 @@ public void onProgressChanged(@NonNull final SeekBar seekbar, } }); + final Button button = (Button) dialogBinding.btnChngeDir; + button.setOnClickListener(new View.OnClickListener() { + public void onClick(final View v) { + askForSavePath = true; + prepareSelectedDownload(); + } + }); + fetchStreamsSize(); } @@ -347,7 +356,6 @@ private void initToolbar(final Toolbar toolbar) { okButton = toolbar.findViewById(R.id.okay); okButton.setEnabled(false); // disable until the download service connection is done - toolbar.setOnMenuItemClickListener(item -> { if (item.getItemId() == R.id.okay) { prepareSelectedDownload(); @@ -485,6 +493,8 @@ private void requestDownloadPickAudioFolderResult(final ActivityResult result) { } private void requestDownloadPickVideoFolderResult(final ActivityResult result) { + final String testing = String.valueOf(result.getData()); + requestDownloadPickFolderResult( result, getString(R.string.download_path_video_key), DownloadManager.TAG_VIDEO); } diff --git a/app/src/main/res/layout/download_dialog.xml b/app/src/main/res/layout/download_dialog.xml index 67aa1577c0c..8f996d41ccf 100644 --- a/app/src/main/res/layout/download_dialog.xml +++ b/app/src/main/res/layout/download_dialog.xml @@ -142,11 +142,25 @@ android:progress="3" /> +