B4J Question [ABMaterial] Questions on understanding the framework...

Mashiane

Expert
Licensed User
Longtime User
In my quest on learning the ABMaterial, and trying to develop WebApps based on it. I would like to find out the following:

1. How do I use and assign Colors.RGB(R,G,B) to a theme variant. Currently there are pre-defined color constants that one can use, what if I want to use my own color based on RBG values?

2. Is there something like a ContentChooser for ABMaterial? I want to have a button that I can select, then the Photo Gallery appears and I can choose a picture and this picture can be loaded to an ABMImage component.
 

amminf

Active Member
Licensed User
Longtime User
Hi,

1. In next ABMaterial 2.0 because in feedback forum says:

In 2.00 you can create your own colors with an Alpha channel. Note that it has to be set for every INTENSITY you are going to need:

tmpTheme.Page.AddColorDefinition("myred", ABM.INTENSITY_DARKEN4, "#B71C1C", 0.18)
tmpTheme.Page.AddColorDefinition("myred", ABM.INTENSITY_LIGHTEN2, "#B71C1C", 0.18)

Then you can use it as:

tmpTheme.Container("zdepthred").BackColor = "myred"
tmpTheme.Container("zdepthred").BackColorIntensity = ABM.INTENSITY_DARKEN4


While use constants what you will replace, in v ABM 2.0, with your name definition color.


2. You can to build your chooser modalsheet using ABMImage or ABMCard components associateds to ABMButton like a image selector. I think it's easy.

Regards.
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Question 3: Form Validation

How does one implement Form Validation with ABMaterial. Some javascript frameworks have a "required" attribute per component to check if a value is specified for that particular control. Is there something like that with ABMaterial?

Answer: Kinda Sorted, had to implement this by checking Input. Have explained here how I have done it.
 
Last edited:
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Question 5: ABMInput IconColor?

Hi

Which theme property can I use to change the color of the Icon for the ABMInput component?

Answer: Found something that works, the InputTheme. This also changes the IconColor too.

B4X:
MyTheme.AddInputTheme("inputtheme")
MyTheme.Input("inputtheme").ForeColor = ABM.COLOR_ORANGE
MyTheme.Input("inputtheme").ForeColorIntensity = ABM.INTENSITY_LIGHTEN1
MyTheme.Input("inputtheme").InputColor = ABM.COLOR_ORANGE
MyTheme.Input("inputtheme").InputColorIntensity = ABM.INTENSITY_LIGHTEN1

My ABMInput Component is defined like this..

B4X:
Dim txtEmail As ABMInput
txtEmail.Initialize(page, "txtEmail", ABM.INPUT_EMAIL, "Email", False, "inputtheme")
txtEmail.Enabled = True
txtEmail.PlaceHolderText = "Email"
txtEmail.WrongMessage = "Email Incorrect"
txtEmail.SuccessMessage = "Email Correct"
txtEmail.IconName = "fa fa-envelope-o"
page.Cell(1,1).AddComponent(txtEmail)
 
Last edited:
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Question 6: How to add Clickable Images on the ABMCard where buttons are?

The ABMCard can have numerous buttons in it. How do instead have clickable images. I have rounded the sections where I'd like to perhaps have clickable images.

Currently the code to add a button there is

B4X:
card1.AddAction("BUTTON 1")
card1.AddAction("BUTTON 2")
 

Attachments

  • card.png
    card.png
    6.6 KB · Views: 167
Upvote 0
Top