Refactors monster detail to use a view holder and partially corrects Regional Actions to Regional Effects.
This commit is contained in:
@@ -34,6 +34,7 @@ import java.util.UUID;
|
||||
import io.reactivex.rxjava3.observers.DisposableSingleObserver;
|
||||
|
||||
public class MonsterDetailFragment extends MCFragment {
|
||||
private ViewHolder mHolder;
|
||||
|
||||
private MonsterDetailViewModel monsterDetailViewModel;
|
||||
|
||||
@@ -48,6 +49,8 @@ public class MonsterDetailFragment extends MCFragment {
|
||||
monsterDetailViewModel = new ViewModelProvider(this).get(MonsterDetailViewModel.class);
|
||||
View root = inflater.inflate(R.layout.fragment_monster, container, false);
|
||||
|
||||
mHolder = new ViewHolder(root);
|
||||
|
||||
repository.getMonster(monsterId).toObservable()
|
||||
.firstOrError()
|
||||
.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(), monsterName::setText);
|
||||
|
||||
final TextView monsterMeta = root.findViewById(R.id.meta);
|
||||
monsterDetailViewModel.getMeta().observe(getViewLifecycleOwner(), monsterMeta::setText);
|
||||
|
||||
final TextView monsterArmorClass = root.findViewById(R.id.armor_class);
|
||||
monsterDetailViewModel.getArmorClass().observe(getViewLifecycleOwner(), armorText -> monsterArmorClass.setText(Html.fromHtml("<b>Armor Class</b> " + armorText)));
|
||||
|
||||
final TextView monsterHitPoints = root.findViewById(R.id.hit_points);
|
||||
monsterDetailViewModel.getHitPoints().observe(getViewLifecycleOwner(), hitPoints -> monsterHitPoints.setText(Html.fromHtml("<b>Hit Points</b> " + hitPoints)));
|
||||
|
||||
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.getName().observe(getViewLifecycleOwner(), mHolder.name::setText);
|
||||
monsterDetailViewModel.getMeta().observe(getViewLifecycleOwner(), mHolder.meta::setText);
|
||||
monsterDetailViewModel.getArmorClass().observe(getViewLifecycleOwner(), armorText -> mHolder.armorClass.setText(Html.fromHtml("<b>Armor Class</b> " + armorText)));
|
||||
monsterDetailViewModel.getHitPoints().observe(getViewLifecycleOwner(), hitPoints -> mHolder.hitPoints.setText(Html.fromHtml("<b>Hit Points</b> " + hitPoints)));
|
||||
monsterDetailViewModel.getSpeed().observe(getViewLifecycleOwner(), speed -> mHolder.speed.setText(Html.fromHtml("<b>Speed</b> " + speed)));
|
||||
monsterDetailViewModel.getStrength().observe(getViewLifecycleOwner(), mHolder.strength::setText);
|
||||
monsterDetailViewModel.getDexterity().observe(getViewLifecycleOwner(), mHolder.dexterity::setText);
|
||||
monsterDetailViewModel.getConstitution().observe(getViewLifecycleOwner(), mHolder.constitution::setText);
|
||||
monsterDetailViewModel.getIntelligence().observe(getViewLifecycleOwner(), mHolder.intelligence::setText);
|
||||
monsterDetailViewModel.getWisdom().observe(getViewLifecycleOwner(), mHolder.wisdom::setText);
|
||||
monsterDetailViewModel.getCharisma().observe(getViewLifecycleOwner(), mHolder.charisma::setText);
|
||||
monsterDetailViewModel.getSavingThrows().observe(getViewLifecycleOwner(), savingThrows -> {
|
||||
if (StringHelper.isNullOrEmpty(savingThrows)) {
|
||||
monsterSavingThrows.setVisibility(View.GONE);
|
||||
mHolder.savingThrows.setVisibility(View.GONE);
|
||||
} 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 -> {
|
||||
if (StringHelper.isNullOrEmpty(skills)) {
|
||||
monsterSkills.setVisibility(View.GONE);
|
||||
mHolder.skills.setVisibility(View.GONE);
|
||||
} 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 -> {
|
||||
if (StringHelper.isNullOrEmpty(damageType)) {
|
||||
monsterDamageVulnerabilities.setVisibility(View.GONE);
|
||||
mHolder.damageVulnerabilities.setVisibility(View.GONE);
|
||||
} 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 -> {
|
||||
if (StringHelper.isNullOrEmpty(damageType)) {
|
||||
monsterDamageResistances.setVisibility(View.GONE);
|
||||
mHolder.damageResistances.setVisibility(View.GONE);
|
||||
} 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 -> {
|
||||
if (StringHelper.isNullOrEmpty(damageType)) {
|
||||
monsterDamageImmunities.setVisibility(View.GONE);
|
||||
mHolder.damageImmunities.setVisibility(View.GONE);
|
||||
} 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 -> {
|
||||
if (StringHelper.isNullOrEmpty(conditionImmunities)) {
|
||||
monsterConditionImmunities.setVisibility(View.GONE);
|
||||
mHolder.conditionImmunities.setVisibility(View.GONE);
|
||||
} 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 -> {
|
||||
if (StringHelper.isNullOrEmpty(senses)) {
|
||||
monsterSenses.setVisibility(View.GONE);
|
||||
mHolder.senses.setVisibility(View.GONE);
|
||||
} 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 -> {
|
||||
if (StringHelper.isNullOrEmpty(languages)) {
|
||||
monsterLanguages.setVisibility(View.GONE);
|
||||
mHolder.languages.setVisibility(View.GONE);
|
||||
} 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));
|
||||
});
|
||||
|
||||
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.getChallenge().observe(getViewLifecycleOwner(), challengeRating -> mHolder.challenge.setText(Html.fromHtml("<b>Challenge</b> " + challengeRating)));
|
||||
monsterDetailViewModel.getAbilities().observe(getViewLifecycleOwner(), abilities -> {
|
||||
Context context = getContext();
|
||||
DisplayMetrics displayMetrics = null;
|
||||
@@ -190,7 +152,7 @@ public class MonsterDetailFragment extends MCFragment {
|
||||
displayMetrics = resources.getDisplayMetrics();
|
||||
}
|
||||
}
|
||||
monsterAbilities.removeAllViews();
|
||||
mHolder.abilities.removeAllViews();
|
||||
if (abilities != null) {
|
||||
for (String ability : abilities) {
|
||||
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);
|
||||
layoutParams.topMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, displayMetrics);
|
||||
tvAbility.setLayoutParams(layoutParams);
|
||||
monsterAbilities.addView(tvAbility);
|
||||
mHolder.abilities.addView(tvAbility);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
final LinearLayout monsterActions = root.findViewById(R.id.actions);
|
||||
monsterDetailViewModel.getActions().observe(getViewLifecycleOwner(), actions -> {
|
||||
Context context = getContext();
|
||||
DisplayMetrics displayMetrics = null;
|
||||
@@ -216,7 +176,7 @@ public class MonsterDetailFragment extends MCFragment {
|
||||
displayMetrics = resources.getDisplayMetrics();
|
||||
}
|
||||
}
|
||||
monsterActions.removeAllViews();
|
||||
mHolder.actions.removeAllViews();
|
||||
if (actions != null) {
|
||||
for (String action : actions) {
|
||||
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);
|
||||
layoutParams.topMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, displayMetrics);
|
||||
tvAction.setLayoutParams(layoutParams);
|
||||
monsterActions.addView(tvAction);
|
||||
mHolder.actions.addView(tvAction);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -254,4 +214,62 @@ public class MonsterDetailFragment extends MCFragment {
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/text_margin"
|
||||
android:text="@string/label_regional_actions"
|
||||
android:text="@string/label_regional_effects"
|
||||
android:textSize="@dimen/text_h4_size"
|
||||
app:drawableEndCompat="@drawable/ic_chevron_right_24" />
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/meta" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/armor_class"
|
||||
android:id="@+id/armorClass"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -69,7 +69,7 @@
|
||||
tools:text="Armor Class 15" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hit_points"
|
||||
android:id="@+id/hitPoints"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -78,7 +78,7 @@
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintEnd_toEndOf="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)" />
|
||||
|
||||
<TextView
|
||||
@@ -91,7 +91,7 @@
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintEnd_toEndOf="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." />
|
||||
|
||||
<ImageView
|
||||
@@ -111,7 +111,7 @@
|
||||
|
||||
<!-- Strength -->
|
||||
<TextView
|
||||
android:id="@+id/label_str"
|
||||
android:id="@+id/strength_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -121,7 +121,7 @@
|
||||
android:text="@string/strength_abbreviation"
|
||||
android:textAlignment="center"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@+id/label_dex"
|
||||
app:layout_constraintEnd_toStartOf="@+id/dexterity_label"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider2" />
|
||||
|
||||
@@ -134,14 +134,14 @@
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintEnd_toEndOf="@+id/label_str"
|
||||
app:layout_constraintStart_toStartOf="@+id/label_str"
|
||||
app:layout_constraintTop_toBottomOf="@+id/label_str"
|
||||
app:layout_constraintEnd_toEndOf="@+id/strength_label"
|
||||
app:layout_constraintStart_toStartOf="@+id/strength_label"
|
||||
app:layout_constraintTop_toBottomOf="@+id/strength_label"
|
||||
tools:text="2 (-4)" />
|
||||
|
||||
<!-- Dexterity -->
|
||||
<TextView
|
||||
android:id="@+id/label_dex"
|
||||
android:id="@+id/dexterity_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -151,8 +151,8 @@
|
||||
android:text="@string/dexterity_abbreviation"
|
||||
android:textAlignment="center"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@+id/label_con"
|
||||
app:layout_constraintStart_toEndOf="@+id/label_str"
|
||||
app:layout_constraintEnd_toStartOf="@+id/constitution_label"
|
||||
app:layout_constraintStart_toEndOf="@+id/strength_label"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider2" />
|
||||
|
||||
<TextView
|
||||
@@ -164,14 +164,14 @@
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintEnd_toEndOf="@+id/label_dex"
|
||||
app:layout_constraintStart_toStartOf="@+id/label_dex"
|
||||
app:layout_constraintTop_toBottomOf="@+id/label_dex"
|
||||
app:layout_constraintEnd_toEndOf="@+id/dexterity_label"
|
||||
app:layout_constraintStart_toStartOf="@+id/dexterity_label"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dexterity_label"
|
||||
tools:text="20 (+5)" />
|
||||
|
||||
<!-- Constitution -->
|
||||
<TextView
|
||||
android:id="@+id/label_con"
|
||||
android:id="@+id/constitution_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -181,8 +181,8 @@
|
||||
android:text="@string/constitution_abbreviation"
|
||||
android:textAlignment="center"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@+id/label_int"
|
||||
app:layout_constraintStart_toEndOf="@+id/label_dex"
|
||||
app:layout_constraintEnd_toStartOf="@+id/intelligence_label"
|
||||
app:layout_constraintStart_toEndOf="@+id/dexterity_label"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider2" />
|
||||
|
||||
<TextView
|
||||
@@ -194,14 +194,14 @@
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintEnd_toEndOf="@+id/label_con"
|
||||
app:layout_constraintStart_toStartOf="@+id/label_con"
|
||||
app:layout_constraintTop_toBottomOf="@+id/label_con"
|
||||
app:layout_constraintEnd_toEndOf="@+id/constitution_label"
|
||||
app:layout_constraintStart_toStartOf="@+id/constitution_label"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constitution_label"
|
||||
tools:text="8 (-1)" />
|
||||
|
||||
<!-- Intelligence -->
|
||||
<TextView
|
||||
android:id="@+id/label_int"
|
||||
android:id="@+id/intelligence_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -211,8 +211,8 @@
|
||||
android:text="@string/intelligence_abbreviation"
|
||||
android:textAlignment="center"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@+id/label_wis"
|
||||
app:layout_constraintStart_toEndOf="@+id/label_con"
|
||||
app:layout_constraintEnd_toStartOf="@+id/wisdom_label"
|
||||
app:layout_constraintStart_toEndOf="@+id/constitution_label"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider2" />
|
||||
|
||||
<TextView
|
||||
@@ -224,14 +224,14 @@
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintEnd_toEndOf="@+id/label_int"
|
||||
app:layout_constraintStart_toStartOf="@+id/label_int"
|
||||
app:layout_constraintTop_toBottomOf="@+id/label_int"
|
||||
app:layout_constraintEnd_toEndOf="@+id/intelligence_label"
|
||||
app:layout_constraintStart_toStartOf="@+id/intelligence_label"
|
||||
app:layout_constraintTop_toBottomOf="@+id/intelligence_label"
|
||||
tools:text="10 (+0)" />
|
||||
|
||||
<!-- Wisdom -->
|
||||
<TextView
|
||||
android:id="@+id/label_wis"
|
||||
android:id="@+id/wisdom_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -241,8 +241,8 @@
|
||||
android:text="@string/wisdom_abbreviation"
|
||||
android:textAlignment="center"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@+id/label_cha"
|
||||
app:layout_constraintStart_toEndOf="@+id/label_int"
|
||||
app:layout_constraintEnd_toStartOf="@+id/charisma_label"
|
||||
app:layout_constraintStart_toEndOf="@+id/intelligence_label"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider2" />
|
||||
|
||||
<TextView
|
||||
@@ -254,14 +254,14 @@
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintEnd_toEndOf="@+id/label_wis"
|
||||
app:layout_constraintStart_toStartOf="@+id/label_wis"
|
||||
app:layout_constraintTop_toBottomOf="@+id/label_wis"
|
||||
app:layout_constraintEnd_toEndOf="@+id/wisdom_label"
|
||||
app:layout_constraintStart_toStartOf="@+id/wisdom_label"
|
||||
app:layout_constraintTop_toBottomOf="@+id/wisdom_label"
|
||||
tools:text="14 (+2)" />
|
||||
|
||||
<!-- Charisma -->
|
||||
<TextView
|
||||
android:id="@+id/label_cha"
|
||||
android:id="@+id/charisma_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -272,7 +272,7 @@
|
||||
android:textAlignment="center"
|
||||
android:textStyle="bold"
|
||||
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" />
|
||||
|
||||
<TextView
|
||||
@@ -284,9 +284,9 @@
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintEnd_toEndOf="@+id/label_cha"
|
||||
app:layout_constraintStart_toStartOf="@+id/label_cha"
|
||||
app:layout_constraintTop_toBottomOf="@+id/label_cha"
|
||||
app:layout_constraintEnd_toEndOf="@+id/charisma_label"
|
||||
app:layout_constraintStart_toStartOf="@+id/charisma_label"
|
||||
app:layout_constraintTop_toBottomOf="@+id/charisma_label"
|
||||
tools:text="15 (+2)" />
|
||||
|
||||
<ImageView
|
||||
@@ -305,7 +305,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/strength" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/saving_throws"
|
||||
android:id="@+id/savingThrows"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -327,11 +327,11 @@
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/saving_throws"
|
||||
app:layout_constraintTop_toBottomOf="@+id/savingThrows"
|
||||
tools:text="Skills" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/damage_vulnerabilities"
|
||||
android:id="@+id/damageVulnerabilities"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -344,7 +344,7 @@
|
||||
tools:text="Damage Vulnerabilities" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/damage_resistances"
|
||||
android:id="@+id/damageResistances"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -353,11 +353,11 @@
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/damage_vulnerabilities"
|
||||
app:layout_constraintTop_toBottomOf="@+id/damageVulnerabilities"
|
||||
tools:text="Damage Resistances" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/damage_immunities"
|
||||
android:id="@+id/damageImmunities"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -366,11 +366,11 @@
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/damage_resistances"
|
||||
app:layout_constraintTop_toBottomOf="@+id/damageResistances"
|
||||
tools:text="Damage Immunities" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/condition_immunities"
|
||||
android:id="@+id/conditionImmunities"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -379,7 +379,7 @@
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/damage_immunities"
|
||||
app:layout_constraintTop_toBottomOf="@+id/damageImmunities"
|
||||
tools:text="Condition Immunities" />
|
||||
|
||||
<TextView
|
||||
@@ -392,7 +392,7 @@
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/condition_immunities"
|
||||
app:layout_constraintTop_toBottomOf="@+id/conditionImmunities"
|
||||
tools:text="Senses" />
|
||||
|
||||
<TextView
|
||||
@@ -437,20 +437,20 @@
|
||||
tools:text="Damage Vulnerabilities" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/label_actions"
|
||||
android:id="@+id/actions_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/actions_label"
|
||||
android:text="@string/label_actions"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/abilities" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/divider4"
|
||||
android:id="@+id/actions_divider"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -462,7 +462,7 @@
|
||||
android:src="@drawable/ic_section_divider"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/label_actions" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/actions_label" />
|
||||
|
||||
<!-- Actions -->
|
||||
<LinearLayout
|
||||
@@ -476,8 +476,179 @@
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider4"
|
||||
app:layout_constraintTop_toBottomOf="@+id/actions_divider"
|
||||
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>
|
||||
</ScrollView>
|
||||
</ScrollView>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<string name="action_add_skill">Add Skill</string>
|
||||
<string name="action_add_trait">Add Trait</string>
|
||||
<string name="action_edit">Edit</string>
|
||||
<string name="actions_label">Actions</string>
|
||||
<string name="app_name">MonsterCards</string>
|
||||
<string name="charisma_abbreviation">CHA</string>
|
||||
<string name="constitution_abbreviation">CON</string>
|
||||
@@ -66,7 +65,7 @@
|
||||
<string name="label_proficiency_none">None</string>
|
||||
<string name="label_proficiency_proficient">Proficient</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_search_query">Query</string>
|
||||
<string name="label_senses">Senses</string>
|
||||
|
||||
Reference in New Issue
Block a user