From 7f86872139ae3ff35813e1c5b843188c83636b0c Mon Sep 17 00:00:00 2001
From: Christian Schabesberger <chris.schabesberger@mailbox.org>
Date: Wed, 25 Nov 2015 21:08:19 +0100
Subject: [PATCH] Categorized settings & moved AbstractVideoInfo into service
 folder

---
 .../java/org/schabi/newpipe/VideoInfo.java    |   2 +
 .../org/schabi/newpipe/VideoPreviewInfo.java  |   2 +
 .../{ => services}/AbstractVideoInfo.java     |   2 +-
 app/src/main/res/values-de/strings.xml        |   3 +
 app/src/main/res/values/settings_keys.xml     |   5 +
 app/src/main/res/values/strings.xml           |   3 +
 app/src/main/res/xml/settings_screen.xml      | 110 ++++++++++--------
 7 files changed, 79 insertions(+), 48 deletions(-)
 rename app/src/main/java/org/schabi/newpipe/{ => services}/AbstractVideoInfo.java (92%)

diff --git a/app/src/main/java/org/schabi/newpipe/VideoInfo.java b/app/src/main/java/org/schabi/newpipe/VideoInfo.java
index 5b8321a61..80e5d3861 100644
--- a/app/src/main/java/org/schabi/newpipe/VideoInfo.java
+++ b/app/src/main/java/org/schabi/newpipe/VideoInfo.java
@@ -2,6 +2,8 @@ package org.schabi.newpipe;
 
 import android.graphics.Bitmap;
 
+import org.schabi.newpipe.services.AbstractVideoInfo;
+
 import java.util.List;
 
 /**
diff --git a/app/src/main/java/org/schabi/newpipe/VideoPreviewInfo.java b/app/src/main/java/org/schabi/newpipe/VideoPreviewInfo.java
index f49bd0a0e..1e2f96891 100644
--- a/app/src/main/java/org/schabi/newpipe/VideoPreviewInfo.java
+++ b/app/src/main/java/org/schabi/newpipe/VideoPreviewInfo.java
@@ -4,6 +4,8 @@ import android.graphics.Bitmap;
 import android.os.Parcel;
 import android.os.Parcelable;
 
+import org.schabi.newpipe.services.AbstractVideoInfo;
+
 /**
  * Created by Christian Schabesberger on 26.08.15.
  *
diff --git a/app/src/main/java/org/schabi/newpipe/AbstractVideoInfo.java b/app/src/main/java/org/schabi/newpipe/services/AbstractVideoInfo.java
similarity index 92%
rename from app/src/main/java/org/schabi/newpipe/AbstractVideoInfo.java
rename to app/src/main/java/org/schabi/newpipe/services/AbstractVideoInfo.java
index 43839b1f0..72d43ebde 100644
--- a/app/src/main/java/org/schabi/newpipe/AbstractVideoInfo.java
+++ b/app/src/main/java/org/schabi/newpipe/services/AbstractVideoInfo.java
@@ -1,4 +1,4 @@
-package org.schabi.newpipe;
+package org.schabi.newpipe.services;
 
 import android.graphics.Bitmap;
 
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 7a93ed30d..2676edd52 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -49,4 +49,7 @@
     <string name="showNextAndSimilarTitle">Zeige nächstes und ähnliche Videos</string>
     <string name="urlNotSupportedText">URL wird nicht unterstützt.</string>
     <string name="showSimilarVideosButtonText">Ähnliche Videos</string>
+    <string name="settingsCategoryVideoAudioTitle">VIDEO &amp; AUDIO</string>
+    <string name="settingsCategoryVideoInfoTittle">INFO</string>
+    <string name="settingsCategoryEtcTitle">ETC</string>
 </resources>
diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml
index 3c4b90e65..f1cd7ebaf 100644
--- a/app/src/main/res/values/settings_keys.xml
+++ b/app/src/main/res/values/settings_keys.xml
@@ -1,5 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
+    <!-- Categories -->
+    <string name="settingsCategoryVideoAudio">settings_categoery_video_audio</string>
+    <string name="settingsCategoryVideoInfo">settings_category_video_info</string>
+    <string name="settingsCategoryEtc">settings_category_etc</string>
+    <!-- Key values -->
     <string name="downloadPathPreference">download_path_preference</string>
     <string name="useExternalPlayer">use_external_player</string>
     <string name="autoPlayThroughIntent">autoplay_through_intent</string>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index a3529fc25..fa3a118dd 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -50,4 +50,7 @@
     <string name="urlNotSupportedText">URL not supported.</string>
     <string name="showSimilarVideosButtonText">Similar videos</string>
     <string name="searchLanguageTitle">Preferable content language</string>
+    <string name="settingsCategoryVideoAudioTitle">VIDEO &amp; AUDIO</string>
+    <string name="settingsCategoryVideoInfoTittle">INFO</string>
+    <string name="settingsCategoryEtcTitle">ETC</string>
 </resources>
diff --git a/app/src/main/res/xml/settings_screen.xml b/app/src/main/res/xml/settings_screen.xml
index a72dc87df..59ed1b28f 100644
--- a/app/src/main/res/xml/settings_screen.xml
+++ b/app/src/main/res/xml/settings_screen.xml
@@ -3,59 +3,75 @@
     android:title="@string/title_activity_settings"
     android:key="general_preferences">
 
-    <CheckBoxPreference
-        android:key="@string/useExternalPlayer"
-        android:title="@string/useExternalPlayerTitle"
-        android:defaultValue="false"/>
+    <PreferenceCategory
+        android:key="@string/settingsCategoryVideoAudio"
+        android:title="@string/settingsCategoryVideoAudioTitle">
 
-    <EditTextPreference
-        android:key="@string/downloadPathPreference"
-        android:title="@string/downloadLocation"
-        android:summary="@string/downloadLocationSummary"
-        android:dialogTitle="@string/downloadLocationDialogTitle"
-        android:defaultValue=""/>
+        <CheckBoxPreference
+            android:key="@string/useExternalPlayer"
+            android:title="@string/useExternalPlayerTitle"
+            android:defaultValue="false"/>
 
-    <CheckBoxPreference
-        android:key="@string/autoPlayThroughIntent"
-        android:title="@string/autoPlayThroughIntentTitle"
-        android:summary="@string/autoPlayThroughIntentSummary"
-        android:defaultValue="false" />
+        <ListPreference
+            android:key="@string/defaultResolutionPreference"
+            android:title="@string/defaultResolutionPreferenceTitle"
+            android:entries="@array/resolutionList"
+            android:entryValues="@array/resolutionList"
+            android:defaultValue="@string/defaultResolutionListItem"/>
 
-    <ListPreference
-        android:key="@string/defaultResolutionPreference"
-        android:title="@string/defaultResolutionPreferenceTitle"
-        android:entries="@array/resolutionList"
-        android:entryValues="@array/resolutionList"
-        android:defaultValue="@string/defaultResolutionListItem"/>
+        <ListPreference
+            android:key="@string/defaultAudioFormatPreference"
+            android:title="@string/defaultAudioFormatTitle"
+            android:entries="@array/audioFormatDescriptionList"
+            android:entryValues="@array/audioFormatList"
+            android:defaultValue="@string/defaultAudioFormat"/>
 
-    <CheckBoxPreference
-        android:key="@string/showPlayWidthKodiPreference"
-        android:title="@string/showPlayWithKodiTitle"
-        android:summary="@string/showPlayWithKodiSummary"
-        android:defaultValue="false" />
+    </PreferenceCategory>
+    <PreferenceCategory
+        android:key="@string/settingsCategoryVideoInfo"
+        android:title="@string/settingsCategoryVideoInfoTittle">
 
-    <CheckBoxPreference
-        android:key="@string/leftHandLayout"
-        android:title="@string/leftPlayButtonTitle"
-        android:defaultValue="false" />
+        <CheckBoxPreference
+            android:key="@string/showPlayWidthKodiPreference"
+            android:title="@string/showPlayWithKodiTitle"
+            android:summary="@string/showPlayWithKodiSummary"
+            android:defaultValue="false" />
 
-    <ListPreference
-        android:key="@string/defaultAudioFormatPreference"
-        android:title="@string/defaultAudioFormatTitle"
-        android:entries="@array/audioFormatDescriptionList"
-        android:entryValues="@array/audioFormatList"
-        android:defaultValue="@string/defaultAudioFormat"/>
+        <CheckBoxPreference
+            android:key="@string/leftHandLayout"
+            android:title="@string/leftPlayButtonTitle"
+            android:defaultValue="false" />
 
-    <CheckBoxPreference
-        android:key="@string/showNextVideo"
-        android:title="@string/showNextAndSimilarTitle"
-        android:defaultValue="true" />
+        <ListPreference
+            android:key="@string/searchLanguage"
+            android:title="@string/searchLanguageTitle"
+            android:entries="@array/languageNames"
+            android:entryValues="@array/languageCodes"
+            android:defaultValue="en" />
 
-    <ListPreference
-        android:key="@string/searchLanguage"
-        android:title="@string/searchLanguageTitle"
-        android:entries="@array/languageNames"
-        android:entryValues="@array/languageCodes"
-        android:defaultValue="en" />
-    
+        <CheckBoxPreference
+            android:key="@string/showNextVideo"
+            android:title="@string/showNextAndSimilarTitle"
+            android:defaultValue="true" />
+
+    </PreferenceCategory>
+
+    <PreferenceCategory
+        android:key="@string/settingsCategoryEtc"
+        android:title="@string/settingsCategoryEtcTitle">
+
+        <EditTextPreference
+            android:key="@string/downloadPathPreference"
+            android:title="@string/downloadLocation"
+            android:summary="@string/downloadLocationSummary"
+            android:dialogTitle="@string/downloadLocationDialogTitle"
+            android:defaultValue=""/>
+
+        <CheckBoxPreference
+            android:key="@string/autoPlayThroughIntent"
+            android:title="@string/autoPlayThroughIntentTitle"
+            android:summary="@string/autoPlayThroughIntentSummary"
+            android:defaultValue="false" />
+
+    </PreferenceCategory>
 </PreferenceScreen>
\ No newline at end of file