Android Question Drag & Drop

tufanv

Expert
Licensed User
Longtime User
Hello

Is it possible to drag a value from textbox1 to textbox2 with or without a visual drag effect ?

TY
 
Not that i know of
 
Upvote 0
Yes if you have to create a class on purpose that does it.
It would not be too complicated
 
Last edited:
Upvote 0
The drop part might be difficult.

Now I have no time (but I would like to try :D)... but I'm sure that @Star-Dust is trying right now :D
No, I've had enough of drags, which only like me and tufanv :-p
 
Last edited:
Upvote 0
First method
(You click on the gray border to drag)
ezgif.com-video-to-gif.gif


Code:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("main")
    EditText1.Color=Colors.White
    EditText2.Color=Colors.White
    EditText3.Color=Colors.LightGray
  
    TT.Initialize(EditText1,Colors.Gray,Colors.Black)
End Sub
 

Attachments

Last edited:
Upvote 0
Second method: One click to change the text, a DoubleClick to select a word, Long click to drag.
ezgif.com-video-to-gif.gif

I think you can do it, study it and you will succeed.

Code:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("main")
    EditText1.Color=Colors.White
    EditText2.Color=Colors.White
    EditText3.Color=Colors.LightGray
 
    TT.Initialize(EditText1,Colors.Gray,Colors.Black)
End Sub
 

Attachments

Last edited:
Upvote 0
Third method:

video3.gif


Code:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim TT As tufanvtext
  
    Private EditText1 As EditText
    Private EditText2 As EditText
    Private EditText3 As EditText
    Private EditText4 As EditText
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("main")
    EditText1.Color=Colors.White
    EditText2.Color=Colors.White
    EditText3.Color=Colors.LightGray
  
    TT.Initialize(EditText1,Colors.Gray,Colors.Black)
End Sub
 

Attachments

Last edited:
Upvote 0
Nobody who asked me how he did it :p
 
Upvote 0
Now I'm offended I will not reveal it anymore :p
 
Upvote 0
But did you publish something (library) about it?
No, I did not think I had to make a floating Copy & Past for EditText. As erel says correctly, you create a conflict with the Select of the clipboard
 
Last edited:
Upvote 0
Today I am good at heart and I have attached the sources to the posts with examples.
But I suggest the third method is more stable, I use less code and the concept is simpler.
 
Last edited:
Upvote 0
You changed your post; it was "Today I feel good...", so...
Yes, as you know that Google Translate translates very badly, sometimes I agree with errors for the little bit of English that I know and correct.

Unfortunately I do not always notice and misunderstandings happen, not keeping in mind that there may also be typos that are always translated in a fanciful way by Google
 
Last edited:
Upvote 0
Back
Top