Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature to download to a non default folder for issue #2285 #11637

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

Expand All @@ -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();
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/res/layout/download_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,25 @@
android:progress="3" />
</LinearLayout>

<Button
android:id="@+id/btn_chngeDir"
android:layout_width="335dp"
android:layout_height="wrap_content"
android:layout_below="@+id/threads_layout"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="38dp"
android:layout_marginTop="42dp"
android:layout_marginEnd="38dp"
android:layout_marginBottom="39dp"
android:text="Browse for Alternate Download Folder" />

<org.schabi.newpipe.views.NewPipeTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/threads_layout"
android:layout_marginLeft="24dp"
android:layout_marginTop="114dp"
android:layout_marginRight="24dp"
android:layout_marginBottom="12dp"
android:gravity="center"
Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in this file are irrelevant to the purpose of this PR.

Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
agp_version = '8.1.0'
}
ext.kotlin_version = '1.9.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.0'
classpath "com.android.tools.build:gradle:$agp_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in this file are irrelevant to the purpose of this PR.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ include ':app'
// We assume, that NewPipe and NewPipe Extractor have the same parent directory.
// If this is not the case, please change the path in includeBuild().

//includeBuild('../NewPipeExtractor') {
//includeBuild('../') {
// dependencySubstitution {
// substitute module('com.github.TeamNewPipe:NewPipeExtractor') using project(':extractor')
// }
//}
//}
Loading