Coder Social home page Coder Social logo

mohamedrejeb / compose-dnd Goto Github PK

View Code? Open in Web Editor NEW
258.0 4.0 7.0 468 KB

Compose DND is a library that allows you to easily add drag and drop functionality to your Jetpack Compose or Compose Multiplatform projects.

License: Apache License 2.0

Kotlin 100.00%
android android-library compose compose-library compose-multiplatform compose-multiplatform-library compose-ui dnd drag drag-and-drop

compose-dnd's Introduction

val mohamed = developer {
    about {
        name = "Mohamed Rejeb"
        company = Softylines.
        role = Kotlin_Tech_Lead
    }
    links {
        twitter = "MohamadRejeb"
    }
}

compose-dnd's People

Contributors

jordond avatar mohamedrejeb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

compose-dnd's Issues

On Long press trigger

Nice project man ! Its so useful, i was wondering if you could include a LongPress trigger so its more usable, also i'm having troubles to scroll, it detects the drag state.

Thank you for your contribution !

Unresolved reference to com.mohamedrejeb

Description

I'm trying to use the compose-dnd library in my project which is java project and I make an upgrade for some screens using jetcompose, but I'm encountering an unresolved reference issue when attempting to import the library.

Steps to Reproduce
Added the following dependency to build.gradle:

groovy

implementation 'com.mohamedrejeb.dnd:compose-dnd:0.2.0'

Tried to import the library in my Kotlin file:

import com.mohamedrejeb.compose.dnd.annotation.ExperimentalDndApi
import com.mohamedrejeb.compose.dnd.drop.dropTarget
import com.mohamedrejeb.compose.dnd.reorder.ReorderContainer
import com.mohamedrejeb.compose.dnd.reorder.ReorderableItem

I receive an unresolved reference error for mohamedrejeb

Additional Information
Android Studio version: Android Studio Electric Eel | 2022.1.1
Kotlin version: 1.7.9
Compose version: 1.2.0

Could you please provide guidance on resolving this issue or update the documentation with the correct usage instructions?

Thank you!

DragOver event

Currently you can use dragAndDropState?.draggedItem to find out when you are dragging item so we can show the drop target.

However it will be handy if we show the drop target only when we are over it or in close proximity.

Currently I have a lot of drop targets and when the dragging starts I have to show all of them even when the user is gonna drop only in a single one of them, instead I would want to only show the one that is bellow his drag item.

Wrong Z-index.

Hello. You have a nice library out here!

I found a problem.

When I drag my item I want it to be animated non active status to active status and then stared to drag. I am doing this by empty draggableContent. By the drag became with wrong z-index. See the video. Active item goes under non active item. I believe this is wrong.

ReorderableItem(
        modifier = modifier,
        state = reorderState,
        key = text,
        data = text,
        onDrop = {},
        onDragEnter = onDragEnter,
        draggableContent = {} <- empty
    ) {...}
vidma_recorder_09072024_134831.mp4

Scroll and drag problem

Hi. You have a great library here!

I found a problem with the animation of the reordering in the list and possibly an incorrect position calculation. This happens when the list is scrollable. Please watch the attached video.

You can see 2 problems:

  1. When I take the first element and start to drag it down - it does not drag, but the list suddenly scrolls.

  2. When I take an element from the middle of the list and drag it up - the list does not scroll up.

vidma_recorder_09072024_135730.mp4

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.