B4A Library Tiles_JE

I created a new custom view where the user continues to run the application based on the information displayed in the tiles. There are three types of information that can be displayed:
  • label
  • image
  • layout
The tiles are scrollable. The width of the tiles can be fixed or flexible. Each tile is assigned a unique tag, which is passed in the Click event when clicked. Examine the example.


Screenshot_2025.07.01_19.58.03.962.png


Tiles_JE
Author: Jerryk
Version: 1.3

Methods:

  • Selected Item As String
Sets or gets the selected tile. The tag name is used.

Events:
  • Click (tag As String)
Raised when tile is cliked.

Properties:
  • Tiles Type As String
FilledWidth - TileWidth is ignored, width is calculated based on Tiles Per Row
FixedWidth
-Tiles per row is ignored, actual width is used
  • Tile Height As Int
Tile height
  • Tile Width As Int
Tile width
  • Corner Radius As Int
Tile radius
  • Gap Between Tiles As Int
Gap distance
  • Tiles Per Row As Int
Number of tiles per row
  • Background Color As Int
Background Color for tiles
  • Show Selected As String
"border" - if the tile is selected, border is drawn in color SelectedColor
"tile" - if the tile is selected, background is drawn in color SelectedColor
"off" - the tile is not redrawn
  • Selected Color As Int
Borded Color
  • Selected Border Width As Int
Borded width

Functions:
  • AddLabel (pTag As String, pText As String, pSize As Int, pBackgroundColor As Int) As Label
Add tile with label
  • AddImage (pTag As String, pBitmap As String, pBackgroundColor As Int) As ImageView
Add tile with image as-is
  • AddImageResize (pTag As String, pBitmap As String, pBackgroundColor As Int, pWidth As Int, pHeight As Int) As ImageView
Add tile with image nad resize
  • AddLayout (pTag As String, pLayout As String, pBackgroundColor As Int) As Panel
Add tile with layout
  • FindTile (search As String) As Panel
Find a tile with a specific tag
  • DefaultColor (pTag As String, pCol As Int)
Change default tile color for tile with a specific tag
 

Attachments

  • Tiles.zip
    62.7 KB · Views: 58
  • Tiles_JE.b4xlib
    5.7 KB · Views: 49
Last edited:

Mehrzad238

Active Member
hello @Jerryk


I want to try your library, and the example has 2 issues:


1-There is a dependency that you did not mention in the description that needs the Throwables library, which can be downloaded from this link
2-The example has a ROBOCOPY error. Please replace the example. For more guidance, you can visit this link:

[B4X] Tip - ROBOCOPY error related to shared files folder

Thank you for creating this library. That will come in handy in the future.
 

Attachments

  • 2025-07-25_18-41-10.jpg
    2025-07-25_18-41-10.jpg
    9.7 KB · Views: 40

Theera

Expert
Licensed User
Longtime User
Your library is perfectly, but is there way created to be as the button which can be as container includes panel, ImageView, label, CustomView in it? I think it useful in the future.(look at progress example)
 

Theera

Expert
Licensed User
Longtime User
To add anything, create your own layout where you will place your visual components. Then add it with AddLayout("your tag", "your layout", color). In my example, in the eighth position, a layout with two labels and a progressbar is used.

If I needn't to set tiles, I can do it, can't I? ( I think it has auto setting tiles) please to see my project https://www.facebook.com/share/v/17FjUoZnPV/

The rooms are not arrange.
 

Theera

Expert
Licensed User
Longtime User
Honestly, I don't know, I don't understand what you're getting at? In your app, I see the layout of houses, when you click on a specific house, you can view photos of the interior.
My app's layout of houses is not arrange like the tiles ,If I need to use your tiles library,is there way strategy done it,or not? I'm looking for how to set the status of house be not ready used. when I see your library,I think it may be done.
 

stp

Active Member
Licensed User
Longtime User
hi, what is the syntax to assign a png picture ?

i use now
B4X:
Dim img As ImageView = Tiles_JE1.AddImageResize("Im2", "b4j.png", xui.Color_DarkGray, 70dip, 70dip)

want to use:

B4X:
Dim img As ImageView = Tiles_JE1.AddImageResize("Im2", "https://www.mysite.com/my.png", xui.Color_DarkGray, 70dip, 70dip)
 
Top