Cherish: Launch Statusbar items and LS shortcut editor
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
@@ -68,6 +68,19 @@
|
|||||||
<!-- QS settings -->
|
<!-- QS settings -->
|
||||||
<string name="qs_title">Quick settings</string>
|
<string name="qs_title">Quick settings</string>
|
||||||
|
|
||||||
|
<!-- Lockscreen shortcuts -->
|
||||||
|
<string name="ls_category">Lockscreen Items</string>
|
||||||
|
<string name="ls_tuner">Enable Lockscreen tuner</string>
|
||||||
|
<string name="lockscreen_shortcuts">Lockscreen shortcuts</string>
|
||||||
|
<string name="ls_shortcut_summary">Customize Lockscreen shortcuts</string>
|
||||||
|
|
||||||
|
<!-- Lockscreen icons -->
|
||||||
|
<string name="lockscreen_tuner_title">Lockscreen tuner</string>
|
||||||
|
|
||||||
|
<!-- Statusbar Items -->
|
||||||
|
<string name="sb_icons">Statusbar Icons</string>
|
||||||
|
<string name="statusbar_items_category">Statusbar items</string>
|
||||||
|
|
||||||
<!-- Status bar - icons -->
|
<!-- Status bar - icons -->
|
||||||
<string name="status_bar_icons_title">Status bar icons</string>
|
<string name="status_bar_icons_title">Status bar icons</string>
|
||||||
|
|
||||||
|
|||||||
35
res/xml/cherish_lockscreen_shortcuts.xml
Normal file
35
res/xml/cherish_lockscreen_shortcuts.xml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2020 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.
|
||||||
|
-->
|
||||||
|
<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_shortcuts">
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
android:key="lockscreen_tuner"
|
||||||
|
android:title="@string/ls_tuner">
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:title="@string/lockscreen_tuner_title" >
|
||||||
|
<intent android:action="android.intent.action.MAIN"
|
||||||
|
android:targetPackage="com.android.systemui"
|
||||||
|
android:targetClass="com.android.systemui.tuner.LockscreenActivity" />
|
||||||
|
</Preference>
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
||||||
@@ -18,4 +18,17 @@
|
|||||||
android:title="@string/lockscreen_title"
|
android:title="@string/lockscreen_title"
|
||||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
android:key="lockscreen_category"
|
||||||
|
android:title="@string/ls_category">
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:key="lockscreen_shortcuts"
|
||||||
|
android:fragment="com.cherish.settings.fragments.LockscreenShortcuts"
|
||||||
|
android:title="@string/lockscreen_shortcuts"
|
||||||
|
android:summary="@string/ls_shortcut_summary" />
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|||||||
@@ -15,4 +15,18 @@
|
|||||||
android:title="@string/statusbar_title"
|
android:title="@string/statusbar_title"
|
||||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
android:key="statusbar_icons"
|
||||||
|
android:title="@string/sb_icons">
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:key="systemui_tuner_statusbar"
|
||||||
|
android:title="@string/statusbar_items_category" >
|
||||||
|
<intent android:action="android.intent.action.MAIN"
|
||||||
|
android:targetPackage="com.android.systemui"
|
||||||
|
android:targetClass="com.android.systemui.tuner.StatusbarItemsActivity" />
|
||||||
|
</Preference>
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|||||||
76
src/com/cherish/settings/fragments/LockscreenShortcuts.java
Normal file
76
src/com/cherish/settings/fragments/LockscreenShortcuts.java
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020 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.app.ActivityManagerNative;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.ContentResolver;
|
||||||
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.UserHandle;
|
||||||
|
import android.os.RemoteException;
|
||||||
|
import android.os.ServiceManager;
|
||||||
|
import androidx.preference.Preference;
|
||||||
|
import androidx.preference.ListPreference;
|
||||||
|
import androidx.preference.PreferenceCategory;
|
||||||
|
import androidx.preference.PreferenceScreen;
|
||||||
|
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.WindowManagerGlobal;
|
||||||
|
import android.view.IWindowManager;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import com.android.settings.R;
|
||||||
|
import com.android.settings.SettingsPreferenceFragment;
|
||||||
|
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||||
|
import com.android.settings.Utils;
|
||||||
|
|
||||||
|
public class LockscreenShortcuts extends SettingsPreferenceFragment implements OnPreferenceChangeListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
addPreferencesFromResource(R.xml.cherish_lockscreen_shortcuts);
|
||||||
|
|
||||||
|
final ContentResolver resolver = getActivity().getContentResolver();
|
||||||
|
final PreferenceScreen prefSet = getPreferenceScreen();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetricsCategory() {
|
||||||
|
return MetricsEvent.CHERISH_SETTINGS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object objValue) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user