Added PlayerAdapter
Still need to complete Power creation, edition and listing. Need to complete Player listing and deletion.
|
@ -29,6 +29,10 @@
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".PowerEditor"
|
||||||
|
android:label="@string/title_activity_power_editor" >
|
||||||
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
@ -1,10 +1,19 @@
|
||||||
package com.kauron.dungeonmanager;
|
package com.kauron.dungeonmanager;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.nispok.snackbar.Snackbar;
|
||||||
|
import com.nispok.snackbar.SnackbarManager;
|
||||||
|
import com.nispok.snackbar.listeners.ActionClickListener;
|
||||||
|
|
||||||
class AttackAdapter extends ArrayAdapter<Power> {
|
class AttackAdapter extends ArrayAdapter<Power> {
|
||||||
AttackAdapter(Context context, Power[] powers) {
|
AttackAdapter(Context context, Power[] powers) {
|
||||||
|
@ -12,11 +21,32 @@ class AttackAdapter extends ArrayAdapter<Power> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
public View getView(final int position, final View convertView, ViewGroup parent) {
|
||||||
LayoutInflater mInflater = LayoutInflater.from(getContext());
|
LayoutInflater mInflater = LayoutInflater.from(getContext());
|
||||||
View mView = mInflater.inflate(R.layout.attack_row, parent, false);
|
View mView = mInflater.inflate(R.layout.attack_row, parent, false);
|
||||||
|
|
||||||
Power attack = getItem(position);
|
final Power attack = getItem(position);
|
||||||
|
|
||||||
|
((TextView) mView.findViewById(R.id.name)).setText(attack.getName());
|
||||||
|
((TextView) mView.findViewById(R.id.keywords)).setText(attack.getKeywords());
|
||||||
|
((TextView) mView.findViewById(R.id.frequency)).setText(attack.getFrequencyString());
|
||||||
|
((TextView) mView.findViewById(R.id.extra)).setText(attack.getRangeString() + " " + attack.getDistance());
|
||||||
|
final AttackAdapter current = this;
|
||||||
|
((ImageView) mView.findViewById(R.id.delete)).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
SnackbarManager.show(
|
||||||
|
Snackbar.with(getContext()).text("¿Quieres borrarlo?").actionLabel("Sí").actionListener(new ActionClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onActionClicked(Snackbar snackbar) {
|
||||||
|
current.remove(attack);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
//TODO: convert text to resource
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return mView;
|
return mView;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package com.kauron.dungeonmanager;
|
package com.kauron.dungeonmanager;
|
||||||
|
|
||||||
public class Player {
|
class Player {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Names for the classes
|
* Names for the classes
|
||||||
|
@ -107,7 +107,7 @@ public class Player {
|
||||||
//TODO: implement fully operational powers displayed as cards
|
//TODO: implement fully operational powers displayed as cards
|
||||||
private Power[] powers;
|
private Power[] powers;
|
||||||
|
|
||||||
public Player(
|
Player(
|
||||||
String name, int classInt, int raceInt,
|
String name, int classInt, int raceInt,
|
||||||
int px, int[] atk, int[] abilities,
|
int px, int[] atk, int[] abilities,
|
||||||
Power[] powers
|
Power[] powers
|
||||||
|
@ -128,22 +128,22 @@ public class Player {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getPx() {return px;}
|
int getPx() {return px;}
|
||||||
public void setPx (int px) {this.px = px; setLevel();}
|
void setPx (int px) {this.px = px; setLevel();}
|
||||||
public boolean addPx(int px) {
|
boolean addPx(int px) {
|
||||||
int lastLevel = level;
|
int lastLevel = level;
|
||||||
setPx(this.px + px);
|
setPx(this.px + px);
|
||||||
return lastLevel < level;
|
return lastLevel < level;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxCurativeEfforts() {return maxCurativeEfforts;}
|
int getMaxCurativeEfforts() {return maxCurativeEfforts;}
|
||||||
public void setMaxCurativeEfforts(int maxCurativeEfforts) {this.maxCurativeEfforts = maxCurativeEfforts;}
|
void setMaxCurativeEfforts(int maxCurativeEfforts) {this.maxCurativeEfforts = maxCurativeEfforts;}
|
||||||
|
|
||||||
public int getCurativeEfforts() {return curativeEfforts;}
|
int getCurativeEfforts() {return curativeEfforts;}
|
||||||
public void setCurativeEffort(int curativeEfforts) {this.curativeEfforts = curativeEfforts;}
|
void setCurativeEffort(int curativeEfforts) {this.curativeEfforts = curativeEfforts;}
|
||||||
|
|
||||||
public int getLevel() {return level;}
|
int getLevel() {return level;}
|
||||||
public void setLevel() {
|
void setLevel() {
|
||||||
for (int i = 0; i < LEVEL_PX.length; i++){
|
for (int i = 0; i < LEVEL_PX.length; i++){
|
||||||
if(px < LEVEL_PX[i]) {
|
if(px < LEVEL_PX[i]) {
|
||||||
level = i; return;
|
level = i; return;
|
||||||
|
@ -154,21 +154,21 @@ public class Player {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getMaxPg() {return maxPg;}
|
int getMaxPg() {return maxPg;}
|
||||||
public void setMaxPg(int maxPg) {
|
void setMaxPg(int maxPg) {
|
||||||
if(this.maxPg == 0)
|
if(this.maxPg == 0)
|
||||||
this.pg = maxPg;
|
this.pg = maxPg;
|
||||||
this.maxPg = maxPg;
|
this.maxPg = maxPg;
|
||||||
}
|
}
|
||||||
public void setMaxPgOnLevelUp() {maxPg += CLASS_STATS[PG_ON_LEVEL_UP][classInt];}
|
void setMaxPgOnLevelUp() {maxPg += CLASS_STATS[PG_ON_LEVEL_UP][classInt];}
|
||||||
|
|
||||||
public int getPg() {return pg;}
|
int getPg() {return pg;}
|
||||||
public void setPg(int pg) {this.pg = pg; setState();}
|
void setPg(int pg) {this.pg = pg; setState();}
|
||||||
public void losePg(int damage) {
|
void losePg(int damage) {
|
||||||
pg -= damage;
|
pg -= damage;
|
||||||
setState();
|
setState();
|
||||||
}
|
}
|
||||||
public int recoverPg(int recovered, boolean uses) {
|
int recoverPg(int recovered, boolean uses) {
|
||||||
if(recovered == USE_CURATIVE_EFFORT){
|
if(recovered == USE_CURATIVE_EFFORT){
|
||||||
if(uses && curativeEfforts <= 0) return NOT_CURED;
|
if(uses && curativeEfforts <= 0) return NOT_CURED;
|
||||||
else {
|
else {
|
||||||
|
@ -193,8 +193,8 @@ public class Player {
|
||||||
return CURED;
|
return CURED;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLastState() {return lastState == state ? SAME : lastState;}
|
int getLastState() {return lastState == state ? SAME : lastState;}
|
||||||
public int getState() {return state;}
|
int getState() {return state;}
|
||||||
private void setState() {
|
private void setState() {
|
||||||
lastState = state;
|
lastState = state;
|
||||||
if (pg <= maxPg / -2) state = MUERTO;
|
if (pg <= maxPg / -2) state = MUERTO;
|
||||||
|
@ -203,49 +203,49 @@ public class Player {
|
||||||
else state = OK;
|
else state = OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {return name;}
|
String getName() {return name;}
|
||||||
public void setName(String name) {this.name = name;}
|
void setName(String name) {this.name = name;}
|
||||||
|
|
||||||
public int getClassInt() {return classInt;}
|
int getClassInt() {return classInt;}
|
||||||
public void setClassInt(int classInt) {
|
void setClassInt(int classInt) {
|
||||||
this.classInt = classInt;
|
this.classInt = classInt;
|
||||||
if (atk != null) setClass();
|
if (atk != null) setClass();
|
||||||
}
|
}
|
||||||
public String getClassName() {return CLASS_STRINGS[classInt];}
|
String getClassName() {return CLASS_STRINGS[classInt];}
|
||||||
|
|
||||||
public String getRaceName() {return RACE_STRINGS[raceInt];}
|
String getRaceName() {return RACE_STRINGS[raceInt];}
|
||||||
public void setRaceInt(int raceInt) {this.raceInt= raceInt;}
|
void setRaceInt(int raceInt) {this.raceInt= raceInt;}
|
||||||
public int getRaceInt() {return raceInt;}
|
int getRaceInt() {return raceInt;}
|
||||||
|
|
||||||
//TODO: implement turns (for bonuses and continuous damage in the app
|
//TODO: implement turns (for bonuses and continuous damage in the app
|
||||||
public void rest(boolean isLong) {
|
void rest(boolean isLong) {
|
||||||
if(isLong) {
|
if(isLong) {
|
||||||
pg = maxPg;
|
pg = maxPg;
|
||||||
curativeEfforts = maxCurativeEfforts;
|
curativeEfforts = maxCurativeEfforts;
|
||||||
for (Power p : powers)
|
for (Power p : powers)
|
||||||
if (p != null && p.getType() == Power.DIARIO)
|
if (p != null && p.getFrequency() == Power.DIARIO)
|
||||||
p.recover();
|
p.recover();
|
||||||
setState();
|
setState();
|
||||||
}
|
}
|
||||||
for (Power p : powers)
|
for (Power p : powers)
|
||||||
if (p != null && p.getType() == Power.ENCUENTRO)
|
if (p != null && p.getFrequency() == Power.ENCUENTRO)
|
||||||
p.recover();
|
p.recover();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAtk(int[] atk) {this.atk = atk; if(classInt != NULL) setClass();}
|
void setAtk(int[] atk) {this.atk = atk; if(classInt != NULL) setClass();}
|
||||||
|
|
||||||
public int getFue() {return atk[FUE];}
|
int getFue() {return atk[FUE];}
|
||||||
public int getCon() {return atk[CON];}
|
int getCon() {return atk[CON];}
|
||||||
public int getSab() {return atk[SAB];}
|
int getSab() {return atk[SAB];}
|
||||||
public int getCar() {return atk[CAR];}
|
int getCar() {return atk[CAR];}
|
||||||
public int getDes() {return atk[DES];}
|
int getDes() {return atk[DES];}
|
||||||
public int getInt() {return atk[INT];}
|
int getInt() {return atk[INT];}
|
||||||
public int getCa() {return def[CA];}
|
int getCa() {return def[CA];}
|
||||||
public int getFort() {return def[FORT];}
|
int getFort() {return def[FORT];}
|
||||||
public int getRef() {return def[REF];}
|
int getRef() {return def[REF];}
|
||||||
public int getVol() {return def[VOL];}
|
int getVol() {return def[VOL];}
|
||||||
|
|
||||||
public void setClass() {
|
void setClass() {
|
||||||
if(level == 1) maxPg = atk[CON] + CLASS_STATS[INITIAL_PG][classInt];
|
if(level == 1) maxPg = atk[CON] + CLASS_STATS[INITIAL_PG][classInt];
|
||||||
maxCurativeEfforts = Player.getModifier(atk[CON]) + CLASS_STATS[DAILY_CURATIVE_EFFORTS][classInt];
|
maxCurativeEfforts = Player.getModifier(atk[CON]) + CLASS_STATS[DAILY_CURATIVE_EFFORTS][classInt];
|
||||||
//TODO: fix ca bonuses!
|
//TODO: fix ca bonuses!
|
||||||
|
@ -258,7 +258,7 @@ public class Player {
|
||||||
CLASS_STATS[DEF_VOL][classInt];
|
CLASS_STATS[DEF_VOL][classInt];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getModifier(int i) {
|
static int getModifier(int i) {
|
||||||
return i / 2 - 5;
|
return i / 2 - 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.kauron.dungeonmanager;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
class PlayerAdapter extends ArrayAdapter<Player> {
|
||||||
|
|
||||||
|
PlayerAdapter(Context context, Player[] players) {
|
||||||
|
super(context, R.layout.player_row, players);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
LayoutInflater mInflater = LayoutInflater.from(getContext());
|
||||||
|
View mView = mInflater.inflate(R.layout.player_row, parent, false);
|
||||||
|
|
||||||
|
final Player player = getItem(position);
|
||||||
|
|
||||||
|
((TextView) mView.findViewById(R.id.name)).setText(player.getName());
|
||||||
|
((TextView) mView.findViewById(R.id.other)).setText(player.getClassName() + " " + player.getRaceName());
|
||||||
|
((TextView) mView.findViewById(R.id.level))
|
||||||
|
.setText(
|
||||||
|
getContext().getResources().getString(R.string.level)
|
||||||
|
+ " " + player.getLevel()
|
||||||
|
);
|
||||||
|
|
||||||
|
ProgressBar pg = (ProgressBar) mView.findViewById(R.id.progressBar);
|
||||||
|
pg.setMax(player.getMaxPg());
|
||||||
|
pg.setProgress(player.getPg());
|
||||||
|
|
||||||
|
return mView;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,28 +1,64 @@
|
||||||
package com.kauron.dungeonmanager;
|
package com.kauron.dungeonmanager;
|
||||||
|
|
||||||
public class Power {
|
class Power {
|
||||||
|
public static final int MELEE = 1, AREA = 2, RANGED = 3;
|
||||||
public static final int DIARIO = 4, A_VOLUNTAD = 2, ENCUENTRO = 3, OPORTUNIDAD = 1;
|
public static final int DIARIO = 4, A_VOLUNTAD = 2, ENCUENTRO = 3, OPORTUNIDAD = 1;
|
||||||
|
|
||||||
private boolean used;
|
private boolean used;
|
||||||
private int type;
|
private int frequency, range, distance;
|
||||||
private String name;
|
private String name, keywords;
|
||||||
private int atk, def, damage;
|
private int atk, def;
|
||||||
|
/** An array filled with the maximum damage of each die.
|
||||||
|
* The position 0 is the damage that doesn't depend on dies.
|
||||||
|
* Example: 1d6 + 1d4 + 4 is stored as {4, 4, 6}*/
|
||||||
|
private int[] damage;
|
||||||
|
//TODO: modify this so that it takes an array of the same size always, each with each kind of damage
|
||||||
|
|
||||||
|
|
||||||
public Power(String name, int type){
|
Power(String name, int frequency, int range, int distance, String keywords, int atk, int def, int[] damage){
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.type = type;
|
this.keywords = keywords;
|
||||||
|
this.frequency = frequency;
|
||||||
|
this.range = range;
|
||||||
|
this.distance = distance;
|
||||||
|
this.atk = atk;
|
||||||
|
this.def = def;
|
||||||
|
this.damage = damage;
|
||||||
used = false;
|
used = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName(){return name;}
|
String getName(){return name;}
|
||||||
public int getType(){return type;}
|
int getFrequency() {return frequency;}
|
||||||
|
String getFrequencyString(){
|
||||||
|
//TODO: change lists to arrays in resources
|
||||||
|
switch(frequency) {
|
||||||
|
case 1: return "Oportunidad";
|
||||||
|
case 2: return "A voluntad";
|
||||||
|
case 3: return "Encuentro";
|
||||||
|
case 4: return "Diario";
|
||||||
|
default: return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int getRange() {return range;}
|
||||||
|
String getRangeString() {
|
||||||
|
switch(range){
|
||||||
|
case 1: return "Cuerpo a cuerpo";
|
||||||
|
case 2: return "Área";
|
||||||
|
case 3: return "A distancia";
|
||||||
|
default: return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int getDistance() {return distance;}
|
||||||
|
String getKeywords() {return keywords;}
|
||||||
|
int getAtk() {return atk;}
|
||||||
|
int getDef() {return def;}
|
||||||
|
int[] getDamage() {return damage;}
|
||||||
|
|
||||||
public boolean isUsed(){return used;}
|
boolean isUsed(){return used;}
|
||||||
|
|
||||||
public void use(){
|
void use(){
|
||||||
if(type >= ENCUENTRO && !used)
|
if(frequency >= ENCUENTRO && !used)
|
||||||
used = true;
|
used = true;
|
||||||
}
|
}
|
||||||
public void recover(){used = false;}
|
void recover(){used = false;}
|
||||||
}
|
}
|
41
app/src/main/java/com/kauron/dungeonmanager/PowerEditor.java
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
package com.kauron.dungeonmanager;
|
||||||
|
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
|
|
||||||
|
public class PowerEditor extends ActionBarActivity {
|
||||||
|
|
||||||
|
public static final String NAME="name", FREQ="freq", KEYWORDS="keywords", RANGE="range", DISTANCE="distance";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_power_editor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
getMenuInflater().inflate(R.menu.menu_power_editor, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
//noinspection SimplifiableIfStatement
|
||||||
|
if (id == R.id.action_settings) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
BIN
app/src/main/res/drawable-hdpi/ic_add_user.png
Normal file
After Width: | Height: | Size: 449 B |
BIN
app/src/main/res/drawable-hdpi/ic_delete.png
Normal file
After Width: | Height: | Size: 245 B |
BIN
app/src/main/res/drawable-hdpi/ic_edit.png
Normal file
After Width: | Height: | Size: 423 B |
BIN
app/src/main/res/drawable-mdpi/ic_add_user.png
Normal file
After Width: | Height: | Size: 334 B |
BIN
app/src/main/res/drawable-mdpi/ic_delete.png
Normal file
After Width: | Height: | Size: 206 B |
BIN
app/src/main/res/drawable-mdpi/ic_edit.png
Normal file
After Width: | Height: | Size: 285 B |
BIN
app/src/main/res/drawable-xhdpi/ic_add_user.png
Normal file
After Width: | Height: | Size: 552 B |
BIN
app/src/main/res/drawable-xhdpi/ic_delete.png
Normal file
After Width: | Height: | Size: 305 B |
BIN
app/src/main/res/drawable-xhdpi/ic_edit.png
Normal file
After Width: | Height: | Size: 487 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_add_user.png
Normal file
After Width: | Height: | Size: 814 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_delete.png
Normal file
After Width: | Height: | Size: 412 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_edit.png
Normal file
After Width: | Height: | Size: 755 B |
|
@ -11,6 +11,17 @@
|
||||||
android:background="@color/primary"
|
android:background="@color/primary"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
|
tools:text="Kauron"/>
|
||||||
|
</RelativeLayout>
|
||||||
</android.support.v7.widget.Toolbar>
|
</android.support.v7.widget.Toolbar>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
@ -240,6 +251,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:onClick="onAttackClick"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -275,7 +287,7 @@
|
||||||
android:layout_row="0"
|
android:layout_row="0"
|
||||||
android:layout_column="0"
|
android:layout_column="0"
|
||||||
android:id="@+id/FUE"
|
android:id="@+id/FUE"
|
||||||
android:hint="@string/FUE" />
|
tools:text="@string/FUE" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -286,7 +298,7 @@
|
||||||
android:layout_row="1"
|
android:layout_row="1"
|
||||||
android:layout_column="0"
|
android:layout_column="0"
|
||||||
android:id="@+id/CON"
|
android:id="@+id/CON"
|
||||||
android:hint="@string/CON" />
|
tools:text="@string/CON" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -297,7 +309,7 @@
|
||||||
android:layout_row="0"
|
android:layout_row="0"
|
||||||
android:layout_column="1"
|
android:layout_column="1"
|
||||||
android:id="@+id/DES"
|
android:id="@+id/DES"
|
||||||
android:hint="@string/DES" />
|
tools:text="@string/DES" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -308,7 +320,7 @@
|
||||||
android:layout_row="1"
|
android:layout_row="1"
|
||||||
android:layout_column="1"
|
android:layout_column="1"
|
||||||
android:id="@+id/INT"
|
android:id="@+id/INT"
|
||||||
android:hint="@string/INT" />
|
tools:text="@string/INT" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -319,7 +331,7 @@
|
||||||
android:layout_row="0"
|
android:layout_row="0"
|
||||||
android:layout_column="2"
|
android:layout_column="2"
|
||||||
android:id="@+id/SAB"
|
android:id="@+id/SAB"
|
||||||
android:hint="@string/SAB" />
|
tools:text="@string/SAB" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -330,7 +342,7 @@
|
||||||
android:layout_row="1"
|
android:layout_row="1"
|
||||||
android:layout_column="2"
|
android:layout_column="2"
|
||||||
android:id="@+id/CAR"
|
android:id="@+id/CAR"
|
||||||
android:hint="@string/CAR" />
|
tools:text="@string/CAR" />
|
||||||
</GridLayout>
|
</GridLayout>
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -372,7 +384,7 @@
|
||||||
android:layout_row="0"
|
android:layout_row="0"
|
||||||
android:layout_column="0"
|
android:layout_column="0"
|
||||||
android:id="@+id/CA"
|
android:id="@+id/CA"
|
||||||
android:hint="@string/CA" />
|
tools:text="@string/CA" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -383,7 +395,7 @@
|
||||||
android:layout_row="0"
|
android:layout_row="0"
|
||||||
android:layout_column="1"
|
android:layout_column="1"
|
||||||
android:id="@+id/FORT"
|
android:id="@+id/FORT"
|
||||||
android:hint="@string/FORT" />
|
tools:text="@string/FORT" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -394,7 +406,7 @@
|
||||||
android:layout_row="1"
|
android:layout_row="1"
|
||||||
android:layout_column="0"
|
android:layout_column="0"
|
||||||
android:id="@+id/REF"
|
android:id="@+id/REF"
|
||||||
android:hint="@string/REF" />
|
tools:text="@string/REF" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -405,7 +417,7 @@
|
||||||
android:layout_row="1"
|
android:layout_row="1"
|
||||||
android:layout_column="1"
|
android:layout_column="1"
|
||||||
android:id="@+id/VOL"
|
android:id="@+id/VOL"
|
||||||
android:hint="@string/VOL" />
|
tools:text="@string/VOL" />
|
||||||
</GridLayout>
|
</GridLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
9
app/src/main/res/layout/activity_power_editor.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
|
tools:context="com.kauron.dungeonmanager.PowerEditor">
|
||||||
|
|
||||||
|
</RelativeLayout>
|
|
@ -2,29 +2,57 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
tools:context="com.kauron.dungeonmanager.Welcome"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:minHeight="?attr/actionBarSize"
|
||||||
|
android:background="@color/primary"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
|
tools:text="DungeonManager"
|
||||||
|
android:id="@+id/title" />
|
||||||
|
</RelativeLayout>
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
android:paddingTop="@dimen/activity_vertical_margin"
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
tools:context="com.kauron.dungeonmanager.Welcome"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/new_character"
|
android:text="@string/new_character"
|
||||||
android:id="@+id/newCharacter"
|
android:id="@+id/newCharacter"
|
||||||
android:onClick="onNewClick"
|
android:onClick="onNewClick"/>
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentEnd="true" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/load_character"
|
android:text="@string/load_character"
|
||||||
android:id="@+id/loadCharacter"
|
android:id="@+id/loadCharacter"
|
||||||
android:onClick="onLoadClick"
|
android:onClick="onLoadClick"/>
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true" />
|
<ListView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/listView2"
|
||||||
|
android:layout_gravity="center_horizontal" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -1,33 +1,58 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:text="Name"
|
android:id="@+id/delete"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:src="@drawable/ic_delete"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:contentDescription="@string/edit" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
tools:text="Happiness"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:id="@+id/name" />
|
android:id="@+id/name" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:text="Extra info"
|
tools:text="Melee 1"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:id="@+id/extra" />
|
android:id="@+id/extra"
|
||||||
</LinearLayout>
|
android:layout_below="@+id/name"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentStart="true" />
|
||||||
|
|
||||||
<ImageView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
tools:image="@drawable/delete"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/imageView" />
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
</LinearLayout>
|
android:id="@+id/keywords"
|
||||||
|
tools:text="(fire, explosion)"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:layout_alignBottom="@id/extra"
|
||||||
|
android:layout_toRightOf="@+id/extra"
|
||||||
|
android:layout_toEndOf="@+id/extra" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:id="@+id/frequency"
|
||||||
|
android:layout_alignBottom="@+id/name"
|
||||||
|
android:layout_toRightOf="@+id/name"
|
||||||
|
android:layout_toEndOf="@+id/name"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
tools:text="At will"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
49
app/src/main/res/layout/player_row.xml
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
|
tools:text="Kauron"
|
||||||
|
android:id="@+id/name"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentStart="true" />
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
android:layout_below="@+id/name"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentStart="true" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
tools:text="Brujo Tiflin"
|
||||||
|
android:id="@+id/other"
|
||||||
|
android:layout_above="@+id/progressBar"
|
||||||
|
android:layout_toRightOf="@+id/name"
|
||||||
|
android:layout_toEndOf="@+id/name"
|
||||||
|
android:paddingLeft="15dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
tools:text="LVL 1"
|
||||||
|
android:id="@+id/level"
|
||||||
|
android:layout_above="@+id/progressBar"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentEnd="true" />
|
||||||
|
</RelativeLayout>
|
7
app/src/main/res/menu/menu_power_editor.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:context="com.kauron.dungeonmanager.PowerEditor">
|
||||||
|
<item android:id="@+id/action_settings" android:title="@string/action_settings"
|
||||||
|
android:orderInCategory="100" app:showAsAction="never" />
|
||||||
|
</menu>
|
|
@ -82,4 +82,9 @@
|
||||||
<string name="load_character">Load character</string>
|
<string name="load_character">Load character</string>
|
||||||
<string name="new_character_warning">This will erase any previously existing data saved</string>
|
<string name="new_character_warning">This will erase any previously existing data saved</string>
|
||||||
<string name="new_attack">New attack</string>
|
<string name="new_attack">New attack</string>
|
||||||
|
<string name="edit">Edit</string>
|
||||||
|
<string name="delete">Delete</string>
|
||||||
|
<string name="title_activity_power_editor">PowerEditor</string>
|
||||||
|
|
||||||
|
<string name="hello_world">Hello world!</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|