Android Question CustomlistView => Row with no click possible

Prosg

Active Member
Licensed User
Longtime User
Hello,

With the CustomListView is it possible to have sometimes a Row who are not clickable ?

Regards
 

mangojack

Expert
Licensed User
Longtime User
one way .. in the panel click event , check the index of the clicked panel and either process the click event or consume it.

another .. assign all the panels/rows a specific tag which could then be checked to determine whether to process the event or again consume.
 
Upvote 0

Prosg

Active Member
Licensed User
Longtime User
i don't want the click possible (like readonly in edittext ). No sound no selected
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
without knowing more detail re .. when you wish certain rows to be "unclickable" .. its difficult to supply an good answer .. but try this

When populating the CustomListView do not assign an Event Name to the panel for the rows you do not want / need to be clicked ..

B4X:
'Adds a custom item at the specified index.
Public Sub InsertAt(Index As Int, Pnl As Panel, ItemHeight As Int, Value As Object)

  Dim sd As StateListDrawable
  sd.Initialize
  sd.AddState(sd.State_Pressed, pressedDrawable)
  sd.AddCatchAllState(Pnl.Background)

   'create another panel to handle the click event
   Dim p As Panel
   If Index = 2 Then  '@@ OR whatever you desired condition might be ...

     p.Initialize("")    ' Do not assign an Event to this panel / row..  No Sound / No Select
   Else
     p.Initialize("panel")
   End If

' ...................................
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…