anOparator Active Member Licensed User Longtime User Dec 1, 2019 #1 I have lbl1 added to scv1 '(scv1 = ScrollView) When I swipe the screen GD sometimes fires "lbl1_Click" event. I've tried using "lbl1.Enabled = False" and "scv1.Enabled = False". The swipe works but "lbl1_Click" often fires. Is it possible to stop this Click event? Code: Copy Sub Activity_Create(FirstTime As Boolean) ... ... scv1.Initialize(800dip) lbl1.Initialize("lbl1") scv1.Panel.AddView(lbl1, 2dip, 0, 98%x, 800dip) Activity.AddView(scv1, 0, 40dip, 100%x, 100%y) ... ... End Sub Code: Copy Sub Activity_Touch (Action As Int, X As Float, Y As Float) ' lbl1.Enabled = False scv1.Enabled = False End Sub Code: Copy Sub Gesture_onTouch(Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean ' lbl1.Enabled = False scv1.Enabled = False If FilterMoveEvents Then ' lbl1.Enabled = False ' scv1.Enabled = False If Action = GD.ACTION_MOVE Then Return True Else FilterMoveEvents = False End If End If Return DiscardOtherGestures End Sub
I have lbl1 added to scv1 '(scv1 = ScrollView) When I swipe the screen GD sometimes fires "lbl1_Click" event. I've tried using "lbl1.Enabled = False" and "scv1.Enabled = False". The swipe works but "lbl1_Click" often fires. Is it possible to stop this Click event? Code: Copy Sub Activity_Create(FirstTime As Boolean) ... ... scv1.Initialize(800dip) lbl1.Initialize("lbl1") scv1.Panel.AddView(lbl1, 2dip, 0, 98%x, 800dip) Activity.AddView(scv1, 0, 40dip, 100%x, 100%y) ... ... End Sub Code: Copy Sub Activity_Touch (Action As Int, X As Float, Y As Float) ' lbl1.Enabled = False scv1.Enabled = False End Sub Code: Copy Sub Gesture_onTouch(Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean ' lbl1.Enabled = False scv1.Enabled = False If FilterMoveEvents Then ' lbl1.Enabled = False ' scv1.Enabled = False If Action = GD.ACTION_MOVE Then Return True Else FilterMoveEvents = False End If End If Return DiscardOtherGestures End Sub
Erel B4X founder Staff member Licensed User Longtime User Dec 2, 2019 #2 You should probably use TouchPanelCreator from ViewsEx. It is more complicated but it gives you more control over the event propagation. Example: https://www.b4x.com/android/forum/t...pe-actions-and-pull-to-refresh.98252/#content Upvote 0
You should probably use TouchPanelCreator from ViewsEx. It is more complicated but it gives you more control over the event propagation. Example: https://www.b4x.com/android/forum/t...pe-actions-and-pull-to-refresh.98252/#content
anOparator Active Member Licensed User Longtime User Dec 3, 2019 #3 After I posted the question I made a duplicate project, deleted the Object folder & .meta file, also set "DiscardOtherGestures = Checked". GestureDetector is producing stable swipes after 2 days testing (and I'm happy). Will look into the XUI stuff after this app is published, thanks for the sample. Upvote 0
After I posted the question I made a duplicate project, deleted the Object folder & .meta file, also set "DiscardOtherGestures = Checked". GestureDetector is producing stable swipes after 2 days testing (and I'm happy). Will look into the XUI stuff after this app is published, thanks for the sample.