1 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 package org
.libreoffice
;
11 import android
.os
.Bundle
;
12 import androidx
.fragment
.app
.FragmentActivity
;
13 import androidx
.preference
.PreferenceFragmentCompat
;
14 import androidx
.preference
.PreferenceGroup
;
16 public class SettingsActivity
extends FragmentActivity
{
18 protected void onCreate(Bundle savedInstanceState
) {
19 super.onCreate(savedInstanceState
);
21 // Display the fragment as the main content.
22 getSupportFragmentManager().beginTransaction()
23 .replace(android
.R
.id
.content
, new SettingsFragment())
27 public static class SettingsFragment
extends PreferenceFragmentCompat
{
30 public void onCreatePreferences(Bundle savedInstanceState
, String rootKey
) {
31 setPreferencesFromResource(R
.xml
.libreoffice_preferences
, rootKey
);
35 public void onCreate(Bundle savedInstanceState
) {
36 super.onCreate(savedInstanceState
);
37 if(!BuildConfig
.ALLOW_EDITING
) {
38 PreferenceGroup generalGroup
= findPreference("PREF_CATEGORY_GENERAL");
39 generalGroup
.removePreference(generalGroup
.findPreference("ENABLE_EXPERIMENTAL"));
40 generalGroup
.removePreference(generalGroup
.findPreference("ENABLE_DEVELOPER"));
45 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */