Adds missed change tracking to EditMonsterViewModel.
This commit is contained in:
		| @@ -287,9 +287,11 @@ public class EditMonsterViewModel extends ViewModel { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     public void setHasShield(boolean hasShield) { |     public void setHasShield(boolean hasShield) { | ||||||
|  |         if (!Objects.equals(mHasShield.getValue(), hasShield)) { | ||||||
|             mHasShield.setValue(hasShield); |             mHasShield.setValue(hasShield); | ||||||
|             mHasChanges.setValue(true); |             mHasChanges.setValue(true); | ||||||
|         } |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|     public boolean getHasShieldValueAsBoolean() { |     public boolean getHasShieldValueAsBoolean() { | ||||||
|         return mHasShield.getValue(); |         return mHasShield.getValue(); | ||||||
| @@ -300,9 +302,11 @@ public class EditMonsterViewModel extends ViewModel { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     public void setShieldBonus(int shieldBonus) { |     public void setShieldBonus(int shieldBonus) { | ||||||
|  |         if (!Objects.equals(mShieldBonus.getValue(), shieldBonus)) { | ||||||
|             mShieldBonus.setValue(shieldBonus); |             mShieldBonus.setValue(shieldBonus); | ||||||
|             mHasChanges.setValue(true); |             mHasChanges.setValue(true); | ||||||
|         } |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|     public void setShieldBonus(String shieldBonus) { |     public void setShieldBonus(String shieldBonus) { | ||||||
|         Integer parsedValue = StringHelper.parseInt(shieldBonus); |         Integer parsedValue = StringHelper.parseInt(shieldBonus); | ||||||
| @@ -314,9 +318,11 @@ public class EditMonsterViewModel extends ViewModel { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     public void setCustomArmor(String customArmor) { |     public void setCustomArmor(String customArmor) { | ||||||
|  |         if (!Objects.equals(mCustomArmor.getValue(), customArmor)) { | ||||||
|             mCustomArmor.setValue(customArmor); |             mCustomArmor.setValue(customArmor); | ||||||
|             mHasChanges.setValue(true); |             mHasChanges.setValue(true); | ||||||
|         } |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|     public String getShieldBonusValueAsString() { |     public String getShieldBonusValueAsString() { | ||||||
|         return mShieldBonus.getValue().toString(); |         return mShieldBonus.getValue().toString(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user