Compare commits
20 Commits
appbase-v1
...
appbase-v1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
36af7947e8 | ||
![]() |
805edcf9c4 | ||
![]() |
11005e3356 | ||
![]() |
75361b2313 | ||
![]() |
1d29ce81e8 | ||
![]() |
0297e81090 | ||
![]() |
df7203e985 | ||
![]() |
8c4e8b8e23 | ||
![]() |
d9c02f55e3 | ||
![]() |
a9cb6b471b | ||
![]() |
e694063867 | ||
![]() |
0ee13986dc | ||
![]() |
3239778922 | ||
![]() |
13510f45cf | ||
![]() |
49d300dd33 | ||
![]() |
c42f677d48 | ||
![]() |
9052a3924b | ||
![]() |
9642ad1966 | ||
![]() |
6686da0e8f | ||
![]() |
9e7aff09d1 |
@@ -29,7 +29,7 @@ android {
|
|||||||
// versionName 更新后需要手动设置
|
// versionName 更新后需要手动设置
|
||||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
versionName "1.2"
|
versionName "1.4"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Tue Feb 11 00:31:50 HKT 2025
|
#Wed Feb 12 18:03:55 HKT 2025
|
||||||
stageCount=5
|
stageCount=2
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=1.2
|
baseVersion=1.4
|
||||||
publishVersion=1.2.4
|
publishVersion=1.4.1
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=1.2.5
|
baseBetaVersion=1.4.2
|
||||||
|
@@ -1,20 +1,27 @@
|
|||||||
package cc.winboll.studio.appbase;
|
package cc.winboll.studio.appbase;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import com.hjq.toast.ToastUtils;
|
||||||
|
|
||||||
public class MainActivity extends Activity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
ToastUtils.show("onCreate");
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
|
Toolbar toolbar = findViewById(R.id.activitymainToolbar1);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
CheckBox cbIsDebugMode = findViewById(R.id.activitymainCheckBox1);
|
CheckBox cbIsDebugMode = findViewById(R.id.activitymainCheckBox1);
|
||||||
cbIsDebugMode.setChecked(GlobalApplication.isDebuging());
|
cbIsDebugMode.setChecked(GlobalApplication.isDebuging());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSwitchDebugMode(View view) {
|
public void onSwitchDebugMode(View view) {
|
||||||
|
@@ -7,31 +7,45 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<TextView
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Hello, WinBoll!"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right|center_vertical">
|
android:id="@+id/activitymainToolbar1"/>
|
||||||
|
|
||||||
<CheckBox
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:gravity="center_horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Debug Mode"
|
android:text="Hello, WinBoll!"/>
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:onClick="onSwitchDebugMode"
|
|
||||||
android:id="@+id/activitymainCheckBox1"/>
|
|
||||||
|
|
||||||
<Button
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Test Application CrashReport"
|
android:gravity="right|center_vertical">
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onTestApplicationCrashReport"/>
|
<CheckBox
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Debug Mode"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:onClick="onSwitchDebugMode"
|
||||||
|
android:id="@+id/activitymainCheckBox1"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Test Application CrashReport"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onTestApplicationCrashReport"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="colorTextColor">#006D26C0</color>
|
<color name="colorPrimary">#005800FF</color>
|
||||||
<color name="colorPrimary">#001BDCC0</color>
|
<color name="colorPrimaryDark">#005800FF</color>
|
||||||
<color name="colorPrimaryDark">#0028C025</color>
|
<color name="colorAccent">#005800FF</color>
|
||||||
<color name="colorAccent">#002985CC</color>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -1,5 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<style name="AppTheme" parent="@android:style/Theme.Material.Light.DarkActionBar">
|
<style name="AppTheme" parent="APPBaseTheme">
|
||||||
|
<item name="themeGlobalCrashActivity">@style/MyGlobalCrashActivityTheme</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="MyGlobalCrashActivityTheme" parent="GlobalCrashActivityTheme">
|
||||||
|
<item name="colorTittle">#FFFFFFFF</item>
|
||||||
|
<item name="colorTittleBackgound">#FF00A4B3</item>
|
||||||
|
<item name="colorText">#FFFFFFFF</item>
|
||||||
|
<item name="colorTextBackgound">#FF000000</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -26,5 +26,11 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
api 'com.github.getActivity:ToastUtils:10.5'
|
||||||
|
|
||||||
|
api 'androidx.appcompat:appcompat:1.3.1'
|
||||||
|
//api 'androidx.vectordrawable:vectordrawable:1.1.0'
|
||||||
|
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
||||||
|
|
||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Tue Feb 11 00:31:50 HKT 2025
|
#Wed Feb 12 18:03:55 HKT 2025
|
||||||
stageCount=5
|
stageCount=2
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=1.2
|
baseVersion=1.4
|
||||||
publishVersion=1.2.4
|
publishVersion=1.4.1
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=1.2.5
|
baseBetaVersion=1.4.2
|
||||||
|
@@ -18,6 +18,8 @@
|
|||||||
android:label="GlobalCrashActivity"
|
android:label="GlobalCrashActivity"
|
||||||
android:launchMode="standard"/>
|
android:launchMode="standard"/>
|
||||||
|
|
||||||
|
<service android:name=".SimpleOperateSignalCenterService"/>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@@ -12,6 +12,9 @@ import android.content.pm.ApplicationInfo;
|
|||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import com.hjq.toast.ToastUtils;
|
||||||
|
import com.hjq.toast.style.WhiteToastStyle;
|
||||||
|
|
||||||
public class GlobalApplication extends Application {
|
public class GlobalApplication extends Application {
|
||||||
|
|
||||||
@@ -69,6 +72,12 @@ public class GlobalApplication extends Application {
|
|||||||
//SharedPreferences sharedPreferences = getSharedPreferences(PREFS, Context.MODE_PRIVATE);
|
//SharedPreferences sharedPreferences = getSharedPreferences(PREFS, Context.MODE_PRIVATE);
|
||||||
//GlobalApplication.isDebuging = sharedPreferences.getBoolean(PREFS_ISDEBUGING, GlobalApplication.isDebuging);
|
//GlobalApplication.isDebuging = sharedPreferences.getBoolean(PREFS_ISDEBUGING, GlobalApplication.isDebuging);
|
||||||
|
|
||||||
|
// 初始化 Toast 框架
|
||||||
|
ToastUtils.init(this);
|
||||||
|
// 设置 Toast 布局样式
|
||||||
|
//ToastUtils.setView(R.layout.toast_custom_view);
|
||||||
|
ToastUtils.setStyle(new WhiteToastStyle());
|
||||||
|
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getAppName(Context context) {
|
public static String getAppName(Context context) {
|
||||||
|
@@ -10,7 +10,7 @@ import android.content.ClipboardManager;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Resources;
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -21,16 +21,19 @@ import android.view.MenuItem;
|
|||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import android.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import cc.winboll.studio.libappbase.R;
|
import cc.winboll.studio.libappbase.R;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
public final class GlobalCrashActivity extends Activity implements MenuItem.OnMenuItemClickListener {
|
public final class GlobalCrashActivity extends AppCompatActivity implements MenuItem.OnMenuItemClickListener {
|
||||||
|
|
||||||
private static final int MENUITEM_COPY = 0;
|
private static final int MENUITEM_COPY = 0;
|
||||||
private static final int MENUITEM_RESTART = 1;
|
private static final int MENUITEM_RESTART = 1;
|
||||||
|
|
||||||
|
GlobalCrashReportView mGlobalCrashReportView;
|
||||||
String mLog;
|
String mLog;
|
||||||
|
|
||||||
|
|
||||||
public static final String TAG = "GlobalCrashActivity";
|
public static final String TAG = "GlobalCrashActivity";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -39,27 +42,17 @@ public final class GlobalCrashActivity extends Activity implements MenuItem.OnMe
|
|||||||
CrashHandler.AppCrashSafetyWire.getInstance().postResumeCrashSafetyWireHandler(getApplicationContext());
|
CrashHandler.AppCrashSafetyWire.getInstance().postResumeCrashSafetyWireHandler(getApplicationContext());
|
||||||
|
|
||||||
mLog = getIntent().getStringExtra(CrashHandler.EXTRA_CRASH_INFO);
|
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);
|
setContentView(R.layout.activity_globalcrash);
|
||||||
LinearLayout llMain = findViewById(R.id.activityglobalcrashLinearLayout1);
|
mGlobalCrashReportView = findViewById(R.id.activityglobalcrashGlobalCrashReportView1);
|
||||||
llMain.setBackgroundColor(Color.GRAY);
|
mGlobalCrashReportView.setReport(mLog);
|
||||||
Toolbar toolbar = findViewById(R.id.activityglobalcrashToolbar1);
|
setSupportActionBar(mGlobalCrashReportView.getToolbar());
|
||||||
toolbar.setBackgroundColor(Color.BLACK);
|
|
||||||
toolbar.setTitleTextColor(Color.WHITE);
|
|
||||||
toolbar.setSubtitleTextColor(Color.WHITE);
|
|
||||||
setActionBar(toolbar);
|
|
||||||
TextView tvLog = findViewById(R.id.activityglobalcrashTextView1);
|
|
||||||
tvLog.setText(mLog);
|
|
||||||
tvLog.setTextColor(Color.BLACK);
|
|
||||||
tvLog.setBackgroundColor(Color.GRAY);
|
|
||||||
|
|
||||||
getActionBar().setTitle(CrashHandler.TITTLE);
|
getSupportActionBar().setTitle(CrashHandler.TITTLE);
|
||||||
getActionBar().setSubtitle(GlobalApplication.getAppName(getApplicationContext()));
|
getSupportActionBar().setSubtitle(GlobalApplication.getAppName(getApplicationContext()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
restart();
|
restart();
|
||||||
@@ -103,14 +96,8 @@ public final class GlobalCrashActivity extends Activity implements MenuItem.OnMe
|
|||||||
menu.add(0, MENUITEM_RESTART, 0, "Restart").setOnMenuItemClickListener(this)
|
menu.add(0, MENUITEM_RESTART, 0, "Restart").setOnMenuItemClickListener(this)
|
||||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
|
|
||||||
|
// 更新菜单文字风格
|
||||||
// 设置菜单文本颜色
|
mGlobalCrashReportView.updateMenuStyle();
|
||||||
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);
|
|
||||||
item.setTitle(spanString);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -0,0 +1,138 @@
|
|||||||
|
package cc.winboll.studio.libappbase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/02/11 20:18:30
|
||||||
|
* @Describe 应用崩溃报告视图
|
||||||
|
*/
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.text.style.ForegroundColorSpan;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import cc.winboll.studio.libappbase.R;
|
||||||
|
|
||||||
|
public class GlobalCrashReportView extends LinearLayout {
|
||||||
|
|
||||||
|
public static final String TAG = "GlobalCrashReportView";
|
||||||
|
|
||||||
|
Context mContext;
|
||||||
|
Toolbar mToolbar;
|
||||||
|
int colorTittle;
|
||||||
|
int colorTittleBackground;
|
||||||
|
int colorText;
|
||||||
|
int colorTextBackground;
|
||||||
|
TextView mtvReport;
|
||||||
|
|
||||||
|
public GlobalCrashReportView(Context context) {
|
||||||
|
super(context);
|
||||||
|
mContext = context;
|
||||||
|
//initView();
|
||||||
|
}
|
||||||
|
|
||||||
|
public GlobalCrashReportView(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
mContext = context;
|
||||||
|
initView(attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GlobalCrashReportView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
|
super(context, attrs, defStyleAttr);
|
||||||
|
mContext = context;
|
||||||
|
//initView();
|
||||||
|
}
|
||||||
|
|
||||||
|
public GlobalCrashReportView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||||
|
super(context, attrs, defStyleAttr, defStyleRes);
|
||||||
|
mContext = context;
|
||||||
|
//initView();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColorTittle(int colorTittle) {
|
||||||
|
this.colorTittle = colorTittle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getColorTittle() {
|
||||||
|
return colorTittle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColorTittleBackground(int colorTittleBackground) {
|
||||||
|
this.colorTittleBackground = colorTittleBackground;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getColorTittleBackground() {
|
||||||
|
return colorTittleBackground;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColorText(int colorText) {
|
||||||
|
this.colorText = colorText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getColorText() {
|
||||||
|
return colorText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColorTextBackground(int colorTextBackground) {
|
||||||
|
this.colorTextBackground = colorTextBackground;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getColorTextBackground() {
|
||||||
|
return colorTextBackground;
|
||||||
|
}
|
||||||
|
|
||||||
|
void initView(AttributeSet attrs) {
|
||||||
|
TypedArray a = mContext.obtainStyledAttributes(attrs, R.styleable.GlobalCrashActivity, R.attr.themeGlobalCrashActivity, 0);
|
||||||
|
this.colorTittle = a.getColor(R.styleable.GlobalCrashActivity_colorTittle, Color.WHITE);
|
||||||
|
this.colorTittleBackground = a.getColor(R.styleable.GlobalCrashActivity_colorTittleBackgound, Color.BLACK);
|
||||||
|
this.colorText = a.getColor(R.styleable.GlobalCrashActivity_colorText, Color.BLACK);
|
||||||
|
this.colorTextBackground = a.getColor(R.styleable.GlobalCrashActivity_colorTextBackgound, Color.WHITE);
|
||||||
|
// 返回一个绑定资源结束的信号给资源
|
||||||
|
a.recycle();
|
||||||
|
|
||||||
|
/*this.colorTittle = Color.WHITE;
|
||||||
|
this.colorTittleBackground = Color.BLACK;
|
||||||
|
this.colorText = Color.BLACK;
|
||||||
|
this.colorTextBackground = Color.WHITE;
|
||||||
|
*/
|
||||||
|
|
||||||
|
inflate(mContext, R.layout.view_globalcrashreport, this);
|
||||||
|
|
||||||
|
LinearLayout llMain = findViewById(R.id.viewglobalcrashreportLinearLayout1);
|
||||||
|
llMain.setBackgroundColor(this.colorTextBackground);
|
||||||
|
mToolbar = findViewById(R.id.viewglobalcrashreportToolbar1);
|
||||||
|
mToolbar.setBackgroundColor(this.colorTittleBackground);
|
||||||
|
mToolbar.setTitleTextColor(this.colorTittle);
|
||||||
|
mToolbar.setSubtitleTextColor(this.colorTittle);
|
||||||
|
mtvReport = findViewById(R.id.viewglobalcrashreportTextView1);
|
||||||
|
mtvReport.setTextColor(this.colorText);
|
||||||
|
mtvReport.setBackgroundColor(this.colorTextBackground);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReport(String report) {
|
||||||
|
mtvReport.setText(report);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Toolbar getToolbar() {
|
||||||
|
return mToolbar;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 更新菜单文字风格
|
||||||
|
//
|
||||||
|
public void updateMenuStyle() {
|
||||||
|
// 设置菜单文本颜色
|
||||||
|
Menu menu = mToolbar.getMenu();
|
||||||
|
for (int i = 0; i < menu.size(); i++) {
|
||||||
|
MenuItem item = menu.getItem(i);
|
||||||
|
SpannableString spanString = new SpannableString(item.getTitle().toString());
|
||||||
|
spanString.setSpan(new ForegroundColorSpan(this.colorTittle), 0, spanString.length(), 0);
|
||||||
|
item.setTitle(spanString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,22 @@
|
|||||||
|
package cc.winboll.studio.libappbase;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/02/12 11:12:25
|
||||||
|
* @Describe 简单信号服务中心
|
||||||
|
*/
|
||||||
|
import android.app.Service;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.IBinder;
|
||||||
|
|
||||||
|
public class SimpleOperateSignalCenterService extends Service {
|
||||||
|
|
||||||
|
public static final String TAG = "SimpleOperateSignalCenterService";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IBinder onBind(Intent intent) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -2,34 +2,14 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:id="@+id/activityglobalcrashLinearLayout1">
|
|
||||||
|
|
||||||
<android.widget.Toolbar
|
<cc.winboll.studio.libappbase.GlobalCrashReportView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/activityglobalcrashToolbar1"/>
|
android:id="@+id/activityglobalcrashGlobalCrashReportView1"/>
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1.0">
|
|
||||||
|
|
||||||
<HorizontalScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/activityglobalcrashTextView1"
|
|
||||||
android:background="#FFFFFFFF"/>
|
|
||||||
|
|
||||||
</HorizontalScrollView>
|
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
35
libappbase/src/main/res/layout/view_globalcrashreport.xml
Normal file
35
libappbase/src/main/res/layout/view_globalcrashreport.xml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/viewglobalcrashreportLinearLayout1">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/viewglobalcrashreportToolbar1"/>
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
|
<HorizontalScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#FFFFFFFF"
|
||||||
|
android:id="@+id/viewglobalcrashreportTextView1"/>
|
||||||
|
|
||||||
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
@@ -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,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<attr name="attrTextColor" format="color" />
|
|
||||||
<attr name="attrPrimaryColor" format="color" />
|
<attr name="themeGlobalCrashActivity" format="reference"/>
|
||||||
<attr name="attrPrimaryDarkColor" format="color" />
|
|
||||||
<attr name="attrAccentColor" format="color" />
|
<declare-styleable name="GlobalCrashActivity">
|
||||||
|
<attr name="colorTittle" format="color" />
|
||||||
|
<attr name="colorTittleBackgound" format="color" />
|
||||||
|
<attr name="colorText" format="color" />
|
||||||
|
<attr name="colorTextBackgound" format="color" />
|
||||||
|
</declare-styleable>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="colorPrimary">#FF03AB4E</color>
|
<color name="colorPrimary">#FFFFE200</color>
|
||||||
<color name="colorPrimaryDark">#FF027C39</color>
|
<color name="colorPrimaryDark">#FFFFE200</color>
|
||||||
<color name="colorAccent">#FF3DDC84</color>
|
<color name="colorAccent">#FFFFE200</color>
|
||||||
<color name="colorText">#FF000000</color>
|
<color name="colorText">#FFFFE200</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -1,9 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<style name="AppTheme" parent="@android:style/Theme.Holo.Light">
|
|
||||||
<item name="attrTextColor">#FF000000</item>
|
<style name="APPBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<item name="attrPrimaryColor">@color/colorPrimary</item>
|
<item name="themeGlobalCrashActivity">@style/GlobalCrashActivityTheme</item>
|
||||||
<item name="attrPrimaryDarkColor">@color/colorPrimaryDark</item>
|
</style>
|
||||||
<item name="attrAccentColor">@color/colorAccent</item>
|
|
||||||
|
<style name="GlobalCrashActivityTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">
|
||||||
|
<item name="colorTittle">#FFFFF600</item>
|
||||||
|
<item name="colorTittleBackgound">#FF00B322</item>
|
||||||
|
<item name="colorText">#FF00B322</item>
|
||||||
|
<item name="colorTextBackgound">#FF000000</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Reference in New Issue
Block a user