View cleanup.

Makes more numeric fields Steppers.
Sets titles for fragments.
Sets focus on the first EditText on most edit pages.
Makes Checkbox be a SwitchCompat
Fixes monster list item view.
This commit is contained in:
Tom Hicks
2021-06-26 02:37:37 -07:00
parent 36c26e4c42
commit 2427f69da9
28 changed files with 258 additions and 124 deletions

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -15,21 +16,15 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<!-- // TODO: Make this a stepper instead of a text field -->
<com.google.android.material.textfield.TextInputLayout
<com.majinnaibu.monstercards.ui.components.Stepper
android:id="@+id/naturalArmorBonus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/naturalArmorBonus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/label_natural_armor_bonus"
android:importantForAutofill="no"
android:inputType="numberSigned"
tools:text="+2" />
</com.google.android.material.textfield.TextInputLayout>
android:layout_margin="@dimen/text_margin"
app:label="@string/label_natural_armor_bonus"
app:maxValue="99"
app:minValue="0"
app:stepAmount="1" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/hasShield"
@@ -37,23 +32,17 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_has_a_shield"
android:textSize="20sp" />
android:textAppearance="@android:style/TextAppearance.Material.Medium" />
<!-- // TODO: Make this a stepper instead of a text field -->
<com.google.android.material.textfield.TextInputLayout
<com.majinnaibu.monstercards.ui.components.Stepper
android:id="@+id/shieldBonus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/shieldBonus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/label_shield_bonus"
android:importantForAutofill="no"
android:inputType="numberSigned"
tools:text="4" />
</com.google.android.material.textfield.TextInputLayout>
android:layout_margin="@dimen/text_margin"
app:label="@string/label_shield_bonus"
app:maxValue="99"
app:minValue="0"
app:stepAmount="1" />
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"