Cherish: Add toggles for new reticker styles[2/2]

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
Trishiraj
2022-11-14 00:08:27 +07:00
committed by Hưng Phan
parent c5a0bd55ef
commit 064a312c8c
5 changed files with 38 additions and 1 deletions

View File

@@ -550,6 +550,10 @@
<!-- reTicker -->
<string name="reticker_title">reTicker</string>
<string name="reticker_summary">Thay thế thông báo nổi bằng thông báo kiểu mới được thiết kế lại mỏng và ít xâm lấn hơn</string>
<string name="new_reticker_title">Thay thế reTicker</string>
<string name="new_reticker_summary">Sử dụng bố cục thay thế cho reticker lấy cảm hứng từ ios</string>
<string name="new_reticker_animation_title">Hoạt ảnh reTicker thay thế</string>
<string name="new_reticker_animation_summary">Sử dụng một hoạt ảnh khác cho reticker (được bật theo mặc định trên reticker thay thế)</string>
<string name="reticker_colored_title">Sử dụng nền màu ứng dụng</string>
<string name="reticker_colored_summary">Thay thế màu nền reTicker bằng màu chính của ứng dụng thông báo</string>
<!-- VoWiFi icon -->

View File

@@ -644,6 +644,10 @@
<string name="reticker_category" translatable="false">reTicker</string>
<string name="reticker_title">reTicker</string>
<string name="reticker_summary">Replace heads-up notification with slim and less invasive version of redesigned ticker</string>
<string name="new_reticker_title">Alternative reTicker</string>
<string name="new_reticker_summary">Use an alternative layout for reticker that is inspired from ios</string>
<string name="new_reticker_animation_title">Alternative reTicker animation</string>
<string name="new_reticker_animation_summary">Use a different animation for reticker (enabled by default on alternative reTicker)</string>
<string name="reticker_colored_title">Use app colored background</string>
<string name="reticker_colored_summary">Replace reTicker background color using notification app main color</string>

View File

@@ -95,6 +95,20 @@
android:title="@string/reticker_colored_title"
android:summary="@string/reticker_colored_summary"
android:defaultValue="false" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="new_reticker"
android:dependency="reticker_status"
android:title="@string/new_reticker_title"
android:summary="@string/new_reticker_summary"
android:defaultValue="false" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="new_reticker_animation"
android:dependency="reticker_status"
android:title="@string/new_reticker_animation_title"
android:summary="@string/new_reticker_animation_summary"
android:defaultValue="false" />
</PreferenceCategory>

View File

@@ -32,6 +32,8 @@ import java.util.HashSet;
import android.content.pm.PackageManager.NameNotFoundException;
import com.android.settings.SettingsPreferenceFragment;
import com.cherish.settings.preferences.SystemSettingSwitchPreference;
import com.cherish.settings.preferences.SystemSettingEditTextPreference;
import com.cherish.settings.preferences.SystemSettingMasterSwitchPreference;
import com.cherish.settings.preferences.SystemSettingListPreference;
import com.cherish.settings.preferences.SecureSettingSwitchPreference;
@@ -94,7 +96,7 @@ public class MiscSettings extends SettingsPreferenceFragment implements
boolean value = (Boolean) newValue;
SystemProperties.set(SYS_PHOTOS_SPOOF, value ? "true" : "false");
return true;
}
}
return false;
}

View File

@@ -39,9 +39,13 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
private static final String INCALL_VIB_OPTIONS = "incall_vib_options";
private static final String ALERT_SLIDER_PREF = "alert_slider_notifications";
private static final String NEW_RETICKER = "new_reticker";
private static final String NEW_RETICKER_ANIMATION = "new_reticker_animation";
private Preference mChargingLeds;
private Preference mAlertSlider;
private SystemSettingSwitchPreference mNewReticker, mNewRetickerAnimation;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
@@ -68,11 +72,20 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
if (!CherishUtils.isVoiceCapable(getActivity())) {
prefScreen.removePreference(incallVibCategory);
}
mNewReticker = (SystemSettingSwitchPreference) findPreference(NEW_RETICKER);
mNewReticker.setOnPreferenceChangeListener(this);
mNewRetickerAnimation = (SystemSettingSwitchPreference) findPreference(NEW_RETICKER_ANIMATION);
mNewRetickerAnimation.setOnPreferenceChangeListener(this);
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
if (preference == mNewReticker || preference == mNewRetickerAnimation) {
CherishUtils.showSystemUiRestartDialog(getActivity());
return true;
}
return false;
}