The CircularProgressBar class includes a generic animation code that you can use to create all kinds of animations.
We only need to implement the DrawValue sub. In this case we will draw a border around the view.
The value will be between 0 to 100. The top and bottom borders will be drawn between 0 to 50 and the other borders between 50 to 100.
B4X:
Private Sub DrawValue(View As View, cvs As Canvas, Value As Float)
Dim clr As Int = Colors.White
Dim strokewidth As Int = 4dip
Dim cx = View.Width / 2 As Float
Dim width As Float = View.Width / 50 * Min(50, Value)
cvs.DrawLine(cx - width / 2, 0, cx + width / 2, 0, clr, strokewidth)
cvs.DrawLine(cx - width / 2, View.Height, cx + width / 2, View.Height, clr, strokewidth)
If Value > 50 Then
Dim height As Float = View.Height / 50 * (Value - 50)
cvs.DrawLine(0, 0, 0, height / 2, clr, strokewidth)
cvs.DrawLine(0, View.Height, 0, View.Height - height / 2, clr, strokewidth)
cvs.DrawLine(View.Width, 0, View.Width, height / 2, clr, strokewidth)
cvs.DrawLine(View.Width, View.Height, View.Width, View.Height - height / 2, clr, strokewidth)
End If
View.Invalidate
End Sub