春节主题:登录、主页面。

This commit is contained in:
2026-01-28 09:29:03 +08:00
parent 3d0fb12565
commit 88ce0205fb
68 changed files with 221 additions and 254 deletions

View File

@@ -84,9 +84,10 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
@SuppressLint("UnspecifiedRegisterReceiverFlag")
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
initFestivalTheme(2);
super.onCreate(savedInstanceState);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
getWindow().getDecorView().setBackgroundResource(R.mipmap.log_bj);
// getWindow().getDecorView().setBackgroundResource(R.attr.app_bg_img);
setContentView(getLayoutId());
doDone();
// 隐藏标题栏
@@ -116,6 +117,25 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
EventBus.getDefault().register(this);
}
// 节日判断+主题切换核心方法
private void initFestivalTheme(int currentFestival) {
switch (currentFestival) {
case 0:
setTheme(R.style.AppTheme_CustomAttrs);
break;
case 1:
setTheme(R.style.AppTheme_newYear_CustomAttrs);
break;
case 2:
setTheme(R.style.AppTheme_Spring_CustomAttrs);
break;
default:
// 默认皮肤
setTheme(R.style.AppTheme_CustomAttrs);
break;
}
}
// 在Activity中
private static final int REQUEST_OVERLAY_PERMISSION = 1001;
@@ -181,37 +201,8 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
protected void loadNetworkBackground() {
// 只有当已经有背景URL时才加载
int backgroundUrl = BackgroundManager.getInstance().getBackgroundUrl();
getWindow().getDecorView().setBackgroundResource(backgroundUrl);
// String backgroundUrl = BackgroundManager.getInstance().getBackgroundUrl();
// if (backgroundUrl != null && !backgroundUrl.isEmpty()) {
// // 检查是否有已加载的drawable
// Drawable cachedDrawable = BackgroundManager.getInstance().getBackgroundDrawable();
// if (cachedDrawable != null) {
// getWindow().getDecorView().setBackground(cachedDrawable);
// } else {
// // 加载网络背景
// BackgroundManager.getInstance().loadBackgroundDrawable(this, new BackgroundManager.BackgroundLoadCallback() {
// @Override
// public void onLoadSuccess(Drawable drawable) {
// getWindow().getDecorView().setBackground(drawable);
// }
//
// @Override
// public void onLoadFailed() {
// // 加载失败时使用默认背景
// getWindow().getDecorView().setBackgroundResource(R.mipmap.activity_bj);
// }
//
// @Override
// public void onLoadComplete(int resultId) {
//
// }
// });
// }
// }
// int backgroundUrl = BackgroundManager.getInstance().getBackgroundUrl();
// getWindow().getDecorView().setBackgroundResource(backgroundUrl);
}
@Override

View File

@@ -137,7 +137,7 @@ public class CommonAppContext extends MultiDexApplication implements Application
@Getter
public UnreadCountEvent unreadCountEvent;
public static int selectRelease = -1;
public static int selectRelease = 1;
public int is_open = 0;//主题的开关

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#F0EEF7" />
<solid android:color="#FFF0EEF7" />
<corners android:radius="@dimen/dp_22" />
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@mipmap/icon_shouye_s"/>
<item android:state_selected="false" android:drawable="@mipmap/icon_shouye_ns"/>
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@mipmap/icon_dongtai_s"/>
<item android:state_selected="false" android:drawable="@mipmap/icon_dongtai_ns"/>
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@mipmap/icon_xiaoxi_s"/>
<item android:state_selected="false" android:drawable="@mipmap/icon_xiaoxi_ns"/>
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@mipmap/icon_wode_s"/>
<item android:state_selected="false" android:drawable="@mipmap/icon_wode_ns"/>
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@mipmap/icon_sy_notselect"/>
<item android:state_selected="false" android:drawable="@mipmap/icon_sy_select"/>
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@mipmap/icon_dt_notselect"/>
<item android:state_selected="false" android:drawable="@mipmap/icon_dt_select"/>
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@mipmap/icon_xx_notselect"/>
<item android:state_selected="false" android:drawable="@mipmap/icon_xx_select"/>
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@mipmap/icon_wd_notselect"/>
<item android:state_selected="false" android:drawable="@mipmap/icon_wd_select"/>
</selector>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/ic_agreement_spring_selected" android:state_checked="true" />
<item android:drawable="@drawable/ic_agreement_unselect" android:state_checked="false" />
<item android:drawable="@drawable/ic_agreement_unselect" />
</selector>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="#6D6D6D"
android:state_selected="false" />
<item android:color="@color/colorPrimary_spring"
android:state_selected="true"/>
</selector>

View File

@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ff22BB79 " />
<solid android:color="?attr/app_color_colorPrimary" />
<corners
android:bottomLeftRadius="22dp"
android:bottomRightRadius="22dp"

View File

@@ -73,6 +73,7 @@
android:text="确认"
android:textSize="@dimen/sp_14"
android:gravity="center"
android:backgroundTint="?attr/app_color_colorPrimary"
android:background="@drawable/cs"/>
</RelativeLayout>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 KiB

View File

@@ -3,6 +3,22 @@
<attr name="ev_title" format="string" />
<!-- 自定义图片属性:应用节日背景图 -->
<attr name="app_bg_img" format="reference" />
<attr name="app_color_colorPrimary" format="reference" />
<attr name="app_login_check_select" format="reference"/>
<attr name="app_main_bg" format="reference"/>
<attr name="app_main_tab_1" format="reference"/>
<attr name="app_main_tab_2" format="reference"/>
<attr name="app_main_tab_3" format="reference"/>
<attr name="app_main_tab_4" format="reference"/>
<attr name="app_main_tab_text_color" format="reference"/>
<attr name="app_main_tab_bg" format="reference"/>
<attr name="app_user_bg_color" format="color"/>
<attr name="app_user_edit_me" format="reference"/>
<declare-styleable name="ExplainView">
<attr name="ev_title" />
<attr name="ev_hint" format="string" />

View File

@@ -305,6 +305,7 @@
<!-- 主题色 -->
<color name="colorPrimary">#22BB79</color>
<color name="colorPrimary_spring">#FFFF3700</color>
<!-- 辅助色 -->
<color name="colorSecondary1">#F0EEF7</color>

View File

@@ -5,20 +5,93 @@
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:colorBackground">@color/background</item>
<item name="android:colorBackground">@color/transparent</item>
<item name="android:textColor">@color/color_1F1C1F</item>
<item name="android:textColorHint">@color/color_FF999999</item>
<item name="android:windowBackground">@color/color_F9FAFA</item>
<item name="android:windowTranslucentStatus">false</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowDisablePreview">true</item>
<!-- 新增:全局禁用跳转动画 -->
<item name="android:windowAnimationStyle">@style/NoAnimationStyle</item>
</style>
<!-- 你的基础主题(保持不变) -->
<style name="AppTheme_Spring" parent="@style/Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:colorBackground">@color/transparent</item>
<item name="android:textColor">@color/color_1F1C1F</item>
<item name="android:textColorHint">@color/color_FF999999</item>
<item name="android:windowBackground">@mipmap/icon_spring_bg</item>
<item name="android:windowTranslucentStatus">false</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowDisablePreview">true</item>
<!-- 新增:全局禁用跳转动画 -->
<item name="android:windowAnimationStyle">@style/NoAnimationStyle</item>
</style>
<!-- 子主题:默认主题 -->
<style name="AppTheme.CustomAttrs" parent="AppTheme">
<item name="app_bg_img">@mipmap/log_bj</item>
<item name="app_color_colorPrimary">@color/colorPrimary</item>
<item name="app_login_check_select">@drawable/selector_login_agreement</item>
<item name="app_main_bg">@mipmap/activity_bj</item>
<item name="app_main_tab_1">@drawable/main_bottom_bar_icon_me</item>
<item name="app_main_tab_2">@drawable/main_bottom_bar_icon_media</item>
<item name="app_main_tab_3">@drawable/main_bottom_bar_icon_news</item>
<item name="app_main_tab_4">@drawable/main_bottom_bar_icon_tend</item>
<item name="app_main_tab_text_color">@drawable/text_color_two</item>
<item name="app_user_edit_me">@mipmap/me_edit</item>
</style>
<!-- 子主题:元旦主题 -->
<style name="AppTheme_newYear.CustomAttrs" parent="AppTheme_Spring">
<item name="app_bg_img">@mipmap/log_bj</item>
<item name="app_color_colorPrimary">@color/colorPrimary</item>
<item name="app_login_check_select">@drawable/selector_login_agreement</item>
<item name="app_main_bg">@mipmap/bg_dark</item>
<item name="app_main_tab_1">@drawable/main_tab_new_1</item>
<item name="app_main_tab_2">@drawable/main_tab_new_2</item>
<item name="app_main_tab_3">@drawable/main_tab_new_3</item>
<item name="app_main_tab_4">@drawable/main_tab_new_4</item>
<item name="app_main_tab_text_color">@drawable/text_color_two</item>
<item name="app_main_tab_bg">@drawable/home_bbar_xz</item>
<item name="app_user_bg_color">#231F2C</item>
<item name="app_user_edit_me">@mipmap/me_edit</item>
</style>
<!-- 子主题:春节主题 -->
<style name="AppTheme_Spring.CustomAttrs" parent="AppTheme_Spring">
<item name="app_bg_img">@mipmap/icon_spring_bg</item>
<item name="app_color_colorPrimary">@color/colorPrimary_spring</item>
<item name="app_login_check_select">@drawable/selector_login_spring_agreement</item>
<item name="app_main_bg">@mipmap/icon_main_bg</item>
<item name="app_main_tab_1">@drawable/main_tab_1</item>
<item name="app_main_tab_2">@drawable/main_tab_2</item>
<item name="app_main_tab_3">@drawable/main_tab_3</item>
<item name="app_main_tab_4">@drawable/main_tab_4</item>
<item name="app_main_tab_text_color">@drawable/text_color_spring</item>
<item name="app_main_tab_bg">@mipmap/icon_main_tab_bg</item>
<item name="app_user_bg_color">#FF600D00</item>
<item name="app_user_edit_me">@mipmap/icon_spring_edit_me</item>
</style>
<!-- 定义具体的无动画属性 -->
<style name="NoAnimationStyle" parent="@android:style/Animation.Activity">