diff --git a/.gitignore b/.gitignore
index 42caadb93..2b3c40d66 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@
/app/app.iml
/.idea
/*.iml
+gradle.properties
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index ae3f5f056..d028886b1 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -29,43 +29,46 @@
+
-
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+ android:label="@string/background_player_name"
+ android:exported="false" />
diff --git a/app/src/main/java/org/schabi/newpipe/DownloadDialog.java b/app/src/main/java/org/schabi/newpipe/DownloadDialog.java
index 903251e58..3001455f9 100644
--- a/app/src/main/java/org/schabi/newpipe/DownloadDialog.java
+++ b/app/src/main/java/org/schabi/newpipe/DownloadDialog.java
@@ -57,26 +57,29 @@ public class DownloadDialog extends DialogFragment {
@Override
public void onClick(DialogInterface dialog, int which) {
Context context = getActivity();
- SharedPreferences defaultPreferences = PreferenceManager.getDefaultSharedPreferences(context);
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String suffix = "";
String title = arguments.getString(TITLE);
String url = "";
+ String downloadFolder = "Download";
switch(which) {
case 0: // Video
suffix = arguments.getString(FILE_SUFFIX_VIDEO);
url = arguments.getString(VIDEO_URL);
+ downloadFolder = "Movies";
break;
case 1:
suffix = arguments.getString(FILE_SUFFIX_AUDIO);
url = arguments.getString(AUDIO_URL);
+ downloadFolder = "Music";
break;
default:
Log.d(TAG, "lolz");
}
- //to avoid hard-coded string like "/storage/emulated/0/NewPipe"
- final File dir = new File(defaultPreferences.getString(
- "download_path_preference",
- Environment.getExternalStorageDirectory().getAbsolutePath() + "/NewPipe"));
+ //to avoid hard-coded string like "/storage/emulated/0/Movies"
+ String downloadPath = prefs.getString(getString(R.string.downloadPathPreference),
+ Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + downloadFolder);
+ final File dir = new File(downloadPath);
if(!dir.exists()) {
boolean mkdir = dir.mkdir(); //attempt to create directory
if(!mkdir && !dir.isDirectory()) {
@@ -87,9 +90,7 @@ public class DownloadDialog extends DialogFragment {
DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
DownloadManager.Request request = new DownloadManager.Request(
Uri.parse(url));
- request.setDestinationUri(Uri.fromFile(new File(
- defaultPreferences.getString("download_path_preference", "/storage/emulated/0/NewPipe")
- + "/" + title + suffix)));
+ request.setDestinationUri(Uri.fromFile(new File(dir + "/" + title + suffix)));
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
try {
dm.enqueue(request);
diff --git a/app/src/main/java/org/schabi/newpipe/SettingsActivity.java b/app/src/main/java/org/schabi/newpipe/SettingsActivity.java
index b434b53d8..c8a548ab6 100644
--- a/app/src/main/java/org/schabi/newpipe/SettingsActivity.java
+++ b/app/src/main/java/org/schabi/newpipe/SettingsActivity.java
@@ -1,13 +1,9 @@
package org.schabi.newpipe;
-import android.content.Context;
-import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
-import android.os.Environment;
import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;
-import android.preference.PreferenceManager;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.v7.app.ActionBar;
@@ -148,17 +144,4 @@ public class SettingsActivity extends PreferenceActivity {
}
return true;
}
-
- public static void initSettings(Context context) {
- PreferenceManager.setDefaultValues(context, R.xml.settings_screen, false);
- SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
- if(sp.getString(context.getString(R.string.downloadPathPreference), "").isEmpty()){
- SharedPreferences.Editor spEditor = sp.edit();
- String newPipeDownloadStorage =
- Environment.getExternalStorageDirectory().getAbsolutePath() + "/NewPipe";
- spEditor.putString(context.getString(R.string.downloadPathPreference)
- , newPipeDownloadStorage);
- spEditor.apply();
- }
- }
}
diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java b/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java
index 6aaf10d41..d15709b23 100644
--- a/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java
+++ b/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java
@@ -3,6 +3,7 @@ package org.schabi.newpipe;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
+import android.preference.PreferenceManager;
import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
@@ -171,7 +172,7 @@ public class VideoItemListActivity extends AppCompatActivity
}
}
- SettingsActivity.initSettings(this);
+ PreferenceManager.setDefaultValues(this, R.xml.settings_screen, false);
}
/**
diff --git a/app/src/main/res/layout/paginate_footer.xml b/app/src/main/res/layout/paginate_footer.xml
index 8e5d7571d..b3757c1af 100644
--- a/app/src/main/res/layout/paginate_footer.xml
+++ b/app/src/main/res/layout/paginate_footer.xml
@@ -8,7 +8,7 @@
+
+
diff --git a/app/src/main/res/values-iw b/app/src/main/res/values-iw
new file mode 120000
index 000000000..57bf91954
--- /dev/null
+++ b/app/src/main/res/values-iw
@@ -0,0 +1 @@
+values-he
\ No newline at end of file
diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml
index 8d33b8cbe..0ff359a46 100644
--- a/app/src/main/res/values/settings_keys.xml
+++ b/app/src/main/res/values/settings_keys.xml
@@ -71,6 +71,7 @@
- sl
- fi
- sv
+ - bo
- vi
- tr
- bg
@@ -149,6 +150,7 @@
- Slovenščina
- Suomi
- Svenska
+ - Tibetan བོད་སྐད།
- Tiếng Việt
- Türkçe
- Български
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ffa004d91..12fb9275d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,6 +1,7 @@
NewPipe
+ NewPipe Background Player
NewPipe
%1$s views
Uploaded on %1$s
@@ -10,6 +11,7 @@
https://f-droid.org/repository/browse/?fdfilter=vlc&fdid=org.videolan.vlc
Open in browser
Share
+ Loading
Download
Search
Settings
diff --git a/app/src/main/res/xml/settings_screen.xml b/app/src/main/res/xml/settings_screen.xml
index 98399f778..d4b21426f 100644
--- a/app/src/main/res/xml/settings_screen.xml
+++ b/app/src/main/res/xml/settings_screen.xml
@@ -64,8 +64,7 @@
android:key="@string/downloadPathPreference"
android:title="@string/downloadLocation"
android:summary="@string/downloadLocationSummary"
- android:dialogTitle="@string/downloadLocationDialogTitle"
- android:defaultValue=""/>
+ android:dialogTitle="@string/downloadLocationDialogTitle" />
-
\ No newline at end of file
+
diff --git a/gradle.properties b/gradle.properties
deleted file mode 100644
index 1d3591c8a..000000000
--- a/gradle.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# Project-wide Gradle settings.
-
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
-
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-# Default value: -Xmx10248m -XX:MaxPermSize=256m
-# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
-
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
\ No newline at end of file