What would be the best way to make somthing looking like this:
The text on it needs to be customizable, not only numbers, some strings too, depending on context.
From what I see it:
View
and within onDraw
perform all the calculations and text alignment.ProgressBar
.What do you think ?
Android App Development for Beginners This example demonstrates how to create a custom Progress Bar in Android using Kotlin. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.
Android ProgressBar is a graphical view indicator that shows some progress. Android progress bar displays a bar representing the completing of the task. Progress bar in android is useful since it gives the user an idea of time to finish its task.
In Android, by default a progress bar will be displayed as a spinning wheel but If we want it to be displayed as a horizontal bar then we need to use style attribute as horizontal. It mainly use the “android. widget. ProgressBar” class.
Extend ProgressBar ... override onDraw()
The primary reason for this is that all of the primary methods are already there and the first rule of object-orientated programming is code-reuse means don't reinvent the wheel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With