Just to clarify:
mBase is not the CustomView, it is the main Panel of the CustomView, nothing else.
The properties of mBase are the same as for any other B4XView, you cannot add other properties.
CustomView properties set with setMyProperty and / or getMyProperty routines in the CustomView Module are Properties accessible from outsides the CustomView Module where the CustomView is declared.
You could use Public variables too to change their values from outsides the CustomView module.
When should we use a Public variable instead of a Property ?
You can change the value of a Public variable from outsides, but this does only change the value and nothing else.
But, when you change a value from outsides and you need to do something in the CustomView module depending on the new value with some code, then you must use a Property.
I had a look at your project and have some comments.
In your first post you declared:
Public m_HasLogo As Boolean=False
A property should not be declared as Public but as Private, in the Class_Global routine.
In your project in post#8 you declare it as Private, which is OK, but you should move the line form the DesignerCreateView routine to the Class_Global routine.
But, then the question: When the value of m_HasLogo is changed from outsides, do you need to do something with code in the CustomView module ?
If yes, use a Property like this:
Public Sub setHasLogo(HasLogo As Boolean)
m_HasLogo = HasLogo
If m_HasLogo = False Then
'code for m_HasLogo = False
Else
'code for m_HasLogo = True
End If
End Sub
If no just use a Public variable, but in that case i would name it simply HasLogo.
You declare these B4XViews in Class_Globals:
Private mQRCodePromptPay As B4XView
Public mLbl As B4XView
Public mPnlUpper As B4XView
Are you sure you want to have those Public, which means accessible from outsides.
If yes OK.
If no set them as Private.
You add these views onto mBase in DesignerCreateView.
mBase.AddView(mQRCodePromptPay,0,0,0,mBase.Height)
mBase.AddView(mLbl,0,0,mBase.Width,mBase.Height)
mBase.AddView(mPnlUpper,0,0,mBase.Width,mBase.Height)
What is the purpose of mQRCodePromptPay with a Height of 0 ?
You set mLbl as Lbl form
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
mBase = Base
Tag = mBase.Tag
mBase.Tag = Me
mLbl = Lbl
You cannot use this label.
You need to declare a new one.
You set their dimensions to wth with and height of mBase, this means that they are covering each other !?
You have declared several properties with DesignerProperty and Props.GetDefault like:
#DesignerProperty: Key: HasLogo, DisplayName: HasLogo, FieldType: Boolean, DefaultValue: False,Description: There is logo Icon
m_HasLogo = Props.GetDefault("HasLogo",False)
Do you really need properties ?
If yes, do you want that the user of the CustomView can set their values in the Designer.
If yes, that is OK.
If no, you do not need this.
You try to declare this:
#DesignerProperty: Key: Logo, DisplayName: Logo, FieldType: Bitmap, Description: Add Logo bitmap
But FieldType Bitmap does not exist !
Attached your project modified.
Another suggestion:
Your project is a B4XPages project with a well
defined structure.
To maintain this structure you should not zip it with File / Export As Zip but clicking on this line on top of the B4xMainPage module.
The problem with your project from post#8 is that the first line
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
throughs an error and must be commented because the Shared Files folder does not exist.
To have access to your CustomView, you need to add it in the Designer in the layout.
This is not yet the case in your project.