Skip to content

Commit eb8679a

Browse files
committed
opt: ui & strings
1 parent 2dda710 commit eb8679a

32 files changed

Lines changed: 288 additions & 286 deletions

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ core = "1.17.0"
99
coreKtx = "1.17.0"
1010
fragment = "1.8.9"
1111
lunarcalendar = "latest.release"
12-
miuix = "1.0.10.3"
12+
miuix = "1.0.10.4"
1313
expansions = "1.0.0"
1414
recyclerview = "1.4.0"
1515
coordinatorlayout = "1.3.0"

library/core/src/main/java/com/sevtinge/hyperceiler/hooker/systemui/ControlCenterSettings.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
package com.sevtinge.hyperceiler.hooker.systemui;
2020

21-
import static com.sevtinge.hyperceiler.sub.SubPickerActivity.LAUNCHER_MODE;
21+
import static com.sevtinge.hyperceiler.sub.SubPickerActivity.ALL_APPS_MODE;
2222

2323
import android.content.Intent;
2424
import android.os.Bundle;
@@ -29,9 +29,9 @@
2929
import androidx.preference.SwitchPreference;
3030

3131
import com.sevtinge.hyperceiler.common.prefs.RecommendPreference;
32+
import com.sevtinge.hyperceiler.core.R;
3233
import com.sevtinge.hyperceiler.dashboard.DashboardFragment;
3334
import com.sevtinge.hyperceiler.hook.utils.log.AndroidLogUtils;
34-
import com.sevtinge.hyperceiler.core.R;
3535
import com.sevtinge.hyperceiler.sub.SubPickerActivity;
3636

3737
import fan.preference.SeekBarPreferenceCompat;
@@ -55,7 +55,7 @@ public void initPrefs() {
5555
mExpandNotification.setOnPreferenceClickListener(
5656
preference -> {
5757
Intent intent = new Intent(getActivity(), SubPickerActivity.class);
58-
intent.putExtra("mode", LAUNCHER_MODE);
58+
intent.putExtra("mode", ALL_APPS_MODE);
5959
intent.putExtra("key", preference.getKey());
6060
startActivity(intent);
6161
return true;

library/core/src/main/java/com/sevtinge/hyperceiler/sub/CustomBackgroundSettings.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222

2323
import androidx.annotation.NonNull;
2424
import androidx.preference.Preference;
25-
import androidx.preference.SeekBarPreference;
2625
import androidx.preference.SwitchPreference;
2726

27+
import com.sevtinge.hyperceiler.core.R;
2828
import com.sevtinge.hyperceiler.dashboard.SettingsPreferenceFragment;
2929
import com.sevtinge.hyperceiler.hook.utils.prefs.PrefsUtils;
30-
import com.sevtinge.hyperceiler.core.R;
3130

3231
import fan.pickerwidget.color.HSLColor;
3332
import fan.preference.ColorPickerPreference;
33+
import fan.preference.SeekBarPreferenceCompat;
3434

3535
public class CustomBackgroundSettings extends SettingsPreferenceFragment implements Preference.OnPreferenceChangeListener {
3636

@@ -44,10 +44,10 @@ public class CustomBackgroundSettings extends SettingsPreferenceFragment impleme
4444
private SwitchPreference mCustomEnabledPreference;
4545

4646
private ColorPickerPreference mColorPickerPreference;
47-
private SeekBarPreference mCornerRadiusPreference;
47+
private SeekBarPreferenceCompat mCornerRadiusPreference;
4848

4949
private SwitchPreference mBlurEnabledPreference;
50-
private SeekBarPreference mBlurRadiusPreference;
50+
private SeekBarPreferenceCompat mBlurRadiusPreference;
5151

5252
@Override
5353
public int getPreferenceScreenResId() {
@@ -95,9 +95,9 @@ public void initPrefs() {
9595
private void loadData() {
9696
mCustomEnabledPreference.setChecked(isCustomEnabled());
9797
mColorPickerPreference.setColor(getColor(-1));
98-
mCornerRadiusPreference.setValue(getSeekBarValue(mCornerRadiusKey, 18));
98+
mCornerRadiusPreference.setCurrentValue(getSeekBarValue(mCornerRadiusKey, 18));
9999
mBlurEnabledPreference.setChecked(isBackgroundBlurEnabled());
100-
mBlurRadiusPreference.setValue(getSeekBarValue(mBlurRadiusKey, 60));
100+
mBlurRadiusPreference.setCurrentValue(getSeekBarValue(mBlurRadiusKey, 60));
101101
}
102102

103103
private boolean isCustomEnabled() {
@@ -147,7 +147,7 @@ private void setBackgroundColor(HSLColor value) {
147147
}
148148

149149
private void setBackgroundCornerRadius(int value) {
150-
mCornerRadiusPreference.setValue(value);
150+
mCornerRadiusPreference.setCurrentValue(value);
151151
PrefsUtils.mSharedPreferences.edit().putInt(mCornerRadiusKey, value).apply();
152152
}
153153

@@ -157,7 +157,7 @@ private void setBlurEnabled(boolean isBlurEnabled) {
157157
}
158158

159159
private void setBackgroundBlurRadius(int value) {
160-
mBlurRadiusPreference.setValue(value);
160+
mBlurRadiusPreference.setCurrentValue(value);
161161
PrefsUtils.mSharedPreferences.edit().putInt(mBlurRadiusKey, value).apply();
162162
}
163163
}

library/core/src/main/java/com/sevtinge/hyperceiler/sub/SubPickerActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ private void loadAppData() {
234234
} catch (Exception e) {
235235
runOnUiThread(() -> {
236236
mProgressBar.setVisibility(View.GONE);
237-
Toast.makeText(this, "加载应用列表失败", Toast.LENGTH_SHORT).show();
237+
Toast.makeText(this, getString(R.string.load_apps_failed), Toast.LENGTH_SHORT).show();
238238
});
239239
}
240240
}

library/core/src/main/res/values-zh-rCN/strings.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<string name="soft_reboot">重启 </string>
1919
<string name="restart_app_desc">确定要立即重启%1$s吗?</string>
2020
<string name="tip">提示</string>
21-
<string name="root">未授予Root/Su权限部分功能不可用</string>
21+
<string name="root">未授予 Root/Su 权限部分功能不可用</string>
2222
<string name="experimental_features">实验性功能</string>
2323
<string name="experimental_reshook_new">启用新版资源挂钩</string>
2424
<string name="experimental_reshook_new_desc">新版资源挂钩对于资源注入有更好的性能,但可能会有存在一些问题,仅供测试\n开关此功能需重启生效</string>
@@ -104,7 +104,8 @@
104104
<string name="disable_suggest">禁用推荐</string>
105105
<string name="enable_suggest">启用推荐</string>
106106

107-
<string name="search_apps_hint">搜索%d个应用</string>
107+
<string name="search_apps_hint">搜索 %d 个应用</string>
108+
<string name="load_apps_failed">加载应用列表失败</string>
108109

109110
<string name="logo_egg_NotificationName">彩蛋通知</string>
110111
<string name="logo_egg_NotificationName_tips">这是彩蛋通知</string>

library/core/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
<string name="disable_suggest">Disable suggest</string>
112112
<string name="enable_suggest">Enable suggest</string>
113113
<string name="search_apps_hint">Search %d apps</string>
114+
<string name="load_apps_failed">Failed to load application list</string>
114115
<string name="logo_egg_NotificationName">Easter egg notification</string>
115116
<string name="logo_egg_NotificationName_tips">This is an Easter egg notification</string>
116117
<string name="logo_egg_Notification_tips">Please enable notifications in Settings to see the Easter eggs</string>

library/core/src/main/res/xml/framework_volume.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
app:isPreferenceVisible="false"
6868
app:maxValue="500"
6969
app:minValue="0"
70-
app:showDividerValue="100"
70+
app:dividerValue="100"
7171
app:showSeekBarValue="true"
7272
app:stepValue="25" />
7373

library/core/src/main/res/xml/home_recent.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
android:title="@string/home_recent_show_launch_size"
3838
app:defaultValue="95"
3939
app:defaultValueTitle="@string/array_default"
40-
app:format="%s f"
40+
app:format="%.2f f"
4141
app:maxValue="100"
4242
app:minValue="20"
43-
app:showDividerValue="100"
43+
app:dividerValue="100"
4444
app:showSeekBarValue="true"
4545
app:stepValue="1" />
4646

@@ -50,10 +50,10 @@
5050
android:title="@string/home_recent_show_launch_alpha"
5151
app:defaultValue="100"
5252
app:defaultValueTitle="@string/array_default"
53-
app:format="%s f"
53+
app:format="%.2f f"
5454
app:maxValue="100"
5555
app:minValue="0"
56-
app:showDividerValue="100"
56+
app:dividerValue="100"
5757
app:showSeekBarValue="true"
5858
app:stepValue="1" />
5959

library/core/src/main/res/xml/home_title.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@
138138
android:key="pref_key_home_title_icon_scale"
139139
android:title="@string/home_title_icon_scale"
140140
app:defaultValueTitle="@string/array_default"
141-
app:showDividerValue="100"
142-
app:format="X %s"
141+
app:dividerValue="100"
142+
app:format="%.2f X"
143143
app:isPreferenceVisible="false"
144144
app:maxValue="200"
145145
app:minValue="45"

library/core/src/main/res/xml/home_title_anim_2.xml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
android:key="prefs_key_home_title_custom_anim_param_damping_RECT_CENTERX_2"
2727
android:title="@string/home_title_custom_anim_param_damping_title"
2828
app:defaultValueTitle="@string/array_default"
29-
app:showDividerValue="1000"
30-
app:format="%s f"
29+
app:dividerValue="1000"
30+
app:format="%.3f f"
3131
app:maxValue="2999"
3232
app:minValue="1"
3333
app:stepValue="1" />
@@ -37,8 +37,8 @@
3737
android:key="prefs_key_home_title_custom_anim_param_stiffness_RECT_CENTERX_2"
3838
android:title="@string/home_title_custom_anim_param_stiffness_title"
3939
app:defaultValueTitle="@string/array_default"
40-
app:showDividerValue="1000"
41-
app:format="%s f"
40+
app:dividerValue="1000"
41+
app:format="%.3f f"
4242
app:maxValue="2999"
4343
app:minValue="1"
4444
app:stepValue="1" />
@@ -52,8 +52,8 @@
5252
android:key="prefs_key_home_title_custom_anim_param_damping_RECT_CENTERY_2"
5353
android:title="@string/home_title_custom_anim_param_damping_title"
5454
app:defaultValueTitle="@string/array_default"
55-
app:showDividerValue="1000"
56-
app:format="%s f"
55+
app:dividerValue="1000"
56+
app:format="%.3f f"
5757
app:maxValue="2999"
5858
app:minValue="1"
5959
app:stepValue="1" />
@@ -63,8 +63,8 @@
6363
android:key="prefs_key_home_title_custom_anim_param_stiffness_RECT_CENTERY_2"
6464
android:title="@string/home_title_custom_anim_param_stiffness_title"
6565
app:defaultValueTitle="@string/array_default"
66-
app:showDividerValue="1000"
67-
app:format="%s f"
66+
app:dividerValue="1000"
67+
app:format="%.3f f"
6868
app:maxValue="2999"
6969
app:minValue="1"
7070
app:stepValue="1" />
@@ -78,8 +78,8 @@
7878
android:key="prefs_key_home_title_custom_anim_param_damping_RECT_WIDTH_2"
7979
android:title="@string/home_title_custom_anim_param_damping_title"
8080
app:defaultValueTitle="@string/array_default"
81-
app:showDividerValue="1000"
82-
app:format="%s f"
81+
app:dividerValue="1000"
82+
app:format="%.3f f"
8383
app:maxValue="2999"
8484
app:minValue="1"
8585
app:stepValue="1" />
@@ -89,8 +89,8 @@
8989
android:key="prefs_key_home_title_custom_anim_param_stiffness_RECT_WIDTH_2"
9090
android:title="@string/home_title_custom_anim_param_stiffness_title"
9191
app:defaultValueTitle="@string/array_default"
92-
app:showDividerValue="1000"
93-
app:format="%s f"
92+
app:dividerValue="1000"
93+
app:format="%.3f f"
9494
app:maxValue="2999"
9595
app:minValue="1"
9696
app:stepValue="1" />
@@ -104,8 +104,8 @@
104104
android:key="prefs_key_home_title_custom_anim_param_damping_RECT_RATIO_2"
105105
android:title="@string/home_title_custom_anim_param_damping_title"
106106
app:defaultValueTitle="@string/array_default"
107-
app:showDividerValue="1000"
108-
app:format="%s f"
107+
app:dividerValue="1000"
108+
app:format="%.3f f"
109109
app:maxValue="2999"
110110
app:minValue="1"
111111
app:stepValue="1" />
@@ -115,8 +115,8 @@
115115
android:key="prefs_key_home_title_custom_anim_param_stiffness_RECT_RATIO_2"
116116
android:title="@string/home_title_custom_anim_param_stiffness_title"
117117
app:defaultValueTitle="@string/array_default"
118-
app:showDividerValue="1000"
119-
app:format="%s f"
118+
app:dividerValue="1000"
119+
app:format="%.3f f"
120120
app:maxValue="2999"
121121
app:minValue="1"
122122
app:stepValue="1" />
@@ -130,8 +130,8 @@
130130
android:key="prefs_key_home_title_custom_anim_param_damping_RADIUS_2"
131131
android:title="@string/home_title_custom_anim_param_damping_title"
132132
app:defaultValueTitle="@string/array_default"
133-
app:showDividerValue="1000"
134-
app:format="%s f"
133+
app:dividerValue="1000"
134+
app:format="%.3f f"
135135
app:maxValue="2999"
136136
app:minValue="1"
137137
app:stepValue="1" />
@@ -141,8 +141,8 @@
141141
android:key="prefs_key_home_title_custom_anim_param_stiffness_RADIUS_2"
142142
android:title="@string/home_title_custom_anim_param_stiffness_title"
143143
app:defaultValueTitle="@string/array_default"
144-
app:showDividerValue="1000"
145-
app:format="%s f"
144+
app:dividerValue="1000"
145+
app:format="%.3f f"
146146
app:maxValue="2999"
147147
app:minValue="1"
148148
app:stepValue="1" />
@@ -156,8 +156,8 @@
156156
android:key="prefs_key_home_title_custom_anim_param_damping_ALPHA_2"
157157
android:title="@string/home_title_custom_anim_param_damping_title"
158158
app:defaultValueTitle="@string/array_default"
159-
app:showDividerValue="1000"
160-
app:format="%s f"
159+
app:dividerValue="1000"
160+
app:format="%.3f f"
161161
app:maxValue="2999"
162162
app:minValue="1"
163163
app:stepValue="1" />
@@ -167,8 +167,8 @@
167167
android:key="prefs_key_home_title_custom_anim_param_stiffness_ALPHA_2"
168168
android:title="@string/home_title_custom_anim_param_stiffness_title"
169169
app:defaultValueTitle="@string/array_default"
170-
app:showDividerValue="1000"
171-
app:format="%s f"
170+
app:dividerValue="1000"
171+
app:format="%.3f f"
172172
app:maxValue="2999"
173173
app:minValue="1"
174174
app:stepValue="1" />

0 commit comments

Comments
 (0)