20251216_154557_434
This commit is contained in:
20
powerbell/src/main/res/drawable/btn_brightness_bg.xml
Normal file
20
powerbell/src/main/res/drawable/btn_brightness_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 按压状态:浅灰色背景 -->
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#E0E0E0" /> <!-- 按压深色 -->
|
||||
<corners android:radius="8dp" /> <!-- 圆角适配小米UI风格 -->
|
||||
<stroke android:width="1dp" android:color="#CCCCCC" /> <!-- 边框 -->
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 正常状态:白色背景 -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFFFFF" /> <!-- 正常白色 -->
|
||||
<corners android:radius="8dp" />
|
||||
<stroke android:width="1dp" android:color="#CCCCCC" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
|
||||
18
powerbell/src/main/res/drawable/btn_cancel_bg.xml
Normal file
18
powerbell/src/main/res/drawable/btn_cancel_bg.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 按压状态:深灰色背景 -->
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#D0D0D0" />
|
||||
<corners android:radius="8dp" /> <!-- 与亮度按钮圆角一致,统一风格 -->
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 正常状态:浅灰色背景 -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#F0F0F0" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
|
||||
18
powerbell/src/main/res/drawable/btn_confirm_bg.xml
Normal file
18
powerbell/src/main/res/drawable/btn_confirm_bg.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 按压状态:加深深色背景 -->
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#2D7CFF" /> <!-- 按压深蓝 -->
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 正常状态:主色背景(可改为项目主题色) -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#4096FF" /> <!-- 正常浅蓝,适配小米系统UI -->
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
|
||||
@@ -4,203 +4,156 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="20dp"
|
||||
android:background="@drawable/dialog_bg_radius">
|
||||
android:background="@android:color/white"
|
||||
android:radius="12dp">
|
||||
|
||||
<!-- 标题 -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="调色板"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="20dp"/>
|
||||
<!-- 颜色预览 -->
|
||||
<ImageView
|
||||
android:id="@+id/iv_color_picker"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@color/black"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
|
||||
<!-- 颜色拾取框 -->
|
||||
<!-- RGB输入区 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginBottom="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="颜色拾取:"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/gray_700"
|
||||
android:layout_marginRight="10dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_color_picker"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/white"
|
||||
android:scaleType="fitXY"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="2dp"
|
||||
android:backgroundTint="@color/gray_200"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- RGB 输入框 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginBottom="15dp">
|
||||
android:layout_marginBottom="15dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="RGB:"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/gray_700"
|
||||
android:layout_marginRight="10dp"/>
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_r"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:hint="R"
|
||||
android:inputType="number"
|
||||
android:maxLength="3"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
android:background="@drawable/edittext_bg"
|
||||
android:padding="5dp"
|
||||
android:layout_marginRight="10dp"/>
|
||||
android:maxLength="3"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_g"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:hint="G"
|
||||
android:inputType="number"
|
||||
android:maxLength="3"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
android:background="@drawable/edittext_bg"
|
||||
android:padding="5dp"
|
||||
android:layout_marginRight="10dp"/>
|
||||
android:maxLength="3"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_b"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:hint="B"
|
||||
android:inputType="number"
|
||||
android:gravity="center"
|
||||
android:maxLength="3"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
android:background="@drawable/edittext_bg"
|
||||
android:padding="5dp"/>
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 颜色值输入框 -->
|
||||
<!-- 颜色值输入区 -->
|
||||
<EditText
|
||||
android:id="@+id/et_color_value"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:hint="#AARRGGBB"
|
||||
android:inputType="text"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:textSize="14sp"
|
||||
android:background="@drawable/edittext_bg" />
|
||||
|
||||
<!-- 亮度调节区(底部:左-减号,中-数值,右-加号) -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginBottom="15dp">
|
||||
android:layout_marginBottom="20dp"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="颜色值:"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/gray_700"
|
||||
android:layout_marginRight="10dp"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_color_value"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/tv_brightness_minus"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:hint="#AARRGGBB"
|
||||
android:inputType="text"
|
||||
android:maxLength="9"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
android:background="@drawable/edittext_bg"
|
||||
android:padding="5dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 透明度进度条 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="15dp">
|
||||
android:text="-"
|
||||
android:textSize="20sp"
|
||||
android:textColor="@android:color/black"
|
||||
android:background="@drawable/btn_brightness_bg"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_brightness_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="透明度(0-255)"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/gray_700"
|
||||
android:layout_marginBottom="5dp"/>
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/sb_alpha"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:progressDrawable="@drawable/seekbar_progress"
|
||||
android:thumb="@drawable/seekbar_thumb"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 色阶进度条 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="20dp">
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:text="100%"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="色阶(亮度)"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/gray_700"
|
||||
android:layout_marginBottom="5dp"/>
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/sb_brightness"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:progressDrawable="@drawable/seekbar_progress"
|
||||
android:thumb="@drawable/seekbar_thumb"/>
|
||||
android:id="@+id/tv_brightness_plus"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center"
|
||||
android:text="+"
|
||||
android:textSize="20sp"
|
||||
android:textColor="@android:color/black"
|
||||
android:background="@drawable/btn_brightness_bg"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 按钮区域 -->
|
||||
<!-- 底部按钮区 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="end">
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cancel"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="40dp"
|
||||
android:text="取消"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="45dp"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/gray_700"
|
||||
android:background="@drawable/btn_bg_gray"
|
||||
android:layout_marginRight="10dp"/>
|
||||
android:text="取消"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/black"
|
||||
android:background="@drawable/btn_cancel_bg"
|
||||
android:layout_marginRight="20dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_confirm"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="40dp"
|
||||
android:text="确认"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="45dp"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/white"
|
||||
android:background="@drawable/btn_bg_primary"/>
|
||||
android:text="确认"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/white"
|
||||
android:background="@drawable/btn_confirm_bg"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user