Revert "Cherish:Add pref for qs brightness slider position [2/2]"
This reverts commit 31e425c4da.
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
@@ -300,12 +300,6 @@
|
|||||||
<string name="global_actions_max_columns_title">Max actions to show</string>
|
<string name="global_actions_max_columns_title">Max actions to show</string>
|
||||||
<string name="global_actions_max_columns_summary">Set how many actions to show before buttons move to overflow menu</string>
|
<string name="global_actions_max_columns_summary">Set how many actions to show before buttons move to overflow menu</string>
|
||||||
|
|
||||||
<!-- Brightness slider -->
|
|
||||||
<string name="qs_show_brightness_title">Brightness slider</string>
|
|
||||||
<string name="qs_show_brightness_summary">Brightness slider visability and settings</string>
|
|
||||||
<string name="qs_brightness_position_bottom_title">Bottom brightness slider</string>
|
|
||||||
<string name="qs_brightness_position_bottom_summary">Show the brightness slider on the bottom of QS</string>
|
|
||||||
|
|
||||||
<!-- Battery Styles -->
|
<!-- Battery Styles -->
|
||||||
<string name="battery_style_category_title">Battery level</string>
|
<string name="battery_style_category_title">Battery level</string>
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2020 CherishOS
|
|
||||||
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.
|
|
||||||
-->
|
|
||||||
<PreferenceScreen
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:title="@string/qs_show_brightness_title"
|
|
||||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
|
||||||
|
|
||||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
|
||||||
android:key="qs_brightness_position_bottom"
|
|
||||||
android:icon="@drawable/ic_brightness"
|
|
||||||
android:title="@string/qs_brightness_position_bottom_title"
|
|
||||||
android:summary="@string/qs_brightness_position_bottom_summary"
|
|
||||||
android:defaultValue="false" />
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:title="@string/quicksettings_title"
|
android:title="@string/quicksettings_title"
|
||||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:title="@string/qs_category">
|
android:title="@string/qs_category">
|
||||||
@@ -75,6 +76,8 @@
|
|||||||
android:summary="@string/qs_show_brightness_summary"
|
android:summary="@string/qs_show_brightness_summary"
|
||||||
android:fragment="com.cherish.settings.fragments.BrightnessSliderSettings"
|
android:fragment="com.cherish.settings.fragments.BrightnessSliderSettings"
|
||||||
android:defaultValue="true" />
|
android:defaultValue="true" />
|
||||||
|
=======
|
||||||
|
>>>>>>> parent of 31e425c4 (Cherish:Add pref for qs brightness slider position [2/2])
|
||||||
|
|
||||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||||
android:key="status_bar_brightness_control"
|
android:key="status_bar_brightness_control"
|
||||||
|
|||||||
@@ -1,70 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020 CherishOS
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
package com.cherish.settings.fragments;
|
|
||||||
|
|
||||||
import android.content.ContentResolver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.content.pm.ResolveInfo;
|
|
||||||
import android.content.res.Resources;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.UserHandle;
|
|
||||||
import android.provider.Settings;
|
|
||||||
|
|
||||||
import androidx.preference.ListPreference;
|
|
||||||
import androidx.preference.SwitchPreference;
|
|
||||||
import androidx.preference.Preference;
|
|
||||||
import androidx.preference.PreferenceCategory;
|
|
||||||
import androidx.preference.PreferenceScreen;
|
|
||||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
|
||||||
|
|
||||||
import com.android.settings.R;
|
|
||||||
import com.android.settings.SettingsPreferenceFragment;
|
|
||||||
|
|
||||||
import com.android.internal.logging.nano.MetricsProto;
|
|
||||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class BrightnessSliderSettings extends SettingsPreferenceFragment implements
|
|
||||||
Preference.OnPreferenceChangeListener {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
addPreferencesFromResource(R.xml.brightness_slider);
|
|
||||||
final Resources res = getResources();
|
|
||||||
final ContentResolver resolver = getActivity().getContentResolver();
|
|
||||||
final PreferenceScreen prefScreen = getPreferenceScreen();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
final ContentResolver resolver = getContentResolver();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMetricsCategory() {
|
|
||||||
return MetricsProto.MetricsEvent.CHERISH_SETTINGS;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -31,12 +31,10 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
public class QuickSettings extends SettingsPreferenceFragment implements
|
public class QuickSettings extends SettingsPreferenceFragment implements
|
||||||
OnPreferenceChangeListener {
|
OnPreferenceChangeListener {
|
||||||
|
|
||||||
private static final String BRIGHTNESS_SLIDER = "qs_show_brightness";
|
|
||||||
private static final String FOOTER_TEXT_STRING = "footer_text_string";
|
private static final String FOOTER_TEXT_STRING = "footer_text_string";
|
||||||
private static final String STATUS_BAR_CUSTOM_HEADER = "status_bar_custom_header";
|
private static final String STATUS_BAR_CUSTOM_HEADER = "status_bar_custom_header";
|
||||||
|
|
||||||
private SystemSettingMasterSwitchPreference mBrightnessSlider;
|
|
||||||
private SystemSettingEditTextPreference mFooterString;
|
private SystemSettingEditTextPreference mFooterString;
|
||||||
private SystemSettingMasterSwitchPreference mCustomHeader;
|
private SystemSettingMasterSwitchPreference mCustomHeader;
|
||||||
|
|
||||||
@@ -48,13 +46,6 @@ public class QuickSettings extends SettingsPreferenceFragment implements
|
|||||||
|
|
||||||
PreferenceScreen prefScreen = getPreferenceScreen();
|
PreferenceScreen prefScreen = getPreferenceScreen();
|
||||||
ContentResolver resolver = getActivity().getContentResolver();
|
ContentResolver resolver = getActivity().getContentResolver();
|
||||||
|
|
||||||
mBrightnessSlider = (SystemSettingMasterSwitchPreference)
|
|
||||||
findPreference(BRIGHTNESS_SLIDER);
|
|
||||||
mBrightnessSlider.setOnPreferenceChangeListener(this);
|
|
||||||
boolean enabled = Settings.System.getInt(resolver,
|
|
||||||
BRIGHTNESS_SLIDER, 1) == 1;
|
|
||||||
mBrightnessSlider.setChecked(enabled);
|
|
||||||
|
|
||||||
mCustomHeader = (SystemSettingMasterSwitchPreference) findPreference(STATUS_BAR_CUSTOM_HEADER);
|
mCustomHeader = (SystemSettingMasterSwitchPreference) findPreference(STATUS_BAR_CUSTOM_HEADER);
|
||||||
int qsHeader = Settings.System.getInt(resolver,
|
int qsHeader = Settings.System.getInt(resolver,
|
||||||
@@ -78,12 +69,7 @@ public class QuickSettings extends SettingsPreferenceFragment implements
|
|||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
ContentResolver resolver = getActivity().getContentResolver();
|
ContentResolver resolver = getActivity().getContentResolver();
|
||||||
if (preference == mBrightnessSlider) {
|
if (preference == mFooterString) {
|
||||||
Boolean value = (Boolean) newValue;
|
|
||||||
Settings.System.putInt(resolver,
|
|
||||||
BRIGHTNESS_SLIDER, value ? 1 : 0);
|
|
||||||
return true;
|
|
||||||
} else if (preference == mFooterString) {
|
|
||||||
String value = (String) newValue;
|
String value = (String) newValue;
|
||||||
if (value != "" && value != null)
|
if (value != "" && value != null)
|
||||||
Settings.System.putString(getActivity().getContentResolver(),
|
Settings.System.putString(getActivity().getContentResolver(),
|
||||||
|
|||||||
Reference in New Issue
Block a user