Hello,
I am very new to B4X, so this question might look stupid for most of you, but I stumble and do not get on with it.
First : I am developing on my PC, so I am using B4J
What I am aiming to is a little app ( later running on an android device ) which is monitoring some things and raises an alert
via sound ( that was easy ) and also visual by flashing ( changing colors ) of the app-background or even the background of
a label on the screen.
I found something "Root.Color = 123" which did not work for me. I also tried "Root.SetColorAnimated(iColor1,iColor2,1000)"
also without any visible effect.
I am using the basic Hello World program and just added a label to show that I really entered the change-routine.
I am feeling a little bit silly. It is surely something absolutely easy what I am missing.
I would like to get a gente kick to the right direction
.
Did I post my code the correct way ?
#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private Label1 As Label
Private Bclose As Button
Private Bexit As Button
Private Btest As Button
Private iNowColor, iColor1, iColor2 As Int
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
iNowColor= Root.Color
iColor1= iNowColor
iColor2=255
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Bclose_Click
xui.MsgboxAsync("Hello world!", "B4X")
End Sub
' Test
private Sub Btest_Click
'Dim mp As MediaPlayer
'mp.Initialize("mp", File.GetUri(File.DirAssets, "bubbles.mp3"))
'mp.Play
Label1.Text="Abfrage Türstatus ... " & iNowColor
If (iNowColor= iColor1) Then
'Root.Color= iColor2 '**** Did not work
Root.SetColorAnimated(iColor1,iColor2,1000)
iNowColor = iColor2
Else
'Root.Color = iColor1 '**** Did not work
Root.SetColorAnimated(iColor1,iColor2,1000)
iNowColor= iColor1
End If
End Sub
private Sub Bexit_Click
ExitApplication
End Sub
I am very new to B4X, so this question might look stupid for most of you, but I stumble and do not get on with it.
First : I am developing on my PC, so I am using B4J
What I am aiming to is a little app ( later running on an android device ) which is monitoring some things and raises an alert
via sound ( that was easy ) and also visual by flashing ( changing colors ) of the app-background or even the background of
a label on the screen.
I found something "Root.Color = 123" which did not work for me. I also tried "Root.SetColorAnimated(iColor1,iColor2,1000)"
also without any visible effect.
I am using the basic Hello World program and just added a label to show that I really entered the change-routine.
I am feeling a little bit silly. It is surely something absolutely easy what I am missing.
I would like to get a gente kick to the right direction
Did I post my code the correct way ?
#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private Label1 As Label
Private Bclose As Button
Private Bexit As Button
Private Btest As Button
Private iNowColor, iColor1, iColor2 As Int
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
iNowColor= Root.Color
iColor1= iNowColor
iColor2=255
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Bclose_Click
xui.MsgboxAsync("Hello world!", "B4X")
End Sub
' Test
private Sub Btest_Click
'Dim mp As MediaPlayer
'mp.Initialize("mp", File.GetUri(File.DirAssets, "bubbles.mp3"))
'mp.Play
Label1.Text="Abfrage Türstatus ... " & iNowColor
If (iNowColor= iColor1) Then
'Root.Color= iColor2 '**** Did not work
Root.SetColorAnimated(iColor1,iColor2,1000)
iNowColor = iColor2
Else
'Root.Color = iColor1 '**** Did not work
Root.SetColorAnimated(iColor1,iColor2,1000)
iNowColor= iColor1
End If
End Sub
private Sub Bexit_Click
ExitApplication
End Sub