diff --git a/res/drawable/fod_icon_arc_reactor.png b/res/drawable/fod_icon_arc_reactor.png
deleted file mode 100644
index 6e80ac1..0000000
Binary files a/res/drawable/fod_icon_arc_reactor.png and /dev/null differ
diff --git a/res/drawable/fod_icon_arc_reactor.webp b/res/drawable/fod_icon_arc_reactor.webp
deleted file mode 100644
index 5122256..0000000
Binary files a/res/drawable/fod_icon_arc_reactor.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_cherish.png b/res/drawable/fod_icon_cherish.png
deleted file mode 100644
index ca423f4..0000000
Binary files a/res/drawable/fod_icon_cherish.png and /dev/null differ
diff --git a/res/drawable/fod_icon_cpt_america_flat.png b/res/drawable/fod_icon_cpt_america_flat.png
deleted file mode 100644
index 7937842..0000000
Binary files a/res/drawable/fod_icon_cpt_america_flat.png and /dev/null differ
diff --git a/res/drawable/fod_icon_cpt_america_flat_gray.png b/res/drawable/fod_icon_cpt_america_flat_gray.png
deleted file mode 100644
index 6eecfea..0000000
Binary files a/res/drawable/fod_icon_cpt_america_flat_gray.png and /dev/null differ
diff --git a/res/drawable/fod_icon_custom_0.xml b/res/drawable/fod_icon_custom_0.xml
deleted file mode 100644
index 4bbb494..0000000
--- a/res/drawable/fod_icon_custom_0.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/fod_icon_default.xml b/res/drawable/fod_icon_default.xml
deleted file mode 100644
index 693917b..0000000
--- a/res/drawable/fod_icon_default.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
diff --git a/res/drawable/fod_icon_default_0.xml b/res/drawable/fod_icon_default_0.xml
deleted file mode 100644
index 23eff0e..0000000
--- a/res/drawable/fod_icon_default_0.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
diff --git a/res/drawable/fod_icon_default_1.xml b/res/drawable/fod_icon_default_1.xml
deleted file mode 100644
index ffeafd7..0000000
--- a/res/drawable/fod_icon_default_1.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
diff --git a/res/drawable/fod_icon_default_2.png b/res/drawable/fod_icon_default_2.png
deleted file mode 100755
index f83a70c..0000000
Binary files a/res/drawable/fod_icon_default_2.png and /dev/null differ
diff --git a/res/drawable/fod_icon_default_2.webp b/res/drawable/fod_icon_default_2.webp
deleted file mode 100644
index 1c3a7a0..0000000
Binary files a/res/drawable/fod_icon_default_2.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_default_3.png b/res/drawable/fod_icon_default_3.png
deleted file mode 100644
index bd9ca2a..0000000
Binary files a/res/drawable/fod_icon_default_3.png and /dev/null differ
diff --git a/res/drawable/fod_icon_default_3.webp b/res/drawable/fod_icon_default_3.webp
deleted file mode 100644
index d436866..0000000
Binary files a/res/drawable/fod_icon_default_3.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_default_4.png b/res/drawable/fod_icon_default_4.png
deleted file mode 100644
index f5f1e7d..0000000
Binary files a/res/drawable/fod_icon_default_4.png and /dev/null differ
diff --git a/res/drawable/fod_icon_default_4.webp b/res/drawable/fod_icon_default_4.webp
deleted file mode 100644
index c917ae9..0000000
Binary files a/res/drawable/fod_icon_default_4.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_default_5.png b/res/drawable/fod_icon_default_5.png
deleted file mode 100644
index f53e30c..0000000
Binary files a/res/drawable/fod_icon_default_5.png and /dev/null differ
diff --git a/res/drawable/fod_icon_dragon_black_flat.png b/res/drawable/fod_icon_dragon_black_flat.png
deleted file mode 100644
index 4992518..0000000
Binary files a/res/drawable/fod_icon_dragon_black_flat.png and /dev/null differ
diff --git a/res/drawable/fod_icon_future.png b/res/drawable/fod_icon_future.png
deleted file mode 100644
index 6fac92f..0000000
Binary files a/res/drawable/fod_icon_future.png and /dev/null differ
diff --git a/res/drawable/fod_icon_glow_circle.png b/res/drawable/fod_icon_glow_circle.png
deleted file mode 100644
index cdb1f9b..0000000
Binary files a/res/drawable/fod_icon_glow_circle.png and /dev/null differ
diff --git a/res/drawable/fod_icon_glow_circle.webp b/res/drawable/fod_icon_glow_circle.webp
deleted file mode 100644
index d93999d..0000000
Binary files a/res/drawable/fod_icon_glow_circle.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_gxzw.webp b/res/drawable/fod_icon_gxzw.webp
deleted file mode 100644
index 6c029ce..0000000
Binary files a/res/drawable/fod_icon_gxzw.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_light.png b/res/drawable/fod_icon_light.png
deleted file mode 100644
index 2bfd519..0000000
Binary files a/res/drawable/fod_icon_light.png and /dev/null differ
diff --git a/res/drawable/fod_icon_neon_arc.png b/res/drawable/fod_icon_neon_arc.png
deleted file mode 100644
index bbfb039..0000000
Binary files a/res/drawable/fod_icon_neon_arc.png and /dev/null differ
diff --git a/res/drawable/fod_icon_neon_arc.webp b/res/drawable/fod_icon_neon_arc.webp
deleted file mode 100644
index 60c7ed9..0000000
Binary files a/res/drawable/fod_icon_neon_arc.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_neon_arc_gray.png b/res/drawable/fod_icon_neon_arc_gray.png
deleted file mode 100644
index 5e3a411..0000000
Binary files a/res/drawable/fod_icon_neon_arc_gray.png and /dev/null differ
diff --git a/res/drawable/fod_icon_neon_arc_gray.webp b/res/drawable/fod_icon_neon_arc_gray.webp
deleted file mode 100644
index 168e53e..0000000
Binary files a/res/drawable/fod_icon_neon_arc_gray.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_neon_circle_pink.png b/res/drawable/fod_icon_neon_circle_pink.png
deleted file mode 100644
index 4831b33..0000000
Binary files a/res/drawable/fod_icon_neon_circle_pink.png and /dev/null differ
diff --git a/res/drawable/fod_icon_neon_circle_pink.webp b/res/drawable/fod_icon_neon_circle_pink.webp
deleted file mode 100644
index 5bc4b61..0000000
Binary files a/res/drawable/fod_icon_neon_circle_pink.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_neon_triangle.png b/res/drawable/fod_icon_neon_triangle.png
deleted file mode 100644
index 6ac8ded..0000000
Binary files a/res/drawable/fod_icon_neon_triangle.png and /dev/null differ
diff --git a/res/drawable/fod_icon_neon_triangle.webp b/res/drawable/fod_icon_neon_triangle.webp
deleted file mode 100644
index f82c987..0000000
Binary files a/res/drawable/fod_icon_neon_triangle.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_paint_splash_circle.png b/res/drawable/fod_icon_paint_splash_circle.png
deleted file mode 100644
index f9c7108..0000000
Binary files a/res/drawable/fod_icon_paint_splash_circle.png and /dev/null differ
diff --git a/res/drawable/fod_icon_rainbow_horn.png b/res/drawable/fod_icon_rainbow_horn.png
deleted file mode 100644
index 1340a37..0000000
Binary files a/res/drawable/fod_icon_rainbow_horn.png and /dev/null differ
diff --git a/res/drawable/fod_icon_rainbow_horn.webp b/res/drawable/fod_icon_rainbow_horn.webp
deleted file mode 100644
index cc64927..0000000
Binary files a/res/drawable/fod_icon_rainbow_horn.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_sammy.webp b/res/drawable/fod_icon_sammy.webp
deleted file mode 100644
index 306c03f..0000000
Binary files a/res/drawable/fod_icon_sammy.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_scratch_pink_blue.webp b/res/drawable/fod_icon_scratch_pink_blue.webp
deleted file mode 100644
index a6e1906..0000000
Binary files a/res/drawable/fod_icon_scratch_pink_blue.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_scratch_red_blue.webp b/res/drawable/fod_icon_scratch_red_blue.webp
deleted file mode 100644
index d7dfef0..0000000
Binary files a/res/drawable/fod_icon_scratch_red_blue.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_shooky.png b/res/drawable/fod_icon_shooky.png
deleted file mode 100644
index 5462af1..0000000
Binary files a/res/drawable/fod_icon_shooky.png and /dev/null differ
diff --git a/res/drawable/fod_icon_spiral_blue.png b/res/drawable/fod_icon_spiral_blue.png
deleted file mode 100644
index 4b9adc3..0000000
Binary files a/res/drawable/fod_icon_spiral_blue.png and /dev/null differ
diff --git a/res/drawable/fod_icon_sun_metro.png b/res/drawable/fod_icon_sun_metro.png
deleted file mode 100644
index 9fb6f0e..0000000
Binary files a/res/drawable/fod_icon_sun_metro.png and /dev/null differ
diff --git a/res/drawable/fod_icon_sun_metro.webp b/res/drawable/fod_icon_sun_metro.webp
deleted file mode 100644
index ba12438..0000000
Binary files a/res/drawable/fod_icon_sun_metro.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_transparent.webp b/res/drawable/fod_icon_transparent.webp
deleted file mode 100644
index 7485153..0000000
Binary files a/res/drawable/fod_icon_transparent.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_zaid1.webp b/res/drawable/fod_icon_zaid1.webp
deleted file mode 100644
index 8ef1235..0000000
Binary files a/res/drawable/fod_icon_zaid1.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_zaid2.webp b/res/drawable/fod_icon_zaid2.webp
deleted file mode 100644
index ac553c2..0000000
Binary files a/res/drawable/fod_icon_zaid2.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_zaid3.webp b/res/drawable/fod_icon_zaid3.webp
deleted file mode 100644
index d35c8d1..0000000
Binary files a/res/drawable/fod_icon_zaid3.webp and /dev/null differ
diff --git a/res/drawable/fod_icon_zaid4.webp b/res/drawable/fod_icon_zaid4.webp
deleted file mode 100644
index 382df5e..0000000
Binary files a/res/drawable/fod_icon_zaid4.webp and /dev/null differ
diff --git a/res/drawable/fod_picker_item_background.xml b/res/drawable/fod_picker_item_background.xml
deleted file mode 100644
index eb037ff..0000000
--- a/res/drawable/fod_picker_item_background.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
diff --git a/res/drawable/ic_fingerprint.xml b/res/drawable/ic_fingerprint.xml
index ef20812..20fbc04 100644
--- a/res/drawable/ic_fingerprint.xml
+++ b/res/drawable/ic_fingerprint.xml
@@ -1,23 +1,8 @@
-
-
-
-
+
+
+
+
+
+
diff --git a/res/drawable/ic_fod_item.xml b/res/drawable/ic_fod_item.xml
deleted file mode 100644
index b6ab9c1..0000000
--- a/res/drawable/ic_fod_item.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
diff --git a/res/layout/fod_picker_preference.xml b/res/layout/fod_picker_preference.xml
deleted file mode 100644
index 0e37f37..0000000
--- a/res/layout/fod_picker_preference.xml
+++ /dev/null
@@ -1,381 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values-night/cherish_colors.xml b/res/values-night/cherish_colors.xml
deleted file mode 100644
index b9e96cb..0000000
--- a/res/values-night/cherish_colors.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
- #555555
-
diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml
deleted file mode 100644
index b9e96cb..0000000
--- a/res/values-night/colors.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
- #555555
-
diff --git a/res/values/cherish_arrays.xml b/res/values/cherish_arrays.xml
index 44615f5..8b01890 100644
--- a/res/values/cherish_arrays.xml
+++ b/res/values/cherish_arrays.xml
@@ -570,69 +570,6 @@
- 1
- 2
-
-
-
- - @string/fod_recog_animation_miui_normal
- - @string/fod_recog_animation_miui_aod
- - @string/fod_recog_animation_miui_aurora
- - @string/fod_recog_animation_miui_aurora_cas
- - @string/fod_recog_animation_miui_light
- - @string/fod_recog_animation_miui_pop
- - @string/fod_recog_animation_miui_pulse
- - @string/fod_recog_animation_miui_pulse_white
- - @string/fod_recog_animation_miui_rhythm
- - @string/fod_recog_animation_miui_star_cas
- - @string/fod_recog_animation_op_cosmos
- - @string/fod_recog_animation_op_energy
- - @string/fod_recog_animation_op_mclaren
- - @string/fod_recog_animation_op_scanning
- - @string/fod_recog_animation_op_ripple
- - @string/fod_recog_animation_op_stripe
- - @string/fod_recog_animation_op_wave
- - @string/fod_recog_animation_pureview_dna
- - @string/fod_recog_animation_pureview_future
- - @string/fod_recog_animation_pureview_halo_ring
- - @string/fod_recog_animation_pureview_molecular
- - @string/fod_recog_animation_rog_fusion
- - @string/fod_recog_animation_rog_pulsar
- - @string/fod_recog_animation_rog_supernova
- - @string/fod_recog_animation_shine
- - @string/fod_recog_animation_smoke
- - @string/fod_recog_animation_strings
- - @string/fod_recog_animation_quantum
-
-
-
- - 0
- - 1
- - 2
- - 3
- - 4
- - 5
- - 6
- - 7
- - 8
- - 9
- - 10
- - 11
- - 12
- - 13
- - 14
- - 15
- - 16
- - 17
- - 18
- - 19
- - 20
- - 21
- - 22
- - 23
- - 24
- - 25
- - 26
- - 27
-
@@ -681,21 +618,6 @@
- @string/file_header_provider
-
-
- - @string/fod_pressed_color_white
- - @string/fod_pressed_color_cyan
- - @string/fod_pressed_color_green
- - @string/fod_pressed_color_yellow
-
-
-
- - 0
- - 1
- - 2
- - 3
-
-
- @string/gaming_mode_ringer_off_title
diff --git a/res/values/cherish_colors.xml b/res/values/cherish_colors.xml
index 0fc9b35..c51f3aa 100644
--- a/res/values/cherish_colors.xml
+++ b/res/values/cherish_colors.xml
@@ -28,7 +28,4 @@
#dfedc6
#edc6d1
#66000000
-
-
- #d6d6d6
diff --git a/res/values/cherish_config.xml b/res/values/cherish_config.xml
deleted file mode 100644
index 4e95c63..0000000
--- a/res/values/cherish_config.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
- false
-
\ No newline at end of file
diff --git a/res/values/cherish_dimens.xml b/res/values/cherish_dimens.xml
index e97b736..1e0654c 100644
--- a/res/values/cherish_dimens.xml
+++ b/res/values/cherish_dimens.xml
@@ -25,9 +25,4 @@
70dip
-
-
- 10dp
- 100dp
- 20dp
diff --git a/res/values/cherish_strings.xml b/res/values/cherish_strings.xml
index 1d98b8c..a3c1c97 100644
--- a/res/values/cherish_strings.xml
+++ b/res/values/cherish_strings.xml
@@ -644,39 +644,6 @@
Full → empty: red ← green ← blue ← red
Full → empty: red → green → blue → red
-
- FOD recognizing animation
- Shows an animation while reading your finger
- Recognizing animation effect
- MIUI default
- AOD
- Light
- Pop
- Pulse
- Pulse (White)
- Rhythm
- Cosmos
- McLaren
- Scanning (Cyberpunk 2077)
- Stripe
- Wave
- DNA
- Future
- Halo ring
- Molecular
- Aurora (K30 Pro)
- Aurora (Mi 10 Ultra)
- Starlight
- Energy
- Ripple
- Fusion
- Pulsar
- Supernova
- Oppo Shine
- Realme Smoke
- Realme Strings
- Realme Quantum
-
Navigation gesture options
Choose buttons or gestures to navigate your device
@@ -719,11 +686,6 @@
Make heads up less annoying
Show heads up only for dialer or messaging app if they are not in foreground
-
- Fingerprint icon
- Choose your favorite fingerprint icon
- In order to add your own icon, select the top left icon and use the OnePlus 6T FP Customizer app to select the icon you want.
-
Header image
Use a custom image for QS header
@@ -741,13 +703,6 @@
Darken image
Image height offset
-
- Fingerprint pressed color
- White
- Cyan
- Green
- Yellow
-
Gaming Mode
Customize gaming mode preferences
diff --git a/res/xml/cherish_settings_fod_picker.xml b/res/xml/cherish_settings_fod_picker.xml
deleted file mode 100644
index ebc5cf0..0000000
--- a/res/xml/cherish_settings_fod_picker.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/res/xml/cherish_settings_lockscreen.xml b/res/xml/cherish_settings_lockscreen.xml
index e24abf2..1e5922b 100644
--- a/res/xml/cherish_settings_lockscreen.xml
+++ b/res/xml/cherish_settings_lockscreen.xml
@@ -271,42 +271,4 @@
android:fragment="com.cherish.settings.fragments.KeygaurdBatteryBar" />
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/com/cherish/settings/fragments/FODIconPickerFragment.java b/src/com/cherish/settings/fragments/FODIconPickerFragment.java
deleted file mode 100644
index d966f1d..0000000
--- a/src/com/cherish/settings/fragments/FODIconPickerFragment.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2019-2020 The Evolution X 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.res.Resources;
-import android.os.Bundle;
-import android.provider.Settings;
-
-import androidx.preference.Preference;
-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.SettingsPreferenceFragment;
-
-public class FODIconPickerFragment extends SettingsPreferenceFragment {
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- addPreferencesFromResource(R.xml.cherish_settings_fod_picker);
-
- getActivity().getActionBar().setTitle(R.string.fod_icon_picker_title);
- }
-
- @Override
- public int getMetricsCategory() {
- return MetricsEvent.CHERISH_SETTINGS;
- }
-}
diff --git a/src/com/cherish/settings/fragments/LockScreenSettings.java b/src/com/cherish/settings/fragments/LockScreenSettings.java
index 4db8214..103ff2e 100644
--- a/src/com/cherish/settings/fragments/LockScreenSettings.java
+++ b/src/com/cherish/settings/fragments/LockScreenSettings.java
@@ -53,8 +53,6 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
private static final String CUSTOM_TEXT_CLOCK_FONT_SIZE = "custom_text_clock_font_size";
private static final String DATE_FONT_SIZE = "lockdate_font_size";
private static final String LOCKOWNER_FONT_SIZE = "lockowner_font_size";
- private static final String KEY_FOD_RECOGNIZING_ANIMATION = "fod_recognizing_animation";
- private static final String KEY_FOD_RECOGNIZING_ANIMATION_LIST = "fod_recognizing_animation_list";
private static final String AOD_SCHEDULE_KEY = "always_on_display_schedule";
static final int MODE_DISABLED = 0;
@@ -102,14 +100,6 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
Settings.System.CUSTOM_TEXT_CLOCK_FONT_SIZE, 40));
mCustomTextClockFontSize.setOnPreferenceChangeListener(this);
- SystemSettingSwitchPreference mFODSwitchPref = (SystemSettingSwitchPreference) findPreference(KEY_FOD_RECOGNIZING_ANIMATION);
- SystemSettingListPreference mFODListViewPref = (SystemSettingListPreference) findPreference(KEY_FOD_RECOGNIZING_ANIMATION_LIST);
-
- if (!resources.getBoolean(R.bool.config_showFODAnimationSettings)){
- prefScreen.removePreference(mFODSwitchPref);
- prefScreen.removePreference(mFODListViewPref);
- }
-
mAODPref = findPreference(AOD_SCHEDULE_KEY);
updateAlwaysOnSummary();
}
diff --git a/src/com/cherish/settings/preferences/FODIconPicker.java b/src/com/cherish/settings/preferences/FODIconPicker.java
deleted file mode 100644
index 2a71cae..0000000
--- a/src/com/cherish/settings/preferences/FODIconPicker.java
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * 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.preferences;
-
-import android.content.Context;
-import android.content.res.ColorStateList;
-import android.content.res.TypedArray;
-import android.graphics.Color;
-import android.provider.Settings;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.FrameLayout;
-import android.widget.ImageButton;
-
-import androidx.core.content.res.TypedArrayUtils;
-import androidx.preference.Preference;
-import androidx.preference.PreferenceViewHolder;
-
-import com.android.settings.R;
-
-import com.android.settingslib.Utils;
-import com.android.settingslib.widget.LayoutPreference;
-
-public class FODIconPicker extends LayoutPreference {
-
- private boolean mAllowDividerAbove;
- private boolean mAllowDividerBelow;
-
- private View mRootView;
-
- private static ImageButton Button0;
- private static ImageButton Button1;
- private static ImageButton Button2;
- private static ImageButton Button3;
- private static ImageButton Button4;
- private static ImageButton Button5;
- private static ImageButton Button6;
- private static ImageButton Button7;
- private static ImageButton Button8;
- private static ImageButton Button9;
- private static ImageButton Button10;
- private static ImageButton Button11;
- private static ImageButton Button12;
- private static ImageButton Button13;
- private static ImageButton Button14;
- private static ImageButton Button15;
- private static ImageButton Button16;
- private static ImageButton Button17;
- private static ImageButton Button18;
- private static ImageButton Button19;
- private static ImageButton Button20;
- private static ImageButton Button21;
- private static ImageButton Button22;
- private static ImageButton Button23;
- private static ImageButton Button24;
- private static ImageButton Button25;
- private static ImageButton Button26;
- private static ImageButton Button27;
-
- private static final String TAG = "FODIconPicker";
-
- public FODIconPicker(Context context, AttributeSet attrs) {
- super(context, attrs);
- init(context, attrs, 0 /* defStyleAttr */);
- }
-
- public FODIconPicker(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- init(context, attrs, defStyleAttr);
- }
-
- private void init(Context context, AttributeSet attrs, int defStyleAttr) {
- TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Preference);
- mAllowDividerAbove = TypedArrayUtils.getBoolean(a, R.styleable.Preference_allowDividerAbove,
- R.styleable.Preference_allowDividerAbove, false);
- mAllowDividerBelow = TypedArrayUtils.getBoolean(a, R.styleable.Preference_allowDividerBelow,
- R.styleable.Preference_allowDividerBelow, false);
- a.recycle();
-
- a = context.obtainStyledAttributes(
- attrs, R.styleable.Preference, defStyleAttr, 0);
- int layoutResource = a.getResourceId(R.styleable.Preference_android_layout, 0);
- if (layoutResource == 0) {
- throw new IllegalArgumentException("LayoutPreference requires a layout to be defined");
- }
- a.recycle();
-
- // Need to create view now so that findViewById can be called immediately.
- final View view = LayoutInflater.from(getContext())
- .inflate(layoutResource, null, false);
- setView(view, context);
- }
-
- private void setView(View view, Context context) {
- setLayoutResource(R.layout.layout_preference_frame);
- mRootView = view;
- setShouldDisableView(false);
- Button0 = findViewById(R.id.fodicon0_button);
- Button1 = findViewById(R.id.fodicon1_button);
- Button2 = findViewById(R.id.fodicon2_button);
- Button3 = findViewById(R.id.fodicon3_button);
- Button4 = findViewById(R.id.fodicon4_button);
- Button5 = findViewById(R.id.fodicon5_button);
- Button6 = findViewById(R.id.fodicon6_button);
- Button7 = findViewById(R.id.fodicon7_button);
- Button8 = findViewById(R.id.fodicon8_button);
- Button9 = findViewById(R.id.fodicon9_button);
- Button10 = findViewById(R.id.fodicon10_button);
- Button11 = findViewById(R.id.fodicon11_button);
- Button12 = findViewById(R.id.fodicon12_button);
- Button13 = findViewById(R.id.fodicon13_button);
- Button14 = findViewById(R.id.fodicon14_button);
- Button15 = findViewById(R.id.fodicon15_button);
- Button16 = findViewById(R.id.fodicon16_button);
- Button17 = findViewById(R.id.fodicon17_button);
- Button18 = findViewById(R.id.fodicon18_button);
- Button19 = findViewById(R.id.fodicon19_button);
- Button20 = findViewById(R.id.fodicon20_button);
- Button21 = findViewById(R.id.fodicon21_button);
- Button22 = findViewById(R.id.fodicon22_button);
- Button23 = findViewById(R.id.fodicon23_button);
- Button24 = findViewById(R.id.fodicon24_button);
- Button25 = findViewById(R.id.fodicon25_button);
- Button26 = findViewById(R.id.fodicon26_button);
- Button27 = findViewById(R.id.fodicon27_button);
-
- int defaultfodicon = Settings.System.getInt(
- context.getContentResolver(), Settings.System.FOD_ICON, 0);
- if (defaultfodicon==0) {
- updateHighlightedItem(Button0, context);
- } else if (defaultfodicon == 1) {
- updateHighlightedItem(Button1, context);
- } else if (defaultfodicon == 2) {
- updateHighlightedItem(Button2, context);
- } else if (defaultfodicon == 3) {
- updateHighlightedItem(Button3, context);
- } else if (defaultfodicon == 4) {
- updateHighlightedItem(Button4, context);
- } else if (defaultfodicon == 5) {
- updateHighlightedItem(Button5, context);
- } else if (defaultfodicon == 6) {
- updateHighlightedItem(Button6, context);
- } else if (defaultfodicon == 7) {
- updateHighlightedItem(Button7, context);
- } else if (defaultfodicon == 8) {
- updateHighlightedItem(Button8, context);
- } else if (defaultfodicon == 9) {
- updateHighlightedItem(Button9, context);
- } else if (defaultfodicon == 10) {
- updateHighlightedItem(Button10, context);
- } else if (defaultfodicon == 11) {
- updateHighlightedItem(Button11, context);
- } else if (defaultfodicon == 12) {
- updateHighlightedItem(Button12, context);
- } else if (defaultfodicon == 13) {
- updateHighlightedItem(Button13, context);
- } else if (defaultfodicon == 14) {
- updateHighlightedItem(Button14, context);
- } else if (defaultfodicon == 15) {
- updateHighlightedItem(Button15, context);
- } else if (defaultfodicon == 16) {
- updateHighlightedItem(Button16, context);
- } else if (defaultfodicon == 17) {
- updateHighlightedItem(Button17, context);
- } else if (defaultfodicon == 18) {
- updateHighlightedItem(Button18, context);
- } else if (defaultfodicon == 19) {
- updateHighlightedItem(Button19, context);
- } else if (defaultfodicon == 20) {
- updateHighlightedItem(Button20, context);
- } else if (defaultfodicon == 21) {
- updateHighlightedItem(Button21, context);
- } else if (defaultfodicon == 22) {
- updateHighlightedItem(Button22, context);
- } else if (defaultfodicon == 23) {
- updateHighlightedItem(Button23, context);
- } else if (defaultfodicon == 24) {
- updateHighlightedItem(Button24, context);
- } else if (defaultfodicon == 25) {
- updateHighlightedItem(Button25, context);
- } else if (defaultfodicon == 26) {
- updateHighlightedItem(Button26, context);
- } else if (defaultfodicon == 27) {
- updateHighlightedItem(Button27, context);
- }
-
- Button0.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(0, context);
- updateHighlightedItem(Button0, context);
- }
- });
- Button1.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(1, context);
- updateHighlightedItem(Button1, context);
- }
- });
- Button2.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(2, context);
- updateHighlightedItem(Button2, context);
- }
- });
- Button3.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(3, context);
- updateHighlightedItem(Button3, context);
- }
- });
- Button4.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(4, context);
- updateHighlightedItem(Button4, context);
- }
- });
- Button5.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(5, context);
- updateHighlightedItem(Button5, context);
- }
- });
- Button6.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(6, context);
- updateHighlightedItem(Button6, context);
- }
- });
- Button7.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(7, context);
- updateHighlightedItem(Button7, context);
- }
- });
- Button8.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(8, context);
- updateHighlightedItem(Button8, context);
- }
- });
- Button9.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(9, context);
- updateHighlightedItem(Button9, context);
- }
- });
- Button10.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(10, context);
- updateHighlightedItem(Button10, context);
- }
- });
- Button11.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(11, context);
- updateHighlightedItem(Button11, context);
- }
- });
- Button12.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(12, context);
- updateHighlightedItem(Button12, context);
- }
- });
- Button13.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(13, context);
- updateHighlightedItem(Button13, context);
- }
- });
- Button14.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(14, context);
- updateHighlightedItem(Button14, context);
- }
- });
- Button15.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(15, context);
- updateHighlightedItem(Button15, context);
- }
- });
- Button16.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(16, context);
- updateHighlightedItem(Button16, context);
- }
- });
- Button17.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(17, context);
- updateHighlightedItem(Button17, context);
- }
- });
- Button18.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(18, context);
- updateHighlightedItem(Button18, context);
- }
- });
- Button19.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(19, context);
- updateHighlightedItem(Button19, context);
- }
- });
- Button20.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(20, context);
- updateHighlightedItem(Button20, context);
- }
- });
- Button21.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(21, context);
- updateHighlightedItem(Button21, context);
- }
- });
- Button22.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(22, context);
- updateHighlightedItem(Button22, context);
- }
- });
- Button23.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(23, context);
- updateHighlightedItem(Button23, context);
- }
- });
- Button24.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(24, context);
- updateHighlightedItem(Button24, context);
- }
- });
- Button25.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(25, context);
- updateHighlightedItem(Button25, context);
- }
- });
- Button26.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(26, context);
- updateHighlightedItem(Button26, context);
- }
- });
- Button27.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updateSettings(27, context);
- updateHighlightedItem(Button27, context);
- }
- });
- }
-
- private void updateSettings(int fodicon, Context context) {
- Settings.System.putInt(context.getContentResolver(), Settings.System.FOD_ICON, fodicon);
- }
-
- private void updateHighlightedItem(ImageButton activebutton, Context context) {
- int defaultcolor = context.getResources().getColor(R.color.fod_item_background_stroke_color);
- ColorStateList defaulttint = ColorStateList.valueOf(defaultcolor);
- Button0.setBackgroundTintList(defaulttint);
- Button1.setBackgroundTintList(defaulttint);
- Button2.setBackgroundTintList(defaulttint);
- Button3.setBackgroundTintList(defaulttint);
- Button4.setBackgroundTintList(defaulttint);
- Button5.setBackgroundTintList(defaulttint);
- Button6.setBackgroundTintList(defaulttint);
- Button7.setBackgroundTintList(defaulttint);
- Button8.setBackgroundTintList(defaulttint);
- Button9.setBackgroundTintList(defaulttint);
- Button10.setBackgroundTintList(defaulttint);
- Button11.setBackgroundTintList(defaulttint);
- Button12.setBackgroundTintList(defaulttint);
- Button13.setBackgroundTintList(defaulttint);
- Button14.setBackgroundTintList(defaulttint);
- Button15.setBackgroundTintList(defaulttint);
- Button16.setBackgroundTintList(defaulttint);
- Button17.setBackgroundTintList(defaulttint);
- Button18.setBackgroundTintList(defaulttint);
- Button19.setBackgroundTintList(defaulttint);
- Button20.setBackgroundTintList(defaulttint);
- Button21.setBackgroundTintList(defaulttint);
- Button22.setBackgroundTintList(defaulttint);
- Button23.setBackgroundTintList(defaulttint);
- Button24.setBackgroundTintList(defaulttint);
- Button25.setBackgroundTintList(defaulttint);
- Button26.setBackgroundTintList(defaulttint);
- Button27.setBackgroundTintList(defaulttint);
- activebutton.setBackgroundTintList(Utils.getColorAttr(getContext(), android.R.attr.colorAccent));
- }
-}