Adds ability editor.

This commit is contained in:
Tom Hicks
2021-06-25 14:33:40 -07:00
parent cb1e3343c9
commit 2f9dec4d02
10 changed files with 342 additions and 38 deletions

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.EditAbilitiesFragment">
<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_abilities_list_item" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/add_ability"
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_ability"
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

@@ -1,43 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout 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.EditTraitFragment">
android:orientation="vertical">
<LinearLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_margin="@dimen/text_margin">
<com.google.android.material.textfield.TextInputLayout
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin">
android:hint="@string/label_name"
android:importantForAutofill="no"
android:inputType="text"
tools:text="John Doe" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/label_name"
android:importantForAutofill="no"
android:inputType="text"
tools:text="John Doe" />
</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.TextInputLayout
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/description"
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/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/label_description"
android:importantForAutofill="no"
android:inputType="textMultiLine"
tools:text="John Doe" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</ScrollView>
android:hint="@string/label_description"
android:importantForAutofill="no"
android:inputType="text"
tools:text="John Doe" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>

View File

@@ -111,6 +111,9 @@
<action
android:id="@+id/action_editMonsterFragment_to_editLanguagesFragment"
app:destination="@id/editLanguagesFragment" />
<action
android:id="@+id/action_editMonsterFragment_to_editAbilitiesFragment"
app:destination="@id/editAbilitiesFragment" />
</fragment>
<fragment
android:id="@+id/editBasicInfoFragment"
@@ -275,5 +278,24 @@
android:name="canSpeak"
app:argType="boolean" />
</fragment>
<fragment
android:id="@+id/editAbilitiesFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditAbilitiesFragment"
android:label="EditAbilitiesFragment" >
<action
android:id="@+id/action_editAbilitiesFragment_to_editAbilityFragment"
app:destination="@id/editAbilityFragment" />
</fragment>
<fragment
android:id="@+id/editAbilityFragment"
android:name="com.majinnaibu.monstercards.ui.editmonster.EditAbilityFragment"
android:label="EditAbilityFragment" >
<argument
android:name="description"
app:argType="string" />
<argument
android:name="name"
app:argType="string" />
</fragment>
</navigation>
</navigation>

View File

@@ -1,9 +1,11 @@
<resources>
<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_language">Add Language</string>
<string name="action_add_monster">Add monster</string>
<string name="action_add_sense">Add Sense</string>
<string name="action_add_skill">Add Skill</string>
<string name="action_add_language">Add Language</string>
<string name="action_add_condition_immunity">Add Condition</string>
<string name="action_edit">Edit</string>
<string name="actions_label">Actions</string>
<string name="app_name">MonsterCards</string>
@@ -26,6 +28,7 @@
<string name="label_basic_info">Basic Info</string>
<string name="label_burrow_speed">Burrow Speed</string>
<string name="label_can_hover">Can Hover</string>
<string name="label_can_speak_language">Can Speak</string>
<string name="label_challenge_rating">Challenge Rating</string>
<string name="label_charisma">Charisma</string>
<string name="label_climb_speed">Climb Speed</string>
@@ -38,8 +41,10 @@
<string name="label_custom_speed">Custom Speed</string>
<string name="label_damage_immunities">Damage Immunities</string>
<string name="label_damage_resistances">Damage Resistances</string>
<string name="label_damage_type">Damage Type</string>
<string name="label_damage_vulnerabilities">Damage Vulnerabilities</string>
<string name="label_decrement_field">-</string>
<string name="label_description">Description</string>
<string name="label_dexterity">Dexterity</string>
<string name="label_fly_speed">Fly Speed</string>
<string name="label_has_custom_hp">Has Custom HP</string>
@@ -83,8 +88,4 @@
<string name="title_library">Library</string>
<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>
<string name="label_can_speak_language">Can Speak</string>
</resources>