调色架构1
This commit is contained in:
parent
9e7aff09d1
commit
6686da0e8f
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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">
|
||||
|
||||
<android.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="AppTheme" parent="@android:style/Theme.Material.Light">
|
||||
</style>
|
||||
</resources>
|
@ -1,7 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<attr name="attrTextColor" format="color" />
|
||||
<attr name="attrPrimaryColor" format="color" />
|
||||
<attr name="attrPrimaryDarkColor" format="color" />
|
||||
<attr name="attrAccentColor" format="color" />
|
||||
|
||||
<attr name="colorPrimary" format="color" />
|
||||
<attr name="colorPrimaryDark" format="color" />
|
||||
<attr name="colorAccent" format="color" />
|
||||
<attr name="colorText" format="color" />
|
||||
|
||||
<attr name="globalCrashActivity" format="reference"/>
|
||||
<!--<attr name="attrPrimary" format="color" />
|
||||
<attr name="attrPrimaryDark" format="color" />
|
||||
<attr name="attrAccent" format="color" />-->
|
||||
|
||||
<declare-styleable name="GlobalCrashActivity">
|
||||
<attr name="attrPrimary" format="color" />
|
||||
<attr name="attrPrimaryDark" format="color" />
|
||||
<attr name="attrAccent" format="color" />
|
||||
<attr name="attrText" format="color" />
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#FF03AB4E</color>
|
||||
<color name="colorPrimaryDark">#FF027C39</color>
|
||||
<color name="colorAccent">#FF3DDC84</color>
|
||||
<color name="colorText">#FF000000</color>
|
||||
<color name="colorPrimary">#FFFFE200</color>
|
||||
<color name="colorPrimaryDark">#FFFFE200</color>
|
||||
<color name="colorAccent">#FFFFE200</color>
|
||||
<color name="colorText">#FFFFE200</color>
|
||||
</resources>
|
||||
|
@ -1,9 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="AppTheme" parent="@android:style/Theme.Holo.Light">
|
||||
<item name="attrTextColor">#FF000000</item>
|
||||
<item name="attrPrimaryColor">@color/colorPrimary</item>
|
||||
<item name="attrPrimaryDarkColor">@color/colorPrimaryDark</item>
|
||||
<item name="attrAccentColor">@color/colorAccent</item>
|
||||
<style name="APPBaseTheme" parent="@android:style/Theme.Holo.Light.NoActionBar">
|
||||
<item name="colorPrimary">#FF3C4CE3</item>
|
||||
<item name="colorPrimaryDark">#FF3C4CE3</item>
|
||||
<item name="colorAccent">#FF3C4CE3</item>
|
||||
<item name="attrPrimary">#FF00B322</item>
|
||||
<item name="attrPrimaryDark">#FF000000</item>
|
||||
<item name="attrAccent">#FFFFF600</item>
|
||||
<item name="attrText">#FF00FF31</item>
|
||||
<item name="globalCrashActivity">@style/GlobalCrashActivity</item>
|
||||
</style>
|
||||
|
||||
<style name="GlobalCrashActivity">
|
||||
<item name="attrPrimary">?attr/colorPrimary</item>
|
||||
<item name="attrPrimaryDark">?attr/colorPrimaryDark</item>
|
||||
<item name="attrAccent">?attr/colorAccent</item>
|
||||
<item name="attrText">?attr/colorText</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
Loading…
x
Reference in New Issue
Block a user