I use liveWallpaper Librarie but with tablet the screen orientation of the Livewallpaper change. As my picture as fixed at portrait i want to have always portrait (Orientation landscape : picture Portrait too)
I know that i have to something like that but all the test i do is not correct
here is the code where i have to check
thx for your help
I know that i have to something like that but all the test i do is not correct
B4X:
If GetDeviceLayoutValues.Width > GetDeviceLayoutValues.Height Then
'Landscape
Else
'Portrait
End If
here is the code where i have to check
B4X:
Sub LWM_OffsetChanged (Engine As LWEngine)
Dim petitEcran As Int = 0
If image.IsInitialized AND resized.IsInitialized = False Then
If Engine.ScreenWidth = 320 Then petitEcran = 95
resized = ResizeImage(image, Engine.FullWallpaperWidth + petitEcran, Engine.FullWallpaperHeight)
End If
If resized.IsInitialized Then
' Engine.Rect.Left = -Engine.CurrentOffsetX
' Engine.Rect.Top = -Engine.CurrentOffsetY
' Engine.Rect.Right = -Engine.CurrentOffsetX + Engine.FullWallpaperWidth
' Engine.Rect.Bottom = -Engine.CurrentOffsetY + Engine.FullWallpaperHeight
Engine.Rect.Left = -(Engine.FullWallpaperWidth - actualImageWidth) / 2
Engine.Rect.Top = 0
Engine.Rect.Right = Engine.Rect.Left + Engine.FullWallpaperWidth
Engine.Rect.Bottom = Engine.FullWallpaperHeight
Engine.Canvas.DrawBitmap(resized, Null, Engine.Rect)
End If
Engine.RefreshAll
End Sub
thx for your help