[2/2] OmniGears: interface settings restructering
Screenshot: http://www.mediafire.com/view/81yeivytzbydoh9/Screenshot_2013-12-05-01-43-44.png
Change-Id: I2e54d6f174c09d9d74119fbe274886c2e83ec874
diff --git a/res/drawable-hdpi/ic_bars.png b/res/drawable-hdpi/ic_bars.png
new file mode 100644
index 0000000..573f391
--- /dev/null
+++ b/res/drawable-hdpi/ic_bars.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_menus.png b/res/drawable-hdpi/ic_menus.png
new file mode 100644
index 0000000..0358706
--- /dev/null
+++ b/res/drawable-hdpi/ic_menus.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_notifications.png b/res/drawable-hdpi/ic_notifications.png
new file mode 100644
index 0000000..efdb98c
--- /dev/null
+++ b/res/drawable-hdpi/ic_notifications.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_bars.png b/res/drawable-mdpi/ic_bars.png
new file mode 100644
index 0000000..a004ef8
--- /dev/null
+++ b/res/drawable-mdpi/ic_bars.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_menus.png b/res/drawable-mdpi/ic_menus.png
new file mode 100644
index 0000000..3a29b9c
--- /dev/null
+++ b/res/drawable-mdpi/ic_menus.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_notifications.png b/res/drawable-mdpi/ic_notifications.png
new file mode 100644
index 0000000..f009997
--- /dev/null
+++ b/res/drawable-mdpi/ic_notifications.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_bars.png b/res/drawable-xhdpi/ic_bars.png
new file mode 100644
index 0000000..f765838
--- /dev/null
+++ b/res/drawable-xhdpi/ic_bars.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menus.png b/res/drawable-xhdpi/ic_menus.png
new file mode 100644
index 0000000..031ed6b
--- /dev/null
+++ b/res/drawable-xhdpi/ic_menus.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_notifications.png b/res/drawable-xhdpi/ic_notifications.png
new file mode 100644
index 0000000..b15a8fb
--- /dev/null
+++ b/res/drawable-xhdpi/ic_notifications.png
Binary files differ
diff --git a/res/xml/bars_and_menus_settings.xml b/res/xml/bars_and_menus_settings.xml
deleted file mode 100644
index eef2f61..0000000
--- a/res/xml/bars_and_menus_settings.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2013 The OmniROM Project
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- -->
-
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
- android:title="@string/sound_settings"
- android:key="sound_settings"
- xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
-
- <!-- Status bar -->
- <PreferenceCategory
- android:key="category_status_bar"
- android:title="@string/bars_and_menus_category_status_bar_title"/>
-
- <CheckBoxPreference
- android:key="status_bar_brightness_control"
- android:title="@string/status_bar_toggle_brightness"
- android:summary="@string/status_bar_toggle_brightness_summary"
- android:defaultValue="false" />
-
- <CheckBoxPreference
- android:key="status_bar_notif_count"
- android:title="@string/status_bar_notif_count_title"
- android:summary="@string/status_bar_notif_count_summary"
- android:defaultValue="false" />
-
- <CheckBoxPreference
- android:key="status_bar_traffic"
- android:title="@string/show_network_speed"
- android:summary="@string/show_network_speed_summary"
- android:defaultValue="false" />
-
- <CheckBoxPreference
- android:key="status_bar_network_activity"
- android:title="@string/show_activity_indicators_on_status_bar_title"
- android:summary="@string/show_activity_indicators_on_status_bar_summary"
- android:defaultValue="false" />
-
- <!-- Notification drawer -->
- <PreferenceCategory
- android:key="category_notification_drawer"
- android:title="@string/notification_drawer_category_title"/>
-
- <CheckBoxPreference
- android:key="custom_status_bar_header"
- android:title="@string/custom_statusbar_header_title"
- android:summary="@string/custom_statusbar_header_summary"
- android:defaultValue="false" />
-
- <!-- Recents panel -->
- <PreferenceCategory
- android:key="category_recent_panel"
- android:title="@string/bars_and_menus_category_recent_panel_title"/>
-
- <CheckBoxPreference
- android:key="recent_menu_clear_all"
- android:title="@string/show_recent_clear_all_button_title"
- android:summary="@string/show_recent_clear_all_button_summary"
- android:defaultValue="true" />
-
- <ListPreference
- android:key="recent_menu_clear_all_location"
- android:title="@string/recent_clear_all_button_location_title"
- android:summary="@string/recent_clear_all_button_location_summary"
- android:entries="@array/recent_clear_all_button_location_entries"
- android:entryValues="@array/recent_clear_all_button_location_values"
- android:defaultValue="2"
- android:dependency="recent_menu_clear_all" />
-
- <!-- Power Menu -->
- <PreferenceCategory
- android:key="category_power_menu"
- android:title="@string/bars_and_menus_category_power_menu_title">
-
- <CheckBoxPreference
- android:key="power_menu_screenshot"
- android:title="@string/power_menu_toggle_screenshot_title"
- android:summary="@string/power_menu_toggle_screenshot_summary"
- android:defaultValue="false" />
- </PreferenceCategory>
-
-</PreferenceScreen>
diff --git a/res/xml/bars_settings.xml b/res/xml/bars_settings.xml
new file mode 100644
index 0000000..14ec555
--- /dev/null
+++ b/res/xml/bars_settings.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The OmniROM Project
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ -->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ android:key="interface_bars"
+ android:title="@string/interface_bars_title"
+ xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
+
+ <!-- Status bar -->
+ <PreferenceCategory
+ android:key="category_status_bar"
+ android:title="@string/bars_and_menus_category_status_bar_title"/>
+
+ <CheckBoxPreference
+ android:key="status_bar_brightness_control"
+ android:title="@string/status_bar_toggle_brightness"
+ android:summary="@string/status_bar_toggle_brightness_summary"
+ android:defaultValue="false" />
+
+ <CheckBoxPreference
+ android:key="status_bar_notif_count"
+ android:title="@string/status_bar_notif_count_title"
+ android:summary="@string/status_bar_notif_count_summary"
+ android:defaultValue="false" />
+
+ <CheckBoxPreference
+ android:key="status_bar_traffic"
+ android:title="@string/show_network_speed"
+ android:summary="@string/show_network_speed_summary"
+ android:defaultValue="false" />
+
+ <CheckBoxPreference
+ android:key="status_bar_network_activity"
+ android:title="@string/show_activity_indicators_on_status_bar_title"
+ android:summary="@string/show_activity_indicators_on_status_bar_summary"
+ android:defaultValue="false" />
+
+</PreferenceScreen>
diff --git a/res/xml/menus_settings.xml b/res/xml/menus_settings.xml
new file mode 100644
index 0000000..82dec0b
--- /dev/null
+++ b/res/xml/menus_settings.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The OmniROM Project
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ -->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ android:key="interface_menus"
+ android:title="@string/interface_menus_title"
+ xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
+
+ <!-- Power Menu -->
+ <PreferenceCategory
+ android:key="category_power_menu"
+ android:title="@string/bars_and_menus_category_power_menu_title">
+
+ <CheckBoxPreference
+ android:key="power_menu_screenshot"
+ android:title="@string/power_menu_toggle_screenshot_title"
+ android:summary="@string/power_menu_toggle_screenshot_summary"
+ android:defaultValue="false" />
+ </PreferenceCategory>
+
+</PreferenceScreen>
diff --git a/res/xml/more_interface_settings.xml b/res/xml/more_interface_settings.xml
new file mode 100644
index 0000000..d071b80
--- /dev/null
+++ b/res/xml/more_interface_settings.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The OmniROM Project
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ -->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ android:key="interface_more"
+ android:title="@string/interface_more_title"
+ xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
+
+ <!-- Recents panel -->
+ <PreferenceCategory
+ android:key="category_recent_panel"
+ android:title="@string/bars_and_menus_category_recent_panel_title"/>
+
+ <CheckBoxPreference
+ android:key="recent_menu_clear_all"
+ android:title="@string/show_recent_clear_all_button_title"
+ android:summary="@string/show_recent_clear_all_button_summary"
+ android:defaultValue="true" />
+
+ <ListPreference
+ android:key="recent_menu_clear_all_location"
+ android:title="@string/recent_clear_all_button_location_title"
+ android:summary="@string/recent_clear_all_button_location_summary"
+ android:entries="@array/recent_clear_all_button_location_entries"
+ android:entryValues="@array/recent_clear_all_button_location_values"
+ android:defaultValue="2"
+ android:dependency="recent_menu_clear_all" />
+</PreferenceScreen>
diff --git a/res/xml/notification_panel_settings.xml b/res/xml/notification_panel_settings.xml
new file mode 100644
index 0000000..007a908
--- /dev/null
+++ b/res/xml/notification_panel_settings.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The OmniROM Project
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ -->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ android:key="interface_notification_panel"
+ android:title="@string/interface_notification_panel_title"
+ xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
+
+ <CheckBoxPreference
+ android:key="custom_status_bar_header"
+ android:title="@string/custom_statusbar_header_title"
+ android:summary="@string/custom_statusbar_header_summary"
+ android:defaultValue="false" />
+
+</PreferenceScreen>
diff --git a/src/org/omnirom/omnigears/BarsAndMenusSettings.java b/src/org/omnirom/omnigears/BarsAndMenusSettings.java
deleted file mode 100644
index e1ea941..0000000
--- a/src/org/omnirom/omnigears/BarsAndMenusSettings.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (C) 2013 The OmniROM Project
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.omnirom.omnigears;
-
-import com.android.settings.SettingsPreferenceFragment;
-import com.android.settings.Utils;
-
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.content.BroadcastReceiver;
-import android.content.ContentResolver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.preference.CheckBoxPreference;
-import android.preference.ListPreference;
-import android.preference.Preference;
-import android.preference.PreferenceGroup;
-import android.preference.PreferenceScreen;
-import android.provider.MediaStore;
-import android.provider.Settings;
-import android.provider.Settings.SettingNotFoundException;
-import android.util.Log;
-
-import java.util.List;
-
-public class BarsAndMenusSettings extends SettingsPreferenceFragment implements
- Preference.OnPreferenceChangeListener {
- private static final String TAG = "BarsAndMenusSettings";
-
- private static final String STATUS_BAR_BRIGHTNESS_CONTROL = "status_bar_brightness_control";
- private static final String STATUS_BAR_NOTIF_COUNT = "status_bar_notif_count";
- private static final String STATUS_BAR_TRAFFIC = "status_bar_traffic";
- private static final String RECENT_MENU_CLEAR_ALL = "recent_menu_clear_all";
- private static final String RECENT_MENU_CLEAR_ALL_LOCATION = "recent_menu_clear_all_location";
- private static final String STATUS_BAR_NETWORK_ACTIVITY = "status_bar_network_activity";
- private static final String POWER_MENU_SCREENSHOT = "power_menu_screenshot";
- private static final String STATUS_BAR_CUSTOM_HEADER = "custom_status_bar_header";
-
- private CheckBoxPreference mStatusBarBrightnessControl;
- private CheckBoxPreference mStatusBarNotifCount;
- private CheckBoxPreference mStatusBarTraffic;
- private CheckBoxPreference mRecentClearAll;
- private ListPreference mRecentClearAllPosition;
- private CheckBoxPreference mStatusBarNetworkActivity;
- private CheckBoxPreference mScreenshotPowerMenu;
- private CheckBoxPreference mStatusBarCustomHeader;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- addPreferencesFromResource(R.xml.bars_and_menus_settings);
-
- PreferenceScreen prefSet = getPreferenceScreen();
- ContentResolver resolver = getActivity().getContentResolver();
-
- mStatusBarBrightnessControl = (CheckBoxPreference) prefSet.findPreference(STATUS_BAR_BRIGHTNESS_CONTROL);
- mStatusBarBrightnessControl.setChecked((Settings.System.getInt(resolver,Settings.System.STATUS_BAR_BRIGHTNESS_CONTROL, 0) == 1));
- mStatusBarBrightnessControl.setOnPreferenceChangeListener(this);
-
- try {
- if (Settings.System.getInt(getActivity().getApplicationContext().getContentResolver(),
- Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) {
- mStatusBarBrightnessControl.setEnabled(false);
- mStatusBarBrightnessControl.setSummary(R.string.status_bar_toggle_info);
- }
- } catch (SettingNotFoundException e) {
- }
-
- mStatusBarNotifCount = (CheckBoxPreference) prefSet.findPreference(STATUS_BAR_NOTIF_COUNT);
- mStatusBarNotifCount.setChecked(Settings.System.getInt(resolver,
- Settings.System.STATUS_BAR_NOTIF_COUNT, 0) == 1);
- mStatusBarNotifCount.setOnPreferenceChangeListener(this);
-
- mStatusBarTraffic = (CheckBoxPreference) prefSet.findPreference(STATUS_BAR_TRAFFIC);
- mStatusBarTraffic.setChecked(Settings.System.getInt(resolver,
- Settings.System.STATUS_BAR_TRAFFIC, 0) == 1);
- mStatusBarTraffic.setOnPreferenceChangeListener(this);
- mRecentClearAll = (CheckBoxPreference) prefSet.findPreference(RECENT_MENU_CLEAR_ALL);
- mRecentClearAll.setChecked(Settings.System.getInt(resolver,
- Settings.System.SHOW_CLEAR_RECENTS_BUTTON, 1) == 1);
- mRecentClearAll.setOnPreferenceChangeListener(this);
- mRecentClearAllPosition = (ListPreference) prefSet.findPreference(RECENT_MENU_CLEAR_ALL_LOCATION);
- String recentClearAllPosition = Settings.System.getString(resolver, Settings.System.CLEAR_RECENTS_BUTTON_LOCATION);
- if (recentClearAllPosition != null) {
- mRecentClearAllPosition.setValue(recentClearAllPosition);
- }
- mRecentClearAllPosition.setOnPreferenceChangeListener(this);
-
- mStatusBarNetworkActivity = (CheckBoxPreference) prefSet.findPreference(STATUS_BAR_NETWORK_ACTIVITY);
- mStatusBarNetworkActivity.setChecked(Settings.System.getInt(resolver,
- Settings.System.STATUS_BAR_NETWORK_ACTIVITY, 0) == 1);
- mStatusBarNetworkActivity.setOnPreferenceChangeListener(this);
-
- mScreenshotPowerMenu = (CheckBoxPreference) prefSet.findPreference(POWER_MENU_SCREENSHOT);
- mScreenshotPowerMenu.setChecked(Settings.System.getInt(resolver,
- Settings.System.SCREENSHOT_IN_POWER_MENU, 0) == 1);
- mScreenshotPowerMenu.setOnPreferenceChangeListener(this);
- mStatusBarNetworkActivity.setOnPreferenceChangeListener(this);
-
- mStatusBarCustomHeader = (CheckBoxPreference) prefSet.findPreference(STATUS_BAR_CUSTOM_HEADER);
- mStatusBarCustomHeader.setChecked(Settings.System.getInt(resolver,
- Settings.System.STATUS_BAR_CUSTOM_HEADER, 0) == 1);
- mStatusBarCustomHeader.setOnPreferenceChangeListener(this);
- }
-
- @Override
- public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
- return true;
- }
-
- public boolean onPreferenceChange(Preference preference, Object objValue) {
- ContentResolver resolver = getActivity().getContentResolver();
- if (preference == mStatusBarBrightnessControl) {
- boolean value = (Boolean) objValue;
- Settings.System.putInt(resolver,Settings.System.STATUS_BAR_BRIGHTNESS_CONTROL, value ? 1 : 0);
- } else if (preference == mStatusBarNotifCount) {
- boolean value = (Boolean) objValue;
- Settings.System.putInt(resolver, Settings.System.STATUS_BAR_NOTIF_COUNT, value ? 1 : 0);
- } else if (preference == mStatusBarTraffic) {
- boolean value = (Boolean) objValue;
- Settings.System.putInt(resolver,
- Settings.System.STATUS_BAR_TRAFFIC, value ? 1 : 0);
- } else if (preference == mRecentClearAll) {
- boolean value = (Boolean) objValue;
- Settings.System.putInt(resolver, Settings.System.SHOW_CLEAR_RECENTS_BUTTON, value ? 1 : 0);
- } else if (preference == mRecentClearAllPosition) {
- String value = (String) objValue;
- Settings.System.putString(resolver, Settings.System.CLEAR_RECENTS_BUTTON_LOCATION, value);
- } else if (preference == mStatusBarNetworkActivity) {
- boolean value = (Boolean) objValue;
- Settings.System.putInt(resolver,
- Settings.System.STATUS_BAR_NETWORK_ACTIVITY, value ? 1 : 0);
- } else if (preference == mScreenshotPowerMenu) {
- boolean value = (Boolean) objValue;
- Settings.System.putInt(resolver, Settings.System.SCREENSHOT_IN_POWER_MENU, value ? 1 : 0);
- } else if (preference == mStatusBarCustomHeader) {
- boolean value = (Boolean) objValue;
- Settings.System.putInt(resolver,
- Settings.System.STATUS_BAR_CUSTOM_HEADER, value ? 1 : 0);
- } else {
- return false;
- }
-
- return true;
- }
-}
diff --git a/src/org/omnirom/omnigears/interfacesettings/BarsSettings.java b/src/org/omnirom/omnigears/interfacesettings/BarsSettings.java
new file mode 100644
index 0000000..63b140e
--- /dev/null
+++ b/src/org/omnirom/omnigears/interfacesettings/BarsSettings.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2013 The OmniROM Project
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package org.omnirom.omnigears.interfacesettings;
+
+import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.R;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.os.Bundle;
+import android.preference.CheckBoxPreference;
+import android.preference.Preference;
+import android.preference.PreferenceGroup;
+import android.preference.PreferenceScreen;
+import android.provider.Settings;
+import android.provider.Settings.SettingNotFoundException;
+import android.util.Log;
+
+public class BarsSettings extends SettingsPreferenceFragment implements
+ Preference.OnPreferenceChangeListener {
+ private static final String TAG = "BarsSettings";
+
+ private static final String STATUS_BAR_BRIGHTNESS_CONTROL = "status_bar_brightness_control";
+ private static final String STATUS_BAR_NOTIF_COUNT = "status_bar_notif_count";
+ private static final String STATUS_BAR_TRAFFIC = "status_bar_traffic";
+ private static final String STATUS_BAR_NETWORK_ACTIVITY = "status_bar_network_activity";
+
+ private CheckBoxPreference mStatusBarBrightnessControl;
+ private CheckBoxPreference mStatusBarNotifCount;
+ private CheckBoxPreference mStatusBarTraffic;
+ private CheckBoxPreference mStatusBarNetworkActivity;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ addPreferencesFromResource(R.xml.bars_settings);
+
+ PreferenceScreen prefSet = getPreferenceScreen();
+ ContentResolver resolver = getActivity().getContentResolver();
+
+ mStatusBarBrightnessControl = (CheckBoxPreference) prefSet.findPreference(STATUS_BAR_BRIGHTNESS_CONTROL);
+ mStatusBarBrightnessControl.setChecked((Settings.System.getInt(resolver,Settings.System.STATUS_BAR_BRIGHTNESS_CONTROL, 0) == 1));
+ mStatusBarBrightnessControl.setOnPreferenceChangeListener(this);
+
+ try {
+ if (Settings.System.getInt(getActivity().getApplicationContext().getContentResolver(),
+ Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) {
+ mStatusBarBrightnessControl.setEnabled(false);
+ mStatusBarBrightnessControl.setSummary(R.string.status_bar_toggle_info);
+ }
+ } catch (SettingNotFoundException e) {
+ }
+
+ mStatusBarNotifCount = (CheckBoxPreference) prefSet.findPreference(STATUS_BAR_NOTIF_COUNT);
+ mStatusBarNotifCount.setChecked(Settings.System.getInt(resolver,
+ Settings.System.STATUS_BAR_NOTIF_COUNT, 0) == 1);
+ mStatusBarNotifCount.setOnPreferenceChangeListener(this);
+
+ mStatusBarTraffic = (CheckBoxPreference) prefSet.findPreference(STATUS_BAR_TRAFFIC);
+ mStatusBarTraffic.setChecked(Settings.System.getInt(resolver,
+ Settings.System.STATUS_BAR_TRAFFIC, 0) == 1);
+ mStatusBarTraffic.setOnPreferenceChangeListener(this);
+
+ mStatusBarNetworkActivity = (CheckBoxPreference) prefSet.findPreference(STATUS_BAR_NETWORK_ACTIVITY);
+ mStatusBarNetworkActivity.setChecked(Settings.System.getInt(resolver,
+ Settings.System.STATUS_BAR_NETWORK_ACTIVITY, 0) == 1);
+ mStatusBarNetworkActivity.setOnPreferenceChangeListener(this);
+ mStatusBarNetworkActivity.setOnPreferenceChangeListener(this);
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
+ return true;
+ }
+
+ public boolean onPreferenceChange(Preference preference, Object objValue) {
+ ContentResolver resolver = getActivity().getContentResolver();
+ if (preference == mStatusBarBrightnessControl) {
+ boolean value = (Boolean) objValue;
+ Settings.System.putInt(resolver,Settings.System.STATUS_BAR_BRIGHTNESS_CONTROL, value ? 1 : 0);
+ } else if (preference == mStatusBarNotifCount) {
+ boolean value = (Boolean) objValue;
+ Settings.System.putInt(resolver, Settings.System.STATUS_BAR_NOTIF_COUNT, value ? 1 : 0);
+ } else if (preference == mStatusBarTraffic) {
+ boolean value = (Boolean) objValue;
+ Settings.System.putInt(resolver,
+ Settings.System.STATUS_BAR_TRAFFIC, value ? 1 : 0);
+ } else if (preference == mStatusBarNetworkActivity) {
+ boolean value = (Boolean) objValue;
+ Settings.System.putInt(resolver,
+ Settings.System.STATUS_BAR_NETWORK_ACTIVITY, value ? 1 : 0);
+ } else {
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/src/org/omnirom/omnigears/interfacesettings/MenusSettings.java b/src/org/omnirom/omnigears/interfacesettings/MenusSettings.java
new file mode 100644
index 0000000..a204673
--- /dev/null
+++ b/src/org/omnirom/omnigears/interfacesettings/MenusSettings.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2013 The OmniROM Project
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package org.omnirom.omnigears.interfacesettings;
+
+import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.R;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.os.Bundle;
+import android.preference.CheckBoxPreference;
+import android.preference.Preference;
+import android.preference.PreferenceGroup;
+import android.preference.PreferenceScreen;
+import android.provider.Settings;
+import android.provider.Settings.SettingNotFoundException;
+import android.util.Log;
+
+public class MenusSettings extends SettingsPreferenceFragment implements
+ Preference.OnPreferenceChangeListener {
+ private static final String TAG = "MenusSettings";
+
+ private static final String POWER_MENU_SCREENSHOT = "power_menu_screenshot";
+
+ private CheckBoxPreference mScreenshotPowerMenu;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ addPreferencesFromResource(R.xml.menus_settings);
+
+ PreferenceScreen prefSet = getPreferenceScreen();
+ ContentResolver resolver = getActivity().getContentResolver();
+
+ mScreenshotPowerMenu = (CheckBoxPreference) prefSet.findPreference(POWER_MENU_SCREENSHOT);
+ mScreenshotPowerMenu.setChecked(Settings.System.getInt(resolver,
+ Settings.System.SCREENSHOT_IN_POWER_MENU, 0) == 1);
+ mScreenshotPowerMenu.setOnPreferenceChangeListener(this);
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
+ return true;
+ }
+
+ public boolean onPreferenceChange(Preference preference, Object objValue) {
+ ContentResolver resolver = getActivity().getContentResolver();
+ if (preference == mScreenshotPowerMenu) {
+ boolean value = (Boolean) objValue;
+ Settings.System.putInt(resolver, Settings.System.SCREENSHOT_IN_POWER_MENU, value ? 1 : 0);
+ } else {
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/src/org/omnirom/omnigears/interfacesettings/MoreInterfaceSettings.java b/src/org/omnirom/omnigears/interfacesettings/MoreInterfaceSettings.java
new file mode 100644
index 0000000..5ac0d98
--- /dev/null
+++ b/src/org/omnirom/omnigears/interfacesettings/MoreInterfaceSettings.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2013 The OmniROM Project
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package org.omnirom.omnigears.interfacesettings;
+
+import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.R;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.os.Bundle;
+import android.preference.CheckBoxPreference;
+import android.preference.ListPreference;
+import android.preference.Preference;
+import android.preference.PreferenceGroup;
+import android.preference.PreferenceScreen;
+import android.provider.Settings;
+import android.provider.Settings.SettingNotFoundException;
+import android.util.Log;
+
+public class MoreInterfaceSettings extends SettingsPreferenceFragment implements
+ Preference.OnPreferenceChangeListener {
+ private static final String TAG = "MoreInterfaceSettings";
+
+ private static final String RECENT_MENU_CLEAR_ALL = "recent_menu_clear_all";
+ private static final String RECENT_MENU_CLEAR_ALL_LOCATION = "recent_menu_clear_all_location";
+
+ private CheckBoxPreference mRecentClearAll;
+ private ListPreference mRecentClearAllPosition;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ addPreferencesFromResource(R.xml.more_interface_settings);
+
+ PreferenceScreen prefSet = getPreferenceScreen();
+ ContentResolver resolver = getActivity().getContentResolver();
+
+ mRecentClearAll = (CheckBoxPreference) prefSet.findPreference(RECENT_MENU_CLEAR_ALL);
+ mRecentClearAll.setChecked(Settings.System.getInt(resolver,
+ Settings.System.SHOW_CLEAR_RECENTS_BUTTON, 1) == 1);
+ mRecentClearAll.setOnPreferenceChangeListener(this);
+ mRecentClearAllPosition = (ListPreference) prefSet.findPreference(RECENT_MENU_CLEAR_ALL_LOCATION);
+ String recentClearAllPosition = Settings.System.getString(resolver, Settings.System.CLEAR_RECENTS_BUTTON_LOCATION);
+ if (recentClearAllPosition != null) {
+ mRecentClearAllPosition.setValue(recentClearAllPosition);
+ }
+ mRecentClearAllPosition.setOnPreferenceChangeListener(this);
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
+ return true;
+ }
+
+ public boolean onPreferenceChange(Preference preference, Object objValue) {
+ ContentResolver resolver = getActivity().getContentResolver();
+ if (preference == mRecentClearAll) {
+ boolean value = (Boolean) objValue;
+ Settings.System.putInt(resolver, Settings.System.SHOW_CLEAR_RECENTS_BUTTON, value ? 1 : 0);
+ } else if (preference == mRecentClearAllPosition) {
+ String value = (String) objValue;
+ Settings.System.putString(resolver, Settings.System.CLEAR_RECENTS_BUTTON_LOCATION, value);
+ } else {
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/src/org/omnirom/omnigears/interfacesettings/NotificationPanelSettings.java b/src/org/omnirom/omnigears/interfacesettings/NotificationPanelSettings.java
new file mode 100644
index 0000000..7e2a79c
--- /dev/null
+++ b/src/org/omnirom/omnigears/interfacesettings/NotificationPanelSettings.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2013 The OmniROM Project
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package org.omnirom.omnigears.interfacesettings;
+
+import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.R;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.os.Bundle;
+import android.preference.CheckBoxPreference;
+import android.preference.Preference;
+import android.preference.PreferenceGroup;
+import android.preference.PreferenceScreen;
+import android.provider.Settings;
+import android.provider.Settings.SettingNotFoundException;
+import android.util.Log;
+
+public class NotificationPanelSettings extends SettingsPreferenceFragment implements
+ Preference.OnPreferenceChangeListener {
+ private static final String TAG = "NotificationPanelSettings";
+
+ private static final String STATUS_BAR_CUSTOM_HEADER = "custom_status_bar_header";
+
+ private CheckBoxPreference mStatusBarCustomHeader;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ addPreferencesFromResource(R.xml.notification_panel_settings);
+
+ PreferenceScreen prefSet = getPreferenceScreen();
+ ContentResolver resolver = getActivity().getContentResolver();
+
+ mStatusBarCustomHeader = (CheckBoxPreference) prefSet.findPreference(STATUS_BAR_CUSTOM_HEADER);
+ mStatusBarCustomHeader.setChecked(Settings.System.getInt(resolver,
+ Settings.System.STATUS_BAR_CUSTOM_HEADER, 0) == 1);
+ mStatusBarCustomHeader.setOnPreferenceChangeListener(this);
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
+ return true;
+ }
+
+ public boolean onPreferenceChange(Preference preference, Object objValue) {
+ ContentResolver resolver = getActivity().getContentResolver();
+ if (preference == mStatusBarCustomHeader) {
+ boolean value = (Boolean) objValue;
+ Settings.System.putInt(resolver,
+ Settings.System.STATUS_BAR_CUSTOM_HEADER, value ? 1 : 0);
+ } else {
+ return false;
+ }
+
+ return true;
+ }
+}