Android Question Is there way to keep png files in files folder to be list?

Theera

Well-Known Member
Licensed User
Longtime User
Refer to Klaus' customview tutorial. We can create #DesignerProperty like as belows
#DesignerProperty: Key: Weekdays, DisplayName: day of week, FieldType: String, DefaultValue: Sunday List: Sunday|Monday|Tuesday|.... |Saturday

So I think that there is probably, we can keep png files in Files folder.

P.S. I have just know that FieldType is only String or Boolean. (can't be Int or Bitmap)
 

Theera

Well-Known Member
Licensed User
Longtime User
Int is supported.
Color is also available.
You can use String for List.
Due to writing Xui CustomView, we can't know Photos available in profiles folderWhat are the pictures? Each user has a different picture.
If we can read the filename of a specific png, and Use the addlist command It should be good later.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Due to writing Xui CustomView, we can't know Photos available in profiles folderWhat are the pictures? Each user has a different picture.
If we can read the filename of a specific png, and Use the addlist command It should be good later.
If the image file is not known a priori, because the programmer user will use one of those found in the Files folder, you will not be able to create this "Designer property" of your custom view.
You will only be able to create a property that can only be set by code, of type Bitmap (better B4XBitmap).

Something like:
Class_Globals:
Private mLogo As B4XBitmap
B4X:
Public Sub setLogo(Logo As B4XBitmap)
    mLogo = Logo
    'I assume your custom view will have a B4XImageView:
    MyB4XImageView1.Bitmap = Logo
End Sub

Public Sub getLogo As B4XBitmap
    Return mLogo ' or Return MyB4XImageView
End Sub

User's project:
Dim AAA As TheeraCustomView ' Added to a layout
AAA.Logo = xui.LoadBitmapResize(...)

If your custom view has a B4XImageView, you don't need that variable, mLogo, use directly MyB4XImageView.Bitmap also in the set and get properties:
B4X:
Public Sub setLogo(Logo As B4XBitmap)
    MyB4XImageView1.Bitmap = Logo
End Sub

Public Sub getLogo As B4XBitmap
    Return MyB4XImageView.Bitmap
End Sub
 
Last edited:
Upvote 0

aeric

Expert
Licensed User
Longtime User
Due to writing Xui CustomView, we can't know Photos available in profiles folderWhat are the pictures? Each user has a different picture.
If we can read the filename of a specific png, and Use the addlist command It should be good later.
This is how I did.
B4X:
#DesignerProperty: Key: SelectedLogo, DisplayName: Selected Logo, FieldType: String, DefaultValue: B4X, List: B4X|Google|OctoCat|Waze, Description: Use predefined logo
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Check my project here:
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…