Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
Happy New Year 2025
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed Dec 31, 2024
1 parent 9db74f2 commit 334d5ba
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 36 deletions.
26 changes: 26 additions & 0 deletions MIT_License.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
MIT License

Copyright © 2018 wolfhong
Copyright © 2021 RC1844
Copyright © 2021 Kr328 & RikkaW
Copyright © 2022 Hao_cen
Copyright © 2022 Houkyo
Copyright © 2024 YuKongA

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ dependencies {
implementation(libs.gson)
implementation(libs.hooktool)
implementation(libs.lyric.getter.api)
implementation(libs.lunarcalendar)

implementation(libs.core)
implementation(libs.collection)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sevtinge.hyperceiler.ui.activity;

import static com.sevtinge.hyperceiler.utils.GrayViewUtils.isNeedGrayView;
import static com.sevtinge.hyperceiler.utils.PersistConfig.isLunarNewYearThemeView;
import static com.sevtinge.hyperceiler.utils.PersistConfig.isNeedGrayView;
import static com.sevtinge.hyperceiler.utils.Helpers.isModuleActive;
import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad;
import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion;
Expand Down Expand Up @@ -33,28 +34,28 @@
import com.sevtinge.hyperceiler.prefs.XmlPreference;
import com.sevtinge.hyperceiler.safe.CrashData;
import com.sevtinge.hyperceiler.ui.activity.base.NaviBaseActivity;
import com.sevtinge.hyperceiler.ui.fragment.dashboard.DashboardFragment;
import com.sevtinge.hyperceiler.ui.fragment.main.ContentFragment;
import com.sevtinge.hyperceiler.ui.fragment.main.DetailFragment;
import com.sevtinge.hyperceiler.utils.BackupUtils;
import com.sevtinge.hyperceiler.utils.DialogHelper;
import com.sevtinge.hyperceiler.utils.Helpers;
import com.sevtinge.hyperceiler.utils.LanguageHelper;
import com.sevtinge.hyperceiler.utils.NotificationUtils;
import com.sevtinge.hyperceiler.utils.PermissionUtils;
import com.sevtinge.hyperceiler.utils.PropUtils;
import com.sevtinge.hyperceiler.utils.ThreadPoolManager;
import com.sevtinge.hyperceiler.utils.api.ProjectApi;
import com.sevtinge.hyperceiler.utils.log.AndroidLogUtils;
import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils;
import com.sevtinge.hyperceiler.utils.search.SearchHelper;
import com.sevtinge.hyperceiler.utils.shell.ShellInit;
import com.xhinliang.lunarcalendar.Lunar;
import com.xhinliang.lunarcalendar.LunarCalendar;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import fan.appcompat.app.AlertDialog;
import fan.appcompat.app.Fragment;
import fan.navigator.Navigator;
import fan.navigator.NavigatorFragmentListener;
import fan.navigator.navigatorinfo.UpdateDetailFragmentNavInfo;
Expand Down Expand Up @@ -82,7 +83,9 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
decorView.setLayerType(View.LAYER_TYPE_HARDWARE, paint);
}

HolidayHelper mHolidayHelper = new HolidayHelper(this);
if (isLunarNewYearThemeView) {
HolidayHelper mHolidayHelper = new HolidayHelper(this);
}

SharedPreferences mPrefs = PrefsUtils.mSharedPreferences;
String languageSetting = mPrefs.getString("prefs_key_settings_app_language", "-1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package com.sevtinge.hyperceiler.ui.activity.base;

import static com.sevtinge.hyperceiler.utils.GrayViewUtils.isNeedGrayView;
import static com.sevtinge.hyperceiler.utils.PersistConfig.isNeedGrayView;

import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* This file is part of HyperCeiler.
*
* HyperCeiler is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* Copyright (C) 2023-2025 HyperCeiler Contributions
*/

package com.sevtinge.hyperceiler.utils;

import com.xhinliang.lunarcalendar.Lunar;
import com.xhinliang.lunarcalendar.LunarCalendar;

import java.time.LocalDate;

public class PersistConfig {
private static final LocalDate localDate = LocalDate.now();
private static final LunarCalendar lunarCalender = LunarCalendar.obtainCalendar(localDate.getYear(), localDate.getMonthValue(), localDate.getDayOfMonth());
private static final Lunar lunar = lunarCalender.getLunar();

public final static boolean isNeedGrayView = false;
public final static boolean isLunarNewYearThemeView =
(lunar.month == 12 && 29 <= lunar.day && lunar.day <= 30) ||
(lunar.month == 1 && 1 <= lunar.day && lunar.day <= 15) ||
(localDate.getMonthValue() == 12 && localDate.getDayOfMonth() == 31) ||
(localDate.getMonthValue() == 1 && 1 <= localDate.getDayOfMonth() && localDate.getDayOfMonth() <= 5);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.sevtinge.hyperceiler.view;

import static com.sevtinge.hyperceiler.utils.PersistConfig.isLunarNewYearThemeView;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.RenderEffect;
Expand Down Expand Up @@ -103,15 +105,26 @@ public void setPhoneLight(float[] fArr) {
setLightOffset(0.1f);
setSaturateOffset(0.2f);
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});
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});
if (isLunarNewYearThemeView) {
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});
// 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});
} else {
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});
}
setBound(fArr);
setBound(fArr);
}

public void setPhoneDark(float[] fArr) {
setLightOffset(-0.1f);
setSaturateOffset(0.2f);
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});
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});
if (isLunarNewYearThemeView) {
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});
// 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});
} else {
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});
}
setBound(fArr);
}

Expand Down
13 changes: 10 additions & 3 deletions app/src/main/res/xml/prefs_about_use.xml
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,18 @@
android:data="https://github.com/LSPosed/LSParanoid" />
</Preference>
<Preference
android:summary="xiaowine | Apache-2.0"
android:title="Lyric-Getter-Api">
android:summary="LSPosed | Apache-2.0"
android:title="LSParanoid">
<intent
android:action="android.intent.action.VIEW"
android:data="https://github.com/LSPosed/LSParanoid" />
</Preference>
<Preference
android:summary="wolfhong | MIT"
android:title="LunarCalendar">
<intent
android:action="android.intent.action.VIEW"
android:data="https://github.com/xiaowine/Lyric-Getter-Api" />
android:data="https://github.com/wolfhong/LunarCalendar" />
</Preference>
<Preference
android:summary="YifePlayte | GPL-3.0"
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ annotation = "1.9.1"
core = "1.15.0"
collection = "1.4.5"
fragment = "1.8.5"
lunarcalendar = "latest.release"
recyclerview = "1.3.2"
lifecycle-common = "2.8.7"
coordinatorlayout = "1.2.0"
Expand All @@ -29,6 +30,7 @@ core = { group = "androidx.core", name = "core", version.ref = "core" }
collection = { group = "androidx.collection", name = "collection", version.ref = "collection" }
fragment = { group = "androidx.fragment", name = "fragment", version.ref = "fragment" }
hooktool = { module = "com.github.HChenX:HookTool", version.ref = "hooktool" }
lunarcalendar = { module = "com.xhinliang:LunarCalendar", version.ref = "lunarcalendar" }
recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerview" }
lifecycle-common = { group = "androidx.lifecycle", name = "lifecycle-common", version.ref = "lifecycle-common" }

Expand Down

0 comments on commit 334d5ba

Please sign in to comment.