Search code examples
androidandroid-animationgesturelockscreenswipe-gesture

How can I implement a user "swipe up to reveal" on android


I want to implement a lock screen where the user has to swipe up an image to reveal the app lock screen. I know how to animate views, but how do I animate them based on user input? (i.e. not just swipe up, user should be able to pull the image along)

I really don't know the term for this action so I've been stumped trying to search for it. I tried searching google in many ways but no results


Solution

  • You can use GestureDetector to detect user's gesture and then you need to animation views.Use below links for ref

    1. https://github.com/pwittchen/swipe
    2. https://github.com/championswimmer/SimpleFingerGestures_Android_Library
    3. https://stackoverflow.com/a/12938787/1481962