Skip to content

Commit 334d5ba

Browse files
committed
Happy New Year 2025
1 parent 9db74f2 commit 334d5ba

9 files changed

Lines changed: 102 additions & 36 deletions

File tree

MIT_License.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
MIT License
2+
3+
Copyright © 2018 wolfhong
4+
Copyright © 2021 RC1844
5+
Copyright © 2021 Kr328 & RikkaW
6+
Copyright © 2022 Hao_cen
7+
Copyright © 2022 Houkyo
8+
Copyright © 2024 YuKongA
9+
10+
Permission is hereby granted, free of charge, to any person obtaining a copy
11+
of this software and associated documentation files (the "Software"), to deal
12+
in the Software without restriction, including without limitation the rights
13+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14+
copies of the Software, and to permit persons to whom the Software is
15+
furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included in all
18+
copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26+
SOFTWARE.

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ dependencies {
264264
implementation(libs.gson)
265265
implementation(libs.hooktool)
266266
implementation(libs.lyric.getter.api)
267+
implementation(libs.lunarcalendar)
267268

268269
implementation(libs.core)
269270
implementation(libs.collection)

app/src/main/java/com/sevtinge/hyperceiler/ui/activity/HyperCeilerTabActivity.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.sevtinge.hyperceiler.ui.activity;
22

3-
import static com.sevtinge.hyperceiler.utils.GrayViewUtils.isNeedGrayView;
3+
import static com.sevtinge.hyperceiler.utils.PersistConfig.isLunarNewYearThemeView;
4+
import static com.sevtinge.hyperceiler.utils.PersistConfig.isNeedGrayView;
45
import static com.sevtinge.hyperceiler.utils.Helpers.isModuleActive;
56
import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad;
67
import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion;
@@ -33,28 +34,28 @@
3334
import com.sevtinge.hyperceiler.prefs.XmlPreference;
3435
import com.sevtinge.hyperceiler.safe.CrashData;
3536
import com.sevtinge.hyperceiler.ui.activity.base.NaviBaseActivity;
36-
import com.sevtinge.hyperceiler.ui.fragment.dashboard.DashboardFragment;
37-
import com.sevtinge.hyperceiler.ui.fragment.main.ContentFragment;
3837
import com.sevtinge.hyperceiler.ui.fragment.main.DetailFragment;
3938
import com.sevtinge.hyperceiler.utils.BackupUtils;
4039
import com.sevtinge.hyperceiler.utils.DialogHelper;
4140
import com.sevtinge.hyperceiler.utils.Helpers;
4241
import com.sevtinge.hyperceiler.utils.LanguageHelper;
43-
import com.sevtinge.hyperceiler.utils.NotificationUtils;
4442
import com.sevtinge.hyperceiler.utils.PermissionUtils;
4543
import com.sevtinge.hyperceiler.utils.PropUtils;
4644
import com.sevtinge.hyperceiler.utils.ThreadPoolManager;
4745
import com.sevtinge.hyperceiler.utils.api.ProjectApi;
46+
import com.sevtinge.hyperceiler.utils.log.AndroidLogUtils;
4847
import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils;
4948
import com.sevtinge.hyperceiler.utils.search.SearchHelper;
5049
import com.sevtinge.hyperceiler.utils.shell.ShellInit;
50+
import com.xhinliang.lunarcalendar.Lunar;
51+
import com.xhinliang.lunarcalendar.LunarCalendar;
5152

53+
import java.time.LocalDate;
5254
import java.util.ArrayList;
5355
import java.util.HashMap;
5456
import java.util.Map;
5557

5658
import fan.appcompat.app.AlertDialog;
57-
import fan.appcompat.app.Fragment;
5859
import fan.navigator.Navigator;
5960
import fan.navigator.NavigatorFragmentListener;
6061
import fan.navigator.navigatorinfo.UpdateDetailFragmentNavInfo;
@@ -82,7 +83,9 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
8283
decorView.setLayerType(View.LAYER_TYPE_HARDWARE, paint);
8384
}
8485

85-
HolidayHelper mHolidayHelper = new HolidayHelper(this);
86+
if (isLunarNewYearThemeView) {
87+
HolidayHelper mHolidayHelper = new HolidayHelper(this);
88+
}
8689

8790
SharedPreferences mPrefs = PrefsUtils.mSharedPreferences;
8891
String languageSetting = mPrefs.getString("prefs_key_settings_app_language", "-1");

app/src/main/java/com/sevtinge/hyperceiler/ui/activity/base/BaseActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
package com.sevtinge.hyperceiler.ui.activity.base;
2020

21-
import static com.sevtinge.hyperceiler.utils.GrayViewUtils.isNeedGrayView;
21+
import static com.sevtinge.hyperceiler.utils.PersistConfig.isNeedGrayView;
2222

2323
import android.graphics.ColorMatrix;
2424
import android.graphics.ColorMatrixColorFilter;

app/src/main/java/com/sevtinge/hyperceiler/utils/GrayViewUtils.java

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* This file is part of HyperCeiler.
3+
*
4+
* HyperCeiler is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU Affero General Public License as
6+
* published by the Free Software Foundation, either version 3 of the
7+
* License.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU Affero General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Affero General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*
17+
* Copyright (C) 2023-2025 HyperCeiler Contributions
18+
*/
19+
20+
package com.sevtinge.hyperceiler.utils;
21+
22+
import com.xhinliang.lunarcalendar.Lunar;
23+
import com.xhinliang.lunarcalendar.LunarCalendar;
24+
25+
import java.time.LocalDate;
26+
27+
public class PersistConfig {
28+
private static final LocalDate localDate = LocalDate.now();
29+
private static final LunarCalendar lunarCalender = LunarCalendar.obtainCalendar(localDate.getYear(), localDate.getMonthValue(), localDate.getDayOfMonth());
30+
private static final Lunar lunar = lunarCalender.getLunar();
31+
32+
public final static boolean isNeedGrayView = false;
33+
public final static boolean isLunarNewYearThemeView =
34+
(lunar.month == 12 && 29 <= lunar.day && lunar.day <= 30) ||
35+
(lunar.month == 1 && 1 <= lunar.day && lunar.day <= 15) ||
36+
(localDate.getMonthValue() == 12 && localDate.getDayOfMonth() == 31) ||
37+
(localDate.getMonthValue() == 1 && 1 <= localDate.getDayOfMonth() && localDate.getDayOfMonth() <= 5);
38+
}

app/src/main/java/com/sevtinge/hyperceiler/view/BgEffectPainter.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.sevtinge.hyperceiler.view;
22

3+
import static com.sevtinge.hyperceiler.utils.PersistConfig.isLunarNewYearThemeView;
4+
35
import android.content.Context;
46
import android.content.res.Resources;
57
import android.graphics.RenderEffect;
@@ -103,15 +105,26 @@ public void setPhoneLight(float[] fArr) {
103105
setLightOffset(0.1f);
104106
setSaturateOffset(0.2f);
105107
setPoints(new float[]{0.67f, 0.42f, 1.0f, 0.69f, 0.75f, 1.0f, 0.14f, 0.71f, 0.95f, 0.14f, 0.27f, 0.8f});
106-
setColors(new float[]{0.57f, 0.76f, 0.98f, 1.0f, 0.98f, 0.85f, 0.68f, 1.0f, 0.98f, 0.75f, 0.93f, 1.0f, 0.73f, 0.7f, 0.98f, 1.0f});
108+
if (isLunarNewYearThemeView) {
109+
setColors(new float[]{1.0f, 0.83f, 0.68f, 1.0f, 0.92f, 0.56f, 0.47f, 1.0f, 0.98f, 0.74f, 0.72f, 1.0f, 1.0f, 0.62f, 0.53f, 1.0f});
110+
// setColors(new float[]{0.97f, 0.67f, 0.46f, 1.0f, 0.80f, 0.12f, 0.09f, 1.0f, 0.93f, 0.47f, 0.2f, 1.0f, 0.98f, 0.36f, 0.28f, 1.0f});
111+
} else {
112+
setColors(new float[]{0.57f, 0.76f, 0.98f, 1.0f, 0.98f, 0.85f, 0.68f, 1.0f, 0.98f, 0.75f, 0.93f, 1.0f, 0.73f, 0.7f, 0.98f, 1.0f});
113+
}
114+
setBound(fArr);
107115
setBound(fArr);
108116
}
109117

110118
public void setPhoneDark(float[] fArr) {
111119
setLightOffset(-0.1f);
112120
setSaturateOffset(0.2f);
113121
setPoints(new float[]{0.63f, 0.5f, 0.88f, 0.69f, 0.75f, 0.8f, 0.17f, 0.66f, 0.81f, 0.14f, 0.24f, 0.72f});
114-
setColors(new float[]{0.0f, 0.31f, 0.58f, 1.0f, 0.53f, 0.29f, 0.15f, 1.0f, 0.46f, 0.06f, 0.27f, 1.0f, 0.16f, 0.12f, 0.45f, 1.0f});
122+
if (isLunarNewYearThemeView) {
123+
setColors(new float[]{0.58f, 0.4f, 0.28f, 1.0f, 0.48f, 0.12f, 0.1f, 1.0f, 0.56f, 0.28f, 0.12f, 1.0f, 0.46f, 0.16f, 0.11f, 1.0f});
124+
// setColors(new float[]{0.97f, 0.67f, 0.46f, 1.0f, 0.80f, 0.12f, 0.09f, 1.0f, 0.93f, 0.47f, 0.2f, 1.0f, 0.98f, 0.36f, 0.28f, 1.0f});
125+
} else {
126+
setColors(new float[]{0.0f, 0.31f, 0.58f, 1.0f, 0.53f, 0.29f, 0.15f, 1.0f, 0.46f, 0.06f, 0.27f, 1.0f, 0.16f, 0.12f, 0.45f, 1.0f});
127+
}
115128
setBound(fArr);
116129
}
117130

app/src/main/res/xml/prefs_about_use.xml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,18 @@
251251
android:data="https://github.com/LSPosed/LSParanoid" />
252252
</Preference>
253253
<Preference
254-
android:summary="xiaowine | Apache-2.0"
255-
android:title="Lyric-Getter-Api">
254+
android:summary="LSPosed | Apache-2.0"
255+
android:title="LSParanoid">
256+
<intent
257+
android:action="android.intent.action.VIEW"
258+
android:data="https://github.com/LSPosed/LSParanoid" />
259+
</Preference>
260+
<Preference
261+
android:summary="wolfhong | MIT"
262+
android:title="LunarCalendar">
256263
<intent
257264
android:action="android.intent.action.VIEW"
258-
android:data="https://github.com/xiaowine/Lyric-Getter-Api" />
265+
android:data="https://github.com/wolfhong/LunarCalendar" />
259266
</Preference>
260267
<Preference
261268
android:summary="YifePlayte | GPL-3.0"

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ annotation = "1.9.1"
88
core = "1.15.0"
99
collection = "1.4.5"
1010
fragment = "1.8.5"
11+
lunarcalendar = "latest.release"
1112
recyclerview = "1.3.2"
1213
lifecycle-common = "2.8.7"
1314
coordinatorlayout = "1.2.0"
@@ -29,6 +30,7 @@ core = { group = "androidx.core", name = "core", version.ref = "core" }
2930
collection = { group = "androidx.collection", name = "collection", version.ref = "collection" }
3031
fragment = { group = "androidx.fragment", name = "fragment", version.ref = "fragment" }
3132
hooktool = { module = "com.github.HChenX:HookTool", version.ref = "hooktool" }
33+
lunarcalendar = { module = "com.xhinliang:LunarCalendar", version.ref = "lunarcalendar" }
3234
recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerview" }
3335
lifecycle-common = { group = "androidx.lifecycle", name = "lifecycle-common", version.ref = "lifecycle-common" }
3436

0 commit comments

Comments
 (0)