Adds damage resistances to monster editor.

This commit is contained in:
2021-06-20 19:35:16 -07:00
parent a9dcc81deb
commit 884ffdd218
11 changed files with 329 additions and 74 deletions

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.textfield.TextInputLayout 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:layout_margin="@dimen/text_margin"
tools:context=".ui.editmonster.EditDamageResistanceFragment">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/label_damage_type"
android:importantForAutofill="no"
android:inputType="text"
tools:text="bludgeoning" />
</com.google.android.material.textfield.TextInputLayout>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
tools:context=".ui.editmonster.EditDamageResistancesFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="?android:attr/dividerVertical"
android:dividerPadding="@dimen/text_margin"
app:layoutManager="LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:listitem="@layout/fragment_edit_damage_resistances_list_item" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/add_damage_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:contentDescription="@string/add_damage_type"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@android:drawable/ic_input_add"
app:tint="@android:color/white" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,13 @@
<?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="horizontal">
<TextView
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:textAppearance="?attr/textAppearanceListItem" />
</LinearLayout>

View File

@@ -99,6 +99,9 @@
<action
android:id="@+id/action_editMonsterFragment_to_editConditionImmunitiesFragment"
app:destination="@id/editConditionImmunitiesFragment" />
<action
android:id="@+id/action_editMonsterFragment_to_editDamageResistancesFragment"
app:destination="@id/editDamageResistancesFragment" />
</fragment>
<fragment
android:id="@+id/editBasicInfoFragment"
@@ -192,5 +195,23 @@
android:name="condition"
app:argType="string" />
</fragment>
<fragment
android:id="@+id/editDamageResistancesFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditDamageResistancesFragment"
android:label="fragment_edit_damage_resistances_list"
tools:layout="@layout/fragment_edit_damage_resistances_list">
<action
android:id="@+id/action_editDamageResistancesFragment_to_editDamageResistanceFragment"
app:destination="@id/editDamageResistanceFragment" />
</fragment>
<fragment
android:id="@+id/editDamageResistanceFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditDamageResistanceFragment"
android:label="fragment_edit_damage_resistance"
tools:layout="@layout/fragment_edit_damage_resistance">
<argument
android:name="damageType"
app:argType="string" />
</fragment>
</navigation>
</navigation>

View File

@@ -81,4 +81,6 @@
<string name="title_search">Search</string>
<string name="wisdom_abbreviation">WIS</string>
<string name="label_description">Description</string>
<string name="label_damage_type">Damage Type</string>
<string name="add_damage_type">Add Damage Type</string>
</resources>