PowerDisplay: impact not showing and blank fields not hiding fixed
This commit is contained in:
parent
c8c0306e45
commit
c87641a921
3 changed files with 22 additions and 9 deletions
|
@ -19,9 +19,9 @@ import com.nispok.snackbar.SnackbarManager;
|
|||
public class PowerEditor extends ActionBarActivity {
|
||||
|
||||
private EditText [] edits = new EditText[6];
|
||||
private Spinner [] spinners = new Spinner[6];
|
||||
private Spinner [] spinners = new Spinner[5];
|
||||
|
||||
private String[] strings = new String[5];
|
||||
private String[] strings = new String[6];
|
||||
private int[] ints = new int[5];
|
||||
|
||||
private String originalName;
|
||||
|
|
|
@ -590,8 +590,13 @@ public class ShowPlayer extends ActionBarActivity {
|
|||
((TextView) dialog.findViewById(R.id.freqText)).setText(power.getFrequencyString());
|
||||
else dialog.findViewById(R.id.freqText).setVisibility(View.GONE);
|
||||
|
||||
((TextView) dialog.findViewById(R.id.keywordsText)).setText(power.getKeywords());
|
||||
((TextView) dialog.findViewById(R.id.distanceText)).setText(String.valueOf(power.getDistance()));
|
||||
if (!power.getKeywords().isEmpty())
|
||||
((TextView) dialog.findViewById(R.id.keywordsText)).setText(power.getKeywords());
|
||||
else dialog.findViewById(R.id.keywordsText).setVisibility(View.GONE);
|
||||
|
||||
if (!power.getDistance().isEmpty())
|
||||
((TextView) dialog.findViewById(R.id.distanceText)).setText(power.getDistance());
|
||||
else dialog.findViewById(R.id.distanceText).setVisibility(View.GONE);
|
||||
|
||||
if (!power.getObjective().isEmpty())
|
||||
((TextView) dialog.findViewById(R.id.objectiveText)).setText(power.getObjective());
|
||||
|
@ -603,10 +608,18 @@ public class ShowPlayer extends ActionBarActivity {
|
|||
|
||||
((TextView) dialog.findViewById(R.id.otherText)).setText(power.getOther());
|
||||
|
||||
String[] attack = getResources().getStringArray(R.array.attack);
|
||||
String[] defense = getResources().getStringArray(R.array.defense);
|
||||
((TextView) dialog.findViewById(R.id.impactText)).setText(attack[power.getAtk()]
|
||||
+ " " + getResources().getString(R.string.vs) + " " + defense[power.getDef()]);
|
||||
if (power.getAtk() != 0) {
|
||||
String[] attack = getResources().getStringArray(R.array.attack);
|
||||
String[] defense;
|
||||
String text = attack[power.getAtk()];
|
||||
if (power.getDef() != 0) {
|
||||
defense = getResources().getStringArray(R.array.defense);
|
||||
text += " " + getString(R.string.vs) + " " + defense[power.getDef()];
|
||||
}
|
||||
((TextView) dialog.findViewById(R.id.attackText)).setText(text);
|
||||
} else {
|
||||
dialog.findViewById(R.id.attackLayout).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
final Button useButton = (Button) dialog.findViewById(R.id.useButton);
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="Constitución contra Reflejos"
|
||||
android:id="@+id/impactText"/>
|
||||
android:id="@+id/attackText"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
|
Reference in a new issue