How to create a progress bar, like an image on Android

How to create below image type Progress rings in Android app. I want to show it 10 seconds before downloading my application to the device. and also i want to rotate it. like a window device. Any help should be appreciated. I am new to Andorid.

Picture:

enter image description here

+7
android android-layout progress-bar android-widget
source share
4 answers

I got a great answer.

Using this link, I found a round progress ring.

progress_bar.gif

Then I use this code:

animation.xml

<?xml version="1.0" encoding="utf-8"?> <animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/progress_bar" android:pivotX="50%" android:pivotY="50%" /> 

In my main XML file.

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"> <ProgressBar android:id="@+id/progressbar1" android:layout_marginTop="80dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:indeterminateDrawable="@anim/animation"/> </RelativeLayout> 

and finally the conclusion:

enter image description here

+9
source share

Changing the image of the runtime resource resource - this issue has recently been discussed here. Check this.

In short - you can use

  • custom available
  • animation sheet

Both approaches allow you to create a progress bar like yours.

+4
source share

You can use this library to make it easier. In addition, so many intuitive progressBar types are available to you.

https://github.com/81813780/AVLoadingIndicatorView

+4
source share

u You can use the gifView library: https://github.com/koral--/android-gif-drawable

use this .xml: -

 <pl.droidsonroids.gif.GifImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/src_anim" /> 

where src_anim is your bootloader gif file

+4
source share

All Articles