- Forum posts: 1
Apr 21, 2016, 7:16:50 AM via Website
Apr 21, 2016 7:16:50 AM via Website
in my application i have navigation drawer during navigation it get stuck in some fragment transition
i want smooth transition.. i am using following code for that
public void displayView(int position) {
// update the main content by replacing fragments
Fragment fragment = null;
switch (position) {
case 0:
fragment = new Profile_Fragment();
break;
case 1:
fragment = new Home_Fragment();
break;
case 3:
fragment = new Promos_Fragment();
break;
case 4:
fragment = new Vouchers_Fragment();
break;
default:
break;
}
if (fragment != null) {
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();
// update selected item and title, then close the drawer
mDrawerList.setItemChecked(position, true);
mDrawerList.setSelection(position);
mDrawerLayout.closeDrawer(navDrawerView);
} else {
PrintLog.Log(TAG, "Error in creating fragment");
}
}
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.