Git Product home page Git Product logo

Comments (2)

hyuwah avatar hyuwah commented on July 30, 2024 2

Hi @Prakash19921206,

Thank you for your interest in using this library

Regarding the implementation in scroll view, could you share your layout structure or the use case / scenario you want to achieve with the draggable view?

Draggable view can conflict with touch event from scroll view if it is placed inside the scroll view. One way to make it work is to place it on the same level as the scroll view (we need a viewgroup to wrap both view).

<!-- Parent / Root -->
<FrameLayout>

    <ViewThatWantToBeDraggable/>

    <ScrollView>
        <LinearLayout>
            <!-- Scroll view content -->
        </LinearLayout>
    </ScrollView>

</FrameLayout>

This way, the scroll view touch event won't intercept the touch event of draggable view.

I've made a small example regarding this

draggableview-scrollableview

Is that the kind of behavior you want to achieve?

from draggableview.

Prakash19921206 avatar Prakash19921206 commented on July 30, 2024

Thanks for your reply.

I also needed dragable view to only move within some boundary(LinerLayout) - just like a slider header
I tried a different approach,

  1. Implemented Custom Scroll view to enable/disable scroll whenever we want, based on stackoverflow answer
  2. used this class to set draggable view and limit its movement within a defined boundary - i modified this class a little to enable/disable scroll view when dragabble move is moving around [using ACTION_UP and ACTION_DOWN touch listener]

Here is a sample project with above mentioned code implementation

from draggableview.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.