Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
* Fixed the Option selection issue
Browse files Browse the repository at this point in the history
* Added first fragment reconigtion to avoid blank screen issue
  • Loading branch information
lgallard committed Oct 16, 2014
1 parent 0af8426 commit 88dbef6
Showing 1 changed file with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public void onDrawerClosed(View view) {
/** Called when a drawer has settled in a completely open state. */
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
getActionBar().setTitle(drawerTitle);
// getActionBar().setTitle(drawerTitle);
}
};

Expand Down Expand Up @@ -810,6 +810,10 @@ public void onClick(DialogInterface dialog, int id) {
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {

// Set the drawer menu's item to All
drawerList.setItemChecked(0, true);
setTitle(navigationDrawerItemTitles[0]);

if (requestCode == SETTINGS_CODE) {

// Get options from server and save them as shared preferences
Expand Down Expand Up @@ -1555,7 +1559,11 @@ protected void onPostExecute(Torrent[] result) {
// Set the second fragments container
if (findViewById(R.id.fragment_container) != null) {
firstFragment.setSecondFragmentContainer(R.id.content_frame);
fragmentTransaction.replace(R.id.list_frame, firstFragment);

if (getFragmentManager().findFragmentByTag("firstFragment") == null) {

fragmentTransaction.replace(R.id.one_frame, firstFragment, "firstFragment");
}

} else {
firstFragment.setSecondFragmentContainer(R.id.one_frame);
Expand Down Expand Up @@ -1584,7 +1592,7 @@ protected void onPostExecute(Torrent[] result) {
fragmentManager = getFragmentManager();

for (int i = 0; i < getFragmentManager().getBackStackEntryCount(); ++i) {
getFragmentManager().popBackStack("secondFragment", FragmentManager.POP_BACK_STACK_INCLUSIVE);
fragmentManager.popBackStack("secondFragment", FragmentManager.POP_BACK_STACK_INCLUSIVE);
}

// Replace with the about fragment
Expand All @@ -1600,7 +1608,10 @@ protected void onPostExecute(Torrent[] result) {
}

// Replace with the about fragment
fragmentManager.beginTransaction().replace(R.id.one_frame, firstFragment, "firstFragment").commit();
if (fragmentManager.findFragmentByTag("firstFragment") == null) {
// Replace with the about fragment
fragmentManager.beginTransaction().replace(R.id.one_frame, firstFragment, "firstFragment").commit();
}
}

}
Expand Down Expand Up @@ -1630,7 +1641,10 @@ protected void onPostExecute(Torrent[] result) {

fragmentManager = getFragmentManager();

fragmentManager.beginTransaction().replace(R.id.one_frame, firstFragment, "firstFragment").commit();
if (fragmentManager.findFragmentByTag("firstFragment") == null) {

fragmentManager.beginTransaction().replace(R.id.one_frame, firstFragment, "firstFragment").commit();
}

}
}
Expand All @@ -1655,7 +1669,9 @@ protected void onPostExecute(Torrent[] result) {

} else {
firstFragment.setSecondFragmentContainer(R.id.one_frame);
fragmentTransaction.replace(R.id.one_frame, firstFragment);
if (getFragmentManager().findFragmentByTag("firstFragment") == null) {
fragmentTransaction.replace(R.id.one_frame, firstFragment, "firstFragment");
}
fragmentTransaction.commit();
}

Expand Down

0 comments on commit 88dbef6

Please sign in to comment.