Skip to content

Commit

Permalink
(turn systime to may 1st) happy birthday, hyperceiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed May 4, 2024
1 parent cae1a5f commit 3435027
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.xmlpull.v1.XmlPullParserException;

import java.io.IOException;
import java.util.Calendar;
import java.util.Objects;

import moralnorm.preference.Preference;
Expand All @@ -66,6 +67,7 @@ public class MainFragment extends SettingsPreferenceFragment implements Homepage
Preference mAod;
Preference mGuardProvider;
Preference mHeadtipWarn;
Preference mHeadtipBirthday;
Preference mHelpCantSeeApps;
TipsPreference mTips;
MainActivityContextHelper mainActivityContextHelper;
Expand Down Expand Up @@ -136,6 +138,7 @@ public void initPrefs() {
mGuardProvider = findPreference("prefs_key_guardprovider");
mTips = findPreference("prefs_key_tips");
mHeadtipWarn = findPreference("prefs_key_headtip_warn");
mHeadtipBirthday = findPreference("prefs_key_headtip_hyperceiler");
mHelpCantSeeApps = findPreference("prefs_key_help_cant_see_app");

mHelpCantSeeApps.setVisible(!getSharedPreferences().getBoolean("prefs_key_help_cant_see_apps_switch", false));
Expand All @@ -160,12 +163,21 @@ public void initPrefs() {

mainActivityContextHelper = new MainActivityContextHelper(requireContext());

isBirthday();
isOfficialRom();
if (!getIsOfficialRom()) isSignPass();

mTips = findPreference("prefs_key_tips");
}

public void isBirthday() {
Calendar calendar = Calendar.getInstance();
int currentMonth = calendar.get(Calendar.MONTH);
int currentDay = calendar.get(Calendar.DAY_OF_MONTH);
mHeadtipBirthday.setVisible(currentMonth == Calendar.MAY && currentDay == 1);

}

public void isOfficialRom() {
mHeadtipWarn.setTitle(R.string.headtip_warn_not_offical_rom);
mHeadtipWarn.setVisible(getIsOfficialRom());
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/drawable/headtip_hyperceiler_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- rounded_corner.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="18dp" />
<solid android:color="#2AFC5B8D" />
</shape>
Binary file not shown.
88 changes: 88 additions & 0 deletions app/src/main/res/layout/headtip_hyperceiler.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2015 The Android Open Source 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
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:clickable="false"
android:clipChildren="false"
android:gravity="center_vertical"
android:paddingStart="24dp"
android:paddingTop="6dp"
android:paddingEnd="24dp"
android:paddingBottom="2dp">

<include layout="@layout/image_frame" />

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1.0"
android:background="@drawable/headtip_hyperceiler_background"
android:gravity="center_vertical">

<ImageView
android:id="@+id/image_left"
android:layout_width="92dp"
android:layout_height="66dp"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:paddingLeft="16dp"
android:paddingRight="7dp"

android:src="@drawable/ic_hyperceiler_cartoon" />

<TextView
android:id="@android:id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/image_left"
android:layout_centerVertical="true"
android:clickable="true"
android:enabled="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:inputType="textMultiLine"
android:longClickable="true"
android:paddingLeft="7dp"
android:paddingTop="14dp"
android:paddingRight="16dp"
android:paddingBottom="14dp"
android:textColor="#fc5b8d"
android:textIsSelectable="true" />
</RelativeLayout>

<!-- Preference should place its actual preference widget here. -->
<LinearLayout
android:id="@android:id/widget_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipChildren="false"
android:gravity="center"
android:minWidth="@dimen/preference_widget_minWidth"
android:orientation="vertical" />

<ImageView
android:id="@+id/arrow_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|end"
android:gravity="center"
android:src="@drawable/ic_preference_arrow_right" />

</LinearLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,6 @@
<string name="home_other_app_icon_hide">桌面快捷方式管理</string>
<string name="home_other_toast_slide_again">禁止提示 \"请再划一次\" Toast</string>
<string name="system_framework_guided_access_status">固定时完全隐藏状态栏</string>
<string name="system_framework_guided_access_status_more">如同ios的引导式访问,只能通过按键方式退出,把屏幕完全交给app。退出方式为长按电源键</string>
<string name="system_framework_guided_access_status_more">将屏幕完全移交至应用,仅允许通过长按电源键退出</string>
<string name="system_framework_guided_access_sc">固定时禁止呼出侧边栏</string>
<string name="system_framework_guided_access_screen">解除固定时跳转锁屏</string>
Expand Down Expand Up @@ -1731,5 +1730,6 @@
<string name="headtip_warn_not_offical_rom">您正在使用的 ROM 来源可能并不是 Xiaomi 官方,部分功能可能会失效,详情请咨询您正在使用 ROM 的提供者。</string>
<string name="headtip_warn_sign_verification_failed">签名校验失败,您当前使用的版本可能并非来自于 Re.chronoRain 的官方版本,可能包含恶意代码,请注意使用安全。</string>
<string name="headtip_tip_long_press_to_copy">您可以长按或双击后选择文本进行操作,或者复制并反馈给开发者。</string>
<string name="happy_birthday_hyperceiler">今天是 HyperCeiler 的生日!\n感谢与您岁月相伴之恩,愿来年再续前缘,共赴风雨,携手并进!</string>

</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,6 @@
<string name="safe_mode_recorder_msg">Exception Message</string>
<string name="safe_mode_recorder_st">Stack Trace</string>
<string name="tip_default">Tip: Here is the default tip. If you can see me, it means that there is a problem with HyperCeiler, please report it to the developer in a timely and effective manner.</string>

<string name="preference_recommend_tip">Looking for something else?</string>
<string name="happy_birthday_hyperceiler">Today is HyperCeiler\'s birthday!\nThank you for your support over the past year, and let\'s continue to work together this year!</string>
</resources>
7 changes: 7 additions & 0 deletions app/src/main/res/xml/prefs_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory>
<Preference
android:layout="@layout/headtip_hyperceiler"
android:key="prefs_key_headtip_hyperceiler"
android:enabled="false"
android:title="@string/happy_birthday_hyperceiler"
app:isPreferenceVisible="false" />

<Preference
android:layout="@layout/headtip_warn"
android:key="prefs_key_headtip_warn"
Expand Down

0 comments on commit 3435027

Please sign in to comment.