I'd like to remove title bar from the mainpage and leave the title bar for all other pages active.
I want to use the mainpage as a splash for my app, and it's unprofessional for a splash screen to have a title bar.
The attached project implements a splash screen in the main activity. B4XPages is contained in Activity2, which includes the action bar.
The difficult part is in the switch between the full screen activity to the non-full screen activity. The size of the activity will not be correct. The code in this example takes care of it.
Edit: the attached project includes the fix discussed below.
Sub Activity_Create(FirstTime As Boolean)
Dim ime As IME
ime.Initialize("ime")
ime.AddHeightChangedEvent
Dim pm As B4XPagesManager
pm.Initialize(Activity)
CorrectHeight = 100%y
Wait For ime_HeightChanged (NewHeight As Int, OldHeight As Int)
CorrectHeight = NewHeight
LogColor("CorrectHeight " & CorrectHeight, Colors.Blue) ' <----
End Sub
Sub ime_HeightChanged (NewHeight As Int, OldHeight As Int)
LogColor("ime_HeightChanged", Colors.Blue) ' <----
End Sub
I was "testing", because I wasn't sure that Sub ime_HeightChanged would be triggered given the existence of the wait for.
Neither log executed. ?
I used B4A 10 Beta (I know there is the new version).
Ehm... I see... the edges (reading your post I had thought of a small red square - I wasn't following the matter very much, obviously the square serves to highlight the limits, now I'm "more concentrated" ? .
However I don't understand why those logs are not executed ?
Wait For ime_HeightChanged (NewHeight As Int, OldHeight As Int)
The Wait For pre-empts the event Sub which is never run, but I still don't understand the mechanism that returns the event Sub parameters as apparently multiple return values. I need to look at the generated Java code.
It depends on the device behavior. On some devices the activity will start with the correct height and on other devices it will be updated a few milliseconds after the activity was created.
The Wait For pre-empts the event Sub which is never run, but I still don't understand the mechanism that returns the event Sub parameters as apparently multiple return values. I need to look at the generated Java code.
Sub Activity_Create(FirstTime As Boolean)
Dim ime As IME
ime.Initialize("ime")
ime.AddHeightChangedEvent
Dim pm As B4XPagesManager
pm.Initialize(Activity)
CorrectHeight = 100%y
Log("A: " & DateTime.Now)
Wait For ime_HeightChanged (NewHeight As Int, OldHeight As Int)
Log("B: " & DateTime.Now & ", " & NewHeight & ", " & OldHeight)
CorrectHeight = NewHeight
End Sub