Hello guys,
I want a little notificationbar in my apps, or a dropdown for Panels. I use the GestureDetector library, and i have no plan, how i should realize this, without this bug. And the Label bug comes not from the video. I want to pull out and pull in the panel how at the start.
My code:
I want a little notificationbar in my apps, or a dropdown for Panels. I use the GestureDetector library, and i have no plan, how i should realize this, without this bug. And the Label bug comes not from the video. I want to pull out and pull in the panel how at the start.
My code:
B4X:
Sub Globals
Dim GD As GestureDetector
Dim pnlGreen As Panel
Private Panel1 As Panel
Private Label1 As Label
Dim pnlpos As Object
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("frm_main")
GD.SetOnGestureListener(Panel1, "Gesture")
pnlpos = Panel1.Top
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Gesture_onDrag(deltaX As Float, deltaY As Float, MotionEvent As Object)
Log(" onDrag deltaX = " & deltaX & ", deltaY = " & deltaY & ", ev = " & MotionEvent)
'pnlGreen.Left = Max(0, Min(pnlGreen.Left + deltaX, 100%x - pnlGreen.Width))
Panel1.Top = Max(pnlpos, Min(Panel1.top + deltaY, 100%y - Panel1.height))
End Sub