Animation

4 answers

There is currently no public API available for this.

You can try this library:

https://github.com/markushi/android-ui

+5
source

I used balysv / material-menu and successfully implemented.

ActionView By Markushi requires API level 14 + , but -menu by balysv canActionBarSherLockalsobe used withanimation settings.

:

BURGER, ARROW, X, CHECK. (X, CHECK) (BURGER, ARROW) .

enter image description here

, , - . .

, , ,

enter image description here

+4

In addition to the answer of Gabriele Mariotti.

You can try replacing the android.R.id.home file with ActionViewfrom the mentioned library.

Find and replace it:

private void replaceHomeView(Activity activity){
    View homeView;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            Resources resources = activity.getResources();
            int id = resources.getIdentifier("android:id/home", null, null);
            homeView = activity.getWindow().getDecorView().findViewById(id);
        } else {
            homeView = activity.getWindow().getDecorView().findViewById(R.id.home);
        }
    replace(homeView);

}

Remove and replace the home icon ImageView:

private replace(View home){
   ViewGroup parent = (ViewGroup) view.getParent();
   int homeIndex = parent.indexOfChild(view);
   ActionView newHome = new ActionView(home.getContext));
   newHome.setId(home.getId());
   parent.removeView(home);
   parent.addView(newHome, homeIndex);
}

Note: I have not tested this myself.

0
source

All Articles