Adds saving throws editor.
This commit is contained in:
		| @@ -109,6 +109,13 @@ public class EditMonsterFragment extends MCFragment { | |||||||
|             Navigation.findNavController(view).navigate(action); |             Navigation.findNavController(view).navigate(action); | ||||||
|         }); |         }); | ||||||
|  |  | ||||||
|  |         mHolder.savingThrows.setOnClickListener(v -> { | ||||||
|  |             NavDirections action = EditMonsterFragmentDirections.actionEditMonsterFragmentToEditSavingThrowsFragment(); | ||||||
|  |             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() { | ||||||
| @@ -162,12 +169,42 @@ public class EditMonsterFragment extends MCFragment { | |||||||
|         TextView armorButton; |         TextView armorButton; | ||||||
|         TextView speedButton; |         TextView speedButton; | ||||||
|         TextView abilityScoresButton; |         TextView abilityScoresButton; | ||||||
|  |         TextView savingThrows; | ||||||
|  |         TextView skills; | ||||||
|  |         TextView conditionImmunities; | ||||||
|  |         TextView damageImmunities; | ||||||
|  |         TextView damageResistances; | ||||||
|  |         TextView damageVulnerabilities; | ||||||
|  |         TextView senses; | ||||||
|  |         TextView languages; | ||||||
|  |         TextView challengeRating; | ||||||
|  |         TextView abilities; | ||||||
|  |         TextView actions; | ||||||
|  |         TextView reactions; | ||||||
|  |         TextView legendaryActions; | ||||||
|  |         TextView lairActions; | ||||||
|  |         TextView regionalActions; | ||||||
|  |  | ||||||
|         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); |             abilityScoresButton = root.findViewById(R.id.abilityScores); | ||||||
|  |             savingThrows = root.findViewById(R.id.savingThrows); | ||||||
|  |             skills = root.findViewById(R.id.skills); | ||||||
|  |             conditionImmunities = root.findViewById(R.id.conditionImmunities); | ||||||
|  |             damageImmunities = root.findViewById(R.id.damageImmunities); | ||||||
|  |             damageResistances = root.findViewById(R.id.damageResistances); | ||||||
|  |             damageVulnerabilities = root.findViewById(R.id.damageVulnerabilities); | ||||||
|  |             senses = root.findViewById(R.id.senses); | ||||||
|  |             languages = root.findViewById(R.id.languages); | ||||||
|  |             challengeRating = root.findViewById(R.id.challengeRating); | ||||||
|  |             abilities = root.findViewById(R.id.abilities); | ||||||
|  |             actions = root.findViewById(R.id.actions); | ||||||
|  |             reactions = root.findViewById(R.id.reactions); | ||||||
|  |             legendaryActions = root.findViewById(R.id.legendaryActions); | ||||||
|  |             lairActions = root.findViewById(R.id.lairActions); | ||||||
|  |             regionalActions = root.findViewById(R.id.regionalActions); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -5,7 +5,9 @@ import androidx.lifecycle.LiveData; | |||||||
| import androidx.lifecycle.MutableLiveData; | import androidx.lifecycle.MutableLiveData; | ||||||
| import androidx.lifecycle.ViewModel; | import androidx.lifecycle.ViewModel; | ||||||
|  |  | ||||||
|  | import com.majinnaibu.monstercards.data.enums.AdvantageType; | ||||||
| import com.majinnaibu.monstercards.data.enums.ArmorType; | import com.majinnaibu.monstercards.data.enums.ArmorType; | ||||||
|  | import com.majinnaibu.monstercards.data.enums.ProficiencyType; | ||||||
| import com.majinnaibu.monstercards.helpers.StringHelper; | import com.majinnaibu.monstercards.helpers.StringHelper; | ||||||
| import com.majinnaibu.monstercards.models.Monster; | import com.majinnaibu.monstercards.models.Monster; | ||||||
| import com.majinnaibu.monstercards.utils.Logger; | import com.majinnaibu.monstercards.utils.Logger; | ||||||
| @@ -24,6 +26,18 @@ public class EditMonsterViewModel extends ViewModel { | |||||||
|     private final MutableLiveData<Boolean> mCanHover; |     private final MutableLiveData<Boolean> mCanHover; | ||||||
|     private final MutableLiveData<Boolean> mHasCustomSpeed; |     private final MutableLiveData<Boolean> mHasCustomSpeed; | ||||||
|     private final MutableLiveData<ArmorType> mArmorType; |     private final MutableLiveData<ArmorType> mArmorType; | ||||||
|  |     private final MutableLiveData<ProficiencyType> mStrengthProficiency; | ||||||
|  |     private final MutableLiveData<AdvantageType> mStrengthAdvantage; | ||||||
|  |     private final MutableLiveData<ProficiencyType> mDexterityProficiency; | ||||||
|  |     private final MutableLiveData<AdvantageType> mDexterityAdvantage; | ||||||
|  |     private final MutableLiveData<ProficiencyType> mConstitutionProficiency; | ||||||
|  |     private final MutableLiveData<AdvantageType> mConstitutionAdvantage; | ||||||
|  |     private final MutableLiveData<ProficiencyType> mIntelligenceProficiency; | ||||||
|  |     private final MutableLiveData<AdvantageType> mIntelligenceAdvantage; | ||||||
|  |     private final MutableLiveData<ProficiencyType> mWisdomProficiency; | ||||||
|  |     private final MutableLiveData<AdvantageType> mWisdomAdvantage; | ||||||
|  |     private final MutableLiveData<ProficiencyType> mCharismaProficiency; | ||||||
|  |     private final MutableLiveData<AdvantageType> mCharismaAdvantage; | ||||||
|     private final MutableLiveData<Integer> mHitDice; |     private final MutableLiveData<Integer> mHitDice; | ||||||
|     private final MutableLiveData<Integer> mNaturalArmorBonus; |     private final MutableLiveData<Integer> mNaturalArmorBonus; | ||||||
|     private final MutableLiveData<Integer> mShieldBonus; |     private final MutableLiveData<Integer> mShieldBonus; | ||||||
| @@ -81,6 +95,18 @@ public class EditMonsterViewModel extends ViewModel { | |||||||
|         mIntelligence = new MutableLiveData<>(10); |         mIntelligence = new MutableLiveData<>(10); | ||||||
|         mWisdom = new MutableLiveData<>(10); |         mWisdom = new MutableLiveData<>(10); | ||||||
|         mCharisma = new MutableLiveData<>(10); |         mCharisma = new MutableLiveData<>(10); | ||||||
|  |         mStrengthProficiency = new MutableLiveData<>(ProficiencyType.NONE); | ||||||
|  |         mStrengthAdvantage = new MutableLiveData<>(AdvantageType.NONE); | ||||||
|  |         mDexterityProficiency = new MutableLiveData<>(ProficiencyType.NONE); | ||||||
|  |         mDexterityAdvantage = new MutableLiveData<>(AdvantageType.NONE); | ||||||
|  |         mConstitutionProficiency = new MutableLiveData<>(ProficiencyType.NONE); | ||||||
|  |         mConstitutionAdvantage = new MutableLiveData<>(AdvantageType.NONE); | ||||||
|  |         mIntelligenceProficiency = new MutableLiveData<>(ProficiencyType.NONE); | ||||||
|  |         mIntelligenceAdvantage = new MutableLiveData<>(AdvantageType.NONE); | ||||||
|  |         mWisdomProficiency = new MutableLiveData<>(ProficiencyType.NONE); | ||||||
|  |         mWisdomAdvantage = new MutableLiveData<>(AdvantageType.NONE); | ||||||
|  |         mCharismaProficiency = new MutableLiveData<>(ProficiencyType.NONE); | ||||||
|  |         mCharismaAdvantage = new MutableLiveData<>(AdvantageType.NONE); | ||||||
|  |  | ||||||
|         // 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); | ||||||
| @@ -116,6 +142,18 @@ public class EditMonsterViewModel extends ViewModel { | |||||||
|         mIntelligence.setValue(monster.intelligenceScore); |         mIntelligence.setValue(monster.intelligenceScore); | ||||||
|         mWisdom.setValue(monster.wisdomScore); |         mWisdom.setValue(monster.wisdomScore); | ||||||
|         mCharisma.setValue(monster.charismaScore); |         mCharisma.setValue(monster.charismaScore); | ||||||
|  |         mStrengthProficiency.setValue(monster.strengthSavingThrowProficiency); | ||||||
|  |         mStrengthAdvantage.setValue(monster.strengthSavingThrowAdvantage); | ||||||
|  |         mDexterityProficiency.setValue(monster.dexteritySavingThrowProficiency); | ||||||
|  |         mDexterityAdvantage.setValue(monster.dexteritySavingThrowAdvantage); | ||||||
|  |         mConstitutionProficiency.setValue(monster.constitutionSavingThrowProficiency); | ||||||
|  |         mConstitutionAdvantage.setValue(monster.constitutionSavingThrowAdvantage); | ||||||
|  |         mIntelligenceProficiency.setValue(monster.intelligenceSavingThrowProficiency); | ||||||
|  |         mIntelligenceAdvantage.setValue(monster.intelligenceSavingThrowAdvantage); | ||||||
|  |         mWisdomProficiency.setValue(monster.wisdomSavingThrowProficiency); | ||||||
|  |         mWisdomAdvantage.setValue(monster.wisdomSavingThrowAdvantage); | ||||||
|  |         mCharismaProficiency.setValue(monster.charismaSavingThrowProficiency); | ||||||
|  |         mCharismaAdvantage.setValue(monster.charismaSavingThrowAdvantage); | ||||||
|  |  | ||||||
|         mHasChanges.setValue(false); |         mHasChanges.setValue(false); | ||||||
|     } |     } | ||||||
| @@ -583,6 +621,138 @@ public class EditMonsterViewModel extends ViewModel { | |||||||
|         setCharisma(mCharisma.getValue() - 1); |         setCharisma(mCharisma.getValue() - 1); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     public LiveData<ProficiencyType> getStrengthProficiency() { | ||||||
|  |         return mStrengthProficiency; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setStrengthProficiency(ProficiencyType proficiency) { | ||||||
|  |         if (!Objects.equals(mStrengthProficiency.getValue(), proficiency)) { | ||||||
|  |             mStrengthProficiency.setValue(proficiency); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<AdvantageType> getStrengthAdvantage() { | ||||||
|  |         return mStrengthAdvantage; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setStrengthAdvantage(AdvantageType advantage) { | ||||||
|  |         if (!Objects.equals(mStrengthAdvantage.getValue(), advantage)) { | ||||||
|  |             mStrengthAdvantage.setValue(advantage); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<ProficiencyType> getDexterityProficiency() { | ||||||
|  |         return mDexterityProficiency; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setDexterityProficiency(ProficiencyType proficiency) { | ||||||
|  |         if (!Objects.equals(mDexterityProficiency.getValue(), proficiency)) { | ||||||
|  |             mDexterityProficiency.setValue(proficiency); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<AdvantageType> getDexterityAdvantage() { | ||||||
|  |         return mDexterityAdvantage; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setDexterityAdvantage(AdvantageType advantage) { | ||||||
|  |         if (!Objects.equals(mDexterityAdvantage.getValue(), advantage)) { | ||||||
|  |             mDexterityAdvantage.setValue(advantage); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<ProficiencyType> getConstitutionProficiency() { | ||||||
|  |         return mConstitutionProficiency; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setConstitutionProficiency(ProficiencyType proficiency) { | ||||||
|  |         if (!Objects.equals(mConstitutionProficiency.getValue(), proficiency)) { | ||||||
|  |             mConstitutionProficiency.setValue(proficiency); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<AdvantageType> getConstitutionAdvantage() { | ||||||
|  |         return mConstitutionAdvantage; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setConstitutionAdvantage(AdvantageType advantage) { | ||||||
|  |         if (!Objects.equals(mConstitutionAdvantage.getValue(), advantage)) { | ||||||
|  |             mConstitutionAdvantage.setValue(advantage); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<ProficiencyType> getIntelligenceProficiency() { | ||||||
|  |         return mIntelligenceProficiency; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setIntelligenceProficiency(ProficiencyType proficiency) { | ||||||
|  |         if (!Objects.equals(mIntelligenceProficiency.getValue(), proficiency)) { | ||||||
|  |             mIntelligenceProficiency.setValue(proficiency); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<AdvantageType> getIntelligenceAdvantage() { | ||||||
|  |         return mIntelligenceAdvantage; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setIntelligenceAdvantage(AdvantageType advantage) { | ||||||
|  |         if (!Objects.equals(mIntelligenceAdvantage.getValue(), advantage)) { | ||||||
|  |             mIntelligenceAdvantage.setValue(advantage); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<ProficiencyType> getWisdomProficiency() { | ||||||
|  |         return mWisdomProficiency; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setWisdomProficiency(ProficiencyType proficiency) { | ||||||
|  |         if (!Objects.equals(mWisdomProficiency.getValue(), proficiency)) { | ||||||
|  |             mWisdomProficiency.setValue(proficiency); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<AdvantageType> getWisdomAdvantage() { | ||||||
|  |         return mWisdomAdvantage; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setWisdomAdvantage(AdvantageType advantage) { | ||||||
|  |         if (!Objects.equals(mWisdomAdvantage.getValue(), advantage)) { | ||||||
|  |             mWisdomAdvantage.setValue(advantage); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<ProficiencyType> getCharismaProficiency() { | ||||||
|  |         return mCharismaProficiency; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setCharismaProficiency(ProficiencyType proficiency) { | ||||||
|  |         if (!Objects.equals(mCharismaProficiency.getValue(), proficiency)) { | ||||||
|  |             mCharismaProficiency.setValue(proficiency); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LiveData<AdvantageType> getCharismaAdvantage() { | ||||||
|  |         return mCharismaAdvantage; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setCharismaAdvantage(AdvantageType advantage) { | ||||||
|  |         if (!Objects.equals(mCharismaAdvantage.getValue(), advantage)) { | ||||||
|  |             mCharismaAdvantage.setValue(advantage); | ||||||
|  |             mHasChanges.setValue(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|     public Monster buildMonster() { |     public Monster buildMonster() { | ||||||
|         Monster monster = new Monster(); |         Monster monster = new Monster(); | ||||||
|  |  | ||||||
| @@ -613,6 +783,18 @@ public class EditMonsterViewModel extends ViewModel { | |||||||
|         monster.intelligenceScore = mIntelligence.getValue(); |         monster.intelligenceScore = mIntelligence.getValue(); | ||||||
|         monster.wisdomScore = mWisdom.getValue(); |         monster.wisdomScore = mWisdom.getValue(); | ||||||
|         monster.charismaScore = mCharisma.getValue(); |         monster.charismaScore = mCharisma.getValue(); | ||||||
|  |         monster.strengthSavingThrowAdvantage = mStrengthAdvantage.getValue(); | ||||||
|  |         monster.strengthSavingThrowProficiency = mStrengthProficiency.getValue(); | ||||||
|  |         monster.dexteritySavingThrowAdvantage = mDexterityAdvantage.getValue(); | ||||||
|  |         monster.dexteritySavingThrowProficiency = mDexterityProficiency.getValue(); | ||||||
|  |         monster.constitutionSavingThrowAdvantage = mConstitutionAdvantage.getValue(); | ||||||
|  |         monster.constitutionSavingThrowProficiency = mConstitutionProficiency.getValue(); | ||||||
|  |         monster.intelligenceSavingThrowAdvantage = mIntelligenceAdvantage.getValue(); | ||||||
|  |         monster.intelligenceSavingThrowProficiency = mIntelligenceProficiency.getValue(); | ||||||
|  |         monster.wisdomSavingThrowAdvantage = mWisdomAdvantage.getValue(); | ||||||
|  |         monster.wisdomSavingThrowProficiency = mWisdomProficiency.getValue(); | ||||||
|  |         monster.charismaSavingThrowAdvantage = mCharismaAdvantage.getValue(); | ||||||
|  |         monster.charismaSavingThrowProficiency = mCharismaProficiency.getValue(); | ||||||
|  |  | ||||||
|         return monster; |         return monster; | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ import android.view.LayoutInflater; | |||||||
| import android.view.View; | import android.view.View; | ||||||
| import android.view.ViewGroup; | import android.view.ViewGroup; | ||||||
|  |  | ||||||
| import androidx.annotation.NonNull; | import androidx.fragment.app.Fragment; | ||||||
| import androidx.lifecycle.ViewModelProvider; | import androidx.lifecycle.ViewModelProvider; | ||||||
| import androidx.navigation.NavBackStackEntry; | import androidx.navigation.NavBackStackEntry; | ||||||
| import androidx.navigation.NavController; | import androidx.navigation.NavController; | ||||||
| @@ -14,21 +14,22 @@ import androidx.navigation.Navigation; | |||||||
| import com.majinnaibu.monstercards.R; | import com.majinnaibu.monstercards.R; | ||||||
| import com.majinnaibu.monstercards.ui.components.AdvantagePicker; | import com.majinnaibu.monstercards.ui.components.AdvantagePicker; | ||||||
| import com.majinnaibu.monstercards.ui.components.ProficiencyPicker; | import com.majinnaibu.monstercards.ui.components.ProficiencyPicker; | ||||||
| import com.majinnaibu.monstercards.ui.shared.MCFragment; |  | ||||||
|  |  | ||||||
| public class EditSavingThrowsFragment extends MCFragment { | public class EditSavingThrowsFragment extends Fragment { | ||||||
|     private EditMonsterViewModel mViewModel; |     private EditMonsterViewModel mViewModel; | ||||||
|     private ViewHolder mViewHolder; |     private ViewHolder mViewHolder; | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, |     public View onCreateView(LayoutInflater inflater, ViewGroup container, | ||||||
|                              Bundle savedInstanceState) { |                              Bundle savedInstanceState) { | ||||||
|         NavController navController = Navigation.findNavController(requireActivity(), R.id.nav_host_fragment); |         NavController navController = Navigation.findNavController(requireActivity(), R.id.nav_host_fragment); | ||||||
|         NavBackStackEntry backStackEntry = navController.getBackStackEntry(R.id.edit_monster_navigation); |         NavBackStackEntry backStackEntry = navController.getBackStackEntry(R.id.edit_monster_navigation); | ||||||
|         mViewModel = new ViewModelProvider(backStackEntry).get(EditMonsterViewModel.class); |         mViewModel = new ViewModelProvider(backStackEntry).get(EditMonsterViewModel.class); | ||||||
|         View root = inflater.inflate(R.layout.fragment_edit_saving_throws, container, false); |  | ||||||
|         mViewHolder = new ViewHolder(root); |  | ||||||
|  |  | ||||||
|  |         // Inflate the layout for this fragment | ||||||
|  |         View root = inflater.inflate(R.layout.fragment_edit_saving_throws, container, false); | ||||||
|  |  | ||||||
|  |         mViewHolder = new ViewHolder(root); | ||||||
|         mViewHolder.strengthProficiency.setValue(mViewModel.getStrengthProficiency().getValue()); |         mViewHolder.strengthProficiency.setValue(mViewModel.getStrengthProficiency().getValue()); | ||||||
|         mViewHolder.strengthProficiency.setOnValueChangedListener(value -> mViewModel.setStrengthProficiency(value)); |         mViewHolder.strengthProficiency.setOnValueChangedListener(value -> mViewModel.setStrengthProficiency(value)); | ||||||
|         mViewHolder.strengthAdvantage.setValue(mViewModel.getStrengthAdvantage().getValue()); |         mViewHolder.strengthAdvantage.setValue(mViewModel.getStrengthAdvantage().getValue()); | ||||||
| @@ -76,7 +77,7 @@ public class EditSavingThrowsFragment extends MCFragment { | |||||||
|         AdvantagePicker charismaAdvantage; |         AdvantagePicker charismaAdvantage; | ||||||
|         ProficiencyPicker charismaProficiency; |         ProficiencyPicker charismaProficiency; | ||||||
|  |  | ||||||
|         ViewHolder(@NonNull View root) { |         ViewHolder(View root) { | ||||||
|             strengthAdvantage = root.findViewById(R.id.strengthAdvantage); |             strengthAdvantage = root.findViewById(R.id.strengthAdvantage); | ||||||
|             strengthProficiency = root.findViewById(R.id.strengthProficiency); |             strengthProficiency = root.findViewById(R.id.strengthProficiency); | ||||||
|             dexterityAdvantage = root.findViewById(R.id.dexterityAdvantage); |             dexterityAdvantage = root.findViewById(R.id.dexterityAdvantage); | ||||||
| @@ -91,4 +92,4 @@ public class EditSavingThrowsFragment extends MCFragment { | |||||||
|             charismaProficiency = root.findViewById(R.id.charismaProficiency); |             charismaProficiency = root.findViewById(R.id.charismaProficiency); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -3,7 +3,7 @@ | |||||||
|     xmlns:app="http://schemas.android.com/apk/res-auto" |     xmlns:app="http://schemas.android.com/apk/res-auto" | ||||||
|     xmlns:tools="http://schemas.android.com/tools" |     xmlns:tools="http://schemas.android.com/tools" | ||||||
|     android:layout_width="match_parent" |     android:layout_width="match_parent" | ||||||
|     android:layout_height="match_parent" |     android:layout_height="wrap_content" | ||||||
|     android:layout_margin="@dimen/text_margin" |     android:layout_margin="@dimen/text_margin" | ||||||
|     tools:context=".ui.components.Stepper"> |     tools:context=".ui.components.Stepper"> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -3,169 +3,109 @@ | |||||||
|     xmlns:tools="http://schemas.android.com/tools" |     xmlns:tools="http://schemas.android.com/tools" | ||||||
|     android:layout_width="match_parent" |     android:layout_width="match_parent" | ||||||
|     android:layout_height="match_parent" |     android:layout_height="match_parent" | ||||||
|  |  | ||||||
|     tools:context=".ui.editmonster.EditSavingThrowsFragment"> |     tools:context=".ui.editmonster.EditSavingThrowsFragment"> | ||||||
|  |  | ||||||
|     <LinearLayout |     <LinearLayout | ||||||
|         android:layout_width="match_parent" |         android:layout_width="match_parent" | ||||||
|         android:layout_height="wrap_content" |         android:layout_height="wrap_content" | ||||||
|         android:divider="?android:attr/dividerVertical" |         android:orientation="vertical"> | ||||||
|         android:orientation="vertical" |  | ||||||
|         android:showDividers="middle"> |  | ||||||
|  |  | ||||||
|         <LinearLayout |         <TextView | ||||||
|             android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|             android:layout_height="wrap_content" |             android:layout_height="wrap_content" | ||||||
|             android:layout_marginTop="@dimen/padding_large" |             android:layout_gravity="start" | ||||||
|             android:layout_marginBottom="@dimen/padding_normal" |             android:text="@string/label_strength" /> | ||||||
|             android:orientation="vertical"> |  | ||||||
|  |  | ||||||
|             <TextView |         <com.majinnaibu.monstercards.ui.components.ProficiencyPicker | ||||||
|                 android:layout_width="match_parent" |             android:id="@+id/strengthProficiency" | ||||||
|                 android:layout_height="wrap_content" |             android:layout_width="match_parent" | ||||||
|                 android:gravity="center_horizontal" |             android:layout_height="wrap_content" /> | ||||||
|                 android:text="@string/label_strength" |  | ||||||
|                 android:textAppearance="@android:style/TextAppearance.Material.Title" /> |  | ||||||
|  |  | ||||||
|             <com.majinnaibu.monstercards.ui.components.ProficiencyPicker |         <com.majinnaibu.monstercards.ui.components.AdvantagePicker | ||||||
|                 android:id="@+id/strengthProficiency" |             android:id="@+id/strengthAdvantage" | ||||||
|                 android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|                 android:layout_height="wrap_content" /> |             android:layout_height="wrap_content" /> | ||||||
|  |  | ||||||
|             <com.majinnaibu.monstercards.ui.components.AdvantagePicker |         <TextView | ||||||
|                 android:id="@+id/strengthAdvantage" |  | ||||||
|                 android:layout_width="match_parent" |  | ||||||
|                 android:layout_height="wrap_content" /> |  | ||||||
|         </LinearLayout> |  | ||||||
|  |  | ||||||
|         <LinearLayout |  | ||||||
|             android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|             android:layout_height="wrap_content" |             android:layout_height="wrap_content" | ||||||
|             android:layout_marginTop="@dimen/padding_large" |             android:layout_gravity="start" | ||||||
|             android:layout_marginBottom="@dimen/padding_normal" |             android:text="@string/label_dexterity" /> | ||||||
|             android:orientation="vertical"> |  | ||||||
|  |  | ||||||
|             <TextView |         <com.majinnaibu.monstercards.ui.components.ProficiencyPicker | ||||||
|                 android:layout_width="match_parent" |             android:id="@+id/dexterityProficiency" | ||||||
|                 android:layout_height="wrap_content" |             android:layout_width="match_parent" | ||||||
|                 android:gravity="center_horizontal" |             android:layout_height="wrap_content" /> | ||||||
|                 android:text="@string/label_dexterity" |  | ||||||
|                 android:textAppearance="@android:style/TextAppearance.Material.Title" /> |  | ||||||
|  |  | ||||||
|             <com.majinnaibu.monstercards.ui.components.ProficiencyPicker |         <com.majinnaibu.monstercards.ui.components.AdvantagePicker | ||||||
|                 android:id="@+id/dexterityProficiency" |             android:id="@+id/dexterityAdvantage" | ||||||
|                 android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|                 android:layout_height="wrap_content" /> |             android:layout_height="wrap_content" /> | ||||||
|  |  | ||||||
|             <com.majinnaibu.monstercards.ui.components.AdvantagePicker |         <TextView | ||||||
|                 android:id="@+id/dexterityAdvantage" |  | ||||||
|                 android:layout_width="match_parent" |  | ||||||
|                 android:layout_height="wrap_content" /> |  | ||||||
|  |  | ||||||
|         </LinearLayout> |  | ||||||
|  |  | ||||||
|         <LinearLayout |  | ||||||
|             android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|             android:layout_height="wrap_content" |             android:layout_height="wrap_content" | ||||||
|             android:layout_marginTop="@dimen/padding_large" |             android:layout_gravity="start" | ||||||
|             android:layout_marginBottom="@dimen/padding_normal" |             android:text="@string/label_constitution" /> | ||||||
|             android:orientation="vertical"> |  | ||||||
|  |  | ||||||
|             <TextView |         <com.majinnaibu.monstercards.ui.components.ProficiencyPicker | ||||||
|                 android:layout_width="match_parent" |             android:id="@+id/constitutionProficiency" | ||||||
|                 android:layout_height="wrap_content" |             android:layout_width="match_parent" | ||||||
|                 android:gravity="center_horizontal" |             android:layout_height="wrap_content" /> | ||||||
|                 android:text="@string/label_constitution" |  | ||||||
|                 android:textAppearance="@android:style/TextAppearance.Material.Title" /> |  | ||||||
|  |  | ||||||
|             <com.majinnaibu.monstercards.ui.components.ProficiencyPicker |         <com.majinnaibu.monstercards.ui.components.AdvantagePicker | ||||||
|                 android:id="@+id/constitutionProficiency" |             android:id="@+id/constitutionAdvantage" | ||||||
|                 android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|                 android:layout_height="wrap_content" /> |             android:layout_height="wrap_content" /> | ||||||
|  |  | ||||||
|             <com.majinnaibu.monstercards.ui.components.AdvantagePicker |         <TextView | ||||||
|                 android:id="@+id/constitutionAdvantage" |  | ||||||
|                 android:layout_width="match_parent" |  | ||||||
|                 android:layout_height="wrap_content" /> |  | ||||||
|  |  | ||||||
|         </LinearLayout> |  | ||||||
|  |  | ||||||
|         <LinearLayout |  | ||||||
|             android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|             android:layout_height="wrap_content" |             android:layout_height="wrap_content" | ||||||
|             android:layout_marginTop="@dimen/padding_large" |             android:layout_gravity="start" | ||||||
|             android:layout_marginBottom="@dimen/padding_normal" |             android:text="@string/label_intelligence" /> | ||||||
|             android:orientation="vertical"> |  | ||||||
|  |  | ||||||
|             <TextView |         <com.majinnaibu.monstercards.ui.components.ProficiencyPicker | ||||||
|                 android:layout_width="match_parent" |             android:id="@+id/intelligenceProficiency" | ||||||
|                 android:layout_height="wrap_content" |             android:layout_width="match_parent" | ||||||
|                 android:gravity="center_horizontal" |             android:layout_height="wrap_content" /> | ||||||
|                 android:text="@string/label_intelligence" |  | ||||||
|                 android:textAppearance="@android:style/TextAppearance.Material.Title" /> |  | ||||||
|  |  | ||||||
|             <com.majinnaibu.monstercards.ui.components.ProficiencyPicker |         <com.majinnaibu.monstercards.ui.components.AdvantagePicker | ||||||
|                 android:id="@+id/intelligenceProficiency" |             android:id="@+id/intelligenceAdvantage" | ||||||
|                 android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|                 android:layout_height="wrap_content" /> |             android:layout_height="wrap_content" /> | ||||||
|  |  | ||||||
|             <com.majinnaibu.monstercards.ui.components.AdvantagePicker |         <TextView | ||||||
|                 android:id="@+id/intelligenceAdvantage" |  | ||||||
|                 android:layout_width="match_parent" |  | ||||||
|                 android:layout_height="wrap_content" /> |  | ||||||
|  |  | ||||||
|         </LinearLayout> |  | ||||||
|  |  | ||||||
|         <LinearLayout |  | ||||||
|             android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|             android:layout_height="wrap_content" |             android:layout_height="wrap_content" | ||||||
|             android:layout_marginTop="@dimen/padding_large" |             android:layout_gravity="start" | ||||||
|             android:layout_marginBottom="@dimen/padding_normal" |             android:text="@string/label_wisdom" /> | ||||||
|             android:orientation="vertical"> |  | ||||||
|  |  | ||||||
|             <TextView |         <com.majinnaibu.monstercards.ui.components.ProficiencyPicker | ||||||
|                 android:layout_width="match_parent" |             android:id="@+id/wisdomProficiency" | ||||||
|                 android:layout_height="wrap_content" |             android:layout_width="match_parent" | ||||||
|                 android:gravity="center_horizontal" |             android:layout_height="wrap_content" /> | ||||||
|                 android:text="@string/label_wisdom" |  | ||||||
|                 android:textAppearance="@android:style/TextAppearance.Material.Title" /> |  | ||||||
|  |  | ||||||
|             <com.majinnaibu.monstercards.ui.components.ProficiencyPicker |         <com.majinnaibu.monstercards.ui.components.AdvantagePicker | ||||||
|                 android:id="@+id/wisdomProficiency" |             android:id="@+id/wisdomAdvantage" | ||||||
|                 android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|                 android:layout_height="wrap_content" /> |             android:layout_height="wrap_content" /> | ||||||
|  |  | ||||||
|             <com.majinnaibu.monstercards.ui.components.AdvantagePicker |         <TextView | ||||||
|                 android:id="@+id/wisdomAdvantage" |  | ||||||
|                 android:layout_width="match_parent" |  | ||||||
|                 android:layout_height="wrap_content" /> |  | ||||||
|  |  | ||||||
|         </LinearLayout> |  | ||||||
|  |  | ||||||
|         <LinearLayout |  | ||||||
|             android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|             android:layout_height="wrap_content" |             android:layout_height="wrap_content" | ||||||
|             android:layout_marginTop="@dimen/padding_large" |             android:layout_gravity="start" | ||||||
|             android:layout_marginBottom="@dimen/padding_normal" |             android:text="@string/label_charisma" /> | ||||||
|             android:orientation="vertical"> |  | ||||||
|  |  | ||||||
|             <TextView |         <com.majinnaibu.monstercards.ui.components.ProficiencyPicker | ||||||
|                 android:layout_width="match_parent" |             android:id="@+id/charismaProficiency" | ||||||
|                 android:layout_height="wrap_content" |             android:layout_width="match_parent" | ||||||
|                 android:gravity="center_horizontal" |             android:layout_height="wrap_content" /> | ||||||
|                 android:text="@string/label_charisma" |  | ||||||
|                 android:textAppearance="@android:style/TextAppearance.Material.Title" /> |  | ||||||
|  |  | ||||||
|             <com.majinnaibu.monstercards.ui.components.ProficiencyPicker |         <com.majinnaibu.monstercards.ui.components.AdvantagePicker | ||||||
|                 android:id="@+id/charismaProficiency" |             android:id="@+id/charismaAdvantage" | ||||||
|                 android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|                 android:layout_height="wrap_content" /> |             android:layout_height="wrap_content" /> | ||||||
|  |  | ||||||
|             <com.majinnaibu.monstercards.ui.components.AdvantagePicker |  | ||||||
|                 android:id="@+id/charismaAdvantage" |  | ||||||
|                 android:layout_width="match_parent" |  | ||||||
|                 android:layout_height="wrap_content" /> |  | ||||||
|         </LinearLayout> |  | ||||||
|     </LinearLayout> |     </LinearLayout> | ||||||
|  |  | ||||||
| </ScrollView> | </ScrollView> | ||||||
| @@ -84,6 +84,9 @@ | |||||||
|             <action |             <action | ||||||
|                 android:id="@+id/action_editMonsterFragment_to_editAbilityScoresFragment" |                 android:id="@+id/action_editMonsterFragment_to_editAbilityScoresFragment" | ||||||
|                 app:destination="@id/editAbilityScoresFragment" /> |                 app:destination="@id/editAbilityScoresFragment" /> | ||||||
|  |             <action | ||||||
|  |                 android:id="@+id/action_editMonsterFragment_to_editSavingThrowsFragment" | ||||||
|  |                 app:destination="@id/editSavingThrowsFragment" /> | ||||||
|         </fragment> |         </fragment> | ||||||
|         <fragment |         <fragment | ||||||
|             android:id="@+id/editBasicInfoFragment" |             android:id="@+id/editBasicInfoFragment" | ||||||
| @@ -104,6 +107,11 @@ | |||||||
|             android:id="@+id/editAbilityScoresFragment" |             android:id="@+id/editAbilityScoresFragment" | ||||||
|             android:name="com.majinnaibu.monstercards.ui.editmonster.EditAbilityScoresFragment" |             android:name="com.majinnaibu.monstercards.ui.editmonster.EditAbilityScoresFragment" | ||||||
|             android:label="EditAbilityScoresFragment" /> |             android:label="EditAbilityScoresFragment" /> | ||||||
|  |         <fragment | ||||||
|  |             android:id="@+id/editSavingThrowsFragment" | ||||||
|  |             android:name="com.majinnaibu.monstercards.ui.editmonster.EditSavingThrowsFragment" | ||||||
|  |             android:label="fragment_edit_saving_throws" | ||||||
|  |             tools:layout="@layout/fragment_edit_saving_throws" /> | ||||||
|     </navigation> |     </navigation> | ||||||
|  |  | ||||||
| </navigation> | </navigation> | ||||||
| @@ -35,6 +35,7 @@ | |||||||
|     <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_dexterity">Dexterity</string> | ||||||
|  |     <string name="label_fly_speed">Fly Speed</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> | ||||||
| @@ -61,6 +62,7 @@ | |||||||
|     <string name="label_speed">Speed</string> |     <string name="label_speed">Speed</string> | ||||||
|     <string name="label_strength">Strength</string> |     <string name="label_strength">Strength</string> | ||||||
|     <string name="label_subtype">Subtype</string> |     <string name="label_subtype">Subtype</string> | ||||||
|  |     <string name="label_swim_speed">Swim Speed</string> | ||||||
|     <string name="label_type">Type</string> |     <string name="label_type">Type</string> | ||||||
|     <string name="label_wisdom">Wisdom</string> |     <string name="label_wisdom">Wisdom</string> | ||||||
|     <string name="section_divider">section divider</string> |     <string name="section_divider">section divider</string> | ||||||
| @@ -73,7 +75,4 @@ | |||||||
|     <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> | ||||||
|     <string name="label_fly_speed">Fly Speed</string> |  | ||||||
|     <string name="label_swim_speed">Swim Speed</string> |  | ||||||
|  |  | ||||||
| </resources> | </resources> | ||||||
		Reference in New Issue
	
	Block a user
	 Tom Hicks
						Tom Hicks