Replaces condition immunities, damage immunities, damage resistances, damage vulnerabilities, and senses with a unified list of strings editor.

This commit is contained in:
Tom Hicks
2021-06-25 20:28:25 -07:00
parent 5533c03f07
commit 881fcf9123
38 changed files with 209 additions and 1360 deletions

View File

@@ -1,33 +0,0 @@
<?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.EditConditionImmunitiesFragment">
<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_condition_immunities_list_item" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/add_condition_immunity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:contentDescription="@string/action_add_condition_immunity"
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

@@ -1,13 +0,0 @@
<?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

@@ -1,33 +0,0 @@
<?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/action_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

@@ -1,17 +0,0 @@
<?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

@@ -1,17 +0,0 @@
<?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

@@ -1,33 +0,0 @@
<?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/action_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

@@ -1,13 +0,0 @@
<?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

@@ -1,33 +0,0 @@
<?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/action_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

@@ -1,13 +0,0 @@
<?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

@@ -1,17 +0,0 @@
<?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

@@ -1,17 +0,0 @@
<?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.EditSenseFragment">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/label_description"
android:importantForAutofill="no"
android:inputType="text"
tools:text="darkvision 60 ft." />
</com.google.android.material.textfield.TextInputLayout>

View File

@@ -1,13 +0,0 @@
<?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

@@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
tools:context=".ui.editmonster.EditConditionImmunityFragment">
tools:context=".ui.editmonster.EditStringFragment">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/description"
@@ -15,4 +15,4 @@
android:inputType="text"
tools:text="blinded" />
</com.google.android.material.textfield.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.editmonster.EditSensesFragment">
tools:context=".ui.editmonster.EditStringsFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
@@ -17,15 +17,15 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:listitem="@layout/fragment_edit_senses_list_item" />
tools:listitem="@layout/fragment_edit_traits_list_item" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/add_sense"
android:id="@+id/add_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:contentDescription="@string/action_add_sense"
android:contentDescription="@string/action_add_item"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@android:drawable/ic_input_add"

View File

@@ -10,4 +10,4 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:textAppearance="?attr/textAppearanceListItem" />
</LinearLayout>
</LinearLayout>

View File

@@ -3,7 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:orientation="vertical"
tools:context=".ui.editmonster.EditTraitFragment">
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.editmonster.EditAbilitiesFragment">
tools:context=".ui.editmonster.EditTraitListFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
@@ -17,7 +17,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:listitem="@layout/fragment_edit_abilities_list_item" />
tools:listitem="@layout/fragment_edit_traits_list_item" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/add_trait"

View File

@@ -93,27 +93,15 @@
<action
android:id="@+id/action_editMonsterFragment_to_editSkillsFragment"
app:destination="@id/editSkillsFragment" />
<action
android:id="@+id/action_editMonsterFragment_to_editSensesFragment"
app:destination="@id/editSensesFragment" />
<action
android:id="@+id/action_editMonsterFragment_to_editConditionImmunitiesFragment"
app:destination="@id/editConditionImmunitiesFragment" />
<action
android:id="@+id/action_editMonsterFragment_to_editDamageResistancesFragment"
app:destination="@id/editDamageResistancesFragment" />
<action
android:id="@+id/action_editMonsterFragment_to_editDamageVulnerabilitiesFragment"
app:destination="@id/editDamageVulnerabilitiesFragment" />
<action
android:id="@+id/action_editMonsterFragment_to_editDamageImmunitiesFragment"
app:destination="@id/editDamageImmunitiesFragment" />
<action
android:id="@+id/action_editMonsterFragment_to_editLanguagesFragment"
app:destination="@id/editLanguagesFragment" />
<action
android:id="@+id/action_editMonsterFragment_to_editTraitListFragment"
app:destination="@id/editTraitListFragment" />
<action
android:id="@+id/action_editMonsterFragment_to_editStringsFragment"
app:destination="@id/editStringsFragment" />
</fragment>
<fragment
android:id="@+id/editBasicInfoFragment"
@@ -171,92 +159,6 @@
android:name="advantage"
app:argType="com.majinnaibu.monstercards.data.enums.AdvantageType" />
</fragment>
<fragment
android:id="@+id/editSensesFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditSensesFragment"
android:label="fragment_edit_senses_list"
tools:layout="@layout/fragment_edit_senses_list">
<action
android:id="@+id/action_editSensesFragment_to_editSenseFragment"
app:destination="@id/editSenseFragment" />
</fragment>
<fragment
android:id="@+id/editSenseFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditSenseFragment"
android:label="fragment_edit_sense"
tools:layout="@layout/fragment_edit_sense">
<argument
android:name="sense"
app:argType="string" />
</fragment>
<fragment
android:id="@+id/editConditionImmunitiesFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditConditionImmunitiesFragment"
android:label="fragment_edit_condition_immunities_list"
tools:layout="@layout/fragment_edit_condition_immunities_list">
<action
android:id="@+id/action_editConditionImmunitiesFragment_to_editConditionImmunity"
app:destination="@id/editConditionImmunity" />
</fragment>
<fragment
android:id="@+id/editConditionImmunity"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditConditionImmunityFragment"
android:label="fragment_edit_condition_immunity"
tools:layout="@layout/fragment_edit_condition_immunity">
<argument
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>
<fragment
android:id="@+id/editDamageVulnerabilityFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditDamageVulnerabilityFragment"
android:label="EditDamageVulnerabilityFragment">
<argument
android:name="damageType"
app:argType="string" />
</fragment>
<fragment
android:id="@+id/editDamageImmunitiesFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditDamageImmunitiesFragment"
android:label="EditDamageImmunitiesFragment">
<action
android:id="@+id/action_editDamageImmunitiesFragment_to_editDamageImmunityFragment"
app:destination="@id/editDamageImmunityFragment" />
</fragment>
<fragment
android:id="@+id/editDamageImmunityFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditDamageImmunityFragment"
android:label="EditDamageImmunityFragment">
<argument
android:name="damageType"
app:argType="string" />
</fragment>
<fragment
android:id="@+id/editDamageVulnerabilitiesFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditDamageVulnerabilitiesFragment"
android:label="EditDamageVulnerabilitiesFragment">
<action
android:id="@+id/action_editDamageVulnerabilitiesFragment_to_editDamageVulnerabilityFragment"
app:destination="@id/editDamageVulnerabilityFragment" />
</fragment>
<fragment
android:id="@+id/editLanguagesFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditLanguagesFragment"
@@ -303,5 +205,27 @@
android:name="traitType"
app:argType="com.majinnaibu.monstercards.data.enums.TraitType" />
</fragment>
<fragment
android:id="@+id/editStringsFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditStringsFragment"
android:label="EditStringsFragment">
<action
android:id="@+id/action_editStringsFragment_to_editStringFragment"
app:destination="@id/editStringFragment" />
<argument
android:name="stringType"
app:argType="com.majinnaibu.monstercards.data.enums.StringType" />
</fragment>
<fragment
android:id="@+id/editStringFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditStringFragment"
android:label="EditStringFragment">
<argument
android:name="stringType"
app:argType="com.majinnaibu.monstercards.data.enums.StringType" />
<argument
android:name="value"
app:argType="string" />
</fragment>
</navigation>
</navigation>

View File

@@ -2,6 +2,7 @@
<string name="action_add_ability">Add Ability</string>
<string name="action_add_condition_immunity">Add Condition</string>
<string name="action_add_damage_type">Add Damage Type</string>
<string name="action_add_item">Add Item</string>
<string name="action_add_language">Add Language</string>
<string name="action_add_monster">Add monster</string>
<string name="action_add_sense">Add Sense</string>