Android Tutorial [B4X] Creating a cross platform custom view packed as b4xlib

The attached b4xlib library is a cross platform list of colors:

firefox_86IZH8vlHm.png


It is a XUI custom view. The custom view is based on two layout files. One for xCustomListView and another one for the items layout.
There is also a text file with the colors values.
As layout files files are platform specific we need to create a layout file for each platform.

Notes & tips:

- The source code is included inside the b4xlib file (it is a zip file).
- Layout files of other platforms will not be added to the project.
- It is not possible to load layouts from DesignerCreateView without calling Sleep(0) before.
- ListTemplate layout was actually taken from XUI Views.
- A more powerful color picker implemented as a dialog is included in XUI Views.

ColorsListProject.zip - The B4A project I've used to implement the view.
ColorsList.b4xlib - The library with the files. Open it as a zip file to see.
Usage Example - B4J project that uses this view.
 

Attachments

  • ColorsListProject.zip
    18.4 KB · Views: 691
  • B4J ColorsList Usage Example.zip
    1.9 KB · Views: 664
  • ColorsList.b4xlib
    9.4 KB · Views: 573
Top