I need to enlarge the font size of the notification message. I don't know how to access the Style Sheet properties of the text.
Should I create a 'notificationpopup.css' file?
B4X:
Private Noty As ControlsUtils
....
Noty.ShowNotification3(Text,Title,Noty.ICON_INFORMATION,Null,"CENTER",10000)
Currently I have solved this. I created a new invisible form, where I inserted my StyleSheet. I hooked the notification to this Form.
I'm not sure it's the cleanest solution
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private Button1 As B4XView
Private noty As ControlsUtils 'Lib jControlsFX
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "Styles.css"))
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
Button1_Click
End Sub
Private Sub Button1_Click
noty.ShowNotification3("Title","Text",noty.ICON_INFORMATION,Null,"CENTER",2000)
End Sub
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private Button1 As B4XView
Private noty As ControlsUtils 'Lib jControlsFX
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "Styles.css"))
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
Button1_Click
End Sub
Private Sub Button1_Click
noty.ShowNotification3("Title","Text",noty.ICON_INFORMATION,Null,"CENTER",2000)
End Sub
Unfortunately it did not give me the desired result.
I only have to change the size of the text or title, I don't want to affect all the views of the main form.
For this reason I have created a support form
OK - then just another idea to close off for me = adding and clearing external stylesheet(s) when calling shownotification.
In addition could use more external stylesheets = styles,css (as previous), styletitle.css, styletext,css
So something like:
B4X:
Private Sub Button1_Click
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "Styles.css"))
noty.ShowNotification3("Title","Text",noty.ICON_INFORMATION,Null,"CENTER", 2000)
MainForm.Stylesheets.Clear
End Sub
Private Sub Button2_Click
'Default
MainForm.Stylesheets.Clear
noty.ShowNotification3("Title 2","Text 2",noty.ICON_INFORMATION,Null,"CENTER", 2000)
End Sub
OK - then just another idea to close off for me = adding and clearing external stylesheet(s) when calling shownotification.
In addition could use more external stylesheets = styles,css (as previous), styletitle.css, styletext,css
So something like:
B4X:
Private Sub Button1_Click
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "Styles.css"))
noty.ShowNotification3("Title","Text",noty.ICON_INFORMATION,Null,"CENTER", 2000)
MainForm.Stylesheets.Clear
End Sub
Private Sub Button2_Click
'Default
MainForm.Stylesheets.Clear
noty.ShowNotification3("Title 2","Text 2",noty.ICON_INFORMATION,Null,"CENTER", 2000)
End Sub