M
M
moved_on2015-02-25 01:56:05
Android
moved_on, 2015-02-25 01:56:05

ActionBarDrawerToggle Material animation - from "hamburger" to arrow programmatically?

Good afternoon everyone!
In the latest appcompat, the side menu control icon beautifully transforms into an arrow when the navigation opens and closes. I want to use it not only when changing the state of the side menu, but also when transitioning between fragments.
transition example:

mNavigationDrawerFragment.getmDrawerToggle().setDrawerIndicatorEnabled(false);
        mNavigationDrawerFragment.getmDrawerToggle().setHomeAsUpIndicator(getV7DrawerToggleDelegate().getThemeUpIndicator());
        setSupportActionBar(saveToolbar);
        FragmentManager fragmentManager = getFragmentManager();
        fragmentManager.beginTransaction().addToBackStack(null)
                .setCustomAnimations(R.animator.slide_in_left, R.animator.slide_out_right, 0, 0)
                .replace(R.id.container, new UserFragment(id))
                .commit();

How to make the icon not just change, but do it animatedly?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question