Fixed Snackbars and changed to Light
This commit is contained in:
parent
624766ad33
commit
5cdb4b2932
3 changed files with 20 additions and 36 deletions
|
@ -98,7 +98,7 @@ public class MainActivity extends ActionBarActivity{
|
|||
if(player.getMaxPg() <= player.getPg()){
|
||||
SnackbarManager.show(
|
||||
Snackbar
|
||||
.with(getApplicationContext())
|
||||
.with(this)
|
||||
.text(R.string.maxed_curative)
|
||||
);
|
||||
} else {
|
||||
|
@ -144,13 +144,7 @@ public class MainActivity extends ActionBarActivity{
|
|||
// Player.LEVEL_PX[player.getLevel() - 1],
|
||||
// true, player.getPx() - Player.LEVEL_PX[player.getLevel() - 1]
|
||||
// );
|
||||
} catch(Exception e) {
|
||||
SnackbarManager.show(
|
||||
Snackbar
|
||||
.with(getApplicationContext())
|
||||
.text(R.string.message_no_px)
|
||||
);
|
||||
}
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
});
|
||||
alert.show();
|
||||
|
@ -160,7 +154,7 @@ public class MainActivity extends ActionBarActivity{
|
|||
player.rest(true);
|
||||
SnackbarManager.show(
|
||||
Snackbar
|
||||
.with(getApplicationContext())
|
||||
.with(this)
|
||||
.text(R.string.long_rest_done)
|
||||
);
|
||||
p.edit()
|
||||
|
@ -173,7 +167,7 @@ public class MainActivity extends ActionBarActivity{
|
|||
player.rest(false);
|
||||
SnackbarManager.show(
|
||||
Snackbar
|
||||
.with(getApplicationContext())
|
||||
.with(this)
|
||||
.text(R.string.rest_done)
|
||||
);
|
||||
pgUpdate();
|
||||
|
@ -197,14 +191,14 @@ public class MainActivity extends ActionBarActivity{
|
|||
if (hasCured == Player.NOT_CURED) {
|
||||
SnackbarManager.show(
|
||||
Snackbar
|
||||
.with(getApplicationContext())
|
||||
.with(this)
|
||||
.text(R.string.no_curative_efforts_error)
|
||||
);
|
||||
} else {
|
||||
if(hasCured == Player.MAXED){
|
||||
SnackbarManager.show(
|
||||
Snackbar
|
||||
.with(getApplicationContext())
|
||||
.with(this)
|
||||
.text(R.string.maxed_curative)
|
||||
);
|
||||
}
|
||||
|
@ -327,11 +321,12 @@ public class MainActivity extends ActionBarActivity{
|
|||
|
||||
alert.setNegativeButton(R.string.die, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int whichButton) {
|
||||
SnackbarManager.show(
|
||||
Snackbar
|
||||
.with(getApplicationContext())
|
||||
.text(R.string.message_death)
|
||||
);
|
||||
//TODO: fix
|
||||
// SnackbarManager.show(
|
||||
// Snackbar
|
||||
// .with(this)
|
||||
// .text(R.string.message_death)
|
||||
// );
|
||||
p.edit().clear().apply();
|
||||
restoreData();
|
||||
}
|
||||
|
@ -346,7 +341,7 @@ public class MainActivity extends ActionBarActivity{
|
|||
if(lastState != Player.SAME) {
|
||||
SnackbarManager.show(
|
||||
Snackbar
|
||||
.with(getApplicationContext())
|
||||
.with(this)
|
||||
.text(R.string.state_changed_debilitado)
|
||||
);
|
||||
}
|
||||
|
@ -358,7 +353,7 @@ public class MainActivity extends ActionBarActivity{
|
|||
if(lastState != Player.SAME) {
|
||||
SnackbarManager.show(
|
||||
Snackbar
|
||||
.with(getApplicationContext())
|
||||
.with(this)
|
||||
.text(R.string.state_changed_malherido)
|
||||
);
|
||||
}
|
||||
|
@ -507,7 +502,7 @@ public class MainActivity extends ActionBarActivity{
|
|||
if (!message.isEmpty()) {
|
||||
SnackbarManager.show(
|
||||
Snackbar
|
||||
.with(getApplicationContext())
|
||||
.with(this)
|
||||
.text(message)
|
||||
);
|
||||
}
|
||||
|
@ -530,14 +525,7 @@ public class MainActivity extends ActionBarActivity{
|
|||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (input.getText().toString().isEmpty()) {
|
||||
SnackbarManager.show(
|
||||
Snackbar
|
||||
.with(getApplicationContext())
|
||||
.text(R.string.empty_field)
|
||||
);
|
||||
pgDialog();
|
||||
} else {
|
||||
if (!input.getText().toString().isEmpty()) {
|
||||
player.setMaxPg(Integer.parseInt(input.getText().toString()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,14 +8,15 @@ import android.view.Menu;
|
|||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.nispok.snackbar.Snackbar;
|
||||
import com.nispok.snackbar.SnackbarManager;
|
||||
|
||||
|
||||
public class Welcome extends ActionBarActivity {
|
||||
|
||||
private Button load;
|
||||
private SharedPreferences p;
|
||||
private TextView newText;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -23,15 +24,12 @@ public class Welcome extends ActionBarActivity {
|
|||
setContentView(R.layout.activity_welcome);
|
||||
p = getSharedPreferences("basics", MODE_PRIVATE);
|
||||
load = (Button) findViewById(R.id.loadCharacter);
|
||||
newText = (TextView) findViewById(R.id.newText);
|
||||
if (p.getBoolean("saved", false)) {
|
||||
load.setEnabled(true);
|
||||
load.setText(String.format(getString(R.string.load_text), p.getString("playerName", "")));
|
||||
newText.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
load.setEnabled(false);
|
||||
load.setText(R.string.load_character);
|
||||
newText.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,11 +69,9 @@ public class Welcome extends ActionBarActivity {
|
|||
if (p.getBoolean("saved", false)) {
|
||||
load.setEnabled(true);
|
||||
load.setText(String.format(getString(R.string.load_text), p.getString("playerName", "")));
|
||||
newText.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
load.setEnabled(false);
|
||||
load.setText(R.string.load_character);
|
||||
newText.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Base.Theme.AppCompat">
|
||||
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimaryDark">@color/primary_dark</item>
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
|
|
Reference in a new issue