Compare commits

...

5 Commits

Author SHA1 Message Date
ZhanGSKen
00a9ec1d66 <appbase>APK 15.0.10 release Publish. 2025-03-25 03:24:44 +08:00
ZhanGSKen
64051bb9fe 添加应用基础数据模型 2025-03-25 03:23:45 +08:00
ZhanGSKen
c203557a6a <libappbase>Library Release 15.0.9 2025-03-24 14:06:30 +08:00
ZhanGSKen
00b619ee99 <appbase>APK 15.0.9 release Publish. 2025-03-24 14:06:10 +08:00
ZhanGSKen
3a6fb3e17c 更新日志标题栏风格 2025-03-24 14:04:59 +08:00
8 changed files with 155 additions and 34 deletions

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle #Created by .winboll/winboll_app_build.gradle
#Mon Mar 24 08:04:35 HKT 2025 #Tue Mar 25 03:24:44 HKT 2025
stageCount=9 stageCount=11
libraryProject=libappbase libraryProject=libappbase
baseVersion=15.0 baseVersion=15.0
publishVersion=15.0.8 publishVersion=15.0.10
buildCount=0 buildCount=0
baseBetaVersion=15.0.9 baseBetaVersion=15.0.11

View File

@@ -19,7 +19,6 @@ public class App extends GlobalApplication {
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
GlobalApplication.setIsDebuging(this, BuildConfig.DEBUG);
mSOSCenterServiceReceiver = new SOSCenterServiceReceiver(); mSOSCenterServiceReceiver = new SOSCenterServiceReceiver();
IntentFilter intentFilter = new IntentFilter(); IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(SOS.ACTION_SOS); intentFilter.addAction(SOS.ACTION_SOS);

View File

@@ -17,6 +17,7 @@ import cc.winboll.studio.libappbase.LogView;
import cc.winboll.studio.libappbase.sos.SOS; import cc.winboll.studio.libappbase.sos.SOS;
import cc.winboll.studio.libappbase.utils.ToastUtils; import cc.winboll.studio.libappbase.utils.ToastUtils;
import cc.winboll.studio.libappbase.widgets.StatusWidget; import cc.winboll.studio.libappbase.widgets.StatusWidget;
import cc.winboll.studio.libappbase.APPBaseModel;
public class MainActivity extends Activity { public class MainActivity extends Activity {
@@ -59,7 +60,8 @@ public class MainActivity extends Activity {
} }
public void onSwitchDebugMode(View view) { public void onSwitchDebugMode(View view) {
GlobalApplication.setIsDebuging(this, ((CheckBox)view).isChecked()); boolean isDebuging = ((CheckBox)view).isChecked();
GlobalApplication.setIsDebuging(isDebuging);
} }
public void onStartCenter(View view) { public void onStartCenter(View view) {

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle #Created by .winboll/winboll_app_build.gradle
#Mon Mar 24 08:04:27 HKT 2025 #Tue Mar 25 03:24:44 HKT 2025
stageCount=9 stageCount=11
libraryProject=libappbase libraryProject=libappbase
baseVersion=15.0 baseVersion=15.0
publishVersion=15.0.8 publishVersion=15.0.10
buildCount=0 buildCount=0
baseBetaVersion=15.0.9 baseBetaVersion=15.0.11

View File

@@ -0,0 +1,73 @@
package cc.winboll.studio.libappbase;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/25 02:52:46
* @Describe 基础应用数据模型
*/
import android.util.JsonReader;
import android.util.JsonWriter;
import cc.winboll.studio.libappbase.BaseBean;
import java.io.IOException;
public class APPBaseModel extends BaseBean {
public static final String TAG = "APPBaseModel";
// 应用是否处于正在调试状态
//
boolean isDebuging = false;
public APPBaseModel() {
this.isDebuging = false;
}
public APPBaseModel(boolean isDebuging) {
this.isDebuging = isDebuging;
}
public void setIsDebuging(boolean isDebuging) {
this.isDebuging = isDebuging;
}
public boolean isDebuging() {
return isDebuging;
}
@Override
public String getName() {
return APPBaseModel.class.getName();
}
@Override
public void writeThisToJsonWriter(JsonWriter jsonWriter) throws IOException {
super.writeThisToJsonWriter(jsonWriter);
jsonWriter.name("isDebuging").value(isDebuging());
}
@Override
public boolean initObjectsFromJsonReader(JsonReader jsonReader, String name) throws IOException {
if (super.initObjectsFromJsonReader(jsonReader, name)) { return true; } else {
if (name.equals("isDebuging")) {
setIsDebuging(jsonReader.nextBoolean());
} else {
return false;
}
}
return true;
}
@Override
public BaseBean readBeanFromJsonReader(JsonReader jsonReader) throws IOException {
jsonReader.beginObject();
while (jsonReader.hasNext()) {
String name = jsonReader.nextName();
if (!initObjectsFromJsonReader(jsonReader, name)) {
jsonReader.skipValue();
}
}
// 结束 JSON 对象
jsonReader.endObject();
return this;
}
}

View File

@@ -7,7 +7,6 @@ package cc.winboll.studio.libappbase;
*/ */
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.Handler; import android.os.Handler;
@@ -21,22 +20,29 @@ public class GlobalApplication extends Application {
final static String PREFS = GlobalApplication.class.getName() + "PREFS"; final static String PREFS = GlobalApplication.class.getName() + "PREFS";
final static String PREFS_ISDEBUGING = "PREFS_ISDEBUGING"; final static String PREFS_ISDEBUGING = "PREFS_ISDEBUGING";
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper()); private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
volatile static GlobalApplication _GlobalApplication;
// 是否处于调试状态 // 是否处于调试状态
volatile static boolean isDebuging = false; volatile static boolean isDebuging = false;
public static void setIsDebuging(Context context, boolean isDebuging) { public static void setIsDebuging(boolean isDebuging) {
if (_GlobalApplication != null) {
GlobalApplication.isDebuging = isDebuging; GlobalApplication.isDebuging = isDebuging;
APPBaseModel.saveBeanToFile(getAPPBaseModelFilePath(), new APPBaseModel(isDebuging));
// 获取SharedPreferences实例 // 获取SharedPreferences实例
SharedPreferences sharedPreferences = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE); // SharedPreferences sharedPreferences = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE);
// 获取编辑器 // // 获取编辑器
SharedPreferences.Editor editor = sharedPreferences.edit(); // SharedPreferences.Editor editor = sharedPreferences.edit();
// 保存数据 // // 保存数据
editor.putBoolean(PREFS_ISDEBUGING, GlobalApplication.isDebuging); // editor.putBoolean(PREFS_ISDEBUGING, GlobalApplication.isDebuging);
// 提交更改 // // 提交更改
editor.apply(); // editor.apply();
}
}
static String getAPPBaseModelFilePath() {
return _GlobalApplication.getDataDir().getPath() + "/APPBaseModel.json";
} }
public static boolean isDebuging() { public static boolean isDebuging() {
@@ -55,8 +61,16 @@ public class GlobalApplication extends Application {
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
//GlobalApplication.isDebuging = true; _GlobalApplication = this;
//GlobalApplication.setIsDebuging(this, true);
// 设置应用调试标志
APPBaseModel appBaseModel = APPBaseModel.loadBeanFromFile(getAPPBaseModelFilePath(), APPBaseModel.class);
if (appBaseModel == null) {
setIsDebuging(false);
} else {
setIsDebuging(appBaseModel.isDebuging());
}
LogUtils.init(this); LogUtils.init(this);
//LogUtils.setLogLevel(LogUtils.LOG_LEVEL.Debug); //LogUtils.setLogLevel(LogUtils.LOG_LEVEL.Debug);
//LogUtils.setTAGListEnable(GlobalApplication.TAG, true); //LogUtils.setTAGListEnable(GlobalApplication.TAG, true);
@@ -66,16 +80,8 @@ public class GlobalApplication extends Application {
// 设置应用异常处理窗口 // 设置应用异常处理窗口
CrashHandler.init(this); CrashHandler.init(this);
// 设置应用调试状态
//SharedPreferences sharedPreferences = getSharedPreferences(PREFS, Context.MODE_PRIVATE);
//GlobalApplication.isDebuging = sharedPreferences.getBoolean(PREFS_ISDEBUGING, GlobalApplication.isDebuging);
// 初始化 Toast 框架 // 初始化 Toast 框架
ToastUtils.init(this); 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) {

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 阴影部分 -->
<!-- 个人觉得更形象的表达top代表下边的阴影高度left代表右边的阴影宽度。其实也就是相对应的offsetsolid中的颜色是阴影的颜色也可以设置角度等等 -->
<item
android:left="2dp"
android:top="2dp"
android:right="2dp"
android:bottom="2dp">
<shape android:shape="rectangle" >
<gradient
android:angle="270"
android:endColor="@color/colorPrimary"
android:startColor="@color/colorPrimary" />
<corners
android:bottomLeftRadius="6dip"
android:bottomRightRadius="6dip"
android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
</shape>
</item>
<!-- 背景部分 -->
<!-- 形象的表达bottom代表背景部分在上边缘超出阴影的高度right代表背景部分在左边超出阴影的宽度相对应的offset -->
<item
android:left="3dp"
android:top="3dp"
android:right="3dp"
android:bottom="5dp">
<shape android:shape="rectangle" >
<gradient
android:angle="270"
android:endColor="@color/colorPrimary"
android:startColor="@color/colorPrimary" />
<corners
android:bottomLeftRadius="6dip"
android:bottomRightRadius="6dip"
android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
</shape>
</item>
</layer-list>

View File

@@ -12,7 +12,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:background="@drawable/bg_shadow" android:background="@drawable/bg_toolbar_log"
android:id="@+id/viewlogRelativeLayoutToolbar"> android:id="@+id/viewlogRelativeLayoutToolbar">
<Button <Button
@@ -72,7 +72,7 @@
android:layout_below="@+id/viewlogRelativeLayoutToolbar" android:layout_below="@+id/viewlogRelativeLayoutToolbar"
android:id="@+id/viewlogLinearLayout1" android:id="@+id/viewlogLinearLayout1"
android:gravity="center_vertical" android:gravity="center_vertical"
android:background="@drawable/bg_shadow"> android:background="@drawable/bg_toolbar_log">
<CheckBox <CheckBox
android:layout_width="wrap_content" android:layout_width="wrap_content"