任何人都知道如何实现这种类型的过渡.当我们打开Navagation
抽屉全屏正在这样的动画.我也查看了驻留菜单,但这里的菜单预定义不是我想要的.
我也试过NavigationDrawer
但没有成功.
drawer.addDrawerListener(new DrawerLayout.DrawerListener() { @Override public void onDrawerSlide(View drawerView, float slideOffset) { float moveFactor = (linearLayout.getWidth() * slideOffset); float min = 0.9f; float max = 1.0f; float scaleFactor = (max - ((max - min) * slideOffset)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { linearLayout.setTranslationX(moveFactor); linearLayout.setScaleX(scaleFactor); linearLayout.setScaleY(scaleFactor); } else { AnimationSet animSet = new AnimationSet(true); TranslateAnimation anim = new TranslateAnimation(lastTranslate, moveFactor, 0.0f, 0.0f); anim.setDuration(0); anim.setFillAfter(true); animSet.addAnimation(anim); ScaleAnimation scale = new ScaleAnimation(1.15f, 1.0f, 1.15f, 1.0f); scale.setDuration(10); scale.setFillAfter(true); animSet.addAnimation(scale); drawerView.startAnimation(animSet); lastTranslate = moveFactor; } } @Override public void onDrawerOpened(View drawerView) { } @Override public void onDrawerClosed(View drawerView) { } @Override public void onDrawerStateChanged(int newState) { } });
提前致谢