user1327911
user1327911

Reputation:

How to make my screen to listen to drag listener, android

I was trying to implement a drag down listener on my android app, and make a layout which is in view.GONE state animate and increase upto certain height as I drag down.

I tried using OnTouchListener Action Down and Action Up but it is not helping me.

How to achieve this?

Layout1(App_Header)

Layout2(MapView)

Layout3(ViewPager)

Layout 2 is hidden(View.GONE) after pressing a button.

now by dragging down the screen from the header I should get back my Layout2(MapView) increasing its height as I drag down.

I also tried using DragListener to PagerTabStrip on Layout 3, but it didn't work.

Are there any one who can help me on this?

Upvotes: 0

Views: 11165

Answers (1)

Dyna
Dyna

Reputation: 2305

The best way to achieve it is using OnTouchListener and a custom OnDragListener.

Here is a great example and here is another one (from google documentation)

If you need any additional help just ask!

Upvotes: 2

Related Questions