Adds Edit Armor screen to edit a monster's armor stats.

This commit is contained in:
2021-05-29 19:46:28 -07:00
parent 82ce3d3788
commit f4dd3855d6
9 changed files with 396 additions and 91 deletions

View File

@@ -0,0 +1,9 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:padding="@dimen/text_margin"
android:textSize="20sp"
tools:text="Hello, World!" />

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.editmonster.EditBasicInfoFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Spinner
android:id="@+id/armorType"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.google.android.material.textfield.TextInputLayout
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:digits="0123456789"
android:hint="@string/label_natural_armor_bonus"
android:importantForAutofill="no"
android:inputType="numberSigned"
tools:text="+2" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/hasShield"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/label_has_a_shield"
android:textSize="20sp" />
<com.google.android.material.textfield.TextInputLayout
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:digits="0123456789"
android:hint="@string/label_shield_bonus"
android:importantForAutofill="no"
android:inputType="numberSigned"
tools:text="4" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
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/customArmor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/label_custom_armor"
android:importantForAutofill="no"
android:inputType="text"
tools:text="John Doe" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</ScrollView>

View File

@@ -75,12 +75,20 @@
<action
android:id="@+id/action_editMonsterFragment_to_editBasicInfoFragment"
app:destination="@id/editBasicInfoFragment" />
<action
android:id="@+id/action_editMonsterFragment_to_editArmorFragment"
app:destination="@id/editArmorFragment" />
</fragment>
<fragment
android:id="@+id/editBasicInfoFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditBasicInfoFragment"
android:label="fragment_edit_basic_info"
tools:layout="@layout/fragment_edit_basic_info" />
<fragment
android:id="@+id/editArmorFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditArmorFragment"
android:label="fragment_edit_armor"
tools:layout="@layout/fragment_edit_armor" />
</navigation>
</navigation>

View File

@@ -1,49 +1,53 @@
<resources>
<string name="action_add_monster">Add monster</string>
<string name="action_edit">Edit</string>
<string name="actions_label">Actions</string>
<string name="app_name">MonsterCards</string>
<string name="charisma_abbreviation">CHA</string>
<string name="constitution_abbreviation">CON</string>
<string name="default_monster_name">Unnamed Monster</string>
<string name="dexterity_abbreviation">DEX</string>
<string name="intelligence_abbreviation">INT</string>
<string name="label_search_query">Query</string>
<string name="section_divider">section divider</string>
<string name="strength_abbreviation">STR</string>
<string name="title_collections">Collections</string>
<string name="title_dashboard">Dashboard</string>
<string name="title_library">Library</string>
<string name="title_search">Search</string>
<string name="wisdom_abbreviation">WIS</string>
<string name="action_add_monster">Add monster</string>
<string name="action_edit">Edit</string>
<string name="label_basic_info">Basic Info</string>
<string name="label_armor">Armor</string>
<string name="label_speed">Speed</string>
<string name="label_ability_scores">Ability Scores</string>
<string name="label_saving_throws">Saving Throws</string>
<string name="label_skills">Skills</string>
<string name="label_abilities">Abilities</string>
<string name="label_actions">Actions</string>
<string name="label_alignment">Alignment</string>
<string name="label_armor">Armor</string>
<string name="label_basic_info">Basic Info</string>
<string name="label_challenge_rating">Challenge Rating</string>
<string name="label_condition_immunities">Condition Immunities</string>
<string name="label_custom_armor">Custom Armor</string>
<string name="label_custom_hp">Custom HP</string>
<string name="label_damage_immunities">Damage Immunities</string>
<string name="label_damage_resistances">Damage Resistances</string>
<string name="label_damage_vulnerabilities">Damage Vulnerabilities</string>
<string name="label_senses">Senses</string>
<string name="label_languages">Languages</string>
<string name="label_challenge_rating">Challenge Rating</string>
<string name="label_abilities">Abilities</string>
<string name="label_actions">Actions</string>
<string name="label_reactions">Reactions</string>
<string name="label_legendary_actions">Legendary Actions</string>
<string name="label_has_custom_hp">Has Custom HP</string>
<string name="label_has_a_shield">Has a Shield</string>
<string name="label_hit_dice">Hit Dice</string>
<string name="label_lair_actions">Lair Actions</string>
<string name="label_languages">Languages</string>
<string name="label_legendary_actions">Legendary Actions</string>
<string name="label_natural_armor_bonus">Natural Armor Bonus</string>
<string name="label_name">Name</string>
<string name="label_reactions">Reactions</string>
<string name="label_regional_actions">Regional Actions</string>
<string name="title_edit_monster">Edit %1$s</string>
<string name="default_monster_name">Unnamed Monster</string>
<string name="label_saving_throws">Saving Throws</string>
<string name="label_search_query">Query</string>
<string name="label_senses">Senses</string>
<string name="label_shield_bonus">Shield Bonus</string>
<string name="label_size">Size</string>
<string name="label_skills">Skills</string>
<string name="label_speed">Speed</string>
<string name="label_subtype">Subtype</string>
<string name="label_type">Type</string>
<string name="section_divider">section divider</string>
<string name="snackbar_failed_to_create_monster">Failed to create monster</string>
<string name="snackbar_monster_created">%1$s created</string>
<string name="label_name">Name</string>
<string name="label_size">Size</string>
<string name="label_type">Type</string>
<string name="label_subtype">Subtype</string>
<string name="label_alignment">Alignment</string>
<string name="label_custom_hp">Custom HP</string>
<string name="label_has_custom_hp">Has Custom HP</string>
<string name="label_hit_dice">Hit Dice</string>
<string name="strength_abbreviation">STR</string>
<string name="title_collections">Collections</string>
<string name="title_dashboard">Dashboard</string>
<string name="title_edit_monster">Edit %1$s</string>
<string name="title_library">Library</string>
<string name="title_search">Search</string>
<string name="wisdom_abbreviation">WIS</string>
</resources>