Create a new visual design for action buttons

- Create a new style for two action buttons.
- Change the layout of two_action_buttons.
  Since we use same style for positive/nagative
  buttons now, we only remain button1/button2 for
  this layout.
- Create a setButtonIcon interface in ActionButtonPreference.
  So, user can set icon for each button in this preferece.

Test: visual, robotest
Bug: 116346008
Change-Id: I511272cba5fd961349b85cae6d30004ddabe2c8e
This commit is contained in:
tmfang
2018-11-12 17:42:31 +08:00
parent d6cdafc0d7
commit 8f65efa8f9
6 changed files with 139 additions and 119 deletions

View File

@@ -19,47 +19,28 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingTop="24dp"
android:paddingStart="68dp"
android:paddingEnd="24dp"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:orientation="horizontal">
<FrameLayout
<Button
android:id="@+id/button1"
style="@style/SettingsActionButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content">
<Button
android:id="@+id/button1_positive"
style="@style/ActionPrimaryButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp" />
<Button
android:id="@+id/button1_negative"
style="@style/ActionSecondaryButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp" />
</FrameLayout>
android:paddingTop="20dp"
android:paddingBottom="20dp"/>
<Space
android:layout_width="16dp"
android:layout_width="8dp"
android:layout_height="wrap_content" />
<FrameLayout
<Button
android:id="@+id/button2"
style="@style/SettingsActionButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content">
<Button
android:id="@+id/button2_positive"
style="@style/ActionPrimaryButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp" />
<Button
android:id="@+id/button2_negative"
style="@style/ActionSecondaryButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp" />
</FrameLayout>
android:paddingTop="20dp"
android:paddingBottom="20dp"/>
</LinearLayout>