Anyone having idea that how to achieve this type of transition. When we open Navagation
drawer full screen is getting animation like this. I also looked at reside menu but here menu is predefined not as i want.
I also tried with NavigationDrawer
but not got succeed.
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) {
}
});
Thanks in advance
Finally I got my answer through this link for original post. Please have a look here
and for
MainActivity.java
please have a look below