mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
[Mobile] update FDeckChooser
- select the index as workaround to refresh the display for other deck category
This commit is contained in:
@@ -232,13 +232,22 @@ public class FDeckChooser extends FScreen {
|
|||||||
@Override
|
@Override
|
||||||
public void onActivate() {
|
public void onActivate() {
|
||||||
String selectedDeck = "";
|
String selectedDeck = "";
|
||||||
if (lstDecks.getSelectedItem() != null)
|
int index = 0;
|
||||||
|
if (lstDecks.getSelectedItem() != null) {
|
||||||
selectedDeck = lstDecks.getSelectedItem().getDeck().toString();
|
selectedDeck = lstDecks.getSelectedItem().getDeck().toString();
|
||||||
if (lstDecks.getConfig().getViewIndex() == 1 && selectedDeckType.name().startsWith("NET_")) {
|
index = lstDecks.getSelectedIndex();
|
||||||
if (firstActivation) {
|
}
|
||||||
|
if (lstDecks.getConfig().getViewIndex() == 1 && firstActivation) {
|
||||||
firstActivation = false;
|
firstActivation = false;
|
||||||
lstDecks.refresh();
|
lstDecks.refresh();
|
||||||
|
if (selectedDeckType.name().startsWith("NET_")) {
|
||||||
|
//we can't use the index here since net decks are updated and may add decks and can be inserted anywhere
|
||||||
lstDecks.setSelectedString(selectedDeck);
|
lstDecks.setSelectedString(selectedDeck);
|
||||||
|
} else {
|
||||||
|
//we use index here as a workaround, if the provided decks are updated somehow at least it will refresh the display
|
||||||
|
if (lstDecks.getSelectedIndex() < 0) {
|
||||||
|
lstDecks.setSelectedIndex(index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (needRefreshOnActivate) {
|
} else if (needRefreshOnActivate) {
|
||||||
needRefreshOnActivate = false;
|
needRefreshOnActivate = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user