Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e51a80751a | |||
| 7f4679a46a | |||
| 33d832f8df | |||
| 3bc37b637f | |||
| 0ecdda7127 | |||
| c65fa63545 | |||
| 231de80efa | |||
| 5d49185752 | |||
| a9ac51eb12 | |||
| bd03705240 | |||
| 8641196cdf | |||
| 49acdd7022 | |||
| 70ab6d02c3 | |||
| cb11da95ed |
@@ -1,59 +0,0 @@
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
|
||||
|
||||
name: Java CI with Gradle
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "appbase" ]
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches: [ "appbase" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
|
||||
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
|
||||
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
|
||||
|
||||
# 编译任务改为 assembleStageRelease
|
||||
- name: Build Stage Release APK
|
||||
run: ./gradlew assembleStageRelease --no-daemon
|
||||
|
||||
# 构建成功后,把APK上传到本次tag对应的Release Assets
|
||||
- name: Upload APK to GitHub Release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: app/build/outputs/apk/stageRelease/*.apk
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
|
||||
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
|
||||
#
|
||||
# - name: Setup Gradle
|
||||
# uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
|
||||
# with:
|
||||
# gradle-version: '8.9'
|
||||
#
|
||||
# - name: Build with Gradle 8.9
|
||||
# run: gradle build
|
||||
@@ -33,7 +33,7 @@ android {
|
||||
// versionName 更新后需要手动设置
|
||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||
versionName "15.20"
|
||||
versionName "15.21"
|
||||
if(true) {
|
||||
versionName = genVersionName("${versionName}")
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Wed Jun 24 04:11:18 CST 2026
|
||||
stageCount=34
|
||||
#Tue Jul 21 12:19:05 HKT 2026
|
||||
stageCount=2
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.20
|
||||
publishVersion=15.20.33
|
||||
baseVersion=15.21
|
||||
publishVersion=15.21.1
|
||||
buildCount=0
|
||||
baseBetaVersion=15.20.34
|
||||
baseBetaVersion=15.21.2
|
||||
|
||||
@@ -37,7 +37,7 @@ public class AboutActivity extends Activity {
|
||||
appInfo.setAppName("APPBase");
|
||||
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);
|
||||
|
||||
@@ -89,6 +89,7 @@ allprojects {
|
||||
subprojects {
|
||||
tasks.withType(JavaCompile) {
|
||||
options.encoding = "UTF-8"
|
||||
options.compilerArgs << '-Xlint:-options'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Wed Jun 24 04:11:18 CST 2026
|
||||
stageCount=34
|
||||
#Tue Jul 21 12:19:05 HKT 2026
|
||||
stageCount=2
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.20
|
||||
publishVersion=15.20.33
|
||||
baseVersion=15.21
|
||||
publishVersion=15.21.1
|
||||
buildCount=0
|
||||
baseBetaVersion=15.20.34
|
||||
baseBetaVersion=15.21.2
|
||||
|
||||
@@ -14,6 +14,7 @@ import android.widget.HorizontalScrollView;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import cc.winboll.studio.libappbase.common.ViewColorTable;
|
||||
|
||||
public final class CrashActivity extends Activity implements MenuItem.OnMenuItemClickListener {
|
||||
private static final int MENUITEM_COPY = 0;
|
||||
@@ -35,13 +36,13 @@ public final class CrashActivity extends Activity implements MenuItem.OnMenuItem
|
||||
contentView.setFillViewport(true);
|
||||
|
||||
HorizontalScrollView hw = new HorizontalScrollView(this);
|
||||
hw.setBackgroundColor(0xFFF5F5F5);
|
||||
hw.setBackgroundColor(ViewColorTable.ListItemBgPressedColor);
|
||||
|
||||
TextView message = new TextView(this);
|
||||
final int padding = dp2px(16);
|
||||
message.setPadding(padding, padding, padding, padding);
|
||||
message.setText(mLog);
|
||||
message.setTextColor(0xFF000000);
|
||||
message.setTextColor(ViewColorTable.TextPrimaryColor);
|
||||
message.setTextIsSelectable(true);
|
||||
|
||||
hw.addView(message);
|
||||
|
||||
@@ -2,7 +2,6 @@ package cc.winboll.studio.libappbase;
|
||||
|
||||
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;
|
||||
@@ -12,6 +11,7 @@ import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.libappbase.R;
|
||||
import cc.winboll.studio.libappbase.common.ViewColorTable;
|
||||
import android.content.res.Resources;
|
||||
|
||||
/**
|
||||
@@ -179,9 +179,9 @@ public class GlobalCrashReportView extends LinearLayout {
|
||||
// 设置默认配色(使用 debugTextColor 属性)
|
||||
Resources.Theme theme = mContext.getTheme();
|
||||
mTitleColor = theme.getResources().getColor(android.R.color.holo_green_dark);
|
||||
mTitleBackgroundColor = Color.GRAY;
|
||||
mTitleBackgroundColor = ViewColorTable.SwitchTrackNormalColor;
|
||||
mTextColor = obtainDebugTextColor(theme);
|
||||
mTextBackgroundColor = Color.WHITE;
|
||||
mTextBackgroundColor = ViewColorTable.CardSurfaceColor;
|
||||
// 加载布局
|
||||
inflateView();
|
||||
// 初始化控件样式
|
||||
@@ -196,11 +196,11 @@ public class GlobalCrashReportView extends LinearLayout {
|
||||
if (themeResId != 0) {
|
||||
int[] debugAttrs = new int[] { cc.winboll.studio.libappbase.R.attr.debugTextColor };
|
||||
TypedArray debugTypedArray = theme.obtainStyledAttributes(themeResId, debugAttrs);
|
||||
int color = debugTypedArray.getColor(0, Color.GRAY);
|
||||
int color = debugTypedArray.getColor(0, ViewColorTable.TextSecondaryColor);
|
||||
debugTypedArray.recycle();
|
||||
return color;
|
||||
}
|
||||
return Color.GRAY;
|
||||
return ViewColorTable.TextSecondaryColor;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,16 +219,16 @@ public class GlobalCrashReportView extends LinearLayout {
|
||||
// 读取自定义属性值(无设置时使用默认值)
|
||||
mTitleColor = typedArray.getColor(
|
||||
R.styleable.GlobalCrashActivity_colorTittle,
|
||||
Color.BLACK
|
||||
ViewColorTable.TextPrimaryColor
|
||||
);
|
||||
mTitleBackgroundColor = typedArray.getColor(
|
||||
R.styleable.GlobalCrashActivity_colorTittleBackgound, // 注:原拼写错误(Backgound→Background),保持与 attrs.xml 一致
|
||||
Color.BLACK
|
||||
ViewColorTable.TextPrimaryColor
|
||||
);
|
||||
mTextColor = obtainDebugTextColor(mContext.getTheme());
|
||||
mTextBackgroundColor = typedArray.getColor(
|
||||
R.styleable.GlobalCrashActivity_colorTextBackgound, // 注:原拼写错误,保持与 attrs.xml 一致
|
||||
Color.WHITE
|
||||
ViewColorTable.CardSurfaceColor
|
||||
);
|
||||
|
||||
// 回收 TypedArray,避免内存泄漏
|
||||
|
||||
@@ -28,6 +28,7 @@ import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.R;
|
||||
import cc.winboll.studio.libappbase.common.ViewColorTable;
|
||||
import cc.winboll.studio.libappbase.views.HorizontalListView;
|
||||
import cc.winboll.studio.libappbase.widget.LogTagSpinner;
|
||||
import java.text.Collator;
|
||||
@@ -117,7 +118,7 @@ public class LogView extends RelativeLayout {
|
||||
// 获取Log Level spinner实例
|
||||
mLogLevelSpinner = findViewById(cc.winboll.studio.libappbase.R.id.viewlogSpinner1);
|
||||
|
||||
metTagSearch.setTextColor(mContext.getResources().getColor(R.color.white));
|
||||
metTagSearch.setTextColor(ViewColorTable.EditTextContentColor);
|
||||
metTagSearch.addTextChangedListener(new TextWatcher() {
|
||||
|
||||
@Override
|
||||
@@ -250,7 +251,7 @@ public class LogView extends RelativeLayout {
|
||||
mSelectAllTAGCheckBox.setLayoutParams(layoutParams2);
|
||||
//mSelectAllTAGCheckBox.setPadding(0,0,0,0);
|
||||
TypedArray ta1 = mContext.obtainStyledAttributes(new int[] { R.attr.toolbarTextColor });
|
||||
int toolbarTextColor1 = ta1.getColor(0, mContext.getResources().getColor(R.color.white));
|
||||
int toolbarTextColor1 = ta1.getColor(0, ViewColorTable.ToolbarTitleTextColor);
|
||||
ta1.recycle();
|
||||
mSelectAllTAGCheckBox.setTextColor(toolbarTextColor1);
|
||||
mSelectAllTAGCheckBox.setOnClickListener(new View.OnClickListener(){
|
||||
@@ -507,14 +508,14 @@ public class LogView extends RelativeLayout {
|
||||
holder.tvText.setLayoutParams(layoutParams);
|
||||
holder.tvText.setPadding(0,0,0,0);
|
||||
TypedArray ta2 = mContext.obtainStyledAttributes(new int[] { R.attr.toolbarTextColor });
|
||||
int toolbarTextColor2 = ta2.getColor(0, mContext.getResources().getColor(R.color.white));
|
||||
int toolbarTextColor2 = ta2.getColor(0, ViewColorTable.ToolbarTitleTextColor);
|
||||
ta2.recycle();
|
||||
holder.tvText.setTextColor(toolbarTextColor2);
|
||||
holder.cbChecked.setChecked(item.isChecked());
|
||||
holder.cbChecked.setLayoutParams(layoutParams);
|
||||
holder.cbChecked.setPadding(0,0,0,0);
|
||||
TypedArray ta3 = mContext.obtainStyledAttributes(new int[] { R.attr.toolbarTextColor });
|
||||
int toolbarTextColor3 = ta3.getColor(0, mContext.getResources().getColor(R.color.white));
|
||||
int toolbarTextColor3 = ta3.getColor(0, ViewColorTable.ToolbarTitleTextColor);
|
||||
ta3.recycle();
|
||||
holder.cbChecked.setTextColor(toolbarTextColor3);
|
||||
holder.cbChecked.setOnClickListener(new View.OnClickListener(){
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
package cc.winboll.studio.libappbase.common;
|
||||
|
||||
import android.graphics.Color;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
|
||||
/**
|
||||
* @Author 豆包&Big Pickle&MiMo&ZhanGSKen<zhangsken@qq.com>
|
||||
* @CreateDate 2026/07/21 11:55:00
|
||||
* @LastEditDate 2026/07/21 11:56:46
|
||||
* @Describe 全局静态控件颜色常量表
|
||||
* 命名规范:控件类型+状态/用途+Color
|
||||
* 全部常量基于android.graphics.Color原生色值定义,统一控件前缀命名规则,无实例化入口,纯静态常量工具类
|
||||
* Java7兼容标准,无高版本语法特性,所有函数入参、内部临时变量强制final修饰
|
||||
*/
|
||||
public final class ViewColorTable {
|
||||
|
||||
// 私有构造,禁止外部实例化
|
||||
private ViewColorTable() {
|
||||
final String errMsg = "Cannot instantiate static class ViewColorTable";
|
||||
LogUtils.e("ViewColorTable", "constructor invoke failed, msg = " + errMsg);
|
||||
throw new AssertionError(errMsg);
|
||||
}
|
||||
|
||||
// ====================== TextView 文本控件颜色常量 ======================
|
||||
// 主文本
|
||||
public static final int TextPrimaryColor = Color.BLACK;
|
||||
// 次要说明文本
|
||||
public static final int TextSecondaryColor = Color.GRAY;
|
||||
// 提示占位文字
|
||||
public static final int TextHintColor = Color.LTGRAY;
|
||||
// 错误警告文本
|
||||
public static final int TextErrorColor = Color.RED;
|
||||
// 链接可点击文本
|
||||
public static final int TextLinkColor = Color.parseColor("#007AFF");
|
||||
// 禁用置灰文本
|
||||
public static final int TextDisabledColor = Color.DKGRAY;
|
||||
// 标题大号文本
|
||||
public static final int TextTitleColor = Color.BLACK;
|
||||
// 白色背景下浅色标题
|
||||
public static final int TextTitleLightColor = Color.WHITE;
|
||||
|
||||
// ====================== Button 普通按钮颜色常量 ======================
|
||||
// 按钮正常文字
|
||||
public static final int ButtonTextNormalColor = Color.WHITE;
|
||||
// 按钮按下文字
|
||||
public static final int ButtonTextPressedColor = Color.LTGRAY;
|
||||
// 按钮禁用文字
|
||||
public static final int ButtonTextDisabledColor = Color.GRAY;
|
||||
// 边框按钮文字(空心按钮)
|
||||
public static final int ButtonStrokeTextColor = Color.parseColor("#007AFF");
|
||||
|
||||
// ====================== Switch 原生开关控件颜色常量 ======================
|
||||
// 开关滑块文字
|
||||
public static final int SwitchTextColor = Color.WHITE;
|
||||
// 开关轨道 关闭状态
|
||||
public static final int SwitchTrackNormalColor = Color.GRAY;
|
||||
// 开关轨道 开启状态
|
||||
public static final int SwitchTrackCheckedColor = Color.parseColor("#34C759");
|
||||
// 开关滑块
|
||||
public static final int SwitchThumbColor = Color.WHITE;
|
||||
|
||||
// ====================== EditText 输入框颜色常量 ======================
|
||||
// 输入正文文字
|
||||
public static final int EditTextContentColor = Color.BLACK;
|
||||
// 输入框提示文字
|
||||
public static final int EditTextHintColor = Color.GRAY;
|
||||
// 输入框光标
|
||||
public static final int EditTextCursorColor = Color.parseColor("#007AFF");
|
||||
// 输入框底部线 正常
|
||||
public static final int EditTextLineNormalColor = Color.LTGRAY;
|
||||
// 输入框底部线 聚焦
|
||||
public static final int EditTextLineFocusedColor = Color.parseColor("#007AFF");
|
||||
// 输入框底部线 错误
|
||||
public static final int EditTextLineErrorColor = Color.RED;
|
||||
|
||||
// ====================== CheckBox 多选框颜色常量 ======================
|
||||
// 多选框文字
|
||||
public static final int CheckBoxTextColor = Color.BLACK;
|
||||
// 多选框勾选状态
|
||||
public static final int CheckBoxCheckedColor = Color.parseColor("#007AFF");
|
||||
// 多选框未勾选边框
|
||||
public static final int CheckBoxUnCheckStrokeColor = Color.GRAY;
|
||||
|
||||
// ====================== RadioButton 单选框颜色常量 ======================
|
||||
public static final int RadioTextColor = Color.BLACK;
|
||||
public static final int RadioCheckedCircleColor = Color.parseColor("#007AFF");
|
||||
public static final int RadioUnCheckedStrokeColor = Color.GRAY;
|
||||
|
||||
// ====================== ProgressBar 进度条颜色常量 ======================
|
||||
// 进度底色
|
||||
public static final int ProgressTrackColor = Color.LTGRAY;
|
||||
// 已完成进度
|
||||
public static final int ProgressValueColor = Color.parseColor("#34C759");
|
||||
// 缓冲进度(视频/文件下载)
|
||||
public static final int ProgressBufferColor = Color.GRAY;
|
||||
|
||||
// ====================== SeekBar 拖动条颜色常量 ======================
|
||||
public static final int SeekBarTrackNormalColor = Color.LTGRAY;
|
||||
public static final int SeekBarTrackProgressColor = Color.parseColor("#007AFF");
|
||||
public static final int SeekBarThumbColor = Color.parseColor("#007AFF");
|
||||
|
||||
// ====================== TabLayout 标签栏颜色常量 ======================
|
||||
// Tab未选中文字
|
||||
public static final int TabTextNormalColor = Color.GRAY;
|
||||
// Tab选中文字
|
||||
public static final int TabTextSelectedColor = Color.parseColor("#007AFF");
|
||||
// Tab底部指示器
|
||||
public static final int TabIndicatorColor = Color.parseColor("#007AFF");
|
||||
|
||||
// ====================== Divider 分割线颜色常量 ======================
|
||||
public static final int DividerLineColor = Color.parseColor("#EEEEEE");
|
||||
public static final int DividerDarkLineColor = Color.parseColor("#DDDDDD");
|
||||
|
||||
// ====================== CardView 卡片颜色常量 ======================
|
||||
// 卡片背景
|
||||
public static final int CardSurfaceColor = Color.WHITE;
|
||||
// 卡片边框
|
||||
public static final int CardStrokeColor = Color.parseColor("#EEEEEE");
|
||||
|
||||
// ====================== Dialog / Popup 弹窗颜色常量 ======================
|
||||
// 弹窗标题文字
|
||||
public static final int DialogTitleTextColor = Color.BLACK;
|
||||
// 弹窗内容文字
|
||||
public static final int DialogContentTextColor = Color.GRAY;
|
||||
// 弹窗取消按钮文字
|
||||
public static final int DialogCancelTextColor = Color.GRAY;
|
||||
// 弹窗确认按钮文字
|
||||
public static final int DialogConfirmTextColor = Color.parseColor("#007AFF");
|
||||
// 弹窗遮罩背景
|
||||
public static final int DialogMaskBgColor = 0xCC000000;
|
||||
|
||||
// ====================== Toolbar / TopBar 顶部栏颜色常量 ======================
|
||||
public static final int ToolbarTitleTextColor = Color.WHITE;
|
||||
public static final int ToolbarSubTitleTextColor = Color.LTGRAY;
|
||||
public static final int ToolbarIconTintColor = Color.WHITE;
|
||||
|
||||
// ====================== StatusBar / NavigationBar 系统栏颜色常量 ======================
|
||||
// 浅色状态栏(黑文字)
|
||||
public static final int StatusBarLightBgColor = Color.WHITE;
|
||||
// 深色状态栏(白文字)
|
||||
public static final int StatusBarDarkBgColor = Color.parseColor("#212121");
|
||||
public static final int NavBarBgLightColor = Color.WHITE;
|
||||
public static final int NavBarBgDarkColor = Color.parseColor("#212121");
|
||||
|
||||
// ====================== SwitchCompat AppCompat兼容开关颜色常量 ======================
|
||||
public static final int SwitchCompatTrackOffColor = Color.GRAY;
|
||||
public static final int SwitchCompatTrackOnColor = Color.parseColor("#34C759");
|
||||
public static final int SwitchCompatThumbNormalColor = Color.WHITE;
|
||||
|
||||
// ====================== Chip 标签气泡控件颜色常量 ======================
|
||||
public static final int ChipTextNormalColor = Color.parseColor("#007AFF");
|
||||
public static final int ChipBgNormalColor = Color.parseColor("#E6F0FF");
|
||||
public static final int ChipCloseIconTintColor = Color.GRAY;
|
||||
|
||||
// ====================== FloatingActionButton 悬浮按钮颜色常量 ======================
|
||||
public static final int FabIconTintColor = Color.WHITE;
|
||||
public static final int FabBgNormalColor = Color.parseColor("#007AFF");
|
||||
public static final int FabBgPressedColor = Color.parseColor("#005CC8");
|
||||
|
||||
// ====================== RadioGroup/CheckBoxGroup 选择组颜色常量 ======================
|
||||
public static final int GroupLabelTextColor = Color.BLACK;
|
||||
|
||||
// ====================== RecyclerView 列表颜色常量 ======================
|
||||
// 列表条目背景
|
||||
public static final int ListItemBgNormalColor = Color.WHITE;
|
||||
// 列表条目按压背景
|
||||
public static final int ListItemBgPressedColor = Color.parseColor("#F5F5F5");
|
||||
// 列表条目禁用背景
|
||||
public static final int ListItemBgDisabledColor = Color.parseColor("#FAFAFA");
|
||||
|
||||
// ====================== Badge 角标红点颜色常量 ======================
|
||||
public static final int BadgeDotBgColor = Color.RED;
|
||||
public static final int BadgeTextColor = Color.WHITE;
|
||||
|
||||
// ====================== 静态工具函数区域 ======================
|
||||
/**
|
||||
* 调试打印指定颜色常量十六进制字符串
|
||||
* @param color 目标颜色值,强制final
|
||||
* @param tag 颜色标识标签,强制final
|
||||
* @return 格式化十六进制颜色字符串
|
||||
*/
|
||||
public static String getColorHex(final int color, final String tag) {
|
||||
LogUtils.d("ViewColorTable", "getColorHex invoke, tag = " + tag + ", rawColorInt = " + color);
|
||||
final String hexStr = String.format("#%06X", 0xFFFFFF & color);
|
||||
LogUtils.d("ViewColorTable", "getColorHex result hex = " + hexStr);
|
||||
return hexStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验颜色值是否为透明色
|
||||
* @param color 待校验颜色值,强制final
|
||||
* @return true=完全透明,false=非透明
|
||||
*/
|
||||
public static boolean isColorTransparent(final int color) {
|
||||
LogUtils.d("ViewColorTable", "isColorTransparent invoke, checkColor = " + color);
|
||||
final int alpha = Color.alpha(color);
|
||||
final boolean result = alpha == 0;
|
||||
LogUtils.d("ViewColorTable", "isColorTransparent alpha = " + alpha + ", result = " + result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import cc.winboll.studio.libappbase.GlobalApplication;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.R;
|
||||
import cc.winboll.studio.libappbase.ToastUtils;
|
||||
import cc.winboll.studio.libappbase.common.ViewColorTable;
|
||||
import cc.winboll.studio.libappbase.dialogs.DebugHostDialog;
|
||||
import cc.winboll.studio.libappbase.models.APPInfo;
|
||||
|
||||
@@ -465,10 +466,10 @@ public class AboutView extends LinearLayout {
|
||||
*/
|
||||
private android.graphics.drawable.Drawable create_item_background() {
|
||||
android.graphics.drawable.GradientDrawable drawable = new android.graphics.drawable.GradientDrawable();
|
||||
drawable.setStroke(1, mItemContext.getResources().getColor(R.color.gray_300));
|
||||
drawable.setStroke(1, ViewColorTable.DividerDarkLineColor);
|
||||
drawable.setCornerRadius(4);
|
||||
boolean isNightMode = (mItemContext.getResources().getConfiguration().uiMode & android.content.res.Configuration.UI_MODE_NIGHT_MASK) == android.content.res.Configuration.UI_MODE_NIGHT_YES;
|
||||
drawable.setColor(isNightMode ? mItemContext.getResources().getColor(R.color.gray_800) : mItemContext.getResources().getColor(android.R.color.white));
|
||||
drawable.setColor(isNightMode ? ViewColorTable.StatusBarDarkBgColor : ViewColorTable.CardSurfaceColor);
|
||||
return drawable;
|
||||
}
|
||||
|
||||
@@ -495,7 +496,7 @@ public class AboutView extends LinearLayout {
|
||||
tvTitle.setText(mTitle);
|
||||
tvTitle.setTextSize(16);
|
||||
boolean isNightMode = (mItemContext.getResources().getConfiguration().uiMode & android.content.res.Configuration.UI_MODE_NIGHT_MASK) == android.content.res.Configuration.UI_MODE_NIGHT_YES;
|
||||
tvTitle.setTextColor(isNightMode ? mItemContext.getResources().getColor(R.color.gray_500) : mItemContext.getResources().getColor(R.color.gray_900));
|
||||
tvTitle.setTextColor(isNightMode ? ViewColorTable.TextDisabledColor : ViewColorTable.TextPrimaryColor);
|
||||
llText.addView(tvTitle);
|
||||
// 内容
|
||||
TextView tvContent = new TextView(mItemContext);
|
||||
@@ -524,7 +525,7 @@ public class AboutView extends LinearLayout {
|
||||
|
||||
@Override
|
||||
protected int getContentTextColor() {
|
||||
return mItemContext.getResources().getColor(R.color.blue_normal);
|
||||
return ViewColorTable.TextLinkColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -567,7 +568,7 @@ public class AboutView extends LinearLayout {
|
||||
|
||||
@Override
|
||||
protected int getContentTextColor() {
|
||||
return mItemContext.getResources().getColor(R.color.blue_normal);
|
||||
return ViewColorTable.TextLinkColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+22
-1
@@ -9,6 +9,8 @@ import android.content.SharedPreferences;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||
|
||||
@@ -24,12 +26,26 @@ public class DebugSwitchInfoImageView extends ImageView {
|
||||
// 连续点击计数
|
||||
private int mClickCount = 0;
|
||||
// 目标点击次数
|
||||
private static final int TARGET_CLICK_COUNT = 7;
|
||||
private static final int TARGET_CLICK_COUNT = 10;
|
||||
|
||||
private static String mDebugToken = null;
|
||||
private static final String SP_DEBUG_TOKEN = "debug_token_prefs";
|
||||
private static final String KEY_DEBUG_TOKEN = "debug_token";
|
||||
|
||||
private static final HashMap<Integer, String> NUMBER_WORDS = new HashMap<Integer, String>();
|
||||
static {
|
||||
NUMBER_WORDS.put(1, "one");
|
||||
NUMBER_WORDS.put(2, "two");
|
||||
NUMBER_WORDS.put(3, "three");
|
||||
NUMBER_WORDS.put(4, "four");
|
||||
NUMBER_WORDS.put(5, "five");
|
||||
NUMBER_WORDS.put(6, "six");
|
||||
NUMBER_WORDS.put(7, "seven");
|
||||
NUMBER_WORDS.put(8, "eight");
|
||||
NUMBER_WORDS.put(9, "nine");
|
||||
NUMBER_WORDS.put(10, "ten");
|
||||
}
|
||||
|
||||
public static String getDebugToken() {
|
||||
if (mDebugToken != null) {
|
||||
return mDebugToken;
|
||||
@@ -116,6 +132,11 @@ public class DebugSwitchInfoImageView extends ImageView {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mClickCount++;
|
||||
String word = NUMBER_WORDS.get(mClickCount);
|
||||
if (word == null) {
|
||||
word = "One Piece!";
|
||||
}
|
||||
Toast.makeText(getContext(), word, Toast.LENGTH_SHORT).show();
|
||||
if (mClickCount >= TARGET_CLICK_COUNT) {
|
||||
mClickCount = 0;
|
||||
showDebugTokenDialog();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package cc.winboll.studio.libappbase.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
@@ -13,6 +12,7 @@ import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.R;
|
||||
import cc.winboll.studio.libappbase.common.ViewColorTable;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
|
||||
@@ -105,7 +105,7 @@ public class LogTagSpinner extends Spinner {
|
||||
setLayoutParams(layoutParams);
|
||||
|
||||
// 统一背景色(外部可通过 setBackground 手动覆盖)
|
||||
setBackgroundColor(this.mContext.getColor(R.color.btn_gray_normal));
|
||||
setBackgroundColor(ViewColorTable.SwitchTrackNormalColor);
|
||||
}
|
||||
|
||||
|
||||
@@ -156,10 +156,10 @@ public class LogTagSpinner extends Spinner {
|
||||
//itemTv.setGravity(View.GRAVITY_CENTER_VERTICAL | View.GRAVITY_START);
|
||||
// 5. 文字颜色(使用主题属性 ?attr/toolbarTextColor)
|
||||
TypedArray ta = mContext.obtainStyledAttributes(new int[] { R.attr.toolbarTextColor });
|
||||
int toolbarTextColor = ta.getColor(0, mContext.getResources().getColor(R.color.white));
|
||||
int toolbarTextColor = ta.getColor(0, ViewColorTable.ToolbarTitleTextColor);
|
||||
ta.recycle();
|
||||
itemTv.setTextColor(toolbarTextColor);
|
||||
itemTv.setBackgroundColor(this.mContext.getResources().getColor(R.color.btn_gray_normal));
|
||||
itemTv.setBackgroundColor(ViewColorTable.SwitchTrackNormalColor);
|
||||
// 6. 文字溢出处理(最多 2 行,超出省略,避免长标签换行过多)
|
||||
itemTv.setSingleLine(false);
|
||||
itemTv.setMaxLines(2);
|
||||
|
||||
Reference in New Issue
Block a user