Sub ShakeView (View As B4XView, Duration As Int)
Dim Left As Int = View.Left
Dim Delta As Int = 20dip
For i = 1 To 4
View.SetLayoutAnimated(Duration / 5, Left + Delta, View.Top, View.Width, View.Height)
Delta = -Delta
Sleep(Duration / 5)
Next
View.SetLayoutAnimated(Duration/5, Left, View.Top, View.Width, View.Height)
End Sub