forked from daproy/android_packages_apps_Settings
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path0001-add-option-to-display-navbar-1-2.patch
111 lines (98 loc) · 4.58 KB
/
0001-add-option-to-display-navbar-1-2.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
From 0e64b9e45ab258232afaff986484955a2b640be5 Mon Sep 17 00:00:00 2001
From: Konsta <[email protected]>
Date: Fri, 8 Jun 2012 12:18:03 +0300
Subject: [PATCH 03/16] add option to display navbar (1/2)
Change-Id: I91aea5a954d86e0e256a1e763a59120873a71121
---
res/values/strings.xml | 7 +++++++
res/xml/display_settings.xml | 4 ++++
res/xml/system_settings.xml | 6 ++++++
.../settings/cyanogenmod/SystemSettings.java | 12 ++++++++++++
4 files changed, 29 insertions(+)
diff --git a/res/values/strings.xml b/res/values/strings.xml
index cc6a380..3494972 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -4479,6 +4479,13 @@ found in the list of installed apps.</string>
"system_update_settings_list_item_title" in this project. [CHAR LIMIT=25] -->
<string name="additional_system_update_settings_list_item_title">Additional system updates</string>
+ <!-- Navbar -->
+ <string name="konsta_navbar">Show navigation bar</string>
+ <string name="konsta_navbar_reboot">Requires reboot</string>
+
+ <!-- Category for notification light options -->
+ <string name="notification_light_title">Notification light options</string>
+
<!-- Electron Beam -->
<string name="display_category_animation_options_title">Animation</string>
<string name="display_electron_beam_animation_on_title">Screen-on animation</string>
diff --git a/res/xml/display_settings.xml b/res/xml/display_settings.xml
index efb1ca5..bffd004 100644
--- a/res/xml/display_settings.xml
+++ b/res/xml/display_settings.xml
@@ -42,6 +42,10 @@
android:entries="@array/screen_timeout_entries"
android:entryValues="@array/screen_timeout_values" />
+ <PreferenceCategory
+ android:key="category_pulse_notification_options"
+ android:title="@string/notification_light_title"/>
+
<PreferenceScreen
android:key="notification_pulse"
android:title="@string/notification_pulse_title"
diff --git a/res/xml/system_settings.xml b/res/xml/system_settings.xml
index 17dd604..a511bae 100644
--- a/res/xml/system_settings.xml
+++ b/res/xml/system_settings.xml
@@ -68,4 +68,10 @@
</PreferenceCategory>
+ <CheckBoxPreference
+ android:key="konsta_navbar"
+ android:title="@string/konsta_navbar"
+ android:summary="@string/konsta_navbar_reboot"
+ android:defaultValue="false" />
+
</PreferenceScreen>
diff --git a/src/com/android/settings/cyanogenmod/SystemSettings.java b/src/com/android/settings/cyanogenmod/SystemSettings.java
index 51f1772..7301722 100644
--- a/src/com/android/settings/cyanogenmod/SystemSettings.java
+++ b/src/com/android/settings/cyanogenmod/SystemSettings.java
@@ -23,6 +23,7 @@ import android.content.res.Resources;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceScreen;
@@ -46,9 +47,11 @@ public class SystemSettings extends SettingsPreferenceFragment implements
private static final String KEY_NAV_BAR = "navigation_bar";
private static final String KEY_NAV_BAR_EDIT = "nav_bar_edit";
private static final String KEY_NAV_BAR_GLOW = "nav_bar_glow";
+ private static final String KONSTA_NAVBAR = "konsta_navbar";
private ListPreference mFontSizePref;
private ListPreference mGlowTimes;
+ private CheckBoxPreference mKonstaNavbar;
private final Configuration mCurConfig = new Configuration();
@@ -75,6 +78,10 @@ public class SystemSettings extends SettingsPreferenceFragment implements
} catch (RemoteException e) {
}
updateGlowTimesSummary();
+
+ mKonstaNavbar = (CheckBoxPreference) findPreference(KONSTA_NAVBAR);
+ mKonstaNavbar.setChecked(Settings.System.getInt(getActivity().getContentResolver(),
+ Settings.System.KONSTA_NAVBAR, 0) == 1);
}
int floatToIndex(float val) {
@@ -157,6 +164,11 @@ public class SystemSettings extends SettingsPreferenceFragment implements
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
+ if (preference == mKonstaNavbar) {
+ Settings.System.putInt(getContentResolver(), Settings.System.KONSTA_NAVBAR,
+ mKonstaNavbar.isChecked() ? 1 : 0);
+ return true;
+ }
return super.onPreferenceTreeClick(preferenceScreen, preference);
}
--
1.7.9.5