Dear All,
I just wanted to test my logic when rotating the screen and created four layouts with designer (two for main and two for plot). I used the LoadLayout method to switch between the four layouts, dependent where I'm in main or plot mode and in portrait or landscape mode.
Here is the snippet of the Activity_create sub:
The switch logic works fine but the spinner is invalid: not functioning (no selection possible) and is looking strange like this (just a triangle is visible):
If I comment out the line
PanelMainLandscape.LoadLayout("MainPanelLandscape")
the spinner view looks as expected (the triangle is not visible because I colored the spinner background):
Commenting out other LoadLayout commands do not have an effect. Obviously, the switching of panels do not work anymore because one panel is missing.
Any idea what is happening?
Wosl
I just wanted to test my logic when rotating the screen and created four layouts with designer (two for main and two for plot). I used the LoadLayout method to switch between the four layouts, dependent where I'm in main or plot mode and in portrait or landscape mode.
Here is the snippet of the Activity_create sub:
B4X:
Sub Activity_Create (FirstTime As Boolean)
'---------------------------------------------------------------
' Fetch PV power data from SQLite DB on NAS, calculate work data and plot result
'---------------------------------------------------------------
PanelMainPortrait.Initialize("")
PanelPlotPortrait.Initialize("")
PanelMainLandscape.Initialize("")
PanelPlotLandscape.Initialize("")
Activity.AddView(PanelMainPortrait, 0, 0, 100%x, 100%y)
Activity.AddView(PanelPlotPortrait, 0, 0, 100%x, 100%y)
Activity.AddView(PanelMainLandscape, 0, 0, 100%x, 100%y)
Activity.AddView(PanelPlotLandscape, 0, 0, 100%x, 100%y)
PanelMainPortrait.LoadLayout("MainPanelPortrait")
PanelPlotPortrait.LoadLayout("PlotPanelPortrait")
PanelMainLandscape.LoadLayout("MainPanelLandscape")
PanelPlotLandscape.LoadLayout("PlotPanelLandscape")
If FirstTime Then
SpinnerChartType.AddAll(SpinnerArray)
SpinnerChartType.Color=Colors.LightGray
SpinnerChartType.SelectedIndex = 0
iChartTypeSelection = 0
HeadlineMainPortrait.Text = "SQL Query of Power Values and Energy Calculation"
HeadlinePlotPortrait.Text = "Plot Power or Works Data"
lPlotMode = False
End If
ScreenHeight=Activity.Height
ScreenWidth=Activity.Width
If ScreenHeight > ScreenWidth Then
' Screen not rotated (height > width)
lRotation = False
Else
' Screen rotated (height <= width)
lRotation = True
End If
ScreenPanel (True, False)
If lPlotMode = True Then ButtonPlot_click
End Sub
The switch logic works fine but the spinner is invalid: not functioning (no selection possible) and is looking strange like this (just a triangle is visible):
If I comment out the line
PanelMainLandscape.LoadLayout("MainPanelLandscape")
the spinner view looks as expected (the triangle is not visible because I colored the spinner background):
Commenting out other LoadLayout commands do not have an effect. Obviously, the switching of panels do not work anymore because one panel is missing.
Any idea what is happening?
Wosl