Evolver: Support navbar themes in both Launcher3 & NexusLauncher
* Also remove retired navbar features Revert "Evolver: Add separate tunables for navbar layout customization [2/2]" This reverts commit 575212bf58c30e75540e109526a63337130df73b. Signed-off-by: AnierinB <anierin@evolution-x.org> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This commit is contained in:
@@ -1,27 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2018 The Android Open Source Project
|
||||
~ Copyright 2021 The Android Open Source 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.
|
||||
-->
|
||||
|
||||
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 xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:autoMirrored="true"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
|
||||
<path
|
||||
android:fillColor="#ffffffff"
|
||||
android:pathData="M6.49,14.86c-0.66-0.39-0.66-1.34,0-1.73l6.02-3.53l5.89-3.46C19.11,5.73,20,6.26,20,7.1V14v6.9 c0,0.84-0.89,1.37-1.6,0.95l-5.89-3.46L6.49,14.86z" />
|
||||
</vector>
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M15.5417 1.66669C15.1833 1.66669 14.8417 1.76669 14.5333 1.94169L3.21667 8.74169C2.775 9.00002 2.5 9.48335 2.5 10C2.5 10.5167 2.775 11 3.21667 11.2584L14.5333 18.05C14.8417 18.2334 15.1833 18.325 15.5417 18.325C16.625 18.325 17.5 17.45 17.5 16.3667V3.62502C17.5 2.54169 16.625 1.66669 15.5417 1.66669Z" />
|
||||
</vector>
|
||||
@@ -1,29 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2018 The Android Open Source Project
|
||||
~ Copyright 2021 The Android Open Source 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.
|
||||
-->
|
||||
|
||||
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 xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="96"
|
||||
android:viewportHeight="96">
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
|
||||
<path
|
||||
android:fillColor="#ffffffff"
|
||||
android:pathData="M48 83.6c-19.6 0 -35.6 -16 -35.6 -35.6 0 -19.6 16 -35.6 35.6 -35.6 19.6 0 35.6 16 35.6 35.6l0 0.2C83.4 67.8 67.6 83.4 48 83.6ZM77.8 48.2C77.6 32 64.8 18.8 48.4 18.2c-16.2 0 -29.6 12.8 -30.2 29 0 16.6 13.2 30 29.6 30.4 16.4 -0.2 29.6 -13.2 30 -29.4z" />
|
||||
<path
|
||||
android:fillColor="#ffffffff"
|
||||
android:pathData="M72 48.2C72 61.4 61.2 72.2 47.8 72 34.4 71.8 23.8 61.2 24 47.8 24.2 34.4 34.8 24 48 24l0.2 0C61.4 24.2 72 34.8 72 48.2c0 -0.2 0 0 0 0z" />
|
||||
</vector>
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M10.0001 18.3334C5.40008 18.3334 1.66675 14.6 1.66675 10C1.66675 5.40002 5.40008 1.66669 10.0001 1.66669C14.6001 1.66669 18.3334 5.40002 18.3334 10C18.3334 14.6 14.6001 18.3334 10.0001 18.3334Z" />
|
||||
</vector>
|
||||
@@ -1,26 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2018 The Android Open Source Project
|
||||
~ Copyright 2021 The Android Open Source 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.
|
||||
-->
|
||||
|
||||
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 xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
|
||||
<path
|
||||
android:fillColor="#ffffffff"
|
||||
android:pathData="M19.9,21.5H8.1c-0.88,0-1.6-0.72-1.6-1.6V8.1c0-0.88,0.72-1.6,1.6-1.6h11.8c0.88,0,1.6,0.72,1.6,1.6v11.8 C21.5,20.78,20.78,21.5,19.9,21.5z" />
|
||||
</vector>
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M4.47634 2.5H15.5241C16.6164 2.5 17.5002 3.38382 17.5002 4.4761V15.5239C17.5002 16.6162 16.6164 17.5 15.5241 17.5H4.47634C3.38407 17.5 2.50024 16.6162 2.50024 15.5239V4.4761C2.50024 3.38382 3.38407 2.5 4.47634 2.5Z" />
|
||||
</vector>
|
||||
@@ -655,21 +655,6 @@
|
||||
<item>1</item>
|
||||
</string-array>
|
||||
|
||||
<!-- SysUI Tuner: Labels for different types of navigation bar layouts [CHAR LIMIT=60] -->
|
||||
<string-array name="navbar_layout_entries">
|
||||
<item>@string/navbar_layout_normal</item>
|
||||
<item>@string/navbar_layout_compact</item>
|
||||
<item>@string/navbar_layout_leftleaning</item>
|
||||
<item>@string/navbar_layout_rightleaning</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="navbar_layout_values" translatable="false">
|
||||
<item>default</item>
|
||||
<item>left;back,home,recent;right</item>
|
||||
<item>left,back,home,recent,right;space;space</item>
|
||||
<item>space;space;left,back,home,recent,right</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Pulse music visualizer -->
|
||||
<string-array name="pulse_render_mode_entries">
|
||||
<item>@string/pulse_render_mode_fading_bars</item>
|
||||
|
||||
@@ -552,16 +552,6 @@
|
||||
<string name="gameprops_title">Unlock higher FPS in games</string>
|
||||
<string name="gameprops_summary">Spoof your device as different model for specific games to unlock higher FPS</string>
|
||||
|
||||
<!-- Navigation Bar -->
|
||||
<string name="navbar_layout_category_title">Button navbar</string>
|
||||
<string name="navbar_layout_title">Layout</string>
|
||||
<string name="navbar_layout_normal">Normal</string>
|
||||
<string name="navbar_layout_compact">Compact</string>
|
||||
<string name="navbar_layout_leftleaning">Left-leaning</string>
|
||||
<string name="navbar_layout_rightleaning">Right-leaning</string>
|
||||
<string name="navbar_invert_layout_title">Invert layout</string>
|
||||
<string name="navbar_invert_layout_summary">Inverts the layout of the navigation bar and other items, such as the IME switcher</string>
|
||||
|
||||
<!-- About -->
|
||||
<string name="about_info">Evolution X aims to provide users with a Pixel-like feel at first glance, with additional features at your disposal</string>
|
||||
<string name="about_website_title">Website</string>
|
||||
|
||||
@@ -57,14 +57,6 @@
|
||||
android:icon="@drawable/ic_power_menu"
|
||||
android:fragment="org.evolution.settings.fragments.powermenu.PowerMenu" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<Preference
|
||||
android:key="buttons"
|
||||
android:title="@string/buttons_title"
|
||||
android:summary="@string/buttons_summary"
|
||||
android:icon="@drawable/ic_buttons"
|
||||
android:fragment="org.evolution.settings.fragments.buttons.Buttons" />
|
||||
|
||||
<!-- Miscellaneous -->
|
||||
<Preference
|
||||
android:key="miscellaneous"
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2019-2024 Evolution X
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
|
||||
android:title="@string/buttons_title">
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="buttons_navbar_layout_category"
|
||||
android:title="@string/navbar_layout_category_title">
|
||||
|
||||
<org.evolution.settings.preferences.SecureSettingListPreference
|
||||
android:key="navbar_layout_views"
|
||||
android:title="@string/navbar_layout_title"
|
||||
android:summary="%s"
|
||||
android:entries="@array/navbar_layout_entries"
|
||||
android:entryValues="@array/navbar_layout_values"
|
||||
android:defaultValue="default" />
|
||||
|
||||
<org.evolution.settings.preferences.SecureSettingSwitchPreference
|
||||
android:key="navbar_inverse_layout"
|
||||
android:title="@string/navbar_invert_layout_title"
|
||||
android:summary="@string/navbar_invert_layout_summary"
|
||||
android:defaultValue="false" />
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2022 VoltageOS
|
||||
Copyright (C) 2016-2025 crDroid Android Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -20,10 +21,10 @@
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
|
||||
android:title="@string/lock_screen_pulse_settings_title">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
<!--<SwitchPreferenceCompat
|
||||
android:key="navbar_pulse_enabled"
|
||||
android:title="@string/show_navbar_pulse_title"
|
||||
android:summary="@string/show_navbar_pulse_summary"/>
|
||||
android:summary="@string/show_navbar_pulse_summary"/>-->
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:key="lockscreen_pulse_enabled"
|
||||
|
||||
@@ -5,52 +5,22 @@
|
||||
|
||||
package org.evolution.settings;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
import org.evolution.settings.utils.DeviceUtils;
|
||||
|
||||
@SearchIndexable
|
||||
public class EvolutionSettings extends DashboardFragment {
|
||||
|
||||
private static final String TAG = "EvolutionSettings";
|
||||
|
||||
private static final String KEY_BUTTONS_PREF = "buttons";
|
||||
|
||||
private Preference mButtonsPref;
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
return R.xml.evolution_settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
|
||||
final Context context = getContext();
|
||||
final ContentResolver resolver = context.getContentResolver();
|
||||
final PreferenceScreen prefScreen = getPreferenceScreen();
|
||||
final Resources resources = context.getResources();
|
||||
|
||||
mButtonsPref = (Preference) findPreference(KEY_BUTTONS_PREF);
|
||||
|
||||
if (DeviceUtils.isEdgeToEdgeEnabled(context)) {
|
||||
prefScreen.removePreference(mButtonsPref);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.EVOLVER;
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.settings.fragments.buttons;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SearchIndexable
|
||||
public class Buttons extends SettingsPreferenceFragment implements
|
||||
Preference.OnPreferenceChangeListener {
|
||||
|
||||
private static final String TAG = "Buttons";
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
addPreferencesFromResource(R.xml.evolution_settings_buttons);
|
||||
|
||||
final Context context = getContext();
|
||||
final ContentResolver resolver = context.getContentResolver();
|
||||
final PreferenceScreen prefScreen = getPreferenceScreen();
|
||||
final Resources resources = context.getResources();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
final Context context = getContext();
|
||||
final ContentResolver resolver = context.getContentResolver();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.EVOLVER;
|
||||
}
|
||||
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.evolution_settings_buttons) {
|
||||
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
List<String> keys = super.getNonIndexableKeys(context);
|
||||
final Resources resources = context.getResources();
|
||||
return keys;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2016-2021 crDroid Android Project
|
||||
* Copyright (C) 2016-2025 crDroid Android Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -42,7 +42,6 @@ public class PulseSettings extends SettingsPreferenceFragment implements
|
||||
|
||||
private static final String TAG = PulseSettings.class.getSimpleName();
|
||||
|
||||
private static final String NAVBAR_PULSE_ENABLED_KEY = "navbar_pulse_enabled";
|
||||
private static final String LOCKSCREEN_PULSE_ENABLED_KEY = "lockscreen_pulse_enabled";
|
||||
private static final String AMBIENT_PULSE_ENABLED_KEY = "ambient_pulse_enabled";
|
||||
private static final String PULSE_SMOOTHING_KEY = "pulse_smoothing_enabled";
|
||||
@@ -61,7 +60,6 @@ public class PulseSettings extends SettingsPreferenceFragment implements
|
||||
|
||||
private static final String PULSE_SETTINGS_FOOTER = "pulse_settings_footer";
|
||||
|
||||
private SwitchPreferenceCompat mNavbarPulse;
|
||||
private SwitchPreferenceCompat mLockscreenPulse;
|
||||
private SwitchPreferenceCompat mAmbientPulse;
|
||||
private SwitchPreferenceCompat mPulseSmoothing;
|
||||
@@ -82,12 +80,6 @@ public class PulseSettings extends SettingsPreferenceFragment implements
|
||||
|
||||
ContentResolver resolver = getContext().getContentResolver();
|
||||
|
||||
mNavbarPulse = (SwitchPreferenceCompat) findPreference(NAVBAR_PULSE_ENABLED_KEY);
|
||||
boolean navbarPulse = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.NAVBAR_PULSE_ENABLED, 0, UserHandle.USER_CURRENT) != 0;
|
||||
mNavbarPulse.setChecked(navbarPulse);
|
||||
mNavbarPulse.setOnPreferenceChangeListener(this);
|
||||
|
||||
mLockscreenPulse = (SwitchPreferenceCompat) findPreference(LOCKSCREEN_PULSE_ENABLED_KEY);
|
||||
boolean lockscreenPulse = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.LOCKSCREEN_PULSE_ENABLED, 1, UserHandle.USER_CURRENT) != 0;
|
||||
@@ -124,13 +116,7 @@ public class PulseSettings extends SettingsPreferenceFragment implements
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
ContentResolver resolver = getContext().getContentResolver();
|
||||
if (preference == mNavbarPulse) {
|
||||
boolean val = (Boolean) newValue;
|
||||
Settings.Secure.putIntForUser(resolver,
|
||||
Settings.Secure.NAVBAR_PULSE_ENABLED, val ? 1 : 0, UserHandle.USER_CURRENT);
|
||||
updateAllPrefs();
|
||||
return true;
|
||||
} else if (preference == mLockscreenPulse) {
|
||||
if (preference == mLockscreenPulse) {
|
||||
boolean val = (Boolean) newValue;
|
||||
Settings.Secure.putIntForUser(resolver,
|
||||
Settings.Secure.LOCKSCREEN_PULSE_ENABLED, val ? 1 : 0, UserHandle.USER_CURRENT);
|
||||
@@ -155,18 +141,16 @@ public class PulseSettings extends SettingsPreferenceFragment implements
|
||||
private void updateAllPrefs() {
|
||||
ContentResolver resolver = getContext().getContentResolver();
|
||||
|
||||
boolean navbarPulse = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.NAVBAR_PULSE_ENABLED, 0, UserHandle.USER_CURRENT) != 0;
|
||||
boolean lockscreenPulse = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.LOCKSCREEN_PULSE_ENABLED, 1, UserHandle.USER_CURRENT) != 0;
|
||||
|
||||
boolean ambientPulse = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.AMBIENT_PULSE_ENABLED, 0, UserHandle.USER_CURRENT) != 0;
|
||||
|
||||
mPulseSmoothing.setEnabled(navbarPulse || lockscreenPulse || ambientPulse);
|
||||
mPulseSmoothing.setEnabled(lockscreenPulse || ambientPulse);
|
||||
|
||||
mColorModePref.setEnabled(navbarPulse || lockscreenPulse || ambientPulse);
|
||||
if (navbarPulse || lockscreenPulse) {
|
||||
mColorModePref.setEnabled(lockscreenPulse || ambientPulse);
|
||||
if (lockscreenPulse || ambientPulse) {
|
||||
int colorMode = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.PULSE_COLOR_MODE, COLOR_TYPE_LAVALAMP, UserHandle.USER_CURRENT);
|
||||
updateColorPrefs(colorMode);
|
||||
@@ -175,8 +159,8 @@ public class PulseSettings extends SettingsPreferenceFragment implements
|
||||
mLavaSpeedPref.setEnabled(false);
|
||||
}
|
||||
|
||||
mRenderMode.setEnabled(navbarPulse || lockscreenPulse || ambientPulse);
|
||||
if (navbarPulse || lockscreenPulse || ambientPulse) {
|
||||
mRenderMode.setEnabled(lockscreenPulse || ambientPulse);
|
||||
if (lockscreenPulse || ambientPulse) {
|
||||
int renderMode = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.PULSE_RENDER_STYLE, RENDER_STYLE_SOLID_LINES, UserHandle.USER_CURRENT);
|
||||
updateRenderCategories(renderMode);
|
||||
@@ -185,7 +169,7 @@ public class PulseSettings extends SettingsPreferenceFragment implements
|
||||
mSolidBarsCat.setEnabled(false);
|
||||
}
|
||||
|
||||
mFooterPref.setEnabled(navbarPulse || lockscreenPulse);
|
||||
mFooterPref.setEnabled(lockscreenPulse || ambientPulse);
|
||||
}
|
||||
|
||||
private void updateColorPrefs(int val) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 crDroid Android Project
|
||||
* Copyright (C) 2022-2025 crDroid Android Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -56,6 +56,7 @@ import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import com.android.internal.util.evolution.ThemeUtils;
|
||||
import com.android.internal.util.evolution.Utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -73,6 +74,7 @@ public class NavigationBarIcons extends SettingsPreferenceFragment {
|
||||
private String mCategory = "android.theme.customization.navbar";
|
||||
|
||||
private List<String> mPkgs;
|
||||
private String mLauncherPackage;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -80,7 +82,12 @@ public class NavigationBarIcons extends SettingsPreferenceFragment {
|
||||
getActivity().setTitle(R.string.themes_navigation_bar_icons_title);
|
||||
|
||||
mThemeUtils = new ThemeUtils(getActivity());
|
||||
mPkgs = mThemeUtils.getOverlayPackagesForCategory(mCategory, "com.android.systemui");
|
||||
|
||||
mLauncherPackage = Utils.isPackageInstalled(getContext(), "com.google.android.apps.nexuslauncher", false)
|
||||
? "com.google.android.apps.nexuslauncher"
|
||||
: "com.android.launcher3";
|
||||
|
||||
mPkgs = mThemeUtils.getOverlayPackagesForCategory(mCategory, mLauncherPackage);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -132,13 +139,13 @@ public class NavigationBarIcons extends SettingsPreferenceFragment {
|
||||
holder.image2.setBackgroundDrawable(getDrawable(holder.image2.getContext(), navPkg, "ic_sysbar_home"));
|
||||
holder.image3.setBackgroundDrawable(getDrawable(holder.image3.getContext(), navPkg, "ic_sysbar_recent"));
|
||||
|
||||
String currentPackageName = mThemeUtils.getOverlayInfos(mCategory, "com.android.systemui").stream()
|
||||
String currentPackageName = mThemeUtils.getOverlayInfos(mCategory, mLauncherPackage).stream()
|
||||
.filter(info -> info.isEnabled())
|
||||
.map(info -> info.packageName)
|
||||
.findFirst()
|
||||
.orElse("com.android.systemui");
|
||||
.orElse(mLauncherPackage);
|
||||
|
||||
holder.name.setText("com.android.systemui".equals(navPkg) ? "Default" : getLabel(holder.name.getContext(), navPkg));
|
||||
holder.name.setText(mLauncherPackage.equals(navPkg) ? "Default" : getLabel(holder.name.getContext(), navPkg));
|
||||
|
||||
if (currentPackageName.equals(navPkg)) {
|
||||
mAppliedPkg = navPkg;
|
||||
@@ -155,8 +162,6 @@ public class NavigationBarIcons extends SettingsPreferenceFragment {
|
||||
updateActivatedStatus(navPkg, true);
|
||||
mSelectedPkg = navPkg;
|
||||
enableOverlays(position);
|
||||
Settings.System.putStringForUser(getContext().getContentResolver(),
|
||||
Settings.System.NAVBAR_STYLE, navPkg, UserHandle.USER_CURRENT);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -193,7 +198,7 @@ public class NavigationBarIcons extends SettingsPreferenceFragment {
|
||||
}
|
||||
|
||||
public Drawable getDrawable(Context context, String pkg, String drawableName) {
|
||||
if (pkg.equals("com.android.systemui"))
|
||||
if (pkg.equals("com.android.launcher3") || pkg.equals("com.google.android.apps.nexuslauncher"))
|
||||
pkg = "com.android.settings";
|
||||
try {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
@@ -219,6 +224,6 @@ public class NavigationBarIcons extends SettingsPreferenceFragment {
|
||||
}
|
||||
|
||||
public void enableOverlays(int position) {
|
||||
mThemeUtils.setOverlayEnabled(mCategory, mPkgs.get(position), "com.android.systemui");
|
||||
mThemeUtils.setOverlayEnabled(mCategory, mPkgs.get(position), mLauncherPackage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ public class Themes extends SettingsPreferenceFragment implements
|
||||
private static final String KEY_LOCK_SOUND = "lock_sound";
|
||||
private static final String KEY_UNLOCK_SOUND = "unlock_sound";
|
||||
private static final String KEY_ICONS_CATEGORY = "themes_icons_category";
|
||||
private static final String KEY_NAVBAR_ICON = "android.theme.customization.navbar";
|
||||
private static final String KEY_SIGNAL_ICON = "android.theme.customization.signal_icon";
|
||||
private static final String KEY_UDFPS_ICON = "udfps_icon";
|
||||
private static final String KEY_ANIMATIONS_CATEGORY = "themes_animations_category";
|
||||
@@ -79,7 +78,6 @@ public class Themes extends SettingsPreferenceFragment implements
|
||||
private GlobalSettingListPreference mUnlockSound;
|
||||
private PreferenceCategory mLauncherCategory;
|
||||
private PreferenceCategory mIconsCategory;
|
||||
private Preference mNavbarIcon;
|
||||
private Preference mSignalIcon;
|
||||
private Preference mUdfpsIcon;
|
||||
private PreferenceCategory mAnimationsCategory;
|
||||
@@ -106,7 +104,6 @@ public class Themes extends SettingsPreferenceFragment implements
|
||||
mUnlockSound.setOnPreferenceChangeListener(this);
|
||||
mLauncherCategory = (PreferenceCategory) findPreference(KEY_LAUNCHER_CATEGORY);
|
||||
mIconsCategory = (PreferenceCategory) findPreference(KEY_ICONS_CATEGORY);
|
||||
mNavbarIcon = (Preference) findPreference(KEY_NAVBAR_ICON);
|
||||
mSignalIcon = (Preference) findPreference(KEY_SIGNAL_ICON);
|
||||
mUdfpsIcon = (Preference) findPreference(KEY_UDFPS_ICON);
|
||||
mAnimationsCategory = (PreferenceCategory) findPreference(KEY_ANIMATIONS_CATEGORY);
|
||||
@@ -116,10 +113,6 @@ public class Themes extends SettingsPreferenceFragment implements
|
||||
mIconsCategory.removePreference(mSignalIcon);
|
||||
}
|
||||
|
||||
if (DeviceUtils.isEdgeToEdgeEnabled(context)) {
|
||||
mIconsCategory.removePreference(mNavbarIcon);
|
||||
}
|
||||
|
||||
FingerprintManager fingerprintManager = (FingerprintManager)
|
||||
getActivity().getSystemService(Context.FINGERPRINT_SERVICE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user