Refactors monster detail to use a view holder and partially corrects Regional Actions to Regional Effects.

This commit is contained in:
Tom Hicks
2021-06-27 00:17:16 -07:00
parent d567609250
commit 918751dd3e
4 changed files with 328 additions and 140 deletions

View File

@@ -34,6 +34,7 @@ import java.util.UUID;
import io.reactivex.rxjava3.observers.DisposableSingleObserver; import io.reactivex.rxjava3.observers.DisposableSingleObserver;
public class MonsterDetailFragment extends MCFragment { public class MonsterDetailFragment extends MCFragment {
private ViewHolder mHolder;
private MonsterDetailViewModel monsterDetailViewModel; private MonsterDetailViewModel monsterDetailViewModel;
@@ -48,6 +49,8 @@ public class MonsterDetailFragment extends MCFragment {
monsterDetailViewModel = new ViewModelProvider(this).get(MonsterDetailViewModel.class); monsterDetailViewModel = new ViewModelProvider(this).get(MonsterDetailViewModel.class);
View root = inflater.inflate(R.layout.fragment_monster, container, false); View root = inflater.inflate(R.layout.fragment_monster, container, false);
mHolder = new ViewHolder(root);
repository.getMonster(monsterId).toObservable() repository.getMonster(monsterId).toObservable()
.firstOrError() .firstOrError()
.subscribe(new DisposableSingleObserver<Monster>() { .subscribe(new DisposableSingleObserver<Monster>() {
@@ -64,123 +67,82 @@ public class MonsterDetailFragment extends MCFragment {
} }
}); });
final TextView monsterName = root.findViewById(R.id.name); monsterDetailViewModel.getName().observe(getViewLifecycleOwner(), mHolder.name::setText);
monsterDetailViewModel.getName().observe(getViewLifecycleOwner(), monsterName::setText); monsterDetailViewModel.getMeta().observe(getViewLifecycleOwner(), mHolder.meta::setText);
monsterDetailViewModel.getArmorClass().observe(getViewLifecycleOwner(), armorText -> mHolder.armorClass.setText(Html.fromHtml("<b>Armor Class</b> " + armorText)));
final TextView monsterMeta = root.findViewById(R.id.meta); monsterDetailViewModel.getHitPoints().observe(getViewLifecycleOwner(), hitPoints -> mHolder.hitPoints.setText(Html.fromHtml("<b>Hit Points</b> " + hitPoints)));
monsterDetailViewModel.getMeta().observe(getViewLifecycleOwner(), monsterMeta::setText); monsterDetailViewModel.getSpeed().observe(getViewLifecycleOwner(), speed -> mHolder.speed.setText(Html.fromHtml("<b>Speed</b> " + speed)));
monsterDetailViewModel.getStrength().observe(getViewLifecycleOwner(), mHolder.strength::setText);
final TextView monsterArmorClass = root.findViewById(R.id.armor_class); monsterDetailViewModel.getDexterity().observe(getViewLifecycleOwner(), mHolder.dexterity::setText);
monsterDetailViewModel.getArmorClass().observe(getViewLifecycleOwner(), armorText -> monsterArmorClass.setText(Html.fromHtml("<b>Armor Class</b> " + armorText))); monsterDetailViewModel.getConstitution().observe(getViewLifecycleOwner(), mHolder.constitution::setText);
monsterDetailViewModel.getIntelligence().observe(getViewLifecycleOwner(), mHolder.intelligence::setText);
final TextView monsterHitPoints = root.findViewById(R.id.hit_points); monsterDetailViewModel.getWisdom().observe(getViewLifecycleOwner(), mHolder.wisdom::setText);
monsterDetailViewModel.getHitPoints().observe(getViewLifecycleOwner(), hitPoints -> monsterHitPoints.setText(Html.fromHtml("<b>Hit Points</b> " + hitPoints))); monsterDetailViewModel.getCharisma().observe(getViewLifecycleOwner(), mHolder.charisma::setText);
final TextView monsterSpeed = root.findViewById(R.id.speed);
monsterDetailViewModel.getSpeed().observe(getViewLifecycleOwner(), speed -> monsterSpeed.setText(Html.fromHtml("<b>Speed</b> " + speed)));
final TextView monsterStrength = root.findViewById(R.id.strength);
monsterDetailViewModel.getStrength().observe(getViewLifecycleOwner(), monsterStrength::setText);
final TextView monsterDexterity = root.findViewById(R.id.dexterity);
monsterDetailViewModel.getDexterity().observe(getViewLifecycleOwner(), monsterDexterity::setText);
final TextView monsterConstitution = root.findViewById(R.id.constitution);
monsterDetailViewModel.getConstitution().observe(getViewLifecycleOwner(), monsterConstitution::setText);
final TextView monsterIntelligence = root.findViewById(R.id.intelligence);
monsterDetailViewModel.getIntelligence().observe(getViewLifecycleOwner(), monsterIntelligence::setText);
final TextView monsterWisdom = root.findViewById(R.id.wisdom);
monsterDetailViewModel.getWisdom().observe(getViewLifecycleOwner(), monsterWisdom::setText);
final TextView monsterCharisma = root.findViewById(R.id.charisma);
monsterDetailViewModel.getCharisma().observe(getViewLifecycleOwner(), monsterCharisma::setText);
final TextView monsterSavingThrows = root.findViewById(R.id.saving_throws);
monsterDetailViewModel.getSavingThrows().observe(getViewLifecycleOwner(), savingThrows -> { monsterDetailViewModel.getSavingThrows().observe(getViewLifecycleOwner(), savingThrows -> {
if (StringHelper.isNullOrEmpty(savingThrows)) { if (StringHelper.isNullOrEmpty(savingThrows)) {
monsterSavingThrows.setVisibility(View.GONE); mHolder.savingThrows.setVisibility(View.GONE);
} else { } else {
monsterSavingThrows.setVisibility(View.VISIBLE); mHolder.savingThrows.setVisibility(View.VISIBLE);
} }
monsterSavingThrows.setText(Html.fromHtml("<b>Saving Throws</b> " + savingThrows)); mHolder.savingThrows.setText(Html.fromHtml("<b>Saving Throws</b> " + savingThrows));
}); });
final TextView monsterSkills = root.findViewById(R.id.skills);
monsterDetailViewModel.getSkills().observe(getViewLifecycleOwner(), skills -> { monsterDetailViewModel.getSkills().observe(getViewLifecycleOwner(), skills -> {
if (StringHelper.isNullOrEmpty(skills)) { if (StringHelper.isNullOrEmpty(skills)) {
monsterSkills.setVisibility(View.GONE); mHolder.skills.setVisibility(View.GONE);
} else { } else {
monsterSkills.setVisibility(View.VISIBLE); mHolder.skills.setVisibility(View.VISIBLE);
} }
monsterSkills.setText(Html.fromHtml("<b>Skills</b> " + skills)); mHolder.skills.setText(Html.fromHtml("<b>Skills</b> " + skills));
}); });
final TextView monsterDamageVulnerabilities = root.findViewById(R.id.damage_vulnerabilities);
monsterDetailViewModel.getDamageVulnerabilities().observe(getViewLifecycleOwner(), damageType -> { monsterDetailViewModel.getDamageVulnerabilities().observe(getViewLifecycleOwner(), damageType -> {
if (StringHelper.isNullOrEmpty(damageType)) { if (StringHelper.isNullOrEmpty(damageType)) {
monsterDamageVulnerabilities.setVisibility(View.GONE); mHolder.damageVulnerabilities.setVisibility(View.GONE);
} else { } else {
monsterDamageVulnerabilities.setVisibility(View.VISIBLE); mHolder.damageVulnerabilities.setVisibility(View.VISIBLE);
} }
monsterDamageVulnerabilities.setText(Html.fromHtml("<b>Damage Vulnerabilities</b> " + damageType)); mHolder.damageVulnerabilities.setText(Html.fromHtml("<b>Damage Vulnerabilities</b> " + damageType));
}); });
final TextView monsterDamageResistances = root.findViewById(R.id.damage_resistances);
monsterDetailViewModel.getDamageResistances().observe(getViewLifecycleOwner(), damageType -> { monsterDetailViewModel.getDamageResistances().observe(getViewLifecycleOwner(), damageType -> {
if (StringHelper.isNullOrEmpty(damageType)) { if (StringHelper.isNullOrEmpty(damageType)) {
monsterDamageResistances.setVisibility(View.GONE); mHolder.damageResistances.setVisibility(View.GONE);
} else { } else {
monsterDamageResistances.setVisibility(View.VISIBLE); mHolder.damageResistances.setVisibility(View.VISIBLE);
} }
monsterDamageResistances.setText(Html.fromHtml("<b>Damage Resistances</b> " + damageType)); mHolder.damageResistances.setText(Html.fromHtml("<b>Damage Resistances</b> " + damageType));
}); });
final TextView monsterDamageImmunities = root.findViewById(R.id.damage_immunities);
monsterDetailViewModel.getDamageImmunities().observe(getViewLifecycleOwner(), damageType -> { monsterDetailViewModel.getDamageImmunities().observe(getViewLifecycleOwner(), damageType -> {
if (StringHelper.isNullOrEmpty(damageType)) { if (StringHelper.isNullOrEmpty(damageType)) {
monsterDamageImmunities.setVisibility(View.GONE); mHolder.damageImmunities.setVisibility(View.GONE);
} else { } else {
monsterDamageImmunities.setVisibility(View.VISIBLE); mHolder.damageImmunities.setVisibility(View.VISIBLE);
} }
monsterDamageImmunities.setText(Html.fromHtml("<b>Damage Immunities</b> " + damageType)); mHolder.damageImmunities.setText(Html.fromHtml("<b>Damage Immunities</b> " + damageType));
}); });
final TextView monsterConditionImmunities = root.findViewById(R.id.condition_immunities);
monsterDetailViewModel.getConditionImmunities().observe(getViewLifecycleOwner(), conditionImmunities -> { monsterDetailViewModel.getConditionImmunities().observe(getViewLifecycleOwner(), conditionImmunities -> {
if (StringHelper.isNullOrEmpty(conditionImmunities)) { if (StringHelper.isNullOrEmpty(conditionImmunities)) {
monsterConditionImmunities.setVisibility(View.GONE); mHolder.conditionImmunities.setVisibility(View.GONE);
} else { } else {
monsterConditionImmunities.setVisibility(View.VISIBLE); mHolder.conditionImmunities.setVisibility(View.VISIBLE);
} }
monsterConditionImmunities.setText(Html.fromHtml("<b>Condition Immunities</b> " + conditionImmunities)); mHolder.conditionImmunities.setText(Html.fromHtml("<b>Condition Immunities</b> " + conditionImmunities));
}); });
final TextView monsterSenses = root.findViewById(R.id.senses);
monsterDetailViewModel.getSenses().observe(getViewLifecycleOwner(), senses -> { monsterDetailViewModel.getSenses().observe(getViewLifecycleOwner(), senses -> {
if (StringHelper.isNullOrEmpty(senses)) { if (StringHelper.isNullOrEmpty(senses)) {
monsterSenses.setVisibility(View.GONE); mHolder.senses.setVisibility(View.GONE);
} else { } else {
monsterSenses.setVisibility(View.VISIBLE); mHolder.senses.setVisibility(View.VISIBLE);
} }
monsterSenses.setText(Html.fromHtml("<b>Senses</b> " + senses)); mHolder.senses.setText(Html.fromHtml("<b>Senses</b> " + senses));
}); });
final TextView monsterLanguages = root.findViewById(R.id.languages);
monsterDetailViewModel.getLanguages().observe(getViewLifecycleOwner(), languages -> { monsterDetailViewModel.getLanguages().observe(getViewLifecycleOwner(), languages -> {
if (StringHelper.isNullOrEmpty(languages)) { if (StringHelper.isNullOrEmpty(languages)) {
monsterLanguages.setVisibility(View.GONE); mHolder.languages.setVisibility(View.GONE);
} else { } else {
monsterLanguages.setVisibility(View.VISIBLE); mHolder.languages.setVisibility(View.VISIBLE);
} }
monsterLanguages.setText(Html.fromHtml("<b>Languages</b> " + languages)); mHolder.languages.setText(Html.fromHtml("<b>Languages</b> " + languages));
}); });
monsterDetailViewModel.getChallenge().observe(getViewLifecycleOwner(), challengeRating -> mHolder.challenge.setText(Html.fromHtml("<b>Challenge</b> " + challengeRating)));
final TextView monsterChallenge = root.findViewById(R.id.challenge);
monsterDetailViewModel.getChallenge().observe(getViewLifecycleOwner(), challengeRating -> monsterChallenge.setText(Html.fromHtml("<b>Challenge</b> " + challengeRating)));
final LinearLayout monsterAbilities = root.findViewById(R.id.abilities);
monsterDetailViewModel.getAbilities().observe(getViewLifecycleOwner(), abilities -> { monsterDetailViewModel.getAbilities().observe(getViewLifecycleOwner(), abilities -> {
Context context = getContext(); Context context = getContext();
DisplayMetrics displayMetrics = null; DisplayMetrics displayMetrics = null;
@@ -190,7 +152,7 @@ public class MonsterDetailFragment extends MCFragment {
displayMetrics = resources.getDisplayMetrics(); displayMetrics = resources.getDisplayMetrics();
} }
} }
monsterAbilities.removeAllViews(); mHolder.abilities.removeAllViews();
if (abilities != null) { if (abilities != null) {
for (String ability : abilities) { for (String ability : abilities) {
TextView tvAbility = new TextView(context); TextView tvAbility = new TextView(context);
@@ -201,12 +163,10 @@ public class MonsterDetailFragment extends MCFragment {
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParams.topMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, displayMetrics); layoutParams.topMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, displayMetrics);
tvAbility.setLayoutParams(layoutParams); tvAbility.setLayoutParams(layoutParams);
monsterAbilities.addView(tvAbility); mHolder.abilities.addView(tvAbility);
} }
} }
}); });
final LinearLayout monsterActions = root.findViewById(R.id.actions);
monsterDetailViewModel.getActions().observe(getViewLifecycleOwner(), actions -> { monsterDetailViewModel.getActions().observe(getViewLifecycleOwner(), actions -> {
Context context = getContext(); Context context = getContext();
DisplayMetrics displayMetrics = null; DisplayMetrics displayMetrics = null;
@@ -216,7 +176,7 @@ public class MonsterDetailFragment extends MCFragment {
displayMetrics = resources.getDisplayMetrics(); displayMetrics = resources.getDisplayMetrics();
} }
} }
monsterActions.removeAllViews(); mHolder.actions.removeAllViews();
if (actions != null) { if (actions != null) {
for (String action : actions) { for (String action : actions) {
TextView tvAction = new TextView(getContext()); TextView tvAction = new TextView(getContext());
@@ -224,7 +184,7 @@ public class MonsterDetailFragment extends MCFragment {
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParams.topMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, displayMetrics); layoutParams.topMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, displayMetrics);
tvAction.setLayoutParams(layoutParams); tvAction.setLayoutParams(layoutParams);
monsterActions.addView(tvAction); mHolder.actions.addView(tvAction);
} }
} }
}); });
@@ -254,4 +214,62 @@ public class MonsterDetailFragment extends MCFragment {
} }
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
private static class ViewHolder {
final TextView name;
final TextView meta;
final TextView armorClass;
final TextView hitPoints;
final TextView speed;
final TextView strength;
final TextView dexterity;
final TextView constitution;
final TextView intelligence;
final TextView wisdom;
final TextView charisma;
final TextView savingThrows;
final TextView skills;
final TextView damageVulnerabilities;
final TextView damageResistances;
final TextView damageImmunities;
final TextView conditionImmunities;
final TextView senses;
final TextView languages;
final TextView challenge;
final LinearLayout abilities;
final LinearLayout actions;
final LinearLayout reactions;
final LinearLayout legendaryActions;
final LinearLayout lairActions;
final LinearLayout regionalEffects;
ViewHolder(View root) {
name = root.findViewById(R.id.name);
meta = root.findViewById(R.id.meta);
armorClass = root.findViewById(R.id.armorClass);
hitPoints = root.findViewById(R.id.hitPoints);
speed = root.findViewById(R.id.speed);
strength = root.findViewById(R.id.strength);
dexterity = root.findViewById(R.id.dexterity);
constitution = root.findViewById(R.id.constitution);
intelligence = root.findViewById(R.id.intelligence);
wisdom = root.findViewById(R.id.wisdom);
charisma = root.findViewById(R.id.charisma);
savingThrows = root.findViewById(R.id.savingThrows);
skills = root.findViewById(R.id.skills);
damageVulnerabilities = root.findViewById(R.id.damageVulnerabilities);
damageResistances = root.findViewById(R.id.damageResistances);
damageImmunities = root.findViewById(R.id.damageImmunities);
conditionImmunities = root.findViewById(R.id.conditionImmunities);
senses = root.findViewById(R.id.senses);
languages = root.findViewById(R.id.languages);
challenge = root.findViewById(R.id.challenge);
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);
regionalEffects = root.findViewById(R.id.regionalEffects);
}
}
} }

View File

@@ -181,7 +181,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin" android:layout_margin="@dimen/text_margin"
android:text="@string/label_regional_actions" android:text="@string/label_regional_effects"
android:textSize="@dimen/text_h4_size" android:textSize="@dimen/text_h4_size"
app:drawableEndCompat="@drawable/ic_chevron_right_24" /> app:drawableEndCompat="@drawable/ic_chevron_right_24" />

View File

@@ -56,7 +56,7 @@
app:layout_constraintTop_toBottomOf="@+id/meta" /> app:layout_constraintTop_toBottomOf="@+id/meta" />
<TextView <TextView
android:id="@+id/armor_class" android:id="@+id/armorClass"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@@ -69,7 +69,7 @@
tools:text="Armor Class 15" /> tools:text="Armor Class 15" />
<TextView <TextView
android:id="@+id/hit_points" android:id="@+id/hitPoints"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@@ -78,7 +78,7 @@
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/armor_class" app:layout_constraintTop_toBottomOf="@+id/armorClass"
tools:text="Hit Points 1 (1d4 - 1)" /> tools:text="Hit Points 1 (1d4 - 1)" />
<TextView <TextView
@@ -91,7 +91,7 @@
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/hit_points" app:layout_constraintTop_toBottomOf="@+id/hitPoints"
tools:text="10 ft., fly 30 ft." /> tools:text="10 ft., fly 30 ft." />
<ImageView <ImageView
@@ -111,7 +111,7 @@
<!-- Strength --> <!-- Strength -->
<TextView <TextView
android:id="@+id/label_str" android:id="@+id/strength_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@@ -121,7 +121,7 @@
android:text="@string/strength_abbreviation" android:text="@string/strength_abbreviation"
android:textAlignment="center" android:textAlignment="center"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/label_dex" app:layout_constraintEnd_toStartOf="@+id/dexterity_label"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/divider2" /> app:layout_constraintTop_toBottomOf="@+id/divider2" />
@@ -134,14 +134,14 @@
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:textAlignment="center" android:textAlignment="center"
app:layout_constraintEnd_toEndOf="@+id/label_str" app:layout_constraintEnd_toEndOf="@+id/strength_label"
app:layout_constraintStart_toStartOf="@+id/label_str" app:layout_constraintStart_toStartOf="@+id/strength_label"
app:layout_constraintTop_toBottomOf="@+id/label_str" app:layout_constraintTop_toBottomOf="@+id/strength_label"
tools:text="2 (-4)" /> tools:text="2 (-4)" />
<!-- Dexterity --> <!-- Dexterity -->
<TextView <TextView
android:id="@+id/label_dex" android:id="@+id/dexterity_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@@ -151,8 +151,8 @@
android:text="@string/dexterity_abbreviation" android:text="@string/dexterity_abbreviation"
android:textAlignment="center" android:textAlignment="center"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/label_con" app:layout_constraintEnd_toStartOf="@+id/constitution_label"
app:layout_constraintStart_toEndOf="@+id/label_str" app:layout_constraintStart_toEndOf="@+id/strength_label"
app:layout_constraintTop_toBottomOf="@+id/divider2" /> app:layout_constraintTop_toBottomOf="@+id/divider2" />
<TextView <TextView
@@ -164,14 +164,14 @@
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:textAlignment="center" android:textAlignment="center"
app:layout_constraintEnd_toEndOf="@+id/label_dex" app:layout_constraintEnd_toEndOf="@+id/dexterity_label"
app:layout_constraintStart_toStartOf="@+id/label_dex" app:layout_constraintStart_toStartOf="@+id/dexterity_label"
app:layout_constraintTop_toBottomOf="@+id/label_dex" app:layout_constraintTop_toBottomOf="@+id/dexterity_label"
tools:text="20 (+5)" /> tools:text="20 (+5)" />
<!-- Constitution --> <!-- Constitution -->
<TextView <TextView
android:id="@+id/label_con" android:id="@+id/constitution_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@@ -181,8 +181,8 @@
android:text="@string/constitution_abbreviation" android:text="@string/constitution_abbreviation"
android:textAlignment="center" android:textAlignment="center"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/label_int" app:layout_constraintEnd_toStartOf="@+id/intelligence_label"
app:layout_constraintStart_toEndOf="@+id/label_dex" app:layout_constraintStart_toEndOf="@+id/dexterity_label"
app:layout_constraintTop_toBottomOf="@+id/divider2" /> app:layout_constraintTop_toBottomOf="@+id/divider2" />
<TextView <TextView
@@ -194,14 +194,14 @@
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:textAlignment="center" android:textAlignment="center"
app:layout_constraintEnd_toEndOf="@+id/label_con" app:layout_constraintEnd_toEndOf="@+id/constitution_label"
app:layout_constraintStart_toStartOf="@+id/label_con" app:layout_constraintStart_toStartOf="@+id/constitution_label"
app:layout_constraintTop_toBottomOf="@+id/label_con" app:layout_constraintTop_toBottomOf="@+id/constitution_label"
tools:text="8 (-1)" /> tools:text="8 (-1)" />
<!-- Intelligence --> <!-- Intelligence -->
<TextView <TextView
android:id="@+id/label_int" android:id="@+id/intelligence_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@@ -211,8 +211,8 @@
android:text="@string/intelligence_abbreviation" android:text="@string/intelligence_abbreviation"
android:textAlignment="center" android:textAlignment="center"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/label_wis" app:layout_constraintEnd_toStartOf="@+id/wisdom_label"
app:layout_constraintStart_toEndOf="@+id/label_con" app:layout_constraintStart_toEndOf="@+id/constitution_label"
app:layout_constraintTop_toBottomOf="@+id/divider2" /> app:layout_constraintTop_toBottomOf="@+id/divider2" />
<TextView <TextView
@@ -224,14 +224,14 @@
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:textAlignment="center" android:textAlignment="center"
app:layout_constraintEnd_toEndOf="@+id/label_int" app:layout_constraintEnd_toEndOf="@+id/intelligence_label"
app:layout_constraintStart_toStartOf="@+id/label_int" app:layout_constraintStart_toStartOf="@+id/intelligence_label"
app:layout_constraintTop_toBottomOf="@+id/label_int" app:layout_constraintTop_toBottomOf="@+id/intelligence_label"
tools:text="10 (+0)" /> tools:text="10 (+0)" />
<!-- Wisdom --> <!-- Wisdom -->
<TextView <TextView
android:id="@+id/label_wis" android:id="@+id/wisdom_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@@ -241,8 +241,8 @@
android:text="@string/wisdom_abbreviation" android:text="@string/wisdom_abbreviation"
android:textAlignment="center" android:textAlignment="center"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/label_cha" app:layout_constraintEnd_toStartOf="@+id/charisma_label"
app:layout_constraintStart_toEndOf="@+id/label_int" app:layout_constraintStart_toEndOf="@+id/intelligence_label"
app:layout_constraintTop_toBottomOf="@+id/divider2" /> app:layout_constraintTop_toBottomOf="@+id/divider2" />
<TextView <TextView
@@ -254,14 +254,14 @@
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:textAlignment="center" android:textAlignment="center"
app:layout_constraintEnd_toEndOf="@+id/label_wis" app:layout_constraintEnd_toEndOf="@+id/wisdom_label"
app:layout_constraintStart_toStartOf="@+id/label_wis" app:layout_constraintStart_toStartOf="@+id/wisdom_label"
app:layout_constraintTop_toBottomOf="@+id/label_wis" app:layout_constraintTop_toBottomOf="@+id/wisdom_label"
tools:text="14 (+2)" /> tools:text="14 (+2)" />
<!-- Charisma --> <!-- Charisma -->
<TextView <TextView
android:id="@+id/label_cha" android:id="@+id/charisma_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@@ -272,7 +272,7 @@
android:textAlignment="center" android:textAlignment="center"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/label_wis" app:layout_constraintStart_toEndOf="@+id/wisdom_label"
app:layout_constraintTop_toBottomOf="@+id/divider2" /> app:layout_constraintTop_toBottomOf="@+id/divider2" />
<TextView <TextView
@@ -284,9 +284,9 @@
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:textAlignment="center" android:textAlignment="center"
app:layout_constraintEnd_toEndOf="@+id/label_cha" app:layout_constraintEnd_toEndOf="@+id/charisma_label"
app:layout_constraintStart_toStartOf="@+id/label_cha" app:layout_constraintStart_toStartOf="@+id/charisma_label"
app:layout_constraintTop_toBottomOf="@+id/label_cha" app:layout_constraintTop_toBottomOf="@+id/charisma_label"
tools:text="15 (+2)" /> tools:text="15 (+2)" />
<ImageView <ImageView
@@ -305,7 +305,7 @@
app:layout_constraintTop_toBottomOf="@+id/strength" /> app:layout_constraintTop_toBottomOf="@+id/strength" />
<TextView <TextView
android:id="@+id/saving_throws" android:id="@+id/savingThrows"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@@ -327,11 +327,11 @@
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/saving_throws" app:layout_constraintTop_toBottomOf="@+id/savingThrows"
tools:text="Skills" /> tools:text="Skills" />
<TextView <TextView
android:id="@+id/damage_vulnerabilities" android:id="@+id/damageVulnerabilities"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@@ -344,7 +344,7 @@
tools:text="Damage Vulnerabilities" /> tools:text="Damage Vulnerabilities" />
<TextView <TextView
android:id="@+id/damage_resistances" android:id="@+id/damageResistances"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@@ -353,11 +353,11 @@
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/damage_vulnerabilities" app:layout_constraintTop_toBottomOf="@+id/damageVulnerabilities"
tools:text="Damage Resistances" /> tools:text="Damage Resistances" />
<TextView <TextView
android:id="@+id/damage_immunities" android:id="@+id/damageImmunities"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@@ -366,11 +366,11 @@
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/damage_resistances" app:layout_constraintTop_toBottomOf="@+id/damageResistances"
tools:text="Damage Immunities" /> tools:text="Damage Immunities" />
<TextView <TextView
android:id="@+id/condition_immunities" android:id="@+id/conditionImmunities"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@@ -379,7 +379,7 @@
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/damage_immunities" app:layout_constraintTop_toBottomOf="@+id/damageImmunities"
tools:text="Condition Immunities" /> tools:text="Condition Immunities" />
<TextView <TextView
@@ -392,7 +392,7 @@
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/condition_immunities" app:layout_constraintTop_toBottomOf="@+id/conditionImmunities"
tools:text="Senses" /> tools:text="Senses" />
<TextView <TextView
@@ -437,20 +437,20 @@
tools:text="Damage Vulnerabilities" /> tools:text="Damage Vulnerabilities" />
<TextView <TextView
android:id="@+id/label_actions" android:id="@+id/actions_label"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:text="@string/actions_label" android:text="@string/label_actions"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/abilities" /> app:layout_constraintTop_toBottomOf="@+id/abilities" />
<ImageView <ImageView
android:id="@+id/divider4" android:id="@+id/actions_divider"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="8dp" android:layout_height="8dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@@ -462,7 +462,7 @@
android:src="@drawable/ic_section_divider" android:src="@drawable/ic_section_divider"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/label_actions" /> app:layout_constraintTop_toBottomOf="@+id/actions_label" />
<!-- Actions --> <!-- Actions -->
<LinearLayout <LinearLayout
@@ -476,8 +476,179 @@
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/divider4" app:layout_constraintTop_toBottomOf="@+id/actions_divider"
tools:text="Damage Vulnerabilities" /> tools:text="Damage Vulnerabilities" />
<TextView
android:id="@+id/reactions_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:text="@string/label_reactions"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/actions" />
<ImageView
android:id="@+id/reactions_divider"
android:layout_width="0dp"
android:layout_height="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:contentDescription="@string/section_divider"
android:scaleType="fitXY"
android:src="@drawable/ic_section_divider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/reactions_label" />
<!-- Reactions -->
<LinearLayout
android:id="@+id/reactions"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="0dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/reactions_divider"
tools:text="Damage Vulnerabilities" />
<TextView
android:id="@+id/legendaryActions_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:text="@string/label_legendary_actions"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/reactions" />
<ImageView
android:id="@+id/legendaryActions_divider"
android:layout_width="0dp"
android:layout_height="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:contentDescription="@string/section_divider"
android:scaleType="fitXY"
android:src="@drawable/ic_section_divider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/legendaryActions_label" />
<!-- Legendary Actions -->
<LinearLayout
android:id="@+id/legendaryActions"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="0dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/legendaryActions_divider"
tools:text="Damage Vulnerabilities" />
<TextView
android:id="@+id/lairActions_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:text="@string/label_lair_actions"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/legendaryActions" />
<ImageView
android:id="@+id/lairActions_divider"
android:layout_width="0dp"
android:layout_height="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:contentDescription="@string/section_divider"
android:scaleType="fitXY"
android:src="@drawable/ic_section_divider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/lairActions_label" />
<!-- Lair Actions -->
<LinearLayout
android:id="@+id/lairActions"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="0dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/lairActions_divider"
tools:text="Damage Vulnerabilities" />
<TextView
android:id="@+id/regionalEffects_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:text="@string/label_regional_effects"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/lairActions" />
<ImageView
android:id="@+id/regionalEffects_divider"
android:layout_width="0dp"
android:layout_height="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:contentDescription="@string/section_divider"
android:scaleType="fitXY"
android:src="@drawable/ic_section_divider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/regionalEffects_label" />
<!-- Regional Effects -->
<LinearLayout
android:id="@+id/regionalEffects"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="0dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/regionalEffects_divider"
tools:text="Damage Vulnerabilities" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

View File

@@ -9,7 +9,6 @@
<string name="action_add_skill">Add Skill</string> <string name="action_add_skill">Add Skill</string>
<string name="action_add_trait">Add Trait</string> <string name="action_add_trait">Add Trait</string>
<string name="action_edit">Edit</string> <string name="action_edit">Edit</string>
<string name="actions_label">Actions</string>
<string name="app_name">MonsterCards</string> <string name="app_name">MonsterCards</string>
<string name="charisma_abbreviation">CHA</string> <string name="charisma_abbreviation">CHA</string>
<string name="constitution_abbreviation">CON</string> <string name="constitution_abbreviation">CON</string>
@@ -66,7 +65,7 @@
<string name="label_proficiency_none">None</string> <string name="label_proficiency_none">None</string>
<string name="label_proficiency_proficient">Proficient</string> <string name="label_proficiency_proficient">Proficient</string>
<string name="label_reactions">Reactions</string> <string name="label_reactions">Reactions</string>
<string name="label_regional_actions">Regional Actions</string> <string name="label_regional_effects">Regional Effects</string>
<string name="label_saving_throws">Saving Throws</string> <string name="label_saving_throws">Saving Throws</string>
<string name="label_search_query">Query</string> <string name="label_search_query">Query</string>
<string name="label_senses">Senses</string> <string name="label_senses">Senses</string>