Android Question xCustomListView - LongClick

Discussion in 'Android Questions' started by LucaMs, May 13, 2019.

  1. LucaMs

    LucaMs Expert Licensed User

    Unlike the ListView (and the many apps), LongClick on a Label inside a xCustomListView is not detected (nor, even less, on other View types).

    Furthermore, the behavior is different in b4a and b4j; in b4a only the click event of the label fires, in b4j, after this event, also the LongClick of xCLV starts.

    However, apart from the different behavior between the two platforms, the main point is that the LongClick on the Label should happen as in a normal ListView.
  2. Erel

    Erel Administrator Staff Member Licensed User

    I guess that you haven't consumed the mouse event. However this is again not the correct place to discuss it as it is a B4J question.

    The handling of touch events in views inside ScrollView (CustomListView = ScrollView) is more sensitive as in many cases the ScrollView intercepts the gesture as a scrolling gesture.

    However I just tried it and it works fine here:
    Sub Globals
    Private xui As XUI
    Private CustomListView1 As CustomListView
    End Sub

    Sub Activity_Create(FirstTime As Boolean)
    For i = 1 To 100
    Dim lbl As Label
           lbl.Text = 
    Dim x As B4XView = lbl
           x.TextColor = xui.Color_Black
    Dim p As B4XView = xui.CreatePanel("")
    End Sub

    Sub lbl_Click
    End Sub

    Sub lbl_LongClick
    End Sub

    Sub CustomListView1_ItemLongClick (Index As Int, Value As Object)
    Log("CLV Long")
    End Sub
  3. LucaMs

    LucaMs Expert Licensed User

    No, maybe I explained badly but my question is mainly about the difference between the long click (tap) on a label inside a ListView and in a label inside a xCustomListView.

    [I have yet to read the rest :)]
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice