Powers: now all fields are optional, except the names
Made display scrollable
This commit is contained in:
parent
3d794a925a
commit
8f9f27a8c4
3 changed files with 168 additions and 152 deletions
|
@ -59,13 +59,15 @@ class Power implements Serializable{
|
|||
|
||||
String getKeywords() {return keywords;}
|
||||
|
||||
String getTypeString() {return ACTIONS[action];}
|
||||
String getActionString() {return ACTIONS[action];}
|
||||
String getFrequencyString() {return FREQ[freq];}
|
||||
String getRangeString() {return RANGES[range];}
|
||||
|
||||
int getAtk() {return atk;}
|
||||
int getDef() {return def;}
|
||||
int getFreq() {return freq;}
|
||||
int getAction() {return action;}
|
||||
int getRange() {return range;}
|
||||
|
||||
String getDistance() {return distance;}
|
||||
String getName(){return name;}
|
||||
|
|
|
@ -577,13 +577,30 @@ public class ShowPlayer extends ActionBarActivity {
|
|||
nameText.setBackgroundColor(color);
|
||||
|
||||
((TextView) nameText).setText(power.getName());
|
||||
((TextView) dialog.findViewById(R.id.typeText)).setText(power.getTypeString());
|
||||
((TextView) dialog.findViewById(R.id.rangeText)).setText(power.getRangeString() + " ");
|
||||
((TextView) dialog.findViewById(R.id.freqText)).setText(power.getFrequencyString());
|
||||
|
||||
if (power.getAction() != 0)
|
||||
((TextView) dialog.findViewById(R.id.actionText)).setText(power.getActionString());
|
||||
else dialog.findViewById(R.id.actionText).setVisibility(View.GONE);
|
||||
|
||||
if (power.getRange() != 0)
|
||||
((TextView) dialog.findViewById(R.id.rangeText)).setText(power.getRangeString() + " ");
|
||||
else dialog.findViewById(R.id.rangeText).setVisibility(View.GONE);
|
||||
|
||||
if (power.getFreq() != 0)
|
||||
((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()));
|
||||
((TextView) dialog.findViewById(R.id.objectiveText)).setText(power.getObjective());
|
||||
((TextView) dialog.findViewById(R.id.impactText)).setText(power.getImpact());
|
||||
|
||||
if (!power.getObjective().isEmpty())
|
||||
((TextView) dialog.findViewById(R.id.objectiveText)).setText(power.getObjective());
|
||||
else dialog.findViewById(R.id.objectiveLayout).setVisibility(View.GONE);
|
||||
|
||||
if (!power.getImpact().isEmpty())
|
||||
((TextView) dialog.findViewById(R.id.impactText)).setText(power.getImpact());
|
||||
else dialog.findViewById(R.id.impactLayout).setVisibility(View.GONE);
|
||||
|
||||
((TextView) dialog.findViewById(R.id.otherText)).setText(power.getOther());
|
||||
|
||||
String[] attack = getResources().getStringArray(R.array.attack);
|
||||
|
|
Reference in a new issue