From 6686da0e8fd6c8df39878deee7f3d241fa47afb5 Mon Sep 17 00:00:00 2001 From: ZhanGSKen Date: Tue, 11 Feb 2025 12:42:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=89=B2=E6=9E=B6=E6=9E=841?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appbase/build.properties | 4 +- libappbase/build.properties | 4 +- .../libappbase/GlobalCrashActivity.java | 42 ++++++++++++------- .../main/res/layout/activity_globalcrash.xml | 3 +- libappbase/src/main/res/values-v21/styles.xml | 5 --- libappbase/src/main/res/values/attrs.xml | 21 ++++++++-- libappbase/src/main/res/values/colors.xml | 8 ++-- libappbase/src/main/res/values/styles.xml | 21 +++++++--- 8 files changed, 71 insertions(+), 37 deletions(-) delete mode 100644 libappbase/src/main/res/values-v21/styles.xml diff --git a/appbase/build.properties b/appbase/build.properties index 2ddf51d..4c70ac1 100644 --- a/appbase/build.properties +++ b/appbase/build.properties @@ -1,8 +1,8 @@ #Created by .winboll/winboll_app_build.gradle -#Tue Feb 11 00:32:01 HKT 2025 +#Tue Feb 11 04:40:18 GMT 2025 stageCount=5 libraryProject=libappbase baseVersion=1.2 publishVersion=1.2.4 -buildCount=0 +buildCount=62 baseBetaVersion=1.2.5 diff --git a/libappbase/build.properties b/libappbase/build.properties index 9b48d4d..4c70ac1 100644 --- a/libappbase/build.properties +++ b/libappbase/build.properties @@ -1,8 +1,8 @@ #Created by .winboll/winboll_app_build.gradle -#Tue Feb 11 00:31:50 HKT 2025 +#Tue Feb 11 04:40:18 GMT 2025 stageCount=5 libraryProject=libappbase baseVersion=1.2 publishVersion=1.2.4 -buildCount=0 +buildCount=62 baseBetaVersion=1.2.5 diff --git a/libappbase/src/main/java/cc/winboll/studio/libappbase/GlobalCrashActivity.java b/libappbase/src/main/java/cc/winboll/studio/libappbase/GlobalCrashActivity.java index 6aea89a..8504715 100644 --- a/libappbase/src/main/java/cc/winboll/studio/libappbase/GlobalCrashActivity.java +++ b/libappbase/src/main/java/cc/winboll/studio/libappbase/GlobalCrashActivity.java @@ -10,7 +10,7 @@ import android.content.ClipboardManager; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; -import android.content.res.Resources; +import android.content.res.TypedArray; import android.graphics.Color; import android.net.Uri; import android.os.Bundle; @@ -30,35 +30,49 @@ public final class GlobalCrashActivity extends Activity implements MenuItem.OnMe private static final int MENUITEM_RESTART = 1; String mLog; - + int colorPrimary; + int colorPrimaryDark; + int colorAccent; + int colorText; + public static final String TAG = "GlobalCrashActivity"; - + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); CrashHandler.AppCrashSafetyWire.getInstance().postResumeCrashSafetyWireHandler(getApplicationContext()); + mLog = getIntent().getStringExtra(CrashHandler.EXTRA_CRASH_INFO); - setTheme(android.R.style.Theme_DeviceDefault_NoActionBar); - + //setTheme(android.R.style.Theme_Holo_Light_NoActionBar); + setTheme(R.style.APPBaseTheme); setContentView(R.layout.activity_globalcrash); + + TypedArray a = obtainStyledAttributes(R.attr.globalCrashActivity, R.styleable.GlobalCrashActivity); + colorPrimary = a.getColor(R.styleable.GlobalCrashActivity_attrPrimary, Color.WHITE); + colorPrimaryDark = a.getColor(R.styleable.GlobalCrashActivity_attrPrimaryDark, Color.BLACK); + colorAccent = a.getColor(R.styleable.GlobalCrashActivity_attrAccent, Color.RED); + colorText = a.getColor(R.styleable.GlobalCrashActivity_attrText, Color.RED); + // 返回一个绑定资源结束的信号给资源 + a.recycle(); + LinearLayout llMain = findViewById(R.id.activityglobalcrashLinearLayout1); - llMain.setBackgroundColor(Color.GRAY); + llMain.setBackgroundColor(colorPrimaryDark); Toolbar toolbar = findViewById(R.id.activityglobalcrashToolbar1); - toolbar.setBackgroundColor(Color.BLACK); - toolbar.setTitleTextColor(Color.WHITE); - toolbar.setSubtitleTextColor(Color.WHITE); + toolbar.setBackgroundColor(colorPrimary); + toolbar.setTitleTextColor(colorAccent); + toolbar.setSubtitleTextColor(colorAccent); setActionBar(toolbar); TextView tvLog = findViewById(R.id.activityglobalcrashTextView1); tvLog.setText(mLog); - tvLog.setTextColor(Color.BLACK); - tvLog.setBackgroundColor(Color.GRAY); + tvLog.setTextColor(colorPrimary); + tvLog.setBackgroundColor(colorPrimaryDark); getActionBar().setTitle(CrashHandler.TITTLE); getActionBar().setSubtitle(GlobalApplication.getAppName(getApplicationContext())); } - - + + @Override public void onBackPressed() { @@ -108,7 +122,7 @@ public final class GlobalCrashActivity extends Activity implements MenuItem.OnMe for (int i = 0; i < menu.size(); i++) { MenuItem item = menu.getItem(i); SpannableString spanString = new SpannableString(item.getTitle().toString()); - spanString.setSpan(new ForegroundColorSpan(Color.WHITE), 0, spanString.length(), 0); + spanString.setSpan(new ForegroundColorSpan(colorAccent), 0, spanString.length(), 0); item.setTitle(spanString); } return true; diff --git a/libappbase/src/main/res/layout/activity_globalcrash.xml b/libappbase/src/main/res/layout/activity_globalcrash.xml index ff06e75..23d05d9 100644 --- a/libappbase/src/main/res/layout/activity_globalcrash.xml +++ b/libappbase/src/main/res/layout/activity_globalcrash.xml @@ -5,7 +5,8 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" - android:id="@+id/activityglobalcrashLinearLayout1"> + android:id="@+id/activityglobalcrashLinearLayout1" + style="@style/APPBaseTheme"> - - - \ No newline at end of file diff --git a/libappbase/src/main/res/values/attrs.xml b/libappbase/src/main/res/values/attrs.xml index efe7291..49801a3 100644 --- a/libappbase/src/main/res/values/attrs.xml +++ b/libappbase/src/main/res/values/attrs.xml @@ -1,7 +1,20 @@ - - - - + + + + + + + + + + + + + + + diff --git a/libappbase/src/main/res/values/colors.xml b/libappbase/src/main/res/values/colors.xml index fcd701b..7d93b9d 100644 --- a/libappbase/src/main/res/values/colors.xml +++ b/libappbase/src/main/res/values/colors.xml @@ -1,7 +1,7 @@ - #FF03AB4E - #FF027C39 - #FF3DDC84 - #FF000000 + #FFFFE200 + #FFFFE200 + #FFFFE200 + #FFFFE200 diff --git a/libappbase/src/main/res/values/styles.xml b/libappbase/src/main/res/values/styles.xml index 0267b7f..72d14c8 100644 --- a/libappbase/src/main/res/values/styles.xml +++ b/libappbase/src/main/res/values/styles.xml @@ -1,9 +1,20 @@ - + +