Skip to content

Commit

Permalink
Halo visibility when there are no notifications option
Browse files Browse the repository at this point in the history
  • Loading branch information
sbradymobile authored and temasek committed Jul 10, 2013
1 parent c9df211 commit 75161ad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions res/values/cm_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,8 @@
<string name="halo_ping_color_title">HALO ping color</string>
<string name="halo_pause_title">HALO pause active app</string>
<string name="halo_pause_summary">When opening an app with HALO the underlying app will get paused (enabled by default on low memory devices)</string>
<string name="halo_gone_title">HALO notification visibility</string>
<string name="halo_gone_summary">Completely hide HALO when there are no notifications</string>

<!-- We want HALO popups -->
<string name="popups_title">Allow floating windows</string>
Expand Down
6 changes: 6 additions & 0 deletions res/xml/user_interface_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@
android:summary="@string/halo_pause_summary"
android:dependency="halo_enabled" />

<CheckBoxPreference
android:key="halo_gone"
android:title="@string/halo_gone_title"
android:summary="@string/halo_gone_summary"
android:dependency="halo_enabled" />

<PreferenceCategory
android:key="halo_color"
android:title="@string/halo_color_title" />
Expand Down
10 changes: 10 additions & 0 deletions src/com/android/settings/UserInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class UserInterface extends SettingsPreferenceFragment implements OnPrefe
private static final String KEY_HALO_BUTTON_COLOR = "halo_button_color";
private static final String KEY_HALO_TEXT_BUBBLE_COLOR = "halo_text_bubble_color";
private static final String KEY_HALO_PING_COLOR = "halo_ping_color";
private static final String KEY_HALO_GONE = "halo_gone";

private Preference mLcdDensity;
private Preference mCustomLabel;
Expand All @@ -86,6 +87,7 @@ public class UserInterface extends SettingsPreferenceFragment implements OnPrefe
private Preference mHaloButtonColor;
private Preference mHaloTextBubbleColor;
private Preference mHaloPingColor;
private CheckBoxPreference mHaloGone;

private boolean mIsCrtOffChecked = false;

Expand Down Expand Up @@ -126,6 +128,10 @@ public void onCreate(Bundle savedInstanceState) {
mHaloReversed.setChecked(Settings.System.getInt(mContext.getContentResolver(),
Settings.System.HALO_REVERSED, 1) == 1);

mHaloGone = (CheckBoxPreference) prefSet.findPreference(KEY_HALO_GONE);
mHaloGone.setChecked(Settings.System.getInt(mContext.getContentResolver(),
Settings.System.HALO_GONE, 0) == 1);

int isLowRAM = (ActivityManager.isLargeRAM()) ? 0 : 1;
mHaloPause = (CheckBoxPreference) prefSet.findPreference(KEY_HALO_PAUSE);
mHaloPause.setChecked(Settings.System.getInt(mContext.getContentResolver(),
Expand Down Expand Up @@ -320,6 +326,10 @@ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preferen
cp.setDefaultColor(0xff33b5e5);
cp.show();
return true;
} else if (preference == mHaloGone) {
Settings.System.putInt(mContext.getContentResolver(),
Settings.System.HALO_GONE, mHaloGone.isChecked()
? 1 : 0);
} else if (preference == mCustomLabel) {
AlertDialog.Builder alert = new AlertDialog.Builder(getActivity());
alert.setTitle(R.string.custom_carrier_label_title);
Expand Down

0 comments on commit 75161ad

Please sign in to comment.