In my app there is the view says googleBtn. If i press on it then the Animation occurs and the Menu view goes to upar side. and if i press that button again then the menu will open. See the Below images.
While menu is open:
After menu is closed:
Now the problem is animation occurs right to hide the Menu. But after finishing the animation i want to fix the menu layout to that position (As like second image) but it not happend like that.
Right now if the menu is open and i press google button then the menu getting closed. but after finishing the animation it comes to normal position.
I have try with to fix the scroll y position of the Layout but still not get success.
The code for the Button click is below:
case R.id.googleBtn:
if(menu){
menuLayout.startAnimation(hideMenu);
menu = false;
}
else{
menuLayout.startAnimation(showMenu);
menu = true;
}
break;
and the layout of the Menu is like below:
<LinearLayout android:id="@+id/menuLayout"
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:gravity="center_horizontal"
android:background="@drawable/slide">
<View android:layout_height="80dp" android:layout_width="80dp"
android:layout_marginBottom="25dp" android:id="@+id/googleBtn"
android:background="#00000000" android:layout_gravity="bottom"/>
</LinearLayout>
So why i am not able to fix the scroll value? ?
Need help regarding this.
Update
This are my code for the Animation:
For Menuhide:
<?xml version="1.0" encoding="utf-8"?>
<translate
android:fromYDelta="0"
android:toYDelta="-70%"
android:duration="1000"
android:fillEnabled="true"
android:fillAfter="true"
/>
And for MenuShow:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromYDelta="-70%"
android:toYDelta="0"
android:duration="1000"/>
</set>