B4A Library [B4X] [XUI] xCustomListView - cross platform CustomListView

Status
Not open for further replies.

luke2012

Well-Known Member
Licensed User
The attached project is a B4A project. To run xCustomListView on iOS device I can import the code and the class (as it is) within a B4i project?
 

Erel

Administrator
Staff member
Licensed User
Add the class as-is to your B4i project. The code in the main module will require some small changes.
 

Rusty

Well-Known Member
Licensed User
In post #14, I asked if one could put EditTexts in the xCustomListView.
In fact, you can :)
I have added rows of "items" into the clv that contain panels which contain a label and an EditText view.
It is important to my application that when the EditText gains/loses focus that I suppress the soft keyboard with IME and then show my own custom keyboard.
When the EditText is touched the FIRST time, this works great :)
If you exit the EditText (change focus to something else), the custom keyboard disappears as appropriate, but when you touch the same EditText to regain focus, the Focus Changed event does NOT fire...
However, the soft keyboard does pop-up...
When you touch the soft keyboard, the Focus Changed event then DOES fire...
Am I doing something wrong? When I load the CLV, I load a .bal file with the EditText defined within...
Any ideas are welcome...
Rusty

UPDATE: The Focus Changed event does not fire when you touch the soft keyboard, it is the TextChanged event...
FURTHER UPDATE: I updated Erel's example and placed an edittext within the .Bal file. It generated the CLV with the label, button, chechbox and edittext views as planned.
When I touch the edittext, the hasfocus fires. If i touch any other edittext, the hasfocus fires, if i touch a button, checkbox or label, the hasfocus does NOT fire.
Is there a way to make the focus change when another type view is touched?
 
Last edited:

Erel

Administrator
Staff member
Licensed User
FURTHER UPDATE: I updated Erel's example and placed an edittext within the .Bal file. It generated the CLV with the label, button, chechbox and edittext views as planned.
When I touch the edittext, the hasfocus fires. If i touch any other edittext, the hasfocus fires, if i touch a button, checkbox or label, the hasfocus does NOT fire.
Is there a way to make the focus change when another type view is touched?
Please start a new thread for this question.
 

Sapta

Member
Licensed User
Hi @Erel

Can I request for the next version ?
At _ReachEnd event, can be added ProgressBar at the bottom like PullToRefresh like example here
Thank you
 

Dadaista

Active Member
Licensed User
Hi

I have changed old CLV for new CLV

I get this error

B4X:
Registo conectado a:  Sunstech TAB109QCBT
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
customlistview_designercreateview (B4A line: 46)
sv.ScrollViewInnerPanel.Color = xui.PaintOrColorT
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
   at anywheresoftware.b4a.objects.B4XViewWrapper$XUI.PaintOrColorToColor(B4XViewWrapper.java:527)
   at com.dbsaiz.caja.venta.free.customlistview._designercreateview(customlistview.java:475)
   at java.lang.reflect.Method.invoke(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:372)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
   at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:67)
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
   at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
   at com.dbsaiz.caja.venta.free.main._activity_create(main.java:516)
   at java.lang.reflect.Method.invoke(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:372)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
   at com.dbsaiz.caja.venta.free.main.afterFirstLayout(main.java:102)
   at com.dbsaiz.caja.venta.free.main.access$000(main.java:17)
   at com.dbsaiz.caja.venta.free.main$WaitForLayout.run(main.java:80)
   at android.os.Handler.handleCallback(Handler.java:739)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:135)
   at android.app.ActivityThread.main(ActivityThread.java:5254)
   at java.lang.reflect.Method.invoke(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:372)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Object context is paused. Ignoring CallSubDelayed: AfterLoadLayout
Object context is paused. Ignoring CallSubDelayed: AfterLoadLayout
My CLV's are created in run time

How can I solve it?
 
Last edited:

Erel

Administrator
Staff member
Licensed User
xCustomListView as well as the latest versions of CLV must be added with the designer. You can create a layout file with only a CLV and load it whenever you want to create one.
 

janderkan

Active Member
Licensed User
Hi All
I have downloaded the project attached to post #1 (v1.20)
It compiles and runs with no problems.
But when i add a new layout to the project, I get the following error when calling 'Activity.LoadLayout("2")'
java.lang.RuntimeException: java.lang.RuntimeException: CustomView CustomType property was not set.
(I did search the forum, but did not find any solution)
In the designer the Custom type property is greyed out, so it is not possible to change it.

Starting a new project does not help.

Biggest problem is that an existing project where I use CustomListView v1.76 suddenly have the exact same problem.

B4A - 7.80
JDK - 8.152
Android 27

Latest info !!
Downgraded to B4A 7.30 - Problem solved :) !!!! or :( ...

Latest-Latest info !!
7.30 - 7_3.jpg 7,80 - 7_8.jpg
In the designer when I select 'Add View' the arrow next to CustomView is missing in B4A 7.80
 
Last edited:

Erel

Administrator
Staff member
Licensed User
Please start a new thread in the questions forum and upload the project that fails to compile.

Make sure not to confuse between:
1. This class.
2. The old CustomListView class.
3. CustomListView library.
 

XbNnX_507

Active Member
Licensed User
is it possible to use VisibleRangeChanged event to reuse the views in runtime instead of creating and removing these?
( similar to the way recycle view works).
 

Angel Garcia

Member
Licensed User
Hi All,
I'm trying to use a CLV with horizontal scrolling with no success, i set it as the tutorial:
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0,0,0,180dip,CLVMap.AsView.Height)
CLVMap.Add(p, cd)
But i'm still getting items added vertically, any help would be appreciated.

EDIT:
LOL i didn't see it "set it in the designer", ROFLCOPTER, i'm sorry :(

Thanks!
 
Last edited:

Claudio Oliveira

Active Member
Licensed User
@Erel ,
Apparently there's a mistake in RemoveAt sub.
When there are text items in the list, RemoveAt sub calculates NewOffset values incorrectly.

This code line
B4X:
Dim NewOffset As Int = item.Offset - item.Size - DividerSize
Should be like this
B4X:
Dim NewOffset As Int = item.Offset - RemoveItem.Size - DividerSize
Regards
 
Status
Not open for further replies.
Top