[Libreoffice-commits] core.git: android/source

Michael Weghorn (via logerrit) logerrit at kemper.freedesktop.org
Fri Mar 6 15:49:01 UTC 2020


 android/source/res/xml/libreoffice_preferences.xml            |   19 +++++-----
 android/source/src/java/org/libreoffice/SettingsActivity.java |    5 ++
 2 files changed, 14 insertions(+), 10 deletions(-)

New commits:
commit 3e19e0ddaa0221fac93d00798613f5938eae7a7b
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Fri Mar 6 11:20:00 2020 +0100
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Fri Mar 6 16:48:26 2020 +0100

    android: Move "Display language" setting to "General" section
    
    This fits better than the "File Explorer Settings" one.
    
    The whole "General" section was hidden before when editing
    mode was disabled for the build ('!BuildConfig.ALLOW_EDITING').
    Since the language setting is unrelated to this, no longer
    do so, but explicitly remove the two other entries in this group,
    namely "ENABLE_DEVELOPER" and "ENABLE_EXPERIMENTAL".
    
    Change-Id: I64d1abef38d7669fc1072b380f497ca83e23f265
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90096
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>

diff --git a/android/source/res/xml/libreoffice_preferences.xml b/android/source/res/xml/libreoffice_preferences.xml
index d02c9d5cccbc..d418dd559f86 100644
--- a/android/source/res/xml/libreoffice_preferences.xml
+++ b/android/source/res/xml/libreoffice_preferences.xml
@@ -25,15 +25,6 @@
             android:key="EXPLORER_VIEW_TYPE"
             android:summary="@string/pref_viewmode_summary" />
 
-        <ListPreference
-            android:title="@string/display_language"
-            android:summary="@string/display_language_summary"
-            android:entries="@array/SupportedLanguages"
-            android:entryValues="@array/SupportedLanguagesValues"
-            android:defaultValue="SYSTEM_DEFAULT_LANGUAGE"
-            android:key="DISPLAY_LANGUAGE"
-            />
-
         <CheckBoxPreference
             android:title="@string/pref_show_hidden_files"
             android:key="ENABLE_SHOW_HIDDEN_FILES"
@@ -43,6 +34,16 @@
     <PreferenceCategory
         android:title="@string/pref_category_general"
         android:key="PREF_CATEGORY_GENERAL">
+
+        <ListPreference
+            android:title="@string/display_language"
+            android:summary="@string/display_language_summary"
+            android:entries="@array/SupportedLanguages"
+            android:entryValues="@array/SupportedLanguagesValues"
+            android:defaultValue="SYSTEM_DEFAULT_LANGUAGE"
+            android:key="DISPLAY_LANGUAGE"
+            />
+
         <CheckBoxPreference
             android:title="@string/pref_experimental_editing"
             android:key="ENABLE_EXPERIMENTAL"
diff --git a/android/source/src/java/org/libreoffice/SettingsActivity.java b/android/source/src/java/org/libreoffice/SettingsActivity.java
index 73ada55b9380..5623abc2e597 100644
--- a/android/source/src/java/org/libreoffice/SettingsActivity.java
+++ b/android/source/src/java/org/libreoffice/SettingsActivity.java
@@ -12,6 +12,7 @@ import android.app.Activity;
 import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.preference.PreferenceFragment;
+import android.preference.PreferenceGroup;
 
 public class SettingsActivity extends Activity {
     @Override
@@ -30,7 +31,9 @@ public class SettingsActivity extends Activity {
             super.onCreate(savedInstanceState);
             addPreferencesFromResource(R.xml.libreoffice_preferences);
             if(!BuildConfig.ALLOW_EDITING) {
-                getPreferenceScreen().removePreference(findPreference("PREF_CATEGORY_GENERAL"));
+                PreferenceGroup generalGroup = (PreferenceGroup) findPreference("PREF_CATEGORY_GENERAL");
+                generalGroup.removePreference(generalGroup.findPreference("ENABLE_EXPERIMENTAL"));
+                generalGroup.removePreference(generalGroup.findPreference("ENABLE_DEVELOPER"));
             }
         }
 


More information about the Libreoffice-commits mailing list