feat: 容器统一加灰色边框,borderCornerRadius 属性统一管理圆角

创建通用灰色边框 drawable(5 模块各一份):
  - bg_container_border.xml:透明填充 + 1dp #B0B0B0 描边
  - 自动应用到 80 个无背景容器的布局文件

深色模式 bg_frame 加边框:
  - drawable-night/bg_frame.xml(mymessagemanager + aes):
    背景 shape 添加 1dp #666666 描边,保留渐变蒙版

统一圆角为 6dp(borderCornerRadius 属性化):
  - 5 模块 attrs.xml 声明 borderCornerRadius(dimension)
  - 12 个主题(6 普通 + 6 深色)设置 borderCornerRadius=6dp
  - 12 个 drawable 文件约 40 处 corners 改用 ?attr/borderCornerRadius
    (bg_frame / bg_frame_black/white / bg_shadow / bg_border_round
     bg_toolbar_log / acard_frame_main / atoolbar_frame / ohpcts_frame
     bg_container_border 等)
  - 3 个 Java 自定义控件(AToolbar / ASupportToolbar / AboutView)
    从硬编码 px 改为读取 ?attr/borderCornerRadius

受益布局模块:libaes / libappbase / appbase / mymessagemanager / aes / winboll
This commit is contained in:
2026-05-09 10:59:55 +08:00
parent b385aa7030
commit 4e4673a93b
108 changed files with 282 additions and 317 deletions

View File

@@ -3,6 +3,7 @@ package cc.winboll.studio.libappbase.views;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.TypedArray;
import android.net.Uri;
import android.util.AttributeSet;
import android.view.Gravity;
@@ -421,8 +422,11 @@ public class AboutView extends LinearLayout {
*/
private android.graphics.drawable.Drawable create_item_background() {
android.graphics.drawable.GradientDrawable drawable = new android.graphics.drawable.GradientDrawable();
TypedArray taBorder = mItemContext.obtainStyledAttributes(new int[]{R.attr.borderCornerRadius});
float cornerRadius = taBorder.getDimension(0, 6 * mItemContext.getResources().getDisplayMetrics().density);
taBorder.recycle();
drawable.setStroke(1, mItemContext.getResources().getColor(R.color.gray_200));
drawable.setCornerRadius(4);
drawable.setCornerRadius(cornerRadius);
drawable.setColor(mItemContext.getResources().getColor(android.R.color.white));
return drawable;
}

View File

@@ -5,9 +5,5 @@
android:width="1dp"
android:color="#000000" /> <!-- 这里可调整边框宽度和颜色 -->
<solid android:color="@android:color/transparent" />
<corners
android:bottomLeftRadius="6dip"
android:bottomRightRadius="6dip"
android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
<corners android:radius="?attr/borderCornerRadius" />
</shape>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@android:color/transparent" />
<stroke android:width="1dp" android:color="#FFB0B0B0" />
<corners android:radius="?attr/borderCornerRadius" />
</shape>

View File

@@ -12,11 +12,7 @@
android:angle="270"
android:endColor="@color/colorPrimary"
android:startColor="@color/colorPrimary" />
<corners
android:bottomLeftRadius="6dip"
android:bottomRightRadius="6dip"
android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
<corners android:radius="?attr/borderCornerRadius" />
</shape>
</item>
<!-- 背景部分 -->
@@ -31,11 +27,7 @@
android:angle="270"
android:endColor="@color/colorPrimary"
android:startColor="@color/colorPrimary" />
<corners
android:bottomLeftRadius="6dip"
android:bottomRightRadius="6dip"
android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
<corners android:radius="?attr/borderCornerRadius" />
</shape>
</item>
</layer-list>

View File

@@ -4,7 +4,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
<android.widget.Toolbar
android:layout_width="match_parent"
@@ -16,5 +16,5 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0"
android:id="@+id/aboutviewroot_ll"/>
android:id="@+id/aboutviewroot_ll" android:background="@drawable/bg_container_border" />
</LinearLayout>

View File

@@ -4,7 +4,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
<cc.winboll.studio.libappbase.GlobalCrashReportView
android:layout_width="match_parent"

View File

@@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
<cc.winboll.studio.libappbase.LogView
android:layout_width="match_parent"

View File

@@ -18,7 +18,7 @@
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="wrap_content" android:background="@drawable/bg_container_border">
<EditText
android:id="@+id/et_sign_fingerprint"

View File

@@ -32,7 +32,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="end">
android:gravity="end" android:background="@drawable/bg_container_border">
<!-- 取消按钮 -->
<Button

View File

@@ -2,7 +2,7 @@
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
<LinearLayout
android:layout_width="match_parent"
@@ -12,7 +12,7 @@
android:paddingLeft="16dp"
android:paddingTop="16dp"
android:paddingRight="16dp"
android:paddingBottom="16dp">
android:paddingBottom="16dp" android:background="@drawable/bg_container_border">
<cc.winboll.studio.libappbase.views.DebugSwitchImageView
android:id="@+id/iv_app_icon"
@@ -46,7 +46,7 @@
android:id="@+id/ll_function_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"/>
android:orientation="vertical" android:background="@drawable/bg_container_border" />
<LinearLayout
android:orientation="horizontal"
@@ -54,7 +54,7 @@
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="8dp"
android:spacing="20dp">
android:spacing="20dp" android:background="@drawable/bg_container_border">
<ImageButton
android:layout_width="48dp"

View File

@@ -5,7 +5,7 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/viewglobalcrashreportLinearLayout1">
android:id="@+id/viewglobalcrashreportLinearLayout1" android:background="@drawable/bg_container_border">
<android.widget.Toolbar
android:layout_width="match_parent"
@@ -15,11 +15,11 @@
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0">
android:layout_weight="1.0" android:background="@drawable/bg_container_border">
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
<TextView
android:layout_width="match_parent"

View File

@@ -121,7 +121,7 @@
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:layout_alignParentBottom="true"
android:layout_below="@+id/viewlogLinearLayout1">
android:layout_below="@+id/viewlogLinearLayout1" android:background="@drawable/bg_container_border">
<ScrollView
android:layout_width="match_parent"

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="borderCornerRadius" format="dimension" />
<attr name="themeGlobalCrashActivity" format="reference"/>
<declare-styleable name="GlobalCrashActivity">