Cherish: Less boring heads up option [2/2]

Change-Id: Icdac0d6fa6615c845edff0e3c0d9dc1ab7b69941
This commit is contained in:
ezio84
2020-05-23 14:42:54 +05:30
committed by Hung Phan
parent acd7bb7753
commit e9dcd06e4d
5 changed files with 39 additions and 16 deletions

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 CherishOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector android:height="24dp" android:viewportHeight="512"
android:viewportWidth="512" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="m481,422v-210h-90v-32c49.626,0 90,-40.374 90,-90s-40.374,-90 -90,-90 -90,40.374 -90,90c0,0.669 0.011,1.335 0.025,2h-180.025v120h-90v210h-31v30c0,33.084 26.916,60 60,60h392c33.084,0 60,-26.916 60,-60v-30zM391,30c33.084,0 60,26.916 60,60s-26.916,60 -60,60 -60,-26.916 -60,-60 26.916,-60 60,-60zM306.884,122c9.385,24.588 29.255,44.036 54.116,52.852v187.148h-210v-240zM61,242h60v120h-30v30h330v-30h-30v-120h60v180h-390zM452,482h-392c-16.542,0 -30,-13.458 -30,-30h452c0,16.542 -13.458,30 -30,30z"/>
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="m376,60h30v60h-30z"/>
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="m241,182h90v30h-90z"/>
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="m241,242h90v30h-90z"/>
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="m241,302h90v30h-90z"/>
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="m181,182h30v30h-30z"/>
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="m181,242h30v30h-30z"/>
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="m181,302h30v30h-30z"/>
</vector>

View File

@@ -425,16 +425,13 @@
<string name="gaming_mode_dynamic_title">Chế độ động</string>
<string name="gaming_mode_dynamic_summary">Tự động phát hiện và thêm trò chơi</string>
<!-- Heads up -->
<string name="heads_up_notifications">Đứng đầu</string>
<string name="heads_up_notifications">Heads up</string>
<string name="heads_up_notifications_summary">Bật lên thông báo trên thanh trạng thái</string>
<string name="add_heads_up_package">Thêm ứng dụng</string>
<string name="heads_up_stoplist_title">Danh sách dừng</string>
<string name="add_heads_up_stoplist_summary">Vô hiệu hóa heads up trong các ứng dụng này</string>
<string name="heads_up_blacklist_title">Danh sách đen</string>
<string name="add_heads_up_blacklist_summary">Vô hiệu hóa các ứng dụng này</string>
<string name="profile_choose_app">Chọn ứng dụng</string>
<string name="dialog_delete_title">Xóa</string>
<string name="dialog_delete_message">Xóa mục đã chọn?</string>
<!-- Heads up timeout -->
<string name="heads_up_time_out_title">Hết giờ</string>
<string name="heads_up_time_out_summary">Thông báo nhìn nhanh sẽ hiển thị cho <xliff:g id="number">%d</xliff:g> giây</string>
@@ -454,4 +451,7 @@
<string name="heads_up_snooze_10min">10 phút</string>
<string name="heads_up_snooze_15min">15 phút</string>
<string name="heads_up_snooze_20min">20 phút</string>
<!-- Heads up options -->
<string name="less_boring_heads_up_title">Ít nhàm chán heads up</string>
<string name="less_boring_heads_up_summary">Chỉ hiển thị các ứng dụng quay số, ứng dụng nhắn tin và báo thức</string>
</resources>

View File

@@ -495,9 +495,6 @@
<string name="add_heads_up_stoplist_summary">Disable heads up in these applications</string>
<string name="heads_up_blacklist_title">Blacklist</string>
<string name="add_heads_up_blacklist_summary">Disable heads up for these applications</string>
<string name="profile_choose_app">Choose app</string>
<string name="dialog_delete_title">Delete</string>
<string name="dialog_delete_message">Remove selected item?</string>
<!-- Heads up snooze -->
<string name="heads_up_snooze_title">Snooze timer</string>
@@ -510,4 +507,8 @@
<string name="heads_up_snooze_15min">15 minutes</string>
<string name="heads_up_snooze_20min">20 minutes</string>
<!-- Heads up options -->
<string name="less_boring_heads_up_title">Less boring heads up</string>
<string name="less_boring_heads_up_summary">Show heads up only for dialer, messaging and alarm app</string>
</resources>

View File

@@ -75,6 +75,13 @@
android:summary="@string/heads_up_notifications_summary"
android:defaultValue="true" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="less_boring_heads_up"
android:icon="@drawable/ic_less_notification"
android:title="@string/less_boring_heads_up_title"
android:summary="@string/less_boring_heads_up_summary"
android:defaultValue="false" />
</PreferenceCategory>
<PreferenceCategory

View File

@@ -118,15 +118,6 @@ public class HeadsUp extends SettingsPreferenceFragment
Settings.System.HEADS_UP_NOTIFICATION_SNOOZE, defaultSnooze);
mHeadsUpSnoozeTime.setValue(String.valueOf(headsUpSnooze));
updateHeadsUpSnoozeTimeSummary(headsUpSnooze);
int defaultSnooze = systemUiResources.getInteger(systemUiResources.getIdentifier(
"com.android.systemui:integer/heads_up_default_snooze_length_ms", null, null));
mHeadsUpSnoozeTime = (ListPreference) findPreference(PREF_HEADS_UP_SNOOZE_TIME);
mHeadsUpSnoozeTime.setOnPreferenceChangeListener(this);
int headsUpSnooze = Settings.System.getInt(getContentResolver(),
Settings.System.HEADS_UP_NOTIFICATION_SNOOZE, defaultSnooze);
mHeadsUpSnoozeTime.setValue(String.valueOf(headsUpSnooze));
updateHeadsUpSnoozeTimeSummary(headsUpSnooze);
}
@Override