B4A Library [B4X] [XUI] AS Settings

Blueforcer

Well-Known Member
Licensed User
Longtime User
No, without see anything about your implementation.
Please provide an example project what shows the error and please make a new thread for questions. Thanks
No worries, i just found the issue as i looked closer to the error message:
location: variable _settings of type settings
i had a codemodule in my project with the name "settings". Renaming solved this issue
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 2.06
    • AS_SettingsPage
      • Add AddProperty_ComboBox2 - The value is displayed in the ComboBox and the key is used for selection and stored in the database
    • AS_Properties
      • Add SetDefaultValue - Defines the default value globally for this property
        • You can call GetProperty and this specified value is taken as the default value
        • No need to call GetPropertyDefault anymore
      • Add GetDefaultValue - Returns the default value that was set with SetDefaultValue
AddProperty_ComboBox2
Tutorial has been extended by this function:
SetDefaultValue
This allows you to define the default value of a property once globally, so you don't always have to call GetPropertyDefault. Especially if you need this property in several places in the code, this is now easier.
B4X:
AS_Properties.SetDefaultValue("MyTestProp","DefaultValue3")
Log(AS_Properties.GetProperty("MyTestProp"))
GetDefaultValue
Can be used to assign the default value when building the settings page
B4X:
AS_Properties.SetDefaultValue("MyTestProp",True)
AS_Settings1.MainPage.AddProperty_Boolean("Basic","MyTestProp","Boolean Example","",Null,AS_Properties.GetDefaultValue("MyTestProp"))
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 2.10
    • AS_Settings
      • Add AS_Settings_GroupProperties
        • Removed GroupNameTextColor
If you want the group text on the right side:
Add this code, before you add groups
B4X:
AS_Settings1.GroupProperties.HorizontalTextAlignment = "RIGHT"
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 2.11
    • AS_SettingsPage
      • BugFixes and Improvements
      • Add AddProperty_ColorChooser
      • Add Type AS_Settings_ColorItem
      • Add Event DisabledItemClicked
AddProperty_ColorChooser
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 2.12
    • AS_SettingsPage
      • BugFix - GetProperty now also works if the page has not yet been populated
      • Add get isPagePopulated - Indicates whether the page has already been filled with your properties
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 2.15
    • AS_SettingsPage
      • New - AddProperty_Link - Identical to AddProperty_Action only with a different icon
      • New - PageScrollChanged Event
      • New - CustomDrawGroup Event
      • Update - The round corners of a group are no longer created with 2 separate items in the list, but directly on the 1st and last item of a group
      • Update - AS_Settings_PropertyViews the LeftBackgroundPanel is renamed to BackgroundPanel
      • BugFix - In the Property SelectionList if SelectionMode Single was set and you used the SaveMode Manual, you could select multiple items
      • BugFix - In the Property Action more space is now released for the description if no value text is displayed
      • BugFix - In the Property ComboBox the complete item can be clicked to open the combobox
AddProperty_Link

PageScrollChanged Event
B4X:
Private Sub AS_Settings1_PageScrollChanged(Offset As Int, Page As AS_SettingsPage)
    Log("PageScrollChanged: " & Offset)
End Sub
CustomDrawGroup Event
B4X:
Private Sub AS_Settings1_CustomDrawGroup(CustomDrawGroup As AS_Settings_CustomDrawGroup)
    CustomGroupColor(CustomDrawGroup.GroupViews.BackgroundPanel,CustomDrawGroup.group.Key)
End Sub

Private Sub AS_Settings1_CustomDrawProperty(CustomDrawProperty As AS_Settings_CustomDrawProperty)
    CustomGroupColor(CustomDrawProperty.PropertyViews.RootBackgroundPanel,CustomDrawProperty.Property.Group.Key)
    CustomGroupColor(CustomDrawProperty.PropertyViews.BackgroundPanel,CustomDrawProperty.Property.Group.Key)
End Sub

Private Sub CustomGroupColor(BackgroundPanel As B4XView,GroupKey As String)
    Select Case GroupKey
        Case "Basic"
            BackgroundPanel.Color = xui.Color_ARGB(255,73, 98, 164)
        Case "Advanced"
            BackgroundPanel.Color = xui.Color_ARGB(255,141, 68, 173)
    End Select
End Sub
 
Last edited:

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 2.17
    • AS_Settings
      • Update AS_Settings_GroupProperties added LeftGap
        • Default: 5dip
      • Update AS_Settings_Property_Properties added NameFont and DescriptionFont
        • NameFont Default: Bold 18
        • DescriptionFont Default: Normal 15
AS_Settings_GroupProperties - LeftGap
B4X:
AS_Settings1.GroupProperties.LeftGap = 20dip

AS_Settings_Property_Properties - NameFont
B4X:
AS_Settings1.PropertyProperties.NameFont = xui.CreateDefaultBoldFont(25)

AS_Settings_Property_Properties - DescriptionFont
B4X:
AS_Settings1.PropertyProperties.DescriptionFont = xui.CreateDefaultBoldFont(25)
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 2.18
    • AS_Settings
      • New AS_Settings_SelectionListItemProperties
        • xFont Default: BoldFont(18)
        • SeperatorVisible Default: True
      • New CustomDrawActionProperty Event - only for Action and Link Property
    • AS_SettingsPage
      • New get ExitIconImageView - B4J only
      • BugFix if the CustomProperty is in a group, the BackgroundPanel now has the correct width
New example for the Custom Property
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…