Public Sub HeightChanged (NewHeight As Int)
Dim c As B4XView = CLV.AsView
c.Height = NewHeight - pnlBottom.Height - pnlTopChat.Height
CLV.Base_Resize(c.Width, c.Height)
pnlBottom.Top = NewHeight - pnlBottom.Height
ScrollToLastItem
End Sub
Private Sub MainPage_KeyboardStateChanged (Height As Float)
If Height = 0 Then
chat1.HeightChanged(pnlChat.Height)
MainPage_Resize(MainPage.RootPanel.Width, MainPage.RootPanel.Height)
Else
chat1.HeightChanged(MainPage.RootPanel.Height - Height) 'can ignore safe area
MainPage_Resize(MainPage.RootPanel.Width, MainPage.RootPanel.Height)
End If
End sub
Private Sub MainPage_Resize(Width As Int, Height As Int)
Dim r As Rect = MainPage.SafeAreaInsets
pnlChat.SetLayoutAnimated(0, 0.1, r.Left, r.Top, Width - r.Right - r.Left, Height - r.Bottom - r.Top)
End sub