Private Sub Button1_Click
Dim v As B4XView = Sender
ScaleView(v, 1000, 2, v.Width, v.Height) 'bottom right corner
Sleep(1000)
ScaleView(v, 1000, 0.5, v.Width / 2, v.Height / 2) 'center
Sleep(1000)
ScaleView(v, 1000, 2, 0, 0) 'top left
End Sub
Private Sub ScaleView(View As B4XView, Duration As Int, ScaleRatio As Float, PivotX As Int, PivotY As Int)
Dim dx As Float = ScaleRatio * PivotX - PivotX
Dim dy As Float = ScaleRatio * PivotY - PivotY
View.SetLayoutAnimated(Duration, View.Left - dx, View.Top - dy, _
View.Width * ScaleRatio, View.Height * ScaleRatio)
End Sub