How can i create a horizontal progress bar with indication text at the progress point. I want to create a progress bar like this.
you can use NumberProgressBar lib
Gradle
dependencies {
compile 'com.daimajia.numberprogressbar:library:1.4#aar'
}
Use it in your own code:
<com.daimajia.numberprogressbar.NumberProgressBar
android:id="#+id/number_progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
There are some others too
Related
I am trying to create a progress bar using default progress bar given in android , I achieved 80% of that required design but i cannot find a code to finish the required design.
this is a required design
given design
i need to bring the rounded part [highlighted in blue ] in my progress bar
finished design
xml code
<ProgressBar
android:id="#+id/ww_progress_bar"
android:visibility="visible"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/circular_shape"
android:progressDrawable="#drawable/circular_progress_bar"
android:textAlignment="center" />
KT class
binding.wwProgressBar.visibility = VISIBLE
binding.wwProgressBar.setProgress(40)
binding.wwProgressBar.max = progressMax
is it possible to bring the required design? can anyone help to finish this design?
you need to use seek bar for it
use custom thumb for it
or
for easy implementation
you can use gihub library
https://github.com/tankery/CircularSeekBar
you should set thumb in your ProgressBar
android:thumb="#drawable/thumb_seekbar"
you can use this link for more information
I have to create horizontal progress bar layout design. the challenges is I have to update width of progress bar according to percentage. Second challenge is I have to update color code of progress bar according to percentage. And I have to show percentage view/ text view at end of the progress bar.
Please help to solve this layout design.
For that I have tried default progress bar but its not working may be I missing something.
You can Use
1. LinearProgressIndicator google material view
Gradle - implementation 'com.google.android.material:material:1.4.0'
Code in xml:
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="#+id/progress1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:trackColor="#color/white"
app:indicatorColor="#color/teal_200"
app:trackThickness="30dp"
android:progress="20"
android:layout_margin="20dp"/>
Set progress to LinearProgressIndicator in Activity class
progress1.setProgress(30);
2. Check this github project - https://github.com/MackHartley/RoundedProgressBar
I need to create a modal alert with some animated progress indicator. I've found this example below, and I'd like to create something like this:
I already know how to implement the circular progress indicator, but this effect at the end is new to me.
Has anyone seen a similar effect? (Circular progress indicator with effect in the end)
Is this some kind of gif? And if it is, how can I add a gif to a view on Android?
You can use this well known library AnimCheckBox. Here is an screenshot what will you get.
How to use?
Add this dependency to your app level build.gradle
dependencies{
compile 'com.hanks.animatecheckbox:library:0.1'
}
Then in your layout.xml
<com.hanks.library.AnimateCheckBox
android:layout_width="50dp"
android:layout_height="50dp"
android:padding="15dp"
app:animDuration="200"
app:checkedColor="#00f"
app:lineColor="#fff"
app:lineWidth="1.2dp"
app:unCheckColor="#ff0"/>
I want to build a horizontal progress bar with a progress animation like this:
http://www.sapdesignguild.org/community/images/progress_bar_en_lt1m.gif
My problem is that I'm not sure about how to set a horizontal-translate animation on the progress bar, like in mac or ubuntu progress bar. Right now, all I am able to get is a static image. This is my progress bar declaration:
<ProgressBar
android:id="#+id/pgBar2"
android:layout_width="fill_parent"
android:max="100"
android:indeterminate="true"
android:indeterminateBehavior="repeat"
android:indeterminateDrawable="#drawable/image2"
android:indeterminateOnly="false"
style="#android:style/Widget.ProgressBar.Horizontal/>
How can I get this kind of animation? thanks!
How to show an indeterminate horizontal progress bar in android? The animation of the progress bar should start from 0 to 100 and then go back from 100 to 0 continuously. I am not looking for the wheel progress bar.
I already knew that setIndeterminate will give an infinite horizontal progress bar. But it will be similar to the loading wheel, except that it will be horizontal. If you see my question I was looking for horizontal bar which starts from 0 and goes all the way to 100 (a gradual increase). If you want to achieve this in Android, you must use your progress bar as below:
<ProgressBar
android:id="#+id/progress_horizontal"
android:indeterminateOnly="false"
android:indeterminateDrawable="#drawable/progress_indeterminate_horizontal"
android:progressDrawable="#drawable/progress_horizontal"
android:minHeight="24dip"
android:maxHeight="24dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
As I wanted to change the background of my progress bar, I changed the ProgressDrawable and IndeterminateDrawable. The original drawables are located under frameworks/base/core/res/res/drawable. Copy them to your project and change the color according to your needs.
Create a thread which updates the progress count and does a Thread.Sleep. Then it sends the message to the Handler which will update the progress bar in UI thread.
Use the method setIndeterminate of ProgressBar:
android.widget.ProgressBar bar = new android.widget.ProgressBar(context);
bar.setIndeterminate(true);
But yeah, you could have found this pretty quickly in the developer docs.
http://developer.android.com/reference/android/widget/ProgressBar.html#setIndeterminate%28boolean%29
Maybe a bit late, but you can do something like this:
<ProgressBar
android:id="#+id/progress"
android:layout_width="match_parent"
android:layout_height="10dp"
android:indeterminate="true"
style="?android:attr/progressBarStyleHorizontal" />
Hope it helps someone!
To expand on Vinoth Answer, here is a ready code:
<ProgressBar
android:id="#+id/progressBarLoadingRecite"
android:indeterminateDrawable="#android:drawable/progress_indeterminate_horizontal"
android:minHeight="24dip"
android:layout_marginTop="20dip"
android:indeterminate="true"
android:maxHeight="24dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
In the xml defining your progress bar, you can add
style="#android:style/Widget.ProgressBar.Horizontal"