Can this class be used?

Star-Dust

Expert
Licensed User
Longtime User
I thought about turning it into an XUI library.
That allows dragging on all platforms (with the exception of IOS, Arduino & ESP8266 and PalmOS) , if I can :p


video1.gif
video2.gif
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
I think that the management of events linked to the transposition are different.
In fact for B4J I had to manage them in another way.
On B4i I do not know how they work or what events raises, I have no idea.

For the moment I'm turning some other class that takes care of the Drag & Drog using XUI. We will see what results I will have, yet it is not all clear.
 

Star-Dust

Expert
Licensed User
Longtime User
We talk about those, only that I manage thanks to JavaObject the events related to the touch and drag to "sub" inside the class

B4X:
#IF B4A
       Dim obj As Reflector
       obj.Target=View
       obj.SetOnTouchListener("ViewA_Touch")
#ELSE IF B4J
        Dim jo As JavaObject = View
        Dim e As Object = jo.CreateEvent("javafx.event.EventHandler, "ViewJ", False)
        jo.RunMethod("setOnMouseDragged", Array As Object(e))
  
#ELSE IF B4i
   'nothing
#End If

The B4XView does not have events so I've created in the similar library that creates and manages Touch events for the B4XView based on the environment I'm in if B4J or B4A.

This will not work in b4i
 

Star-Dust

Expert
Licensed User
Longtime User
Thanks, I'll watch it.
 

Star-Dust

Expert
Licensed User
Longtime User
You create panels within the class itself So you do not need to use Java object. And the same raised events can be managed equally by B4A and B4i

In my class the views are created in the design is passed as a parameter to the class, which will handle drag-and-drop inside.

To do something similar to yours I should create transparent panels to attach to each view that is passed to me as a parameter.

If the views that are passed as parameters in turn are panels that contain Edittext, Checkbox or Button, sticking on another transparent panel would create problems because the view could not be clicked or selected

From this comes my need to use Java not to overlap a panel above the views, but to manage the drag-and-drop within the class
 
Top