Revert Old Visualizer and blur lockscreen [2/2]

Revert "Lockscreen Visualizer: Add pulse magic [2/2]"

This reverts commit 7fc61d9041.

Revert "Cherish:Add visualizer feature [2/2]"

This reverts commit 912ae467c4.

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>

Revert "Cherish:Add lockscreen media artwork options"

This reverts commit 0e9c0b1e1e.

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
Hưng Phan
2022-02-25 21:50:01 +07:00
parent 137595f91d
commit 6fd9a141b2
4 changed files with 1 additions and 255 deletions

View File

@@ -532,27 +532,6 @@
<string name="vowifi_icon_title">VoWiFi icon</string>
<string name="vowifi_icon_summary">Display VoWiFi icon when available</string>
<!-- Lockscreen media artwork -->
<string name="lockscreen_media_blur_title">Media art blur level</string>
<string name="show_lockscreen_media_art_title">Show media art</string>
<string name="lockscreen_media_art_options_title">Lockscreen media art</string>
<!-- Lock screen visualizer -->
<string name="enable_visualizer">Enable Visualizer</string>
<string name="lockscreen_visualizer_title">Visualizer</string>
<string name="lockscreen_visualizer_enable">Music Visualizer</string>
<string name="lockscreen_visualizer_enable_summary">Show visualizer bars while playing music</string>
<string name="lockscreen_autocolor_title">Automatic color</string>
<string name="lockscreen_autocolor_summary">Sync color with lockscreen background</string>
<string name="lockscreen_autocolor_lavalamp">Requires lava lamp disabled</string>
<string name="lockscreen_lavalamp_title">Lava lamp</string>
<string name="lockscreen_lavalamp_summary">Use a smooth lava lamp style color blend animation</string>
<string name="lockscreen_lavalamp_speed_title">Color blend interval</string>
<string name="lockscreen_solid_lines_category">Solid Lines</string>
<string name="lockscreen_solid_units_count_title">Lines count</string>
<string name="lockscreen_solid_fudge_factor_title">Sanity level</string>
<string name="lockscreen_solid_units_opacity_title">Lines opacity</string>
<!-- Custom Signal bar icons -->
<string name="custom_signal_bar_title">Signal</string>
@@ -716,4 +695,5 @@
<!-- Sb Icon Style -->
<string name="statusbar_icons_style">Colored Statusbar Icons</string>
<string name="statusbar_icons_style_summary">Choose the style of your statusbar icons (requires SystemUI restart)</string>
</resources>

View File

@@ -57,26 +57,6 @@
android:title="@string/lockscreen_battery_info_title"
android:summary="@string/lockscreen_battery_info_summary"
android:defaultValue="true" />
<PreferenceCategory
android:key="lockscreen_media_art_options"
android:title="@string/lockscreen_media_art_options_title" >
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="show_lockscreen_media_art"
android:title="@string/show_lockscreen_media_art_title"
android:defaultValue="true" />
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="lockscreen_media_blur"
android:title="@string/lockscreen_media_blur_title"
android:dependency="show_lockscreen_media_art"
android:max="25"
android:min="0"
android:defaultValue="25"
settings:units="dp"/>
</PreferenceCategory>
<PreferenceCategory
android:key="lockscreen_category"
@@ -88,19 +68,6 @@
android:title="@string/lockscreen_shortcuts"
android:summary="@string/ls_shortcut_summary" />
</PreferenceCategory>
<PreferenceCategory
android:key="lockscreen_visualizer_options"
android:title="@string/lockscreen_visualizer_title" >
<Preference
android:key="lockscreen_visualizer"
android:fragment="com.cherish.settings.fragments.Visualizer"
android:title="@string/lockscreen_visualizer_enable"
android:summary="@string/lockscreen_visualizer_enable_summary" />
</PreferenceCategory>
<PreferenceCategory

View File

@@ -1,71 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 Havoc-OS
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"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/lockscreen_visualizer_enable">
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="lockscreen_visualizer_autocolor"
android:title="@string/lockscreen_autocolor_title"
android:summary="@string/lockscreen_autocolor_summary"
android:defaultValue="true" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="lockscreen_lavalamp_enabled"
android:title="@string/lockscreen_lavalamp_title"
android:summary="@string/lockscreen_lavalamp_summary"
android:defaultValue="false" />
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="lockscreen_lavalamp_speed"
android:title="@string/lockscreen_lavalamp_speed_title"
android:defaultValue="10000"
android:max="30000"
settings:min="200"
settings:interval="200"
settings:units="ms"
android:dependency="lockscreen_lavalamp_enabled"/>
<PreferenceCategory
android:key="lockscreen_solid_lines_category"
android:title="@string/lockscreen_solid_lines_category" >
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="lockscreen_solid_units_count"
android:title="@string/lockscreen_solid_units_count_title"
android:defaultValue="32"
android:max="128"
settings:min="16"
settings:interval="16"/>
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="lockscreen_solid_fudge_factor"
android:title="@string/lockscreen_solid_fudge_factor_title"
android:defaultValue="16"
android:max="32"
settings:min="2"/>
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="lockscreen_solid_units_opacity"
android:title="@string/lockscreen_solid_units_opacity_title"
android:defaultValue="140"
android:max="255"
settings:min="0"
settings:interval="5"/>
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -1,130 +0,0 @@
/*
* Copyright (C) 2021 The CherishOS 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.SettingsMainSwitchBar;
import com.android.settingslib.widget.OnMainSwitchChangeListener;
public class Visualizer extends SettingsPreferenceFragment implements
OnPreferenceChangeListener, OnMainSwitchChangeListener {
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 SettingsMainSwitchBar 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.setTitle(getActivity().getString(R.string.enable_visualizer));
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;
}
}