Compare commits
5 Commits
appbase-v1
...
appbase-v1
| Author | SHA1 | Date | |
|---|---|---|---|
| 069e5a66ad | |||
| e9a1dca8ca | |||
| 7e3a3d1446 | |||
| 7414cd0f33 | |||
| b2b3f949b7 |
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Wed Mar 25 20:36:14 HKT 2026
|
||||
stageCount=15
|
||||
#Mon Apr 06 20:25:21 HKT 2026
|
||||
stageCount=17
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.15
|
||||
publishVersion=15.15.14
|
||||
publishVersion=15.15.16
|
||||
buildCount=0
|
||||
baseBetaVersion=15.15.15
|
||||
baseBetaVersion=15.15.17
|
||||
|
||||
@@ -46,7 +46,7 @@ public class AboutActivity extends Activity {
|
||||
appInfo.setAppName(getString(R.string.app_name));
|
||||
appInfo.setAppIcon(R.drawable.ic_winboll);
|
||||
appInfo.setAppDescription(getString(R.string.app_description));
|
||||
appInfo.setAppGitName("APPBase");
|
||||
appInfo.setAppGitName("WinBoLL");
|
||||
appInfo.setAppGitOwner("Studio");
|
||||
appInfo.setAppGitAPPBranch(branchName);
|
||||
appInfo.setAppGitAPPSubProjectFolder(branchName);
|
||||
|
||||
@@ -21,9 +21,12 @@ public class App extends GlobalApplication {
|
||||
*/
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate(); // 调用父类初始化逻辑(如基础库配置、全局上下文设置)
|
||||
//setIsDebugging(false);
|
||||
setIsDebugging(BuildConfig.DEBUG);
|
||||
super.onCreate();
|
||||
// 如果应用不在调试状态,就根据编译类型设置调试状态
|
||||
if (isDebugging() != true) {
|
||||
setIsDebugging(BuildConfig.DEBUG);
|
||||
}
|
||||
|
||||
// 初始化 Toast 工具类(传入应用全局上下文,确保 Toast 可在任意地方调用)
|
||||
ToastUtils.init(getApplicationContext());
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Wed Mar 25 20:36:14 HKT 2026
|
||||
stageCount=15
|
||||
#Mon Apr 06 20:25:21 HKT 2026
|
||||
stageCount=17
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.15
|
||||
publishVersion=15.15.14
|
||||
publishVersion=15.15.16
|
||||
buildCount=0
|
||||
baseBetaVersion=15.15.15
|
||||
baseBetaVersion=15.15.17
|
||||
|
||||
@@ -76,10 +76,11 @@ public class AboutView extends LinearLayout {
|
||||
private EditText metDevUserPassword;
|
||||
|
||||
// ===================================== 页面视图控件 =====================================
|
||||
private ImageView ivAppIcon;
|
||||
private DebugSwitchImageView ivAppIcon;
|
||||
private TextView tvAppNameVersion;
|
||||
private TextView tvAppDesc;
|
||||
private LinearLayout llFunctionContainer;
|
||||
private ImageButton ibSebugStepOver;
|
||||
private ImageButton ibSigngetDialog;
|
||||
private ImageButton ibWinBoLLHostDialog;
|
||||
|
||||
@@ -185,22 +186,27 @@ public class AboutView extends LinearLayout {
|
||||
* 加载XML布局并绑定所有视图控件,初始化按钮点击事件
|
||||
*/
|
||||
private void initViewFromXml() {
|
||||
LogUtils.d(TAG, "initViewFromXml():开始加载布局并绑定控件");
|
||||
View.inflate(mContext, R.layout.layout_about_view, this);
|
||||
// 基础控件绑定
|
||||
ivAppIcon = findViewById(R.id.iv_app_icon);
|
||||
tvAppNameVersion = findViewById(R.id.tv_app_name_version);
|
||||
tvAppDesc = findViewById(R.id.tv_app_desc);
|
||||
llFunctionContainer = findViewById(R.id.ll_function_container);
|
||||
// 功能按钮绑定
|
||||
ibSigngetDialog = findViewById(R.id.ib_signgetdialog);
|
||||
ibWinBoLLHostDialog = findViewById(R.id.ib_winbollhostdialog);
|
||||
// 调试地址按钮动态显隐
|
||||
ibWinBoLLHostDialog.setVisibility(GlobalApplication.isDebugging() ? View.VISIBLE : View.GONE);
|
||||
// 绑定按钮点击事件
|
||||
setBtnClickListener();
|
||||
LogUtils.d(TAG, "initViewFromXml():布局加载+控件绑定+事件初始化完成");
|
||||
}
|
||||
LogUtils.d(TAG, "initViewFromXml():开始加载布局并绑定控件");
|
||||
View.inflate(mContext, R.layout.layout_about_view, this);
|
||||
// 基础控件绑定
|
||||
ivAppIcon = findViewById(R.id.iv_app_icon);
|
||||
tvAppNameVersion = findViewById(R.id.tv_app_name_version);
|
||||
tvAppDesc = findViewById(R.id.tv_app_desc);
|
||||
llFunctionContainer = findViewById(R.id.ll_function_container);
|
||||
// 功能按钮绑定
|
||||
ibSebugStepOver = findViewById(R.id.ib_debug_step_over);
|
||||
ibSigngetDialog = findViewById(R.id.ib_signgetdialog);
|
||||
ibWinBoLLHostDialog = findViewById(R.id.ib_winbollhostdialog);
|
||||
|
||||
// 调试按钮统一只在调试模式显示
|
||||
ibWinBoLLHostDialog.setVisibility(GlobalApplication.isDebugging() ? View.VISIBLE : View.GONE);
|
||||
//ibSigngetDialog.setVisibility(GlobalApplication.isDebugging() ? View.VISIBLE : View.GONE);
|
||||
ibSebugStepOver.setVisibility(GlobalApplication.isDebugging() ? View.VISIBLE : View.GONE);
|
||||
|
||||
// 绑定按钮点击事件
|
||||
setBtnClickListener();
|
||||
LogUtils.d(TAG, "initViewFromXml():布局加载+控件绑定+事件初始化完成");
|
||||
}
|
||||
|
||||
/**
|
||||
* 从APPInfo实体读取应用基础核心配置,赋值到本地属性
|
||||
@@ -312,7 +318,17 @@ public class AboutView extends LinearLayout {
|
||||
*/
|
||||
private void 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() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package cc.winboll.studio.libappbase.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||
|
||||
/**
|
||||
* @Author 豆包&ZhanGSKen<zhangsken@qq.com>
|
||||
* @Date 2026/04/06 19:32
|
||||
* @Describe 具有调试模式切换功能的应用Logo控件,连续点击10次弹出提示
|
||||
*/
|
||||
public class DebugSwitchImageView extends ImageView {
|
||||
|
||||
public static final String TAG = "DebugSwitchImageView";
|
||||
|
||||
// 连续点击计数
|
||||
private int mClickCount = 0;
|
||||
// 目标点击次数
|
||||
private static final int TARGET_CLICK_COUNT = 10;
|
||||
|
||||
public DebugSwitchImageView(Context context) {
|
||||
super(context);
|
||||
init();
|
||||
}
|
||||
|
||||
public DebugSwitchImageView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init();
|
||||
}
|
||||
|
||||
public DebugSwitchImageView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
}
|
||||
|
||||
public DebugSwitchImageView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mClickCount++;
|
||||
if (mClickCount == TARGET_CLICK_COUNT) {
|
||||
// 达到10次,弹出Toast
|
||||
Toast.makeText(getContext(), "连续点击已达到10次,现在开启应用调试功能。", Toast.LENGTH_SHORT).show();
|
||||
GlobalApplication.setIsDebugging(true);
|
||||
GlobalApplication.saveDebugStatus(GlobalApplication.getInstance());
|
||||
// 重置计数,可再次触发
|
||||
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>
|
||||
@@ -14,7 +14,7 @@
|
||||
android:paddingRight="16dp"
|
||||
android:paddingBottom="32dp">
|
||||
|
||||
<ImageView
|
||||
<cc.winboll.studio.libappbase.views.DebugSwitchImageView
|
||||
android:id="@+id/iv_app_icon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
@@ -58,6 +58,15 @@
|
||||
android:layout_marginTop="16dp"
|
||||
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
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
|
||||
Reference in New Issue
Block a user