Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ROMControl option for Text size on StatusBar

Patch set 2: restart systemui after changing text size

Change-Id: Ib5b06fe39e3cd3adfda194787c57aece24f919ab
  • Loading branch information...
commit 7c72e0f3503945c581a74a9642d9ff87471448b6 1 parent 24268f9
@Zaphod-Beeblebrox Zaphod-Beeblebrox authored romanbb committed
View
18 res/values/arrays.xml
@@ -208,6 +208,24 @@
<item>25</item>
<item>0</item>
</string-array>
+
+ <string-array name="statusbar_fontsize_entries">
+ <item>8dp</item>
+ <item>12dp</item>
+ <item>14dp</item>
+ <item>16dp(Default)</item>
+ <item>20dp</item>
+ <item>24dp</item>
+ </string-array>
+
+ <string-array name="statusbar_fontsize_values">
+ <item>8</item>
+ <item>12</item>
+ <item>14</item>
+ <item>16</item>
+ <item>20</item>
+ <item>24</item>
+ </string-array>
<string-array name="statusbar_layout_entries">
<item>Regular layout</item>
View
2  res/values/strings.xml
@@ -244,6 +244,8 @@
<string name="statusbar_layout">Notification drawer layout</string>
<string name="statusbar_layout_summary">Change the notification drawer layout (requires UI restart)</string>
+ <string name="statusbar_fontsize">Statusbar Font Size</string>
+ <string name="statusbar_fontsize_summary">Change the size of text elements on statusbar</string>
<!-- Statusbar | Battery -->
<string name="battery_icon">Battery icon style</string>
View
8 res/xml/prefs_statusbar_general.xml
@@ -25,6 +25,14 @@
<CheckBoxPreference
android:key="adb_icon"
android:title="@string/adb_icon_title" />
+
+ <ListPreference
+ android:key="status_bar_fontsize"
+ android:title="@string/statusbar_fontsize"
+ android:summary="@string/statusbar_fontsize_summary"
+ android:entries="@array/statusbar_fontsize_entries"
+ android:entryValues="@array/statusbar_fontsize_values" />
+
<ListPreference
android:key="status_bar_transparency"
View
14 src/com/aokp/romcontrol/fragments/StatusBarGeneral.java
@@ -26,6 +26,7 @@
private static final String PREF_ADB_ICON = "adb_icon";
private static final String PREF_TRANSPARENCY = "status_bar_transparency";
private static final String PREF_LAYOUT = "status_bar_layout";
+ private static final String PREF_FONTSIZE = "status_bar_fontsize";
CheckBoxPreference mDefaultSettingsButtonBehavior;
CheckBoxPreference mAutoHideToggles;
@@ -34,6 +35,7 @@
CheckBoxPreference mAdbIcon;
ListPreference mTransparency;
ListPreference mLayout;
+ ListPreference mFontsize;
Context mContext;
@@ -83,7 +85,12 @@ public void onCreate(Bundle savedInstanceState) {
mLayout.setValue(Integer.toString(Settings.System.getInt(getActivity()
.getContentResolver(), Settings.System.STATUS_BAR_LAYOUT,
0)));
-
+
+ mFontsize = (ListPreference) findPreference(PREF_FONTSIZE);
+ mFontsize.setOnPreferenceChangeListener(this);
+ mFontsize.setValue(Integer.toString(Settings.System.getInt(getActivity()
+ .getContentResolver(), Settings.System.STATUSBAR_FONT_SIZE,
+ 16)));
if (mTablet) {
PreferenceScreen prefs = getPreferenceScreen();
@@ -154,6 +161,11 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
Settings.System.STATUS_BAR_ICON_TRANSPARENCY,
val / 100);
return true;
+ } else if (preference == mFontsize) {
+ int val = Integer.parseInt((String) newValue);
+ result = Settings.System.putInt(getActivity().getContentResolver(),
+ Settings.System.STATUSBAR_FONT_SIZE, val);
+ Helpers.restartSystemUI();
}
return result;
}
Please sign in to comment.
Something went wrong with that request. Please try again.