From 033b9aec6742bc0f31f5d195ec5cdf4e37761a91 Mon Sep 17 00:00:00 2001 From: BigPickle Date: Tue, 21 Jul 2026 13:26:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(appbase):=20=E6=B7=BB=E5=8A=A0=E6=A1=8C?= =?UTF-8?q?=E9=9D=A2=E5=9B=BE=E6=A0=87=E5=BF=AB=E6=8D=B7=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=B9=B6=E4=BF=AE=E5=A4=8D=E9=A2=9C=E8=89=B2=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 桌面图标长按快捷菜单 - 在MainActivity注册动态快捷方式,长按桌面图标显示 - 快捷入口邮件设置,点击打开APPExcetionMailSettingsActivity 2. 修复colors.xml移除后XML资源引用崩溃 - drawable/styles/layout中28处@color/引用替换为内联色值 - 修复CrashActivity启动时Resources: ic_launcher_background → @color/colorPrimary 找不到 --- appbase/build.properties | 4 +-- .../winboll/studio/appbase/MainActivity.java | 32 +++++++++++++++++++ .../main/res/layout-night/activity_main2.xml | 2 +- appbase/src/main/res/values-night/styles.xml | 2 +- appbase/src/main/res/values/styles.xml | 2 +- libappbase/build.properties | 4 +-- .../src/main/res/drawable/bg_toolbar_log.xml | 8 ++--- .../src/main/res/drawable/btn_gray_bg.xml | 6 ++-- .../res/drawable/ic_launcher_background.xml | 2 +- .../src/main/res/values-night/styles.xml | 20 ++++++------ libappbase/src/main/res/values/styles.xml | 20 ++++++------ 11 files changed, 67 insertions(+), 35 deletions(-) diff --git a/appbase/build.properties b/appbase/build.properties index 45210b7..645f82c 100644 --- a/appbase/build.properties +++ b/appbase/build.properties @@ -1,8 +1,8 @@ #Created by .winboll/winboll_app_build.gradle -#Tue Jul 21 12:19:17 HKT 2026 +#Tue Jul 21 13:23:28 HKT 2026 stageCount=2 libraryProject=libappbase baseVersion=15.21 publishVersion=15.21.1 -buildCount=0 +buildCount=6 baseBetaVersion=15.21.2 diff --git a/appbase/src/main/java/cc/winboll/studio/appbase/MainActivity.java b/appbase/src/main/java/cc/winboll/studio/appbase/MainActivity.java index 96b99c4..e3cd4fd 100644 --- a/appbase/src/main/java/cc/winboll/studio/appbase/MainActivity.java +++ b/appbase/src/main/java/cc/winboll/studio/appbase/MainActivity.java @@ -1,8 +1,12 @@ package cc.winboll.studio.appbase; import android.app.Activity; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import android.content.pm.ShortcutInfo; +import android.content.pm.ShortcutManager; +import android.graphics.drawable.Icon; import android.net.Uri; import android.os.Bundle; import android.view.Menu; @@ -11,6 +15,7 @@ import android.view.View; import android.widget.Toolbar; import cc.winboll.studio.appbase.R; import cc.winboll.studio.appbase.model.TestBean; +import cc.winboll.studio.appbase.develop.APPExcetionMailSettingsActivity; import cc.winboll.studio.libappbase.LogActivity; import cc.winboll.studio.libappbase.LogUtils; import cc.winboll.studio.libappbase.ToastUtils; @@ -45,6 +50,7 @@ public class MainActivity extends Activity { setActionBar(mToolbar); // 将 Toolbar 替代系统默认 ActionBar initTestData(); + setupShortcuts(); } void initTestData() { @@ -60,6 +66,32 @@ public class MainActivity extends Activity { return "/BaseBaen/"+TestBean.class.getName()+".json"; } + /** + * 注册桌面图标静态快捷方式 + * 长按桌面图标后显示快捷菜单,点击可直接打开异常邮件接收设置页面 + */ + private void setupShortcuts() { + ShortcutManager shortcutManager = getSystemService(ShortcutManager.class); + if (shortcutManager == null) { + return; + } + + Intent intent = new Intent(this, APPExcetionMailSettingsActivity.class); + intent.setAction(Intent.ACTION_VIEW); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + + ShortcutInfo shortcut = new ShortcutInfo.Builder(this, "exception_mail_settings") + .setShortLabel("邮件设置") + .setLongLabel("异常邮件接收设置") + .setIcon(Icon.createWithResource(this, R.drawable.ic_winboll)) + .setIntent(intent) + .build(); + + shortcutManager.setDynamicShortcuts( + java.util.Arrays.asList(shortcut) + ); + } + /** * 创建菜单时回调(加载工具栏菜单) * 初始化 ActionBar 菜单,加载自定义菜单布局 diff --git a/appbase/src/main/res/layout-night/activity_main2.xml b/appbase/src/main/res/layout-night/activity_main2.xml index 7a96c0c..7e447c2 100644 --- a/appbase/src/main/res/layout-night/activity_main2.xml +++ b/appbase/src/main/res/layout-night/activity_main2.xml @@ -12,6 +12,6 @@ android:layout_height="wrap_content" android:text="Main2Activity" android:textSize="24sp" - android:textColor="@color/gray_900"/> + android:textColor="#212121"/> \ No newline at end of file diff --git a/appbase/src/main/res/values-night/styles.xml b/appbase/src/main/res/values-night/styles.xml index a03559c..350b676 100644 --- a/appbase/src/main/res/values-night/styles.xml +++ b/appbase/src/main/res/values-night/styles.xml @@ -9,6 +9,6 @@ ?attr/toolbarBackgroundColor ?attr/debugTextColor ?attr/mainWindowDarkBackgroundColor - @color/toolbarTextColor + #FF000000 \ No newline at end of file diff --git a/appbase/src/main/res/values/styles.xml b/appbase/src/main/res/values/styles.xml index be91a4e..62c6e3a 100644 --- a/appbase/src/main/res/values/styles.xml +++ b/appbase/src/main/res/values/styles.xml @@ -9,6 +9,6 @@ ?attr/toolbarBackgroundColor ?attr/debugTextColor ?attr/mainWindowBackgroundColor - @color/toolbarTextColor + #FF000000 diff --git a/libappbase/build.properties b/libappbase/build.properties index c32ca47..645f82c 100644 --- a/libappbase/build.properties +++ b/libappbase/build.properties @@ -1,8 +1,8 @@ #Created by .winboll/winboll_app_build.gradle -#Tue Jul 21 12:19:05 HKT 2026 +#Tue Jul 21 13:23:28 HKT 2026 stageCount=2 libraryProject=libappbase baseVersion=15.21 publishVersion=15.21.1 -buildCount=0 +buildCount=6 baseBetaVersion=15.21.2 diff --git a/libappbase/src/main/res/drawable/bg_toolbar_log.xml b/libappbase/src/main/res/drawable/bg_toolbar_log.xml index 84fda8a..5b8627c 100644 --- a/libappbase/src/main/res/drawable/bg_toolbar_log.xml +++ b/libappbase/src/main/res/drawable/bg_toolbar_log.xml @@ -10,8 +10,8 @@ + android:endColor="#FF00B322" + android:startColor="#FF00B322" /> + android:endColor="#FF00B322" + android:startColor="#FF00B322" /> - + - + - + diff --git a/libappbase/src/main/res/drawable/ic_launcher_background.xml b/libappbase/src/main/res/drawable/ic_launcher_background.xml index 9486190..17514cf 100644 --- a/libappbase/src/main/res/drawable/ic_launcher_background.xml +++ b/libappbase/src/main/res/drawable/ic_launcher_background.xml @@ -5,7 +5,7 @@ android:viewportWidth="108" android:viewportHeight="108"> ?attr/mainWindowDarkBackgroundColor ?attr/mainWindowDarkTextColor - @color/toolbarBackgroundColor - @color/toolbarTextColor + #FF00B322 + #FF000000 ?attr/mainWindowDarkBackgroundColor ?attr/mainWindowDarkTextColor ?attr/mainWindowDarkBackgroundColor @@ -21,21 +21,21 @@ ?attr/mainWindowDarkBackgroundColor ?attr/mainWindowDarkBackgroundColor ?attr/mainWindowDarkTextColor - @color/mainWindowBackgroundColor - @color/mainWindowTextColor - @color/mainWindowBackgroundColor - @color/mainWindowTextColor + #FFF5F5F5 + #FF000000 + #FFF5F5F5 + #FF000000 diff --git a/libappbase/src/main/res/values/styles.xml b/libappbase/src/main/res/values/styles.xml index 92d8143..e59019b 100644 --- a/libappbase/src/main/res/values/styles.xml +++ b/libappbase/src/main/res/values/styles.xml @@ -12,8 +12,8 @@ ?attr/mainWindowBackgroundColor ?attr/mainWindowTextColor - @color/toolbarBackgroundColor - @color/toolbarTextColor + #FF00B322 + #FF000000 ?attr/mainWindowBackgroundColor ?attr/mainWindowTextColor ?attr/mainWindowBackgroundColor @@ -21,21 +21,21 @@ ?attr/mainWindowBackgroundColor ?attr/mainWindowBackgroundColor ?attr/mainWindowTextColor - @color/mainWindowBackgroundColor - @color/mainWindowTextColor - @color/mainWindowBackgroundColor - @color/mainWindowTextColor + #FFF5F5F5 + #FF000000 + #FFF5F5F5 + #FF000000