refactor: 抽象背景选择对话框为独立的BgSelectorDialog类
- 新增BgSelectorDialog对话框类,继承Dialog - 新增dialog_bg_selector.xml布局文件定义对话框视图 - 重构ImageViewerActivity.switchBg()使用新的BgSelectorDialog - 重构CropActivity.showBgDialog()使用新的BgSelectorDialog - 统一两个Activity的背景选择交互方式
This commit is contained in:
45
gallery/src/main/res/layout/dialog_bg_selector.xml
Normal file
45
gallery/src/main/res/layout/dialog_bg_selector.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选择背景"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="16dp" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radio_group_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_checkerboard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="灰白相间"
|
||||
android:padding="12dp" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_white"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="全白"
|
||||
android:padding="12dp" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_black"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="全黑"
|
||||
android:padding="12dp" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user