Questions tagged [viewdraghelper]

(Android) ViewDragHelper is a utility class for writing custom ViewGroups.

(Android) ViewDragHelper is a utility class for writing custom ViewGroups.

It offers a number of useful operations and state tracking for allowing a user to drag and reposition views within their parent ViewGroup.

Reference: https://developer.android.com/reference/android/support/v4/widget/ViewDragHelper.html

16 questions
14
votes
6 answers

Why is view dragged with ViewDragHelper reset to its original position on layout()?

I am implementing a custom expandable action bar in my game. I am using ViewDragHelper to handle the dragging and flinging of the bar view, which is contained in a LinearLayout I subclassed to attach the ViewDragHelper. The following links have been…
Sébastien
  • 13,831
  • 10
  • 55
  • 70
2
votes
0 answers

android Swipe completely hidden view up and down with bottomsheet or viewdraghelper

In my android app I need to create a view that user can slide up and down with finger. Not just slide up/down with swipe/fling but slide up/down when finger is held down on screen. Like Snapchat Memories slide view. I have tried using…
Chandan Pednekar
  • 525
  • 5
  • 19
2
votes
0 answers

Swipe/Drag to dismiss RecyclerView

I am looking for a way to dismiss RecyclerView when it is scrolled over bounds. Effect would be similar to Google Maps. I have RecyclerView with top padding so scrolling content works visually properly but when I scroll down to RecyclerView top I…
Niko
  • 8,093
  • 5
  • 49
  • 85
2
votes
1 answer

ViewDragHelper animation listener

I'm using ViewDragHelper to slide a view to a new location, and I'm trying to use viewDragHelper.smoothSlideViewTo(dragView, x, y). The question is: How do I get a notification after the slide animation is complete? I'm looking for a way to listen…
yongsunCN
  • 736
  • 7
  • 18
2
votes
1 answer

View Drag Helper helper

I am trying to get the ViewDragHelper to work with a vertical LinearLayout, - Container - which has A ---- List View B ---- horizontal linear layout C ---- Support Map Fragment as children views. A has layout_height="0dp". Pulling down on B,…
Nihal Kenkre
  • 21
  • 1
  • 3
1
vote
1 answer

Android: Implement floating video player (like YouTube android app) with JW Player SDK

I am trying to implement Floating video player (like YouTube player which minimize when dragged to bottom right of the screen). For that I am using DraggablePanel library (https://github.com/pedrovgs/DraggablePanel). I was having some problem while…
1
vote
0 answers

android - sliding a new fragment in view - from where?

I'm a newbie in Android development and I was curious about: In many music player apps, there is a "now playing" view on the bottom of the screen, and when you swipe it up, a whole new "now playing" layout slides in from the bottom, while the…
1
vote
1 answer

ViewDragHelper doesn't work properly

In a FrameLayout there's a child TextView which can be dragged, but the method onViewReleased and onViewPositionChanged don't work properly(scroll back to the original place) when I try to change text or margin of this TextView while it is…
machinezhou
  • 679
  • 2
  • 6
  • 16
1
vote
0 answers

Android: Hidden part of view doesn't show after drag it up

I'm trying to use ViewDragHelp to implement draggable panel but the problem is the hidden part of panel isn't shown. Picture what i meant Here is my code . SlidePanel is the draggable panel and the "white_pane" is the partially hidden panel (i set…
Tong Ratta
  • 31
  • 4
0
votes
1 answer

Android Animate Alpha during Drag Animation Now Working

I've added the drag functionality to a component using ViewDragHelper and I'm trying to add a fade animation to the component so that when the user touches the screen and drag it, it changes the component's alpha using an animation. The problem is…
Foad Saeidi Nik
  • 260
  • 1
  • 5
  • 20
0
votes
1 answer

Android - Animate a view and change his real position (and another view follow with behavior dependency)

I'm trying to animate my appBar using a ViewDragHelper, when I drag it down it should start an animation and go down. On top I have another view (pink in the example) that "follow" my appbar with a behavior (the top view depends on AppBarLayout). As…
SwaiX
  • 79
  • 1
  • 5
0
votes
1 answer

Children match_parent ignoring parent in custom view with viewdraghelper

I have been studying custom views recently and trying to make one specific example work out from a tutorial located here: http://flavienlaurent.com/blog/2013/08/28/each-navigation-drawer-hides-a-viewdraghelper/ I will add the relevant code to…
Shadow
  • 4,168
  • 5
  • 41
  • 72
0
votes
1 answer

Android - Child view touch positions incorrect

I have a RelativeLayout which has a ViewDragHelper which I use to move the view around. I have to use layout(boolean changed, int left, int top, int right, int bottom) to update view size on drag because the views inside need to resize. This all…
0
votes
1 answer

Using ViewDragHelper to vertical dragging and ViewPager

i'm trying to achive this on my application: youtube link The goal is to have a ViewPager that can be dragged vertically but at the same time you can swipe the views inside of ViewPager, the problem is when i swipe inside of viewPagger horizantally…
danielgek
  • 135
  • 3
  • 10
0
votes
1 answer

How to implement Floating type MediaPlayer similar to Samsung Tab10.0

I am working on a project where i want to implement mediaplayer as docked/Floating type similar to Gallary mediaPlayer of Samsung. i was thinking of the following views/widgets but could not decide which would be helpful: popupwindow Android…
Amritpal Singh
  • 984
  • 2
  • 14
  • 33
1
2