Repositioning Tools Extension

Description

Hello every one! Today I introduce my third extension, which is repositioning tools extension.
This extension give you the ability to drag your components any where on the screen, without needing to drop it in another arrangement,This will be useful for many users who are making animations and they need the user to drag something by himself , like swiping to delete or making parallax effect,etc..
Actually, i've got the extension idea from @nikzdreamer2001 ( Unfortunately, he is suspended :pensive: ) here.
i've called this extension repositioning tools and not drag tools ,etc.. so i've the ability to update it with others repositoining tools like scaling,zooming,etc..:grinning:

Blocks picture

Designer properties

image

Documentation

Block Description
Draging This event is raised when the component is being dragged.

Params Type Description
component Component The component that’ve been dragged
x Number (int) The x position of the component that dragged
y Number (int) The y position of the component that dragged

Error This event is raised when there is an error.

Params Type Description
error String The error message

Dragged This event is raised when the component is dropped anywhere in the screen.

Params Type Description
component Component The component that’ve been dragged
x Number (int) The x position of the component that dragged
y Number (int) The y position of the component that dragged

Register component as draggable so the extension can detect drags on.

Params Type Description
component Component The component will be draggable
horizontal Boolean Determines if the component can be dragged horizontally
vertical Boolean Determines if the component can be dragged vertically

If both the horizontal and vertical parameters set to true, you can drag the component any where in the screen, horizontally and vertically.
Unregister Unregisters the component so the extension won't detect drags on the component, and the user can’t drag it anymore.

Params Type Description
component Component The component that has to be unregistered

Sets the shadow elevation when the component is being dragged.


Params Type Description
ElevationShadow Number (int) The shadow elevation value

Screen recording

Notes

If you've registered component that you've already registered the old parameters will be overwritten and no errors will occur.

Usages

I will update this section here with new usages:
1- Swipe to remove list view:
I'm going to share its blocks as soon as i complete it :wink:

Download links

AIX: io.mohamed.RepositioningTools.aix (13.7 KB)

Credits

Thanks for @WatermelonIce for the documentation table.
Thanks for any one who liked this extension :heart:.If you've liked it please hit the like button :grin:
Any suggestions,bugs will be considered, just tell me below and i will try my best to implement it :wink:

Regards,
Mohamed Tamer

23 Likes

Great work!

2 Likes

Nice one :partying_face:

2 Likes

Wow, Cool Extension :exploding_head: :partying_face: :+1:

2 Likes

Thanks very much @marco_tanzi @WatermelonIce @Salman_Dev :heart: :grinning:

3 Likes

:ok_hand: :ok_hand: :ok_hand:

1 Like

Perhaps, This could help me create overlapping Content. I can see in the video that the button can overlap others, I also think that you should give permission to change X/Y Axis using blocks! Your extension could make literally thousands of possibilities!

2 Likes

So can we make a custom slider with this extension

2 Likes

Hi @MohamedTamer, can you attach an aia test ?

1 Like

Thanks @Kumaraswamy @Mayank_Kumar @Techno_Vedang @patel for your replies.

My componentTools extension, have an option to set X,Y and Z coordinates :wink::

But i'm adding a special method here , to drag the component programmaticly in the new update.

Yes it can but you probably can see move horizontally and Vertically in my component extensions, they also can overlap components.

Yes you can :grin: May be the next update make it easier.

Of course ! i will make a one now, and update my topic.

3 Likes

Oh, Ok I didn't know you had an extension for that too.

2 Likes

Is it possible to create another block that detects when an element has been overlapped?
This would be interesting for developing games.

2 Likes

Thanks for your suggestion, I can try to make it :wink:

1 Like

Hello mohamed well in continuation to our conversation we would like your precious help...
I have made an example to fully understand the problem...
You will notice that when you add a character to the first text it pushes the next text....
repostools.aia (15.0 KB)
Regards

4 Likes

@MohamedTamer
Nice extension. I look forward to usinng it.

2 Likes

Version 3.0

Changes:

  • Changed the dragging mechanism
    Now touch events which were being translated into drags, will not be dragged directly, but will require the developer to accept the drag first, this could help in allowing the developers to allow dragging only in case some conditions were met. This behavior can be disabled by enabling the AlwaysAcceptDrags (Thanks @broekmancompany )
  • Registered components are managed by IDs. A new id parameter is added for all blocks
  • The DragComponent block now has a duration parameter
  • Completely rewritten the extension's code.
  • Migrated To Rush CLI for building the extension ( Thanks @shreyash )
  • Fixes non-smooth dragging when the component's parent is a scrollable component ( i.e: HorizontalScrollArrangement or VerticalScrollArrangement ) ( Thanks @Soham_Shah )

The extension is now open source:


The extension link has been updated in the first post.
Regards,
Mohamed Tamer

6 Likes

Very nice Extension @MohamedTamer
:+1:

Very nice ,,thank you

1 Like

can I limit the scope of draggable components to only buttons in a single vertical arrangement? this would be to prevent unwanted movement of components elsewhere in the app.

Great useful extension , thank you