创建通用灰色边框 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
114 lines
3.2 KiB
XML
114 lines
3.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<LinearLayout
|
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
android:orientation="vertical"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:padding="16dp" android:background="@drawable/bg_container_border">
|
|
|
|
<android.widget.Toolbar
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:id="@+id/toolbar"/>
|
|
|
|
<ScrollView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="0dp"
|
|
android:layout_weight="1.0" android:background="@drawable/bg_container_border">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical"
|
|
android:gravity="center_vertical"
|
|
android:spacing="12dp" android:background="@drawable/bg_container_border">
|
|
|
|
<Button
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="关于应用"
|
|
android:textSize="16sp"
|
|
|
|
android:background="#81C7F5"
|
|
android:paddingVertical="12dp"
|
|
android:layout_marginHorizontal="24dp"
|
|
android:onClick="onAboutActivity"
|
|
android:layout_margin="10dp"/>
|
|
|
|
<Button
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="应用崩溃测试"
|
|
android:textSize="16sp"
|
|
|
|
android:background="#81C7F5"
|
|
android:paddingVertical="12dp"
|
|
android:layout_marginHorizontal="24dp"
|
|
android:onClick="onCrashTest"
|
|
android:layout_margin="10dp"/>
|
|
|
|
<Button
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="应用日志测试"
|
|
android:textSize="16sp"
|
|
|
|
android:background="#81C7F5"
|
|
android:paddingVertical="12dp"
|
|
android:layout_marginHorizontal="24dp"
|
|
android:onClick="onLogTest"
|
|
android:layout_margin="10dp"/>
|
|
|
|
<Button
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="应用日志测试(新窗口)"
|
|
android:textSize="16sp"
|
|
|
|
android:background="#81C7F5"
|
|
android:paddingVertical="12dp"
|
|
android:layout_marginHorizontal="24dp"
|
|
android:onClick="onLogTestNewTask"
|
|
android:layout_margin="10dp"/>
|
|
|
|
<Button
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="应用吐司测试"
|
|
android:textSize="16sp"
|
|
|
|
android:background="#81C7F5"
|
|
android:paddingVertical="12dp"
|
|
android:layout_marginHorizontal="24dp"
|
|
android:onClick="onToastUtilsTest"
|
|
android:layout_margin="10dp"/>
|
|
|
|
<Button
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="分屏测试"
|
|
android:textSize="16sp"
|
|
|
|
android:background="#81C7F5"
|
|
android:paddingVertical="12dp"
|
|
android:layout_marginHorizontal="24dp"
|
|
android:onClick="onSplitScreenMode"
|
|
android:layout_margin="10dp"/>
|
|
|
|
<Button
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="多开窗口"
|
|
android:textSize="16sp"
|
|
|
|
android:background="#81C7F5"
|
|
android:paddingVertical="12dp"
|
|
android:layout_marginHorizontal="24dp"
|
|
android:onClick="onMultiInstance"
|
|
android:layout_margin="10dp"/>
|
|
|
|
</LinearLayout>
|
|
|
|
</ScrollView>
|
|
|
|
</LinearLayout> |