B4J Question [ABMaterial] bugreport

peacemaker

Expert
Licensed User
Longtime User
HI, All and @alwaysbusy
Lib version 5.0, Chrome v.104.0.5112.102 64bit.
I just wanted to mention that

ABMCombo​

_Clicked event works, but _Changed - not.
B4X:
    Dim combo1 As ABMCombo
    combo1.Initialize(page, "cboLang", "Select a {B}person{/B}", 650, "")
    combo1.IconName = "mdi-action-account-circle"
    ' add items
    combo1.AddItem("combo1S1", "Mom", BuildSimpleItem("S1", "mdi-action-account-circle", "{NBSP}{NBSP}Mom"))
    combo1.AddItem("combo1S2", "Dad", BuildSimpleItem("S2", "mdi-action-account-circle", "{NBSP}{NBSP}Dad"))
    combo1.AddItem("combo1S3", "Brother", BuildSimpleItem("S3", "mdi-action-dashboard", "{NBSP}{NBSP}Brother"))
    combo1.AddItem("combo1S4", "Sister", BuildSimpleItem("S4", "mdi-action-dashboard", "{NBSP}{NBSP}Sister"))
    page.cell(2,1).AddComponent(combo1)
    ....
 
 
Sub cboLang_Changed(value As String)   'NOT RAISED AT ALL
    Log(value)
End Sub
Sub cboLang_Clicked(itemId As String)    'Works OK
    Log(itemId)
End Sub
 
Last edited:

peacemaker

Expert
Licensed User
Longtime User
page.NavigationBar.Open - does not work.
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
_Clicked event works, but _Changed - not.
You have to explicitly enable this event. By default it is not to reduce client - server roundtrips.

B4X:
cmb.RaiseChangedEvent = true

page.NavigationBar.Open - does not work.
Try this snippet:

B4X:
page.ws.Eval("$('#sidenavbutton').click();", Null)
page.ws.Flush

Alwaysbusy
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
B4X:
MyTheme.AddNavigationBarTheme("nav1theme")
MyTheme.NavigationBar("nav1theme").TopBarFontSize = "10px"
Font size does not work.
B4X:
page.NavigationBar.UseTheme("nav1theme")    'does not help in ConnectPage
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
B4X:
page.SetAcceptedLanguages(Array As String("ru", "en", "es"), "en")
Dim ActiveFoundLanguage AsString = page.DetectLanguage(ws.UpgradeRequest.GetHeader("Accept-Language"))
page.SetActiveLanguage(ActiveFoundLanguage, "" )
Does not work in Chrome, it returns:
ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
But detected always "en".

MS Edge returns:
en-GB,en;q=0.9,en-US;q=0.8

So, i use:
B4X:
Dim browser_lang As String = ws.UpgradeRequest.GetHeader("Accept-Language").SubString2(0, 2).ToLowerCase
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
Font size does not work.
You are probably thinking this is the size of the title, but it is not. It is the font size of the menus/buttons on the right. The title font size is regulated by the Materialize CSS framework and changes automatically on screen size. It can not be modified.
Does not work in Chrome, it returns:
I can not reproduce this. works correct here:

B4X:
Log(ws.UpgradeRequest.GetHeader("Accept-Language"))
' accepts fr, de and nl and if non of these is found, use en
AppPage.SetAcceptedLanguages(Array As String("fr", "de", "nl"), "en")
ActiveFoundLanguage = AppPage.DetectLanguage(ws.UpgradeRequest.GetHeader("Accept-Language"))
Log(ABMShared.FormatDateTimeNow(Name) & "Users browser language: " & ActiveFoundLanguage)

B4X:
en-US,en;q=0.9,nl-NL;q=0.8,nl;q=0.7   '<-------- nl is found in the list so it takes nl
[ABMApplication: 2022-14-09 09:12:19] Users browser language: nl

if I use:
B4X:
' accepts fr, de and ru and if non of these is found, use en
AppPage.SetAcceptedLanguages(Array As String("fr", "de", "ru"), "en")

B4X:
en-US,en;q=0.9,nl-NL;q=0.8,nl;q=0.7   '<-------- fr, de and ru are not found in this list, so use en
[ABMApplication: 2022-14-09 09:14:22] Users browser language: en

Alwaysbusy
 
Upvote 0
Top