sv.Panel.Enabled = False
For i = 0 To YourCustomListView.GetSize - 1
Dim pnl As Panel = YourCustomListView.GetPanel(i)
pnl.Enabled = False
Next
For Each v As View In pnl.GetAllViewsRecursive
v.Enabled = False
Next
For i = 0 To YourCustomListView.GetSize - 1
Dim pnl As Panel = YourCustomListView.GetPanel(i)
pnl.Enabled = False
For Each v As View In pnl.GetAllViewsRecursive
v.Enabled = False
Next
Next
Thanks luca for the quick reply, I am afraid it did not do anything different than the previous code!!!
any other suggestions?
It should work but I agree that a transparent panel is more simple and fast too (for all items).
The only drawback is that you can not scroll through the list.
I am using "clv1" only in my program.
Sub lbl_FocusChanged (HasFocus As Boolean)
Dim index As Int = cv.GetItemFromView(Sender)
Public Sub GetItemFromView(v As View) As Int
Error occurred on line: 212 (CustomListView)
java.lang.NullPointerException
at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:205)
at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod(Reflection.java:802)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:668)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:334)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:244)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:132)
at anywheresoftware.b4a.BA$2.run(BA.java:299)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
parent = r.RunMethod("getParent")
Seems, no, Erel - it is complex project with several activities. And seems, this error occurs whenCan you upload a small project that demonstrates this issue?
You should create a little sample project.
Anyway, how do you add the CustomListView? And the EditText? Probably you can post these lines.
Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
Dim p As Panel
p.Initialize("")
p.Color = Colors.Transparent
Dim chk As CheckBox
chk.Initialize("chk")
Dim lbl As EditText
lbl.Initialize("lbl")
lbl.InputType = lbl.INPUT_TYPE_NONE
lbl.Text = Text
lbl.TextSize = 16
lbl.TextColor = Colors.Black
lbl.SingleLine = False
p.AddView(chk, 0, (Height-30dip)/2, 30dip, 30dip) 'view #0
p.AddView(lbl, chk.Width, 2dip, Width - chk.Width, Height) 'view #1
Return p
End Sub
cv.Clear
For i = 0 To l.Size - 1
Dim p As Panel = CreateListItem(L.Get(i), cv.AsView.Width, 60dip)
Dim lbl As EditText = p.GetView(1)
Dim texth As Int = su.MeasureMultilineTextHeight(lbl, l.Get(i)) + 75
texth = Max(40dip, texth)
lbl.Height = texth
cv.Add(p, texth + 10dip, l.Get(i))
If (i mod 100) = 0 Then DoEvents
Next
Sub lbl_FocusChanged (HasFocus As Boolean)
Try
Dim index As Int = cv.GetItemFromView(Sender)
Dim pnl As Panel = cv.GetPanel(index)
Dim chk As CheckBox = pnl.GetView(0)
Dim lbl As EditText = pnl.GetView(1)
If HasFocus Then
If chk.Checked Then
chk.Checked = False
Else
chk.Checked = True
End If
atxtSearch.RequestFocus
End If
Catch
End Try
End Sub
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?