Update interfaces when stepping back to them.
This commit is contained in:
parent
847bbe2d5f
commit
deead50800
@ -47,20 +47,6 @@ public class CardActivity extends AppCompatActivity {
|
||||
// Use manually controlled canvas
|
||||
canvasView = (CanvasView) findViewById(R.id.canvasView);
|
||||
canvasView.setParentActivity(this);
|
||||
String cardPath = this.getIntent().getStringExtra(CARD_PATH_KEY);
|
||||
if (cardPath == null) {
|
||||
finish();
|
||||
}
|
||||
|
||||
try {
|
||||
canvasView.loadCard(cardPath);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
finish();
|
||||
} catch (ErrorLoadingCardException e) {
|
||||
e.printStackTrace();
|
||||
finish();
|
||||
}
|
||||
|
||||
// Initialize auxiliary elements
|
||||
partsHolder = new PartsHolder(this);
|
||||
@ -131,10 +117,33 @@ public class CardActivity extends AppCompatActivity {
|
||||
CardActivity.this.setDevMode(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
loadCard();
|
||||
}
|
||||
|
||||
private void loadCard() {
|
||||
String cardPath = this.getIntent().getStringExtra(CARD_PATH_KEY);
|
||||
if (cardPath == null) {
|
||||
finish();
|
||||
}
|
||||
|
||||
try {
|
||||
canvasView.loadCard(cardPath);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
finish();
|
||||
} catch (ErrorLoadingCardException e) {
|
||||
e.printStackTrace();
|
||||
finish();
|
||||
}
|
||||
setDevMode(devMode);
|
||||
}
|
||||
|
||||
|
||||
private void setDevMode(boolean goToDevMode) {
|
||||
boolean willInvalidate = devMode != goToDevMode;
|
||||
|
||||
|
@ -46,11 +46,15 @@ public class DeckPreviewActivity extends AppCompatActivity {
|
||||
});
|
||||
|
||||
listView = (ListView) findViewById(R.id.card_deck_list);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
cardArrayAdapter = new CardPreviewArrayAdapter(getApplicationContext(), listAvailableCards());
|
||||
|
||||
listView.setAdapter(cardArrayAdapter);
|
||||
|
||||
}
|
||||
|
||||
private void createOpenCardDialog() {
|
||||
|
Loading…
Reference in New Issue
Block a user