应用调试功能切换Logo准备完成。
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Apr 06 11:39:20 GMT 2026
|
#Mon Apr 06 12:21:56 GMT 2026
|
||||||
stageCount=16
|
stageCount=16
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.15
|
baseVersion=15.15
|
||||||
publishVersion=15.15.15
|
publishVersion=15.15.15
|
||||||
buildCount=3
|
buildCount=16
|
||||||
baseBetaVersion=15.15.16
|
baseBetaVersion=15.15.16
|
||||||
|
|||||||
@@ -21,9 +21,12 @@ public class App extends GlobalApplication {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate(); // 调用父类初始化逻辑(如基础库配置、全局上下文设置)
|
super.onCreate();
|
||||||
//setIsDebugging(false);
|
// 如果应用不在调试状态,就根据编译类型设置调试状态
|
||||||
setIsDebugging(BuildConfig.DEBUG);
|
if (isDebugging() != true) {
|
||||||
|
setIsDebugging(BuildConfig.DEBUG);
|
||||||
|
}
|
||||||
|
|
||||||
// 初始化 Toast 工具类(传入应用全局上下文,确保 Toast 可在任意地方调用)
|
// 初始化 Toast 工具类(传入应用全局上下文,确保 Toast 可在任意地方调用)
|
||||||
ToastUtils.init(getApplicationContext());
|
ToastUtils.init(getApplicationContext());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Apr 06 11:39:20 GMT 2026
|
#Mon Apr 06 12:21:56 GMT 2026
|
||||||
stageCount=16
|
stageCount=16
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.15
|
baseVersion=15.15
|
||||||
publishVersion=15.15.15
|
publishVersion=15.15.15
|
||||||
buildCount=3
|
buildCount=16
|
||||||
baseBetaVersion=15.15.16
|
baseBetaVersion=15.15.16
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ public class AboutView extends LinearLayout {
|
|||||||
private TextView tvAppNameVersion;
|
private TextView tvAppNameVersion;
|
||||||
private TextView tvAppDesc;
|
private TextView tvAppDesc;
|
||||||
private LinearLayout llFunctionContainer;
|
private LinearLayout llFunctionContainer;
|
||||||
|
private ImageButton ibSebugStepOver;
|
||||||
private ImageButton ibSigngetDialog;
|
private ImageButton ibSigngetDialog;
|
||||||
private ImageButton ibWinBoLLHostDialog;
|
private ImageButton ibWinBoLLHostDialog;
|
||||||
|
|
||||||
@@ -185,22 +186,27 @@ public class AboutView extends LinearLayout {
|
|||||||
* 加载XML布局并绑定所有视图控件,初始化按钮点击事件
|
* 加载XML布局并绑定所有视图控件,初始化按钮点击事件
|
||||||
*/
|
*/
|
||||||
private void initViewFromXml() {
|
private void initViewFromXml() {
|
||||||
LogUtils.d(TAG, "initViewFromXml():开始加载布局并绑定控件");
|
LogUtils.d(TAG, "initViewFromXml():开始加载布局并绑定控件");
|
||||||
View.inflate(mContext, R.layout.layout_about_view, this);
|
View.inflate(mContext, R.layout.layout_about_view, this);
|
||||||
// 基础控件绑定
|
// 基础控件绑定
|
||||||
ivAppIcon = findViewById(R.id.iv_app_icon);
|
ivAppIcon = findViewById(R.id.iv_app_icon);
|
||||||
tvAppNameVersion = findViewById(R.id.tv_app_name_version);
|
tvAppNameVersion = findViewById(R.id.tv_app_name_version);
|
||||||
tvAppDesc = findViewById(R.id.tv_app_desc);
|
tvAppDesc = findViewById(R.id.tv_app_desc);
|
||||||
llFunctionContainer = findViewById(R.id.ll_function_container);
|
llFunctionContainer = findViewById(R.id.ll_function_container);
|
||||||
// 功能按钮绑定
|
// 功能按钮绑定
|
||||||
ibSigngetDialog = findViewById(R.id.ib_signgetdialog);
|
ibSebugStepOver = findViewById(R.id.ib_debug_step_over);
|
||||||
ibWinBoLLHostDialog = findViewById(R.id.ib_winbollhostdialog);
|
ibSigngetDialog = findViewById(R.id.ib_signgetdialog);
|
||||||
// 调试地址按钮动态显隐
|
ibWinBoLLHostDialog = findViewById(R.id.ib_winbollhostdialog);
|
||||||
ibWinBoLLHostDialog.setVisibility(GlobalApplication.isDebugging() ? View.VISIBLE : View.GONE);
|
|
||||||
// 绑定按钮点击事件
|
// 调试按钮统一只在调试模式显示
|
||||||
setBtnClickListener();
|
ibWinBoLLHostDialog.setVisibility(GlobalApplication.isDebugging() ? View.VISIBLE : View.GONE);
|
||||||
LogUtils.d(TAG, "initViewFromXml():布局加载+控件绑定+事件初始化完成");
|
//ibSigngetDialog.setVisibility(GlobalApplication.isDebugging() ? View.VISIBLE : View.GONE);
|
||||||
}
|
ibSebugStepOver.setVisibility(GlobalApplication.isDebugging() ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
|
// 绑定按钮点击事件
|
||||||
|
setBtnClickListener();
|
||||||
|
LogUtils.d(TAG, "initViewFromXml():布局加载+控件绑定+事件初始化完成");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 从APPInfo实体读取应用基础核心配置,赋值到本地属性
|
* 从APPInfo实体读取应用基础核心配置,赋值到本地属性
|
||||||
@@ -312,7 +318,17 @@ public class AboutView extends LinearLayout {
|
|||||||
*/
|
*/
|
||||||
private void setBtnClickListener() {
|
private void setBtnClickListener() {
|
||||||
LogUtils.d(TAG, "setBtnClickListener():开始绑定功能按钮点击事件");
|
LogUtils.d(TAG, "setBtnClickListener():开始绑定功能按钮点击事件");
|
||||||
// 正版校验弹窗
|
// 取消调试状态按钮
|
||||||
|
ibSebugStepOver.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
LogUtils.d(TAG, "ibSebugStepOver onClick:取消调试状态按钮已点击");
|
||||||
|
GlobalApplication.setIsDebugging(false);
|
||||||
|
GlobalApplication.saveDebugStatus(GlobalApplication.getInstance());
|
||||||
|
ToastUtils.show("已取消调试状态,重启应用可生效。");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 正版校验弹窗
|
||||||
ibSigngetDialog.setOnClickListener(new OnClickListener() {
|
ibSigngetDialog.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.util.AttributeSet;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author 豆包&ZhanGSKen<zhangsken@qq.com>
|
* @Author 豆包&ZhanGSKen<zhangsken@qq.com>
|
||||||
@@ -47,7 +48,9 @@ public class DebugSwitchImageView extends ImageView {
|
|||||||
mClickCount++;
|
mClickCount++;
|
||||||
if (mClickCount == TARGET_CLICK_COUNT) {
|
if (mClickCount == TARGET_CLICK_COUNT) {
|
||||||
// 达到10次,弹出Toast
|
// 达到10次,弹出Toast
|
||||||
Toast.makeText(getContext(), "连续点击已达到10次", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "连续点击已达到10次,现在开启应用调试功能。", Toast.LENGTH_SHORT).show();
|
||||||
|
GlobalApplication.setIsDebugging(true);
|
||||||
|
GlobalApplication.saveDebugStatus(GlobalApplication.getInstance());
|
||||||
// 重置计数,可再次触发
|
// 重置计数,可再次触发
|
||||||
mClickCount = 0;
|
mClickCount = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
11
libappbase/src/main/res/drawable/ic_debug_step_over.xml
Normal file
11
libappbase/src/main/res/drawable/ic_debug_step_over.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:viewportWidth="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#ff000000"
|
||||||
|
android:pathData="M19,7H16.19C15.74,6.2 15.12,5.5 14.37,5L16,3.41L14.59,2L12.42,4.17C11.96,4.06 11.5,4 11,4S10.05,4.06 9.59,4.17L7.41,2L6,3.41L7.62,5C6.87,5.5 6.26,6.21 5.81,7H3V9H5.09C5.03,9.33 5,9.66 5,10V11H3V13H5V14C5,14.34 5.03,14.67 5.09,15H3V17H5.81C7.26,19.5 10.28,20.61 13,19.65V19C13,18.43 13.09,17.86 13.25,17.31C12.59,17.76 11.8,18 11,18C8.79,18 7,16.21 7,14V10C7,7.79 8.79,6 11,6S15,7.79 15,10V14C15,14.19 15,14.39 14.95,14.58C15.54,14.04 16.24,13.62 17,13.35V13H19V11H17V10C17,9.66 16.97,9.33 16.91,9H19V7M13,9V11H9V9H13M13,13V15H9V13H13M16,16H22V22H16V16Z"/>
|
||||||
|
|
||||||
|
</vector>
|
||||||
@@ -58,6 +58,15 @@
|
|||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:spacing="20dp">
|
android:spacing="20dp">
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:src="@drawable/ic_debug_step_over"
|
||||||
|
android:id="@+id/ib_debug_step_over"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:background="@null"/>
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
|
|||||||
Reference in New Issue
Block a user