Cherish: Allow controlling QS blur alpha [2/2]
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
<string name="volume_title">Phím rockers</string>
|
||||
<string name="notifications_title">Thông báo</string>
|
||||
<string name="device_part_title">Chứ năng thiết bị</string>
|
||||
<string name="blur_tiles_title">Làm mờ</string>
|
||||
|
||||
<!-- General strings -->
|
||||
<string name="ok">OK</string>
|
||||
@@ -51,4 +52,5 @@
|
||||
<!-- QS category -->
|
||||
<string name="enable_clear_all_button">Thay thế xóa tất cả văn bản bằng nút đẹp</string>
|
||||
<string name="enable_clear_all_button_summary">Hiển thị xóa tất cả nút thông báo trong cài đặt nhanh thay vì văn bản mặc định</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<string name="volume_title">Volume rockers</string>
|
||||
<string name="notifications_title">Notifications</string>
|
||||
<string name="device_part_title">Device features</string>
|
||||
<string name="qs_category">QS category</string>
|
||||
|
||||
<!-- General strings -->
|
||||
<string name="ok">OK</string>
|
||||
@@ -53,6 +54,8 @@
|
||||
<string name="enable_clear_all_button_summary">Show clear all notifications button in quick settings instead of default text one</string>
|
||||
<string name="qs_bg_use_new_tint">QS tile colors</string>
|
||||
<string name="qs_bg_use_new_tint_summary">Use accent color for qs tile icons and background</string>
|
||||
<string name="qs_blur_alpha_title">Blur alpha</string>
|
||||
<string name="qs_blur_alpha_summary">Sets the blur transparency</string>
|
||||
<string name="blur_quicksettings">Blur behind quick settings (beta)</string>
|
||||
<string name="blur_quicksettings_subtitle">blurs darkened background behind quick settings</string>
|
||||
|
||||
|
||||
@@ -34,6 +34,16 @@
|
||||
android:summary="@string/blur_quicksettings_subtitle"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.CustomSeekBarPreference
|
||||
android:key="qs_blur_alpha"
|
||||
android:title="@string/qs_blur_alpha_title"
|
||||
android:summary="@string/qs_blur_alpha_summary"
|
||||
android:max="100"
|
||||
settings:min="1"
|
||||
settings:unitsRight="@string/unit_percent"
|
||||
android:persistent="false"
|
||||
android:dependency="qs_blur" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="dismiss_all_button"
|
||||
android:icon="@drawable/ic_x"
|
||||
|
||||
@@ -14,6 +14,7 @@ import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
import androidx.preference.SwitchPreference;
|
||||
import com.cherish.settings.preferences.CustomSeekBarPreference;
|
||||
import android.provider.Settings;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
@@ -26,7 +27,9 @@ import java.util.ArrayList;
|
||||
|
||||
public class QuickSettings extends SettingsPreferenceFragment implements
|
||||
OnPreferenceChangeListener {
|
||||
|
||||
private static final String QS_BLUR_ALPHA = "qs_blur_alpha";
|
||||
|
||||
private CustomSeekBarPreference mQSBlurAlpha;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
@@ -36,12 +39,22 @@ public class QuickSettings extends SettingsPreferenceFragment implements
|
||||
|
||||
PreferenceScreen prefScreen = getPreferenceScreen();
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
mQSBlurAlpha = (CustomSeekBarPreference) findPreference(QS_BLUR_ALPHA);
|
||||
int qsBlurAlpha = Settings.System.getInt(getContentResolver(),
|
||||
Settings.System.QS_BLUR_ALPHA, 100);
|
||||
mQSBlurAlpha.setValue(qsBlurAlpha);
|
||||
mQSBlurAlpha.setOnPreferenceChangeListener(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
|
||||
if (preference == mQSBlurAlpha) {
|
||||
int value = (Integer) newValue;
|
||||
Settings.System.putInt(getContentResolver(),
|
||||
Settings.System.QS_BLUR_ALPHA, value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user