Changed damage for a NumberPicker and other minor changes
Added shortcut in Welcome for testing Tabs Reverted PowerList divider to default Deleted PowerList's alpha changes depending on the position
This commit is contained in:
parent
f96ace7d3b
commit
6ab167fb6d
4 changed files with 53 additions and 58 deletions
|
@ -41,10 +41,6 @@ class PowerAdapter extends ArrayAdapter<Power> {
|
||||||
keywords .setTextColor ( black ) ;
|
keywords .setTextColor ( black ) ;
|
||||||
frequency .setTextColor ( black ) ;
|
frequency .setTextColor ( black ) ;
|
||||||
range .setTextColor ( black ) ;
|
range .setTextColor ( black ) ;
|
||||||
|
|
||||||
//name.setPaintFlags(name.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
|
|
||||||
} else {
|
|
||||||
mView.getBackground().setAlpha((position % 2) * 50 + 205);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mView;
|
return mView;
|
||||||
|
|
|
@ -23,6 +23,7 @@ import android.widget.AdapterView;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
import android.widget.NumberPicker;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
@ -370,9 +371,11 @@ public class ShowPlayer extends ActionBarActivity {
|
||||||
alert.setTitle(R.string.suffer_damage);
|
alert.setTitle(R.string.suffer_damage);
|
||||||
|
|
||||||
// Set an EditText view to get user input
|
// Set an EditText view to get user input
|
||||||
final EditText input = new EditText(this);
|
final NumberPicker input = new NumberPicker (this);
|
||||||
input.setInputType(InputType.TYPE_CLASS_NUMBER);
|
input.setMinValue(0);
|
||||||
input.setHint(R.string.suffer_damage_hint);
|
input.setMaxValue(player.getMaxHp() * 3);
|
||||||
|
input.setValue(0);
|
||||||
|
input.setWrapSelectorWheel(false);
|
||||||
|
|
||||||
alert.setView(input);
|
alert.setView(input);
|
||||||
|
|
||||||
|
@ -381,12 +384,10 @@ public class ShowPlayer extends ActionBarActivity {
|
||||||
|
|
||||||
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int whichButton) {
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
try {
|
|
||||||
final int undoPreviousValue = player.getHp();
|
final int undoPreviousValue = player.getHp();
|
||||||
int damage = Integer.parseInt(input.getText().toString());
|
player.losePg(input.getValue());
|
||||||
player.losePg(damage);
|
|
||||||
SnackbarManager.show(
|
SnackbarManager.show(
|
||||||
Snackbar.with(context).text(String.format(getString(R.string.lost_hp), damage))
|
Snackbar.with(context).text(String.format(getString(R.string.lost_hp), input.getValue()))
|
||||||
.actionLabel(R.string.action_undo) // action button label
|
.actionLabel(R.string.action_undo) // action button label
|
||||||
.actionListener(new ActionClickListener() {
|
.actionListener(new ActionClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -409,9 +410,6 @@ public class ShowPlayer extends ActionBarActivity {
|
||||||
p.edit().putInt("pg", player.getHp()).apply();
|
p.edit().putInt("pg", player.getHp()).apply();
|
||||||
hpUpdate();
|
hpUpdate();
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
} catch (Exception e) {
|
|
||||||
Toast.makeText(getApplicationContext(), "There was an error", Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ import android.app.AlertDialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
@ -165,6 +165,9 @@ public class Welcome extends ActionBarActivity {
|
||||||
} else {
|
} else {
|
||||||
//TODO: export as files
|
//TODO: export as files
|
||||||
/**TEMP*/
|
/**TEMP*/
|
||||||
|
startActivity(new Intent(
|
||||||
|
getApplicationContext(), TabsViewPagerFragmentActivity.class
|
||||||
|
).putExtra("player", position));
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
activity, "Exporting feature not implemented yet", Toast.LENGTH_LONG)
|
activity, "Exporting feature not implemented yet", Toast.LENGTH_LONG)
|
||||||
.show();
|
.show();
|
||||||
|
|
|
@ -220,8 +220,6 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/powerList"
|
android:id="@+id/powerList"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:divider="@android:color/transparent"
|
|
||||||
android:dividerHeight="0dp"
|
|
||||||
android:choiceMode="none" />
|
android:choiceMode="none" />
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
Reference in a new issue