diff --git a/app/build.gradle b/app/build.gradle index 48e7a12..83ba8d6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,7 @@ android { minSdkVersion 15 targetSdkVersion 21 versionCode 1 - versionName "1.0" + versionName "0.3.0" } buildTypes { release { diff --git a/app/src/main/java/com/slothwerks/hearthstone/compendiumforhearthstone/ui/edit/DeckBuilderActivity.java b/app/src/main/java/com/slothwerks/hearthstone/compendiumforhearthstone/ui/edit/DeckBuilderActivity.java index 3fd36e4..82d57e3 100644 --- a/app/src/main/java/com/slothwerks/hearthstone/compendiumforhearthstone/ui/edit/DeckBuilderActivity.java +++ b/app/src/main/java/com/slothwerks/hearthstone/compendiumforhearthstone/ui/edit/DeckBuilderActivity.java @@ -61,8 +61,9 @@ protected void onCreate(Bundle savedInstanceState) { } // add the rest of the deck builder + DeckBuilderFragment deckBuilderFragment = null; if(savedInstanceState == null) { - DeckBuilderFragment deckBuilderFragment = new DeckBuilderFragment(); + deckBuilderFragment = new DeckBuilderFragment(); Bundle bundle = new Bundle(); // pass in the ID of the deck we're working with @@ -73,16 +74,21 @@ protected void onCreate(Bundle savedInstanceState) { getSupportFragmentManager().beginTransaction() .add(R.id.container, deckBuilderFragment) .commit(); + } + // need to do this to restore the right-drawer deck list + if(deckBuilderFragment == null) + deckBuilderFragment = (DeckBuilderFragment) + getSupportFragmentManager().findFragmentById(R.id.container); - // set up for the right-bar deck list - mDeckDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); - mDeckDrawer = (ListView) findViewById(R.id.deck_builder_deck_drawer); + // set up for the right-bar deck list + mDeckDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); + mDeckDrawer = (ListView) findViewById(R.id.deck_builder_deck_drawer); + + mListAdapter = + new DeckListArrayAdapter(this, deckBuilderFragment.getDeck().getCards()); + mDeckDrawer.setAdapter(mListAdapter); - mListAdapter = - new DeckListArrayAdapter(this, deckBuilderFragment.getDeck().getCards()); - mDeckDrawer.setAdapter(mListAdapter); - } // set the title ("Deck Builder (0/30)") setTitle(String.format(getString(R.string.activity_deck_builder), 0, 30));