Swipe/drag Android view from the bottom of the screen

前端 未结 2 2069
情书的邮戳
情书的邮戳 2021-02-01 07:05

I want to do in my app a View that I can swipe from the bottom of the window (Images below explain it better).

I want the view to stop at certain point. The view must a

相关标签:
2条回答
  • 2021-02-01 07:30

    You can use the new material design pattern called Bottom Sheets. They do the exact thing that you want. They also support custom layouts for the view.

    Material Design - Component - Bottom Sheets

    0 讨论(0)
  • 2021-02-01 07:35

    I think you are in search of a ViewDragHelper:

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

    How to use. This answer links to a sample project to show you how as well: ViewDragHelper: how to use it?

    Dragging best practices:

    http://developer.android.com/training/gestures/scale.html

    0 讨论(0)
提交回复
热议问题