From 3920590036262626688d8180b01b0414961439e7 Mon Sep 17 00:00:00 2001 From: SuperDroidBond Date: Tue, 6 Jul 2021 01:45:20 +0530 Subject: [PATCH] Cherish: Remove Old Visualizer For Pulse Welcoming [2/2] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hưng Phan --- res/values/cherish_strings.xml | 16 -- res/xml/cherish_settings_lockscreen.xml | 7 - res/xml/visualizer_settings.xml | 71 -------- .../settings/fragments/Visualizer.java | 162 ------------------ 4 files changed, 256 deletions(-) delete mode 100644 res/xml/visualizer_settings.xml delete mode 100644 src/com/cherish/settings/fragments/Visualizer.java diff --git a/res/values/cherish_strings.xml b/res/values/cherish_strings.xml index a359560..05f5613 100644 --- a/res/values/cherish_strings.xml +++ b/res/values/cherish_strings.xml @@ -527,22 +527,6 @@ Dashboard suggestions are enabled Dashboard suggestions are disabled - - Display music visualizer - Toggle lockscreen visualizer - Music Visualizer - Show visualizer bars while playing music - Automatic color - Sync color with lockscreen background - Requires lava lamp disabled - Lava lamp - Use a smooth lava lamp style color blend animation - Color blend interval - Solid Lines - Lines count - Sanity level - Lines opacity - Media art Toggle visibility of media art diff --git a/res/xml/cherish_settings_lockscreen.xml b/res/xml/cherish_settings_lockscreen.xml index 04dfd19..f90c81e 100644 --- a/res/xml/cherish_settings_lockscreen.xml +++ b/res/xml/cherish_settings_lockscreen.xml @@ -246,13 +246,6 @@ android:key="visualizer" android:title="@string/visualizer_title"> - - - - - - - - - - - - - - - - - - - - - diff --git a/src/com/cherish/settings/fragments/Visualizer.java b/src/com/cherish/settings/fragments/Visualizer.java deleted file mode 100644 index 66808ee..0000000 --- a/src/com/cherish/settings/fragments/Visualizer.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (C) 2019 AospExtended ROM 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. - */ - -package com.cherish.settings.fragments; - -import android.content.ContentResolver; -import android.content.Context; -import android.os.Bundle; -import android.os.UserHandle; -import android.provider.Settings; -import androidx.preference.ListPreference; -import androidx.preference.Preference; -import androidx.preference.PreferenceCategory; -import androidx.preference.Preference.OnPreferenceChangeListener; -import androidx.preference.SwitchPreference; - -import com.android.internal.logging.nano.MetricsProto.MetricsEvent; - -import com.android.settings.R; -import com.android.settings.SettingsPreferenceFragment; - -import android.widget.Switch; -import com.android.settings.SettingsActivity; -import com.android.settings.widget.SwitchBar; -import com.android.settings.search.BaseSearchIndexProvider; -import com.android.settingslib.search.SearchIndexable; -import android.provider.SearchIndexableResource; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; - -@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC) -public class Visualizer extends SettingsPreferenceFragment implements - OnPreferenceChangeListener, SwitchBar.OnSwitchChangeListener { - - private static final String KEY_AUTOCOLOR = "lockscreen_visualizer_autocolor"; - private static final String KEY_LAVALAMP = "lockscreen_lavalamp_enabled"; - - private SwitchPreference mAutoColor; - private SwitchPreference mLavaLamp; - - private Switch mSwitch; - - private PreferenceCategory pc; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - addPreferencesFromResource(R.xml.visualizer_settings); - - ContentResolver resolver = getActivity().getContentResolver(); - - pc = (PreferenceCategory) findPreference("lockscreen_solid_lines_category"); - - boolean mLavaLampEnabled = Settings.System.getIntForUser(resolver, - Settings.System.LOCKSCREEN_LAVALAMP_ENABLED, 1, - UserHandle.USER_CURRENT) != 0; - - mAutoColor = (SwitchPreference) findPreference(KEY_AUTOCOLOR); - mAutoColor.setEnabled(!mLavaLampEnabled); - - if (mLavaLampEnabled) { - mAutoColor.setSummary(getActivity().getString( - R.string.lockscreen_autocolor_lavalamp)); - } else { - mAutoColor.setSummary(getActivity().getString( - R.string.lockscreen_autocolor_summary)); - } - - mLavaLamp = (SwitchPreference) findPreference(KEY_LAVALAMP); - mLavaLamp.setOnPreferenceChangeListener(this); - } - - @Override - public void onActivityCreated(Bundle savedInstanceState) { - super.onActivityCreated(savedInstanceState); - final SettingsActivity activity = (SettingsActivity) getActivity(); - final SwitchBar switchBar = activity.getSwitchBar(); - mSwitch = switchBar.getSwitch(); - boolean enabled = Settings.System.getInt(getActivity().getContentResolver(), - Settings.System.LOCKSCREEN_VISUALIZER_ENABLED, 0) ==1; - mSwitch.setChecked(enabled); - mAutoColor.setEnabled(enabled); - mLavaLamp.setEnabled(enabled); - pc.setEnabled(enabled); - switchBar.setSwitchBarText(R.string.switch_on_text, R.string.switch_off_text); - switchBar.addOnSwitchChangeListener(this); - switchBar.show(); - } - - @Override - public void onSwitchChanged(Switch switchView, boolean isChecked) { - Settings.System.putInt(getActivity().getContentResolver(), - Settings.System.LOCKSCREEN_VISUALIZER_ENABLED, isChecked ? 1 : 0); - mAutoColor.setEnabled(isChecked); - mLavaLamp.setEnabled(isChecked); - pc.setEnabled(isChecked); - } - - @Override - public boolean onPreferenceChange(Preference preference, Object newValue) { - ContentResolver resolver = getActivity().getContentResolver(); - if (preference == mLavaLamp) { - boolean mLavaLampEnabled = (Boolean) newValue; - if (mLavaLampEnabled) { - mAutoColor.setSummary(getActivity().getString( - R.string.lockscreen_autocolor_lavalamp)); - } else { - mAutoColor.setSummary(getActivity().getString( - R.string.lockscreen_autocolor_summary)); - } - mAutoColor.setEnabled(!mLavaLampEnabled); - return true; - } - return false; - } - - @Override - public int getMetricsCategory() { - return MetricsEvent.CHERISH_SETTINGS; - } - - /** - * For Search. - */ - - public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = - new BaseSearchIndexProvider() { - - @Override - public List getXmlResourcesToIndex(Context context, - boolean enabled) { - ArrayList result = - new ArrayList(); - SearchIndexableResource sir = new SearchIndexableResource(context); - sir.xmlResId = R.xml.visualizer_settings; - result.add(sir); - return result; - } - - @Override - public List getNonIndexableKeys(Context context) { - List keys = super.getNonIndexableKeys(context); - return keys; - } - }; -}