Switched to playersList
The players are generated brand-new, as if they were just created
This commit is contained in:
parent
ce44393121
commit
aebb20542e
14 changed files with 440 additions and 262 deletions
|
@ -13,8 +13,7 @@
|
|||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
|
@ -26,7 +26,7 @@ class AttackAdapter extends ArrayAdapter<Power> {
|
|||
View mView = mInflater.inflate(R.layout.attack_row, parent, false);
|
||||
|
||||
final Power attack = getItem(position);
|
||||
|
||||
if ( attack != null ) {
|
||||
((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());
|
||||
|
@ -46,6 +46,9 @@ class AttackAdapter extends ArrayAdapter<Power> {
|
|||
//TODO: convert text to resource
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.remove(attack);
|
||||
}
|
||||
|
||||
return mView;
|
||||
}
|
||||
|
|
|
@ -3,13 +3,18 @@ package com.kauron.dungeonmanager;
|
|||
import android.content.SharedPreferences;
|
||||
import android.support.v7.app.ActionBarActivity;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.nispok.snackbar.Snackbar;
|
||||
import com.nispok.snackbar.SnackbarManager;
|
||||
|
||||
|
||||
public class Introduction extends ActionBarActivity {
|
||||
|
||||
|
@ -23,6 +28,8 @@ public class Introduction extends ActionBarActivity {
|
|||
super.onCreate(savedInstanceState);
|
||||
// getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
setContentView(R.layout.activity_introduction);
|
||||
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
|
||||
|
||||
name = (EditText) findViewById(R.id.editNameIntro);
|
||||
name.requestFocus();
|
||||
level = (EditText) findViewById(R.id.editPxIntro);
|
||||
|
@ -96,9 +103,20 @@ public class Introduction extends ActionBarActivity {
|
|||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
public void finishButton(View view){
|
||||
if(finished()) {
|
||||
finish();
|
||||
} else {
|
||||
SnackbarManager.show(
|
||||
Snackbar.with(getApplicationContext()).text(R.string.missing_info_error), this
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean finished() {
|
||||
SharedPreferences p = getSharedPreferences(Welcome.PREFERENCES, MODE_PRIVATE);
|
||||
SharedPreferences.Editor ed = p.edit();
|
||||
int i = p.getInt("players", 0);
|
||||
SharedPreferences.Editor ed = getSharedPreferences("player" + i, MODE_PRIVATE).edit();
|
||||
String nameString = name.getText().toString().trim();
|
||||
int classInt = classSpinner.getSelectedItemPosition();
|
||||
int raceInt = raceSpinner.getSelectedItemPosition();
|
||||
|
@ -146,8 +164,6 @@ public class Introduction extends ActionBarActivity {
|
|||
ed.putInt("sab", sab);
|
||||
ed.putInt("con", con);
|
||||
ed.putInt("des", des);
|
||||
|
||||
ed.putBoolean("saved", true);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -165,6 +181,8 @@ public class Introduction extends ActionBarActivity {
|
|||
if (des != 0) ed.putInt("des", des);
|
||||
}
|
||||
ed.apply();
|
||||
getSharedPreferences(Welcome.PREFERENCES, MODE_PRIVATE).edit()
|
||||
.putInt("players", i + 1).apply();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.kauron.dungeonmanager;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
|
@ -43,11 +44,10 @@ public class MainActivity extends ActionBarActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
p = getSharedPreferences(Welcome.PREFERENCES, MODE_PRIVATE);
|
||||
p = getSharedPreferences("player" + getIntent().getIntExtra("player", 0), MODE_PRIVATE);
|
||||
xpBar = (ProgressBar) findViewById(R.id.xpBar);
|
||||
curativeEffortsBar = (ProgressBar) findViewById(R.id.curativeEffortsBar);
|
||||
pgBar = (ProgressBar) findViewById(R.id.pgBar);
|
||||
|
@ -60,11 +60,11 @@ public class MainActivity extends ActionBarActivity {
|
|||
currentXp = (TextView) findViewById(R.id.currentXp);
|
||||
currentCurativeEfforts = (TextView) findViewById(R.id.currentCurativeEfforts);
|
||||
|
||||
//TODO: change references to xml and do not change progressbar background
|
||||
//TODO: do not change progressbar background
|
||||
xpBar.getProgressDrawable()
|
||||
.setColorFilter(Color.parseColor("#62BACE"), PorterDuff.Mode.SRC_IN);
|
||||
.setColorFilter(getResources().getColor(R.color.px_bar), PorterDuff.Mode.SRC_IN);
|
||||
curativeEffortsBar.getProgressDrawable()
|
||||
.setColorFilter(Color.parseColor("#FFD700"), PorterDuff.Mode.SRC_IN);
|
||||
.setColorFilter(getResources().getColor(R.color.surges_bar), PorterDuff.Mode.SRC_IN);
|
||||
undo = false;
|
||||
//begin
|
||||
restoreData();
|
||||
|
@ -257,6 +257,9 @@ public class MainActivity extends ActionBarActivity {
|
|||
|
||||
alert.setView(input);
|
||||
|
||||
final Context context = getApplicationContext();
|
||||
final MainActivity activity = this;
|
||||
|
||||
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int whichButton) {
|
||||
try {
|
||||
|
@ -274,7 +277,7 @@ public class MainActivity extends ActionBarActivity {
|
|||
undoPreviousValue = preValue;
|
||||
undoObject = CURRENT_PG;
|
||||
SnackbarManager.show(
|
||||
Snackbar.with(getApplicationContext()).text("Lost " + damage + " PG's")
|
||||
Snackbar.with(context).text("Lost " + damage + " PG's")
|
||||
.actionLabel("Undo") // action button label
|
||||
.actionListener(new ActionClickListener() {
|
||||
@Override
|
||||
|
@ -282,7 +285,8 @@ public class MainActivity extends ActionBarActivity {
|
|||
undo();
|
||||
}
|
||||
})
|
||||
,getParent()); // action button's
|
||||
.actionColor(getResources().getColor(R.color.yellow))
|
||||
,activity); // action button's
|
||||
p.edit().putInt("pg", player.getPg()).apply();
|
||||
pgUpdate();
|
||||
invalidateOptionsMenu();
|
||||
|
@ -383,7 +387,9 @@ public class MainActivity extends ActionBarActivity {
|
|||
}
|
||||
|
||||
private void restoreData(){
|
||||
int i = getIntent().getIntExtra("player", 0);
|
||||
if (!p.getBoolean("saved", false)) {
|
||||
if (i == -1) {
|
||||
Intent intent = new Intent(this, Introduction.class);
|
||||
startActivity(intent.putExtra(
|
||||
"first_time",
|
||||
|
@ -431,6 +437,7 @@ public class MainActivity extends ActionBarActivity {
|
|||
}
|
||||
player.setCurativeEffort(p.getInt("curativeEfforts", player.getMaxCurativeEfforts()));
|
||||
player.setPg(p.getInt("pg", player.getMaxPg()));
|
||||
|
||||
pgBar.setMax(player.getMaxPg());
|
||||
negPgBar.setMax(player.getMaxPg() / 2);
|
||||
// incrementProgressBar(
|
||||
|
|
|
@ -57,7 +57,7 @@ class Player {
|
|||
* Names for the races
|
||||
*/
|
||||
public static final String[] RACE_STRINGS = new String[] {
|
||||
"Raza", "Dracónido", "Eladrín", "Elfo", "Enano", "Gitzherai", "Humanos", "Medianos",
|
||||
"Raza", "Dracónido", "Eladrín", "Elfo", "Enano", "Gitzherai", "Humano", "Mediano",
|
||||
"Mente del Fragmento", "Minotauro", "Salvaje", "Semielfo", "Tiflin"
|
||||
};
|
||||
|
||||
|
@ -110,6 +110,7 @@ class Player {
|
|||
//TODO: implement fully operational powers displayed as cards
|
||||
private Power[] powers;
|
||||
|
||||
/** Constructor for creating a new character*/
|
||||
Player(
|
||||
String name, int classInt, int raceInt,
|
||||
int px, int[] atk, int[] abilities,
|
||||
|
@ -130,6 +131,25 @@ class Player {
|
|||
this.powers = powers;
|
||||
}
|
||||
|
||||
/** Constructor for restoring the Player in the middle of the game*/
|
||||
Player(
|
||||
int pg, int maxPg, int px, int curativeEfforts, int maxCurativeEfforts, int classInt,
|
||||
int raceInt, String name, int[] atk, int[] def, int[] abilities, Power[] powers) {
|
||||
this.pg = pg;
|
||||
this.maxPg = maxPg;
|
||||
this.px = px;
|
||||
setLevel();
|
||||
setState();
|
||||
this.curativeEfforts = curativeEfforts;
|
||||
this.maxCurativeEfforts = maxCurativeEfforts;
|
||||
this.classInt = classInt;
|
||||
this.raceInt = raceInt;
|
||||
this.name = name;
|
||||
this.atk = atk;
|
||||
this.def = def;
|
||||
this.abilities = abilities;
|
||||
this.powers = powers;
|
||||
}
|
||||
|
||||
int getPx() {return px;}
|
||||
void setPx (int px) {this.px = px; setLevel();}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package com.kauron.dungeonmanager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.AvoidXfermode;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -28,10 +31,27 @@ class PlayerAdapter extends ArrayAdapter<Player> {
|
|||
.setText(
|
||||
getContext().getResources().getString(R.string.level) + " " + player.getLevel()
|
||||
);
|
||||
int pg = player.getPg();
|
||||
int maxPg = player.getMaxPg();
|
||||
ProgressBar neg = (ProgressBar) mView.findViewById(R.id.negPgBar);
|
||||
ProgressBar pos = (ProgressBar) mView.findViewById(R.id.pgBar);
|
||||
|
||||
ProgressBar pg = (ProgressBar) mView.findViewById(R.id.progressBar);
|
||||
pg.setMax(player.getMaxPg());
|
||||
pg.setProgress(player.getPg());
|
||||
neg.setMax(maxPg / 2);
|
||||
pos.setMax(maxPg);
|
||||
|
||||
neg.setProgress(pg < 0 ? -pg : 0);
|
||||
pos.setProgress(pg > 0 ? pg : 0);
|
||||
|
||||
int c;
|
||||
if ( pg <= 0 )
|
||||
c = getContext().getResources().getColor(R.color.red);
|
||||
else if ( pg <= maxPg / 2 )
|
||||
c = getContext().getResources().getColor(R.color.yellow);
|
||||
else
|
||||
c = getContext().getResources().getColor(R.color.green);
|
||||
|
||||
neg.getProgressDrawable().setColorFilter(c, PorterDuff.Mode.SRC_IN);
|
||||
pos.getProgressDrawable().setColorFilter(c, PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
|
||||
return mView;
|
||||
|
|
|
@ -4,41 +4,90 @@ import android.content.Intent;
|
|||
import android.content.SharedPreferences;
|
||||
import android.support.v7.app.ActionBarActivity;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Button;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.nispok.snackbar.Snackbar;
|
||||
import com.nispok.snackbar.SnackbarManager;
|
||||
|
||||
|
||||
public class Welcome extends ActionBarActivity {
|
||||
|
||||
public static final String PREFERENCES = "basics";
|
||||
|
||||
private Button load;
|
||||
private SharedPreferences p;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_welcome);
|
||||
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
|
||||
p = getSharedPreferences(PREFERENCES, MODE_PRIVATE);
|
||||
load = (Button) findViewById(R.id.loadCharacter);
|
||||
if (p.getBoolean("saved", false)) {
|
||||
load.setEnabled(true);
|
||||
load.setText(String.format(getString(R.string.load_text), p.getString("playerName", "")));
|
||||
} else {
|
||||
load.setEnabled(false);
|
||||
load.setText(R.string.load_character);
|
||||
load();
|
||||
}
|
||||
|
||||
@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_welcome, 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_add_player ) {
|
||||
startActivity(new Intent(this, Introduction.class).putExtra("first_time", true));
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
load();
|
||||
}
|
||||
|
||||
private void load() {
|
||||
int n = p.getInt("players",0);
|
||||
if ( n != 0 ) {
|
||||
ListView playerList = (ListView) findViewById(R.id.listView);
|
||||
PlayerAdapter adapter = (PlayerAdapter) playerList.getAdapter();
|
||||
int elements = 0;
|
||||
if ( adapter != null )
|
||||
elements = adapter.getCount();
|
||||
if ( elements < n && adapter != null ) {
|
||||
playerList.setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.no_players_text).setVisibility(View.GONE);
|
||||
for ( int i = elements; i < n; i++ ) {
|
||||
SharedPreferences sav = getSharedPreferences("player" + i, MODE_PRIVATE);
|
||||
adapter.add(
|
||||
new Player(
|
||||
sav.getString(Player.NAME, "player" + i),
|
||||
sav.getInt(Player.CLASS, 0),
|
||||
sav.getInt(Player.RACE, 0),
|
||||
sav.getInt(Player.PX, 0),
|
||||
new int[] {
|
||||
sav.getInt("fue", 10),
|
||||
sav.getInt("con", 10),
|
||||
sav.getInt("des", 10),
|
||||
sav.getInt("int", 10),
|
||||
sav.getInt("sab", 10),
|
||||
sav.getInt("car", 10)
|
||||
},
|
||||
new int[18],
|
||||
new Power[4]
|
||||
));
|
||||
}
|
||||
} else if ( n != 0 ) {
|
||||
playerList.setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.no_players_text).setVisibility(View.GONE);
|
||||
Player[] players = new Player[n];
|
||||
for ( int i = 0; i < n; i++ ) {
|
||||
//TODO: fill the information for the player creation
|
||||
|
@ -60,9 +109,8 @@ public class Welcome extends ActionBarActivity {
|
|||
new Power[4]
|
||||
);
|
||||
}
|
||||
ListView playerList = (ListView) findViewById(R.id.listView);
|
||||
ListAdapter adapter = new PlayerAdapter(this, players);
|
||||
playerList.setAdapter(adapter);
|
||||
|
||||
playerList.setAdapter(new PlayerAdapter(this, players));
|
||||
|
||||
playerList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
|
@ -73,49 +121,8 @@ public class Welcome extends ActionBarActivity {
|
|||
}
|
||||
});
|
||||
} else {
|
||||
findViewById(R.id.listView).setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public void onNewClick(View view) {startActivity(new Intent(this, Introduction.class).putExtra("first_time", true));}
|
||||
public void onLoadClick(View view) {startActivity(new Intent(this, MainActivity.class).putExtra("player", -1));}
|
||||
|
||||
@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_welcome, 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) {
|
||||
SnackbarManager.show(
|
||||
Snackbar.with(getApplicationContext()).text("This doesn't work yet")
|
||||
);
|
||||
return true;
|
||||
} else if ( id == R.id.action_add_player ) {
|
||||
startActivity(new Intent(this, Introduction.class).putExtra("first_time", true));
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (p.getBoolean("saved", false)) {
|
||||
load.setEnabled(true);
|
||||
load.setText(String.format(getString(R.string.load_text), p.getString("playerName", "")));
|
||||
} else {
|
||||
load.setEnabled(false);
|
||||
load.setText(R.string.load_character);
|
||||
playerList.setVisibility(View.GONE);
|
||||
findViewById(R.id.no_players_text).setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,49 @@
|
|||
<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"
|
||||
<LinearLayout
|
||||
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:orientation="vertical"
|
||||
tools:context=".Introduction">
|
||||
|
||||
<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"
|
||||
android:text="Character creation"/>
|
||||
</RelativeLayout>
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/finish_button"
|
||||
android:onClick="finishButton"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="Save character" />
|
||||
|
||||
<ScrollView
|
||||
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=".Introduction">
|
||||
android:paddingBottom="@dimen/activity_vertical_margin">
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -151,7 +190,8 @@
|
|||
android:layout_height="fill_parent"
|
||||
android:layout_below="@+id/thirdLayout"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true">
|
||||
android:layout_alignParentStart="true"
|
||||
android:visibility="gone">
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
|
@ -160,9 +200,12 @@
|
|||
android:id="@+id/new_attack_button" />
|
||||
|
||||
<ListView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/listView" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
|
@ -52,7 +52,6 @@
|
|||
<HorizontalScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="selectPlayer"
|
||||
android:id="@+id/scroll1">
|
||||
<RelativeLayout
|
||||
android:orientation="vertical"
|
||||
|
@ -139,7 +138,7 @@
|
|||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right"
|
||||
android:gravity="end"
|
||||
android:id="@+id/currentPg"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
|
@ -165,7 +164,7 @@
|
|||
android:textStyle="bold"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="0"/>
|
||||
android:text="@string/zero"/>
|
||||
<ProgressBar
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -199,7 +198,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="right"
|
||||
android:gravity="end"
|
||||
android:id="@+id/currentCurativeEfforts"
|
||||
android:textAllCaps="true"/>
|
||||
</LinearLayout>
|
||||
|
@ -232,7 +231,7 @@
|
|||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right"
|
||||
android:gravity="end"
|
||||
android:id="@+id/currentXp"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
|
@ -251,7 +250,6 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:onClick="onAttackClick"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -6,4 +6,37 @@
|
|||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
tools:context="com.kauron.dungeonmanager.PowerEditor">
|
||||
|
||||
<EditText
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/editText"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:capitalize="words" />
|
||||
|
||||
<EditText
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/editText2"
|
||||
android:capitalize="words"
|
||||
android:layout_below="@+id/editText"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignRight="@+id/editText"
|
||||
android:layout_alignEnd="@+id/editText" />
|
||||
|
||||
<EditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/editText3"
|
||||
android:capitalize="words"
|
||||
android:layout_below="@+id/editText2"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignRight="@+id/editText2"
|
||||
android:layout_alignEnd="@+id/editText2" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -33,20 +33,13 @@
|
|||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:orientation="vertical">
|
||||
<Button
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/new_character"
|
||||
android:id="@+id/newCharacter"
|
||||
android:onClick="onNewClick"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/load_character"
|
||||
android:id="@+id/loadCharacter"
|
||||
android:onClick="onLoadClick"/>
|
||||
|
||||
android:layout_height="fill_parent"
|
||||
android:id="@+id/no_players_text"
|
||||
android:text="@string/no_players"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"/>
|
||||
<ListView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -3,7 +3,10 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/relativeLayout"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -15,16 +18,41 @@
|
|||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true" />
|
||||
|
||||
<ProgressBar
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_below="@+id/name"
|
||||
android:paddingTop="3dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true" />
|
||||
android:layout_alignParentStart="true"
|
||||
android:id="@+id/progressBar"
|
||||
android:orientation="horizontal">
|
||||
<ProgressBar
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/negPgBar"
|
||||
android:layout_weight="2"
|
||||
android:rotation="180"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAllCaps="true"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="@string/zero"/>
|
||||
<ProgressBar
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/pgBar"
|
||||
android:layout_weight="1"
|
||||
tools:progress="30"
|
||||
tools:progressTint="#FF0"/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -41,7 +69,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
tools:text="LVL 1"
|
||||
tools:text="Level 1"
|
||||
android:id="@+id/level"
|
||||
android:layout_above="@+id/progressBar"
|
||||
android:layout_alignParentRight="true"
|
||||
|
|
|
@ -8,6 +8,13 @@
|
|||
<color name="secondary_text">#727272</color>
|
||||
<color name="icons">#FFFFFF</color>
|
||||
<color name="divider">#B6B6B6</color>
|
||||
|
||||
<color name="red">#F00</color>
|
||||
<color name="yellow">#ff0</color>
|
||||
<color name="green">#0f0</color>
|
||||
|
||||
<color name="surges_bar">#FFD700</color>
|
||||
<color name="px_bar">#62BACE</color>
|
||||
<!--<color name="primary">#5D4037</color>-->
|
||||
<!--<color name="primaryDark">#3E2723</color>-->
|
||||
</resources>
|
|
@ -88,4 +88,6 @@
|
|||
|
||||
<string name="hello_world">Hello world!</string>
|
||||
<string name="add_player">Add player</string>
|
||||
<string name="zero" translatable="false">0</string>
|
||||
<string name="no_players">No players, please add one</string>
|
||||
</resources>
|
||||
|
|
Reference in a new issue