Adds screen to edit ability scores.
This commit is contained in:
		| @@ -0,0 +1,102 @@ | |||||||
|  | package com.majinnaibu.monstercards.ui.editmonster; | ||||||
|  |  | ||||||
|  | import android.os.Bundle; | ||||||
|  | import android.view.LayoutInflater; | ||||||
|  | import android.view.View; | ||||||
|  | import android.view.ViewGroup; | ||||||
|  | import android.widget.Button; | ||||||
|  | import android.widget.TextView; | ||||||
|  |  | ||||||
|  | import androidx.fragment.app.Fragment; | ||||||
|  | import androidx.lifecycle.ViewModelProvider; | ||||||
|  | import androidx.navigation.NavBackStackEntry; | ||||||
|  | import androidx.navigation.NavController; | ||||||
|  | import androidx.navigation.Navigation; | ||||||
|  |  | ||||||
|  | import com.majinnaibu.monstercards.R; | ||||||
|  |  | ||||||
|  | public class EditAbilityScoresFragment extends Fragment { | ||||||
|  |     private EditMonsterViewModel mViewModel; | ||||||
|  |     private ViewHolder mHolder; | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public View onCreateView(LayoutInflater inflater, ViewGroup container, | ||||||
|  |                              Bundle savedInstanceState) { | ||||||
|  |         NavController navController = Navigation.findNavController(requireActivity(), R.id.nav_host_fragment); | ||||||
|  |         NavBackStackEntry backStackEntry = navController.getBackStackEntry(R.id.edit_monster_navigation); | ||||||
|  |         mViewModel = new ViewModelProvider(backStackEntry).get(EditMonsterViewModel.class); | ||||||
|  |  | ||||||
|  |         // Inflate the layout for this fragment | ||||||
|  |         View root = inflater.inflate(R.layout.fragment_edit_ability_scores, container, false); | ||||||
|  |  | ||||||
|  |         mHolder = new ViewHolder(root); | ||||||
|  |  | ||||||
|  |         mViewModel.getStrength().observe(getViewLifecycleOwner(), value -> mHolder.strength.setText(String.valueOf(value))); | ||||||
|  |         mHolder.increaseStrength.setOnClickListener(v -> mViewModel.incrementStrength()); | ||||||
|  |         mHolder.decreaseStrength.setOnClickListener(v -> mViewModel.decrementStrength()); | ||||||
|  |  | ||||||
|  |         mViewModel.getDexterity().observe(getViewLifecycleOwner(), value -> mHolder.dexterity.setText(String.valueOf(value))); | ||||||
|  |         mHolder.increaseDexterity.setOnClickListener(v -> mViewModel.incrementDexterity()); | ||||||
|  |         mHolder.decreaseDexterity.setOnClickListener(v -> mViewModel.decrementDexterity()); | ||||||
|  |  | ||||||
|  |         mViewModel.getConstitution().observe(getViewLifecycleOwner(), value -> mHolder.constitution.setText(String.valueOf(value))); | ||||||
|  |         mHolder.increaseConstitution.setOnClickListener(v -> mViewModel.incrementConstitution()); | ||||||
|  |         mHolder.decreaseConstitution.setOnClickListener(v -> mViewModel.decrementConstitution()); | ||||||
|  |  | ||||||
|  |         mViewModel.getIntelligence().observe(getViewLifecycleOwner(), value -> mHolder.intelligence.setText(String.valueOf(value))); | ||||||
|  |         mHolder.increaseIntelligence.setOnClickListener(v -> mViewModel.incrementIntelligence()); | ||||||
|  |         mHolder.decreaseIntelligence.setOnClickListener(v -> mViewModel.decrementIntelligence()); | ||||||
|  |  | ||||||
|  |         mViewModel.getWisdom().observe(getViewLifecycleOwner(), value -> mHolder.wisdom.setText(String.valueOf(value))); | ||||||
|  |         mHolder.increaseWisdom.setOnClickListener(v -> mViewModel.incrementWisdom()); | ||||||
|  |         mHolder.decreaseWisdom.setOnClickListener(v -> mViewModel.decrementWisdom()); | ||||||
|  |  | ||||||
|  |         mViewModel.getCharisma().observe(getViewLifecycleOwner(), value -> mHolder.charisma.setText(String.valueOf(value))); | ||||||
|  |         mHolder.increaseCharisma.setOnClickListener(v -> mViewModel.incrementCharisma()); | ||||||
|  |         mHolder.decreaseCharisma.setOnClickListener(v -> mViewModel.decrementCharisma()); | ||||||
|  |  | ||||||
|  |         return root; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     private static class ViewHolder { | ||||||
|  |         TextView strength; | ||||||
|  |         Button decreaseStrength; | ||||||
|  |         Button increaseStrength; | ||||||
|  |         TextView dexterity; | ||||||
|  |         Button increaseDexterity; | ||||||
|  |         Button decreaseDexterity; | ||||||
|  |         TextView constitution; | ||||||
|  |         Button increaseConstitution; | ||||||
|  |         Button decreaseConstitution; | ||||||
|  |         TextView intelligence; | ||||||
|  |         Button increaseIntelligence; | ||||||
|  |         Button decreaseIntelligence; | ||||||
|  |         TextView wisdom; | ||||||
|  |         Button increaseWisdom; | ||||||
|  |         Button decreaseWisdom; | ||||||
|  |         TextView charisma; | ||||||
|  |         Button increaseCharisma; | ||||||
|  |         Button decreaseCharisma; | ||||||
|  |  | ||||||
|  |         ViewHolder(View root) { | ||||||
|  |             strength = root.findViewById(R.id.strength); | ||||||
|  |             increaseStrength = root.findViewById(R.id.strength_increment); | ||||||
|  |             decreaseStrength = root.findViewById(R.id.strength_decrement); | ||||||
|  |             dexterity = root.findViewById(R.id.dexterity); | ||||||
|  |             increaseDexterity = root.findViewById(R.id.dexterity_increment); | ||||||
|  |             decreaseDexterity = root.findViewById(R.id.dexterity_decrement); | ||||||
|  |             constitution = root.findViewById(R.id.constitution); | ||||||
|  |             increaseConstitution = root.findViewById(R.id.constitution_increment); | ||||||
|  |             decreaseConstitution = root.findViewById(R.id.constitution_decrement); | ||||||
|  |             intelligence = root.findViewById(R.id.intelligence); | ||||||
|  |             increaseIntelligence = root.findViewById(R.id.intelligence_increment); | ||||||
|  |             decreaseIntelligence = root.findViewById(R.id.intelligence_decrement); | ||||||
|  |             wisdom = root.findViewById(R.id.wisdom); | ||||||
|  |             increaseWisdom = root.findViewById(R.id.wisdom_increment); | ||||||
|  |             decreaseWisdom = root.findViewById(R.id.wisdom_decrement); | ||||||
|  |             charisma = root.findViewById(R.id.charisma); | ||||||
|  |             increaseCharisma = root.findViewById(R.id.charisma_increment); | ||||||
|  |             decreaseCharisma = root.findViewById(R.id.charisma_decrement); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
| @@ -102,6 +102,13 @@ public class EditMonsterFragment extends MCFragment { | |||||||
|             Navigation.findNavController(view).navigate(action); |             Navigation.findNavController(view).navigate(action); | ||||||
|         }); |         }); | ||||||
|  |  | ||||||
|  |         mHolder.abilityScoresButton.setOnClickListener(v -> { | ||||||
|  |             NavDirections action = EditMonsterFragmentDirections.actionEditMonsterFragmentToEditAbilityScoresFragment(); | ||||||
|  |             View view = getView(); | ||||||
|  |             assert view != null; | ||||||
|  |             Navigation.findNavController(view).navigate(action); | ||||||
|  |         }); | ||||||
|  |  | ||||||
|         requireActivity().getOnBackPressedDispatcher().addCallback(getViewLifecycleOwner(), new OnBackPressedCallback(true) { |         requireActivity().getOnBackPressedDispatcher().addCallback(getViewLifecycleOwner(), new OnBackPressedCallback(true) { | ||||||
|             @Override |             @Override | ||||||
|             public void handleOnBackPressed() { |             public void handleOnBackPressed() { | ||||||
| @@ -154,11 +161,13 @@ public class EditMonsterFragment extends MCFragment { | |||||||
|         TextView basicInfoButton; |         TextView basicInfoButton; | ||||||
|         TextView armorButton; |         TextView armorButton; | ||||||
|         TextView speedButton; |         TextView speedButton; | ||||||
|  |         TextView abilityScoresButton; | ||||||
|  |  | ||||||
|         ViewHolder(View root) { |         ViewHolder(View root) { | ||||||
|             basicInfoButton = root.findViewById(R.id.basicInfo); |             basicInfoButton = root.findViewById(R.id.basicInfo); | ||||||
|             armorButton = root.findViewById(R.id.armor); |             armorButton = root.findViewById(R.id.armor); | ||||||
|             speedButton = root.findViewById(R.id.speed); |             speedButton = root.findViewById(R.id.speed); | ||||||
|  |             abilityScoresButton = root.findViewById(R.id.abilityScores); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -32,6 +32,12 @@ public class EditMonsterViewModel extends ViewModel { | |||||||
|     private final MutableLiveData<Integer> mClimbSpeed; |     private final MutableLiveData<Integer> mClimbSpeed; | ||||||
|     private final MutableLiveData<Integer> mFlySpeed; |     private final MutableLiveData<Integer> mFlySpeed; | ||||||
|     private final MutableLiveData<Integer> mSwimSpeed; |     private final MutableLiveData<Integer> mSwimSpeed; | ||||||
|  |     private final MutableLiveData<Integer> mStrength; | ||||||
|  |     private final MutableLiveData<Integer> mDexterity; | ||||||
|  |     private final MutableLiveData<Integer> mConstitution; | ||||||
|  |     private final MutableLiveData<Integer> mIntelligence; | ||||||
|  |     private final MutableLiveData<Integer> mWisdom; | ||||||
|  |     private final MutableLiveData<Integer> mCharisma; | ||||||
|     private final MutableLiveData<String> mName; |     private final MutableLiveData<String> mName; | ||||||
|     private final MutableLiveData<String> mErrorMessage; |     private final MutableLiveData<String> mErrorMessage; | ||||||
|     private final MutableLiveData<String> mSize; |     private final MutableLiveData<String> mSize; | ||||||
| @@ -69,6 +75,13 @@ public class EditMonsterViewModel extends ViewModel { | |||||||
|         mCanHover = new MutableLiveData<>(false); |         mCanHover = new MutableLiveData<>(false); | ||||||
|         mHasCustomSpeed = new MutableLiveData<>(false); |         mHasCustomSpeed = new MutableLiveData<>(false); | ||||||
|         mCustomSpeed = new MutableLiveData<>(""); |         mCustomSpeed = new MutableLiveData<>(""); | ||||||
|  |         mStrength = new MutableLiveData<>(10); | ||||||
|  |         mDexterity = new MutableLiveData<>(10); | ||||||
|  |         mConstitution = new MutableLiveData<>(10); | ||||||
|  |         mIntelligence = new MutableLiveData<>(10); | ||||||
|  |         mWisdom = new MutableLiveData<>(10); | ||||||
|  |         mCharisma = new MutableLiveData<>(10); | ||||||
|  |  | ||||||
|         // TODO: consider initializing this to true so all new monsters need saving |         // TODO: consider initializing this to true so all new monsters need saving | ||||||
|         mHasChanges = new MutableLiveData<>(false); |         mHasChanges = new MutableLiveData<>(false); | ||||||
|     } |     } | ||||||
| @@ -97,6 +110,12 @@ public class EditMonsterViewModel extends ViewModel { | |||||||
|         mCanHover.setValue(monster.canHover); |         mCanHover.setValue(monster.canHover); | ||||||
|         mHasCustomSpeed.setValue(monster.hasCustomSpeed); |         mHasCustomSpeed.setValue(monster.hasCustomSpeed); | ||||||
|         mCustomSpeed.setValue(monster.customSpeedDescription); |         mCustomSpeed.setValue(monster.customSpeedDescription); | ||||||
|  |         mStrength.setValue(monster.strengthScore); | ||||||
|  |         mDexterity.setValue(monster.dexterityScore); | ||||||
|  |         mConstitution.setValue(monster.constitutionScore); | ||||||
|  |         mIntelligence.setValue(monster.intelligenceScore); | ||||||
|  |         mWisdom.setValue(monster.wisdomScore); | ||||||
|  |         mCharisma.setValue(monster.charismaScore); | ||||||
|  |  | ||||||
|         mHasChanges.setValue(false); |         mHasChanges.setValue(false); | ||||||
|     } |     } | ||||||
| @@ -336,7 +355,6 @@ public class EditMonsterViewModel extends ViewModel { | |||||||
|         if (!Objects.equals(mWalkSpeed.getValue(), walkSpeed)) { |         if (!Objects.equals(mWalkSpeed.getValue(), walkSpeed)) { | ||||||
|             mWalkSpeed.setValue(walkSpeed); |             mWalkSpeed.setValue(walkSpeed); | ||||||
|             mHasChanges.setValue(true); |             mHasChanges.setValue(true); | ||||||
|             Logger.logDebug(String.format("Setting walk speed to %d ft.", walkSpeed)); |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -457,6 +475,119 @@ public class EditMonsterViewModel extends ViewModel { | |||||||
|         setSwimSpeed(mSwimSpeed.getValue() - 5); |         setSwimSpeed(mSwimSpeed.getValue() - 5); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     public LiveData<Integer> getStrength() { | ||||||
|  |         return mStrength; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setStrength(int strength) { | ||||||
|  |         if (!Objects.equals(mStrength.getValue(), strength)) { | ||||||
|  |             mStrength.setValue(strength); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void incrementStrength() { | ||||||
|  |         setStrength(mStrength.getValue() + 1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void decrementStrength() { | ||||||
|  |         setStrength(mStrength.getValue() - 1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<Integer> getDexterity() { | ||||||
|  |         return mDexterity; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setDexterity(int dexterity) { | ||||||
|  |         if (!Objects.equals(mDexterity.getValue(), dexterity)) { | ||||||
|  |             mDexterity.setValue(dexterity); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void incrementDexterity() { | ||||||
|  |         setDexterity(mDexterity.getValue() + 1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void decrementDexterity() { | ||||||
|  |         setDexterity(mDexterity.getValue() - 1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<Integer> getConstitution() { | ||||||
|  |         return mConstitution; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setConstitution(int constitution) { | ||||||
|  |         if (!Objects.equals(mConstitution.getValue(), constitution)) { | ||||||
|  |             mConstitution.setValue(constitution); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void incrementConstitution() { | ||||||
|  |         setConstitution(mConstitution.getValue() + 1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void decrementConstitution() { | ||||||
|  |         setConstitution(mConstitution.getValue() - 1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<Integer> getIntelligence() { | ||||||
|  |         return mIntelligence; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setIntelligence(int intelligence) { | ||||||
|  |         if (!Objects.equals(mIntelligence.getValue(), intelligence)) { | ||||||
|  |             mIntelligence.setValue(intelligence); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void incrementIntelligence() { | ||||||
|  |         setIntelligence(mIntelligence.getValue() + 1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void decrementIntelligence() { | ||||||
|  |         setIntelligence(mIntelligence.getValue() - 1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<Integer> getWisdom() { | ||||||
|  |         return mWisdom; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setWisdom(int wisdom) { | ||||||
|  |         if (!Objects.equals(mWisdom.getValue(), wisdom)) { | ||||||
|  |             mWisdom.setValue(wisdom); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void incrementWisdom() { | ||||||
|  |         setWisdom(mWisdom.getValue() + 1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void decrementWisdom() { | ||||||
|  |         setWisdom(mWisdom.getValue() - 1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<Integer> getCharisma() { | ||||||
|  |         return mCharisma; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setCharisma(int charisma) { | ||||||
|  |         if (!Objects.equals(mCharisma.getValue(), charisma)) { | ||||||
|  |             mCharisma.setValue(charisma); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void incrementCharisma() { | ||||||
|  |         setCharisma(mCharisma.getValue() + 1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void decrementCharisma() { | ||||||
|  |         setCharisma(mCharisma.getValue() - 1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     public Monster buildMonster() { |     public Monster buildMonster() { | ||||||
|         Monster monster = new Monster(); |         Monster monster = new Monster(); | ||||||
| @@ -482,6 +613,12 @@ public class EditMonsterViewModel extends ViewModel { | |||||||
|         monster.canHover = mCanHover.getValue(); |         monster.canHover = mCanHover.getValue(); | ||||||
|         monster.hasCustomSpeed = mHasCustomSpeed.getValue(); |         monster.hasCustomSpeed = mHasCustomSpeed.getValue(); | ||||||
|         monster.customSpeedDescription = mCustomSpeed.getValue(); |         monster.customSpeedDescription = mCustomSpeed.getValue(); | ||||||
|  |         monster.strengthScore = mStrength.getValue(); | ||||||
|  |         monster.dexterityScore = mDexterity.getValue(); | ||||||
|  |         monster.constitutionScore = mConstitution.getValue(); | ||||||
|  |         monster.intelligenceScore = mIntelligence.getValue(); | ||||||
|  |         monster.wisdomScore = mWisdom.getValue(); | ||||||
|  |         monster.charismaScore = mCharisma.getValue(); | ||||||
|  |  | ||||||
|         return monster; |         return monster; | ||||||
|     } |     } | ||||||
|   | |||||||
							
								
								
									
										269
									
								
								app/src/main/res/layout/fragment_edit_ability_scores.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										269
									
								
								app/src/main/res/layout/fragment_edit_ability_scores.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,269 @@ | |||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <ScrollView 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.EditBasicInfoFragment"> | ||||||
|  |  | ||||||
|  |     <LinearLayout | ||||||
|  |         android:layout_width="match_parent" | ||||||
|  |         android:layout_height="wrap_content" | ||||||
|  |         android:orientation="vertical"> | ||||||
|  |  | ||||||
|  |         <androidx.constraintlayout.widget.ConstraintLayout | ||||||
|  |             android:layout_width="match_parent" | ||||||
|  |             android:layout_height="wrap_content" | ||||||
|  |             android:layout_margin="@dimen/text_margin"> | ||||||
|  |  | ||||||
|  |             <TextView | ||||||
|  |                 android:id="@+id/strength" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" | ||||||
|  |                 tools:text="20 ft." /> | ||||||
|  |  | ||||||
|  |             <TextView | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_strength" | ||||||
|  |                 android:textAppearance="?attr/textAppearanceSubtitle1" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |             <Button | ||||||
|  |                 android:id="@+id/strength_decrement" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_decrement_field" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toStartOf="@id/strength_increment" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |             <Button | ||||||
|  |                 android:id="@+id/strength_increment" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_increment_field" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |         </androidx.constraintlayout.widget.ConstraintLayout> | ||||||
|  |  | ||||||
|  |         <androidx.constraintlayout.widget.ConstraintLayout | ||||||
|  |             android:layout_width="match_parent" | ||||||
|  |             android:layout_height="wrap_content" | ||||||
|  |             android:layout_margin="@dimen/text_margin"> | ||||||
|  |  | ||||||
|  |             <TextView | ||||||
|  |                 android:id="@+id/dexterity" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" | ||||||
|  |                 tools:text="20 ft." /> | ||||||
|  |  | ||||||
|  |             <TextView | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_dexterity" | ||||||
|  |                 android:textAppearance="?attr/textAppearanceSubtitle1" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |             <Button | ||||||
|  |                 android:id="@+id/dexterity_decrement" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_decrement_field" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toStartOf="@id/dexterity_increment" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |             <Button | ||||||
|  |                 android:id="@+id/dexterity_increment" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_increment_field" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |         </androidx.constraintlayout.widget.ConstraintLayout> | ||||||
|  |  | ||||||
|  |         <androidx.constraintlayout.widget.ConstraintLayout | ||||||
|  |             android:layout_width="match_parent" | ||||||
|  |             android:layout_height="wrap_content" | ||||||
|  |             android:layout_margin="@dimen/text_margin"> | ||||||
|  |  | ||||||
|  |             <TextView | ||||||
|  |                 android:id="@+id/constitution" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" | ||||||
|  |                 tools:text="20 ft." /> | ||||||
|  |  | ||||||
|  |             <TextView | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_constitution" | ||||||
|  |                 android:textAppearance="?attr/textAppearanceSubtitle1" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |             <Button | ||||||
|  |                 android:id="@+id/constitution_decrement" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_decrement_field" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toStartOf="@id/constitution_increment" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |             <Button | ||||||
|  |                 android:id="@+id/constitution_increment" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_increment_field" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |         </androidx.constraintlayout.widget.ConstraintLayout> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |         <androidx.constraintlayout.widget.ConstraintLayout | ||||||
|  |             android:layout_width="match_parent" | ||||||
|  |             android:layout_height="wrap_content" | ||||||
|  |             android:layout_margin="@dimen/text_margin"> | ||||||
|  |  | ||||||
|  |             <TextView | ||||||
|  |                 android:id="@+id/intelligence" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" | ||||||
|  |                 tools:text="20 ft." /> | ||||||
|  |  | ||||||
|  |             <TextView | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_intelligence" | ||||||
|  |                 android:textAppearance="?attr/textAppearanceSubtitle1" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |             <Button | ||||||
|  |                 android:id="@+id/intelligence_decrement" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_decrement_field" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toStartOf="@id/intelligence_increment" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |             <Button | ||||||
|  |                 android:id="@+id/intelligence_increment" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_increment_field" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |         </androidx.constraintlayout.widget.ConstraintLayout> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |         <androidx.constraintlayout.widget.ConstraintLayout | ||||||
|  |             android:layout_width="match_parent" | ||||||
|  |             android:layout_height="wrap_content" | ||||||
|  |             android:layout_margin="@dimen/text_margin"> | ||||||
|  |  | ||||||
|  |             <TextView | ||||||
|  |                 android:id="@+id/wisdom" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" | ||||||
|  |                 tools:text="20 ft." /> | ||||||
|  |  | ||||||
|  |             <TextView | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_wisdom" | ||||||
|  |                 android:textAppearance="?attr/textAppearanceSubtitle1" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |             <Button | ||||||
|  |                 android:id="@+id/wisdom_decrement" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_decrement_field" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toStartOf="@id/wisdom_increment" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |             <Button | ||||||
|  |                 android:id="@+id/wisdom_increment" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_increment_field" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |         </androidx.constraintlayout.widget.ConstraintLayout> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |         <androidx.constraintlayout.widget.ConstraintLayout | ||||||
|  |             android:layout_width="match_parent" | ||||||
|  |             android:layout_height="wrap_content" | ||||||
|  |             android:layout_margin="@dimen/text_margin"> | ||||||
|  |  | ||||||
|  |             <TextView | ||||||
|  |                 android:id="@+id/charisma" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" | ||||||
|  |                 tools:text="20 ft." /> | ||||||
|  |  | ||||||
|  |             <TextView | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_charisma" | ||||||
|  |                 android:textAppearance="?attr/textAppearanceSubtitle1" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |             <Button | ||||||
|  |                 android:id="@+id/charisma_decrement" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_decrement_field" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toStartOf="@id/charisma_increment" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |             <Button | ||||||
|  |                 android:id="@+id/charisma_increment" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:text="@string/label_increment_field" | ||||||
|  |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |         </androidx.constraintlayout.widget.ConstraintLayout> | ||||||
|  |     </LinearLayout> | ||||||
|  | </ScrollView> | ||||||
| @@ -81,6 +81,9 @@ | |||||||
|             <action |             <action | ||||||
|                 android:id="@+id/action_editMonsterFragment_to_editSpeedFragment" |                 android:id="@+id/action_editMonsterFragment_to_editSpeedFragment" | ||||||
|                 app:destination="@id/editSpeedFragment" /> |                 app:destination="@id/editSpeedFragment" /> | ||||||
|  |             <action | ||||||
|  |                 android:id="@+id/action_editMonsterFragment_to_editAbilityScoresFragment" | ||||||
|  |                 app:destination="@id/editAbilityScoresFragment" /> | ||||||
|         </fragment> |         </fragment> | ||||||
|         <fragment |         <fragment | ||||||
|             android:id="@+id/editBasicInfoFragment" |             android:id="@+id/editBasicInfoFragment" | ||||||
| @@ -97,6 +100,10 @@ | |||||||
|             android:name="com.majinnaibu.monstercards.ui.editmonster.EditSpeedFragment" |             android:name="com.majinnaibu.monstercards.ui.editmonster.EditSpeedFragment" | ||||||
|             android:label="fragment_edit_speed" |             android:label="fragment_edit_speed" | ||||||
|             tools:layout="@layout/fragment_edit_speed" /> |             tools:layout="@layout/fragment_edit_speed" /> | ||||||
|  |         <fragment | ||||||
|  |             android:id="@+id/editAbilityScoresFragment" | ||||||
|  |             android:name="com.majinnaibu.monstercards.ui.editmonster.EditAbilityScoresFragment" | ||||||
|  |             android:label="EditAbilityScoresFragment" /> | ||||||
|     </navigation> |     </navigation> | ||||||
|  |  | ||||||
| </navigation> | </navigation> | ||||||
| @@ -19,8 +19,10 @@ | |||||||
|     <string name="label_burrow_speed">Burrow Speed</string> |     <string name="label_burrow_speed">Burrow Speed</string> | ||||||
|     <string name="label_can_hover">Can Hover</string> |     <string name="label_can_hover">Can Hover</string> | ||||||
|     <string name="label_challenge_rating">Challenge Rating</string> |     <string name="label_challenge_rating">Challenge Rating</string> | ||||||
|  |     <string name="label_charisma">Charisma</string> | ||||||
|     <string name="label_climb_speed">Climb Speed</string> |     <string name="label_climb_speed">Climb Speed</string> | ||||||
|     <string name="label_condition_immunities">Condition Immunities</string> |     <string name="label_condition_immunities">Condition Immunities</string> | ||||||
|  |     <string name="label_constitution">Constitution</string> | ||||||
|     <string name="label_custom_armor">Custom Armor</string> |     <string name="label_custom_armor">Custom Armor</string> | ||||||
|     <string name="label_custom_hp">Custom HP</string> |     <string name="label_custom_hp">Custom HP</string> | ||||||
|     <string name="label_custom_speed">Custom Speed</string> |     <string name="label_custom_speed">Custom Speed</string> | ||||||
| @@ -28,11 +30,13 @@ | |||||||
|     <string name="label_damage_resistances">Damage Resistances</string> |     <string name="label_damage_resistances">Damage Resistances</string> | ||||||
|     <string name="label_damage_vulnerabilities">Damage Vulnerabilities</string> |     <string name="label_damage_vulnerabilities">Damage Vulnerabilities</string> | ||||||
|     <string name="label_decrement_field">-</string> |     <string name="label_decrement_field">-</string> | ||||||
|  |     <string name="label_dexterity">Dexterity</string> | ||||||
|     <string name="label_has_custom_hp">Has Custom HP</string> |     <string name="label_has_custom_hp">Has Custom HP</string> | ||||||
|     <string name="label_has_custom_speed">Has Custom Speed</string> |     <string name="label_has_custom_speed">Has Custom Speed</string> | ||||||
|     <string name="label_has_a_shield">Has a Shield</string> |     <string name="label_has_a_shield">Has a Shield</string> | ||||||
|     <string name="label_hit_dice">Hit Dice</string> |     <string name="label_hit_dice">Hit Dice</string> | ||||||
|     <string name="label_increment_field">+</string> |     <string name="label_increment_field">+</string> | ||||||
|  |     <string name="label_intelligence">Intelligence</string> | ||||||
|     <string name="label_lair_actions">Lair Actions</string> |     <string name="label_lair_actions">Lair Actions</string> | ||||||
|     <string name="label_languages">Languages</string> |     <string name="label_languages">Languages</string> | ||||||
|     <string name="label_legendary_actions">Legendary Actions</string> |     <string name="label_legendary_actions">Legendary Actions</string> | ||||||
| @@ -47,8 +51,10 @@ | |||||||
|     <string name="label_size">Size</string> |     <string name="label_size">Size</string> | ||||||
|     <string name="label_skills">Skills</string> |     <string name="label_skills">Skills</string> | ||||||
|     <string name="label_speed">Speed</string> |     <string name="label_speed">Speed</string> | ||||||
|  |     <string name="label_strength">Strength</string> | ||||||
|     <string name="label_subtype">Subtype</string> |     <string name="label_subtype">Subtype</string> | ||||||
|     <string name="label_type">Type</string> |     <string name="label_type">Type</string> | ||||||
|  |     <string name="label_wisdom">Wisdom</string> | ||||||
|     <string name="section_divider">section divider</string> |     <string name="section_divider">section divider</string> | ||||||
|     <string name="snackbar_failed_to_create_monster">Failed to create monster</string> |     <string name="snackbar_failed_to_create_monster">Failed to create monster</string> | ||||||
|     <string name="snackbar_monster_created">%1$s created</string> |     <string name="snackbar_monster_created">%1$s created</string> | ||||||
| @@ -59,4 +65,5 @@ | |||||||
|     <string name="title_library">Library</string> |     <string name="title_library">Library</string> | ||||||
|     <string name="title_search">Search</string> |     <string name="title_search">Search</string> | ||||||
|     <string name="wisdom_abbreviation">WIS</string> |     <string name="wisdom_abbreviation">WIS</string> | ||||||
|  |  | ||||||
| </resources> | </resources> | ||||||
		Reference in New Issue
	
	Block a user