how can I display a layout in the center with slideUp when I press the button, and press again to hide ... slideDown in ANDROID
help me with that, thnkss
how can I display a layout in the center with slideUp when I press the button, and press again to hide ... slideDown in ANDROID
help me with that, thnkss
I had a similar requirement in the app I am working on. And, I found a third-party library which does a slide-up, slide-down and slide-right in Android.
Refer to the link for more details: https://github.com/mancj/SlideUp-Android
To set up the library(copied from the ReadMe portion of its Github page on request):
Get SlideUp library
Add the JitPack repository to your build file. Add it in your root build.gradle at the end of repositories:
Add the dependency (in the Module gradle)
To add the SlideUp into your project, follow these three simple steps:
Step 1:
create any type of layout
Step 2:
Find that view in your activity/fragment
Step 3:
Create a SlideUp object and pass in your view
You may also refer to the sample project on the link. I found it quite useful.
Create two animation xml under res/anim folder
slide_down.xml
slide_up.xml
Load animation Like bellow Code and start animation when you want According to your Requirement
I use these easy functions, it work like jquery slideUp slideDown, use it in an helper class, just pass your view :
This doesn't work for me, I want to to like jquery slideUp / slideDown function, I tried this code, but it only move the content wich stay at the same place after animation end, the view should have a 0dp height at start of slideDown and the view height (with wrap_content) after the end of the animation.