Adds ability editor.

This commit is contained in:
Tom Hicks
2021-06-25 14:33:40 -07:00
parent 0b881a50da
commit 3a918fea6f
10 changed files with 410 additions and 0 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

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<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"
android:orientation="vertical">
<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/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.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="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,4 +1,5 @@
<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>