Adds edit basic info screen with most string fields.

Cleans up fonts/margins on edit screens.
Makes the EditMonsterViewModel shared between edit monster fragments.
This commit is contained in:
2021-05-27 04:49:26 -07:00
committed by Tom Hicks
parent 595ee0c6fb
commit dcce64f91a
8 changed files with 224 additions and 85 deletions

View File

@@ -1,6 +1,5 @@
<?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"
@@ -20,8 +19,6 @@
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:hint="@string/label_name"
android:importantForAutofill="no"
android:inputType="textCapWords"
@@ -89,23 +86,8 @@
</com.google.android.material.textfield.TextInputLayout>
<!-- Hit Dice (int) -->
<com.majinnaibu.monstercards.ui.components.Stepper
android:id="@+id/hitDice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
app:label="@string/label_hit_dice"
app:maxValue="99"
app:minValue="1"
app:stepAmount="1" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/hasCustomHitPoints"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_has_custom_hp"
android:textAppearance="@android:style/TextAppearance.Material.Medium" />
<!-- Has ustom HP (boolean) -->
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"

View File

@@ -6,7 +6,6 @@
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="?android:attr/dividerVertical"
@@ -21,6 +20,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_basic_info"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -29,6 +29,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_armor"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -37,6 +38,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_speed"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -45,6 +47,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_ability_scores"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -53,6 +56,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_saving_throws"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -61,6 +65,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_skills"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -69,6 +74,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_condition_immunities"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -77,6 +83,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_damage_immunities"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -85,6 +92,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_damage_resistances"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -93,6 +101,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_damage_vulnerabilities"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -101,6 +110,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_senses"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -109,6 +119,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_languages"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -117,6 +128,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_challenge_rating"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -125,6 +137,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_abilities"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -133,6 +146,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_actions"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -141,6 +155,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_reactions"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -149,6 +164,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_legendary_actions"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -157,6 +173,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_lair_actions"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
<TextView
@@ -165,6 +182,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_regional_actions"
android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
</LinearLayout>