Adds screen to edit ability scores.
This commit is contained in:
		| @@ -4,79 +4,99 @@ 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.annotation.NonNull; | ||||
| 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; | ||||
| import com.majinnaibu.monstercards.ui.components.Stepper; | ||||
| import com.majinnaibu.monstercards.ui.shared.MCFragment; | ||||
|  | ||||
| import java.util.Locale; | ||||
|  | ||||
| public class EditAbilityScoresFragment extends MCFragment { | ||||
|     private final String ABILITY_SCORE_FORMAT = "%d (%+d)"; | ||||
| public class EditAbilityScoresFragment extends Fragment { | ||||
|     private EditMonsterViewModel mViewModel; | ||||
|     private ViewHolder mHolder; | ||||
|  | ||||
|     private int getModifier(int value) { | ||||
|         return value / 2 - 5; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, | ||||
|     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.setValue(value)); | ||||
|         mHolder.strength.setOnValueChangeListener((newValue, oldValue) -> mViewModel.setStrength(newValue)); | ||||
|         mHolder.strength.setOnFormatValueCallback(value -> String.format(Locale.getDefault(), ABILITY_SCORE_FORMAT, value, getModifier(value))); | ||||
|         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.setValue(value)); | ||||
|         mHolder.dexterity.setOnValueChangeListener((newValue, oldValue) -> mViewModel.setDexterity(newValue)); | ||||
|         mHolder.dexterity.setOnFormatValueCallback(value -> String.format(Locale.getDefault(), ABILITY_SCORE_FORMAT, value, getModifier(value))); | ||||
|         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.setValue(value)); | ||||
|         mHolder.constitution.setOnValueChangeListener((newValue, oldValue) -> mViewModel.setConstitution(newValue)); | ||||
|         mHolder.constitution.setOnFormatValueCallback(value -> String.format(Locale.getDefault(), ABILITY_SCORE_FORMAT, value, getModifier(value))); | ||||
|         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.setValue(value)); | ||||
|         mHolder.intelligence.setOnValueChangeListener((newValue, oldValue) -> mViewModel.setIntelligence(newValue)); | ||||
|         mHolder.intelligence.setOnFormatValueCallback(value -> String.format(Locale.getDefault(), ABILITY_SCORE_FORMAT, value, getModifier(value))); | ||||
|         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.setValue(value)); | ||||
|         mHolder.wisdom.setOnValueChangeListener((newValue, oldValue) -> mViewModel.setWisdom(newValue)); | ||||
|         mHolder.wisdom.setOnFormatValueCallback(value -> String.format(Locale.getDefault(), ABILITY_SCORE_FORMAT, value, getModifier(value))); | ||||
|         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.setValue(value)); | ||||
|         mHolder.charisma.setOnValueChangeListener((newValue, oldValue) -> mViewModel.setCharisma(newValue)); | ||||
|         mHolder.charisma.setOnFormatValueCallback(value -> String.format(Locale.getDefault(), ABILITY_SCORE_FORMAT, value, getModifier(value))); | ||||
|         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 { | ||||
|         final Stepper strength; | ||||
|         final Stepper dexterity; | ||||
|         final Stepper constitution; | ||||
|         final Stepper intelligence; | ||||
|         final Stepper wisdom; | ||||
|         final Stepper charisma; | ||||
|         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(@NonNull View root) { | ||||
|         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); | ||||
|         }); | ||||
|  | ||||
|         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) { | ||||
|             @Override | ||||
|             public void handleOnBackPressed() { | ||||
| @@ -154,11 +161,13 @@ public class EditMonsterFragment extends MCFragment { | ||||
|         TextView basicInfoButton; | ||||
|         TextView armorButton; | ||||
|         TextView speedButton; | ||||
|         TextView abilityScoresButton; | ||||
|  | ||||
|         ViewHolder(View root) { | ||||
|             basicInfoButton = root.findViewById(R.id.basicInfo); | ||||
|             armorButton = root.findViewById(R.id.armor); | ||||
|             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> mFlySpeed; | ||||
|     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> mErrorMessage; | ||||
|     private final MutableLiveData<String> mSize; | ||||
| @@ -69,6 +75,13 @@ public class EditMonsterViewModel extends ViewModel { | ||||
|         mCanHover = new MutableLiveData<>(false); | ||||
|         mHasCustomSpeed = new MutableLiveData<>(false); | ||||
|         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 | ||||
|         mHasChanges = new MutableLiveData<>(false); | ||||
|     } | ||||
| @@ -97,6 +110,12 @@ public class EditMonsterViewModel extends ViewModel { | ||||
|         mCanHover.setValue(monster.canHover); | ||||
|         mHasCustomSpeed.setValue(monster.hasCustomSpeed); | ||||
|         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); | ||||
|     } | ||||
| @@ -330,7 +349,6 @@ public class EditMonsterViewModel extends ViewModel { | ||||
|         if (!Objects.equals(mWalkSpeed.getValue(), walkSpeed)) { | ||||
|             mWalkSpeed.setValue(walkSpeed); | ||||
|             mHasChanges.setValue(true); | ||||
|             Logger.logDebug(String.format("Setting walk speed to %d ft.", walkSpeed)); | ||||
|         } | ||||
|     } | ||||
|  | ||||
| @@ -451,6 +469,119 @@ public class EditMonsterViewModel extends ViewModel { | ||||
|         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() { | ||||
|         Monster monster = new Monster(); | ||||
| @@ -476,6 +607,12 @@ public class EditMonsterViewModel extends ViewModel { | ||||
|         monster.canHover = mCanHover.getValue(); | ||||
|         monster.hasCustomSpeed = mHasCustomSpeed.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; | ||||
|     } | ||||
|   | ||||
| @@ -11,64 +11,259 @@ | ||||
|         android:layout_height="wrap_content" | ||||
|         android:orientation="vertical"> | ||||
|  | ||||
|         <com.majinnaibu.monstercards.ui.components.Stepper | ||||
|             android:id="@+id/strength" | ||||
|         <androidx.constraintlayout.widget.ConstraintLayout | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_margin="@dimen/text_margin" | ||||
|             app:label="@string/label_strength" | ||||
|             app:maxValue="99" | ||||
|             app:minValue="1" | ||||
|             app:stepAmount="1" /> | ||||
|             android:layout_margin="@dimen/text_margin"> | ||||
|  | ||||
|         <com.majinnaibu.monstercards.ui.components.Stepper | ||||
|             android:id="@+id/dexterity" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_margin="@dimen/text_margin" | ||||
|             app:label="@string/label_dexterity" | ||||
|             app:maxValue="99" | ||||
|             app:minValue="1" | ||||
|             app:stepAmount="1" /> | ||||
|             <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." /> | ||||
|  | ||||
|         <com.majinnaibu.monstercards.ui.components.Stepper | ||||
|             android:id="@+id/constitution" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_margin="@dimen/text_margin" | ||||
|             app:label="@string/label_constitution" | ||||
|             app:maxValue="99" | ||||
|             app:minValue="1" | ||||
|             app:stepAmount="1" /> | ||||
|             <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" /> | ||||
|  | ||||
|         <com.majinnaibu.monstercards.ui.components.Stepper | ||||
|             android:id="@+id/intelligence" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_margin="@dimen/text_margin" | ||||
|             app:label="@string/label_intelligence" | ||||
|             app:maxValue="99" | ||||
|             app:minValue="1" | ||||
|             app:stepAmount="1" /> | ||||
|             <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" /> | ||||
|  | ||||
|         <com.majinnaibu.monstercards.ui.components.Stepper | ||||
|             android:id="@+id/wisdom" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_margin="@dimen/text_margin" | ||||
|             app:label="@string/label_wisdom" | ||||
|             app:maxValue="99" | ||||
|             app:minValue="1" | ||||
|             app:stepAmount="1" /> | ||||
|             <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" /> | ||||
|  | ||||
|         <com.majinnaibu.monstercards.ui.components.Stepper | ||||
|             android:id="@+id/charisma" | ||||
|         </androidx.constraintlayout.widget.ConstraintLayout> | ||||
|  | ||||
|         <androidx.constraintlayout.widget.ConstraintLayout | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_margin="@dimen/text_margin" | ||||
|             app:label="@string/label_charisma" | ||||
|             app:maxValue="99" | ||||
|             app:minValue="1" | ||||
|             app:stepAmount="1" /> | ||||
|             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 | ||||
|                 android:id="@+id/action_editMonsterFragment_to_editSpeedFragment" | ||||
|                 app:destination="@id/editSpeedFragment" /> | ||||
|             <action | ||||
|                 android:id="@+id/action_editMonsterFragment_to_editAbilityScoresFragment" | ||||
|                 app:destination="@id/editAbilityScoresFragment" /> | ||||
|         </fragment> | ||||
|         <fragment | ||||
|             android:id="@+id/editBasicInfoFragment" | ||||
| @@ -97,6 +100,10 @@ | ||||
|             android:name="com.majinnaibu.monstercards.ui.editmonster.EditSpeedFragment" | ||||
|             android:label="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> | ||||
| @@ -19,8 +19,10 @@ | ||||
|     <string name="label_burrow_speed">Burrow Speed</string> | ||||
|     <string name="label_can_hover">Can Hover</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_condition_immunities">Condition Immunities</string> | ||||
|     <string name="label_constitution">Constitution</string> | ||||
|     <string name="label_custom_armor">Custom Armor</string> | ||||
|     <string name="label_custom_hp">Custom HP</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_vulnerabilities">Damage Vulnerabilities</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_speed">Has Custom Speed</string> | ||||
|     <string name="label_has_a_shield">Has a Shield</string> | ||||
|     <string name="label_hit_dice">Hit Dice</string> | ||||
|     <string name="label_increment_field">+</string> | ||||
|     <string name="label_intelligence">Intelligence</string> | ||||
|     <string name="label_lair_actions">Lair Actions</string> | ||||
|     <string name="label_languages">Languages</string> | ||||
|     <string name="label_legendary_actions">Legendary Actions</string> | ||||
| @@ -47,8 +51,10 @@ | ||||
|     <string name="label_size">Size</string> | ||||
|     <string name="label_skills">Skills</string> | ||||
|     <string name="label_speed">Speed</string> | ||||
|     <string name="label_strength">Strength</string> | ||||
|     <string name="label_subtype">Subtype</string> | ||||
|     <string name="label_type">Type</string> | ||||
|     <string name="label_wisdom">Wisdom</string> | ||||
|     <string name="section_divider">section divider</string> | ||||
|     <string name="snackbar_failed_to_create_monster">Failed to create monster</string> | ||||
|     <string name="snackbar_monster_created">%1$s created</string> | ||||
| @@ -59,4 +65,5 @@ | ||||
|     <string name="title_library">Library</string> | ||||
|     <string name="title_search">Search</string> | ||||
|     <string name="wisdom_abbreviation">WIS</string> | ||||
|  | ||||
| </resources> | ||||
		Reference in New Issue
	
	Block a user
	 Tom Hicks
						Tom Hicks