navigation drawer getting stuck during opening and closing drawer

  • Replies:1
Mehul Vishroliya
  • Forum posts: 1

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");
}
}

Reply
Androiddevi
  • Forum posts: 1

Jun 26, 2016, 12:15:05 PM via Website

Hi mehul,

android-working-with-material-navigation-drawer from androidxu(paste the same in google for links)
May be helpful for you

I have tried to develop the navigation drawer by following the tutorial with fragment and i found it to be smooth transitions.
let me know if you can provide me some more code for your issue so that we can analyze

Reply