0

Good day.I am trying to implement the circular progress with progress bar.I do not want horizontal i want circular with the progress.Anyway i got it doing like all the way google says but my progress bar just keep animation and animating in loop,and not updating its animation accordingly to progress...I do not know what i have done wrong.Can you please help me?

here is the layout of progress bar.

<FrameLayout 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:background="#000000"
android:keepScreenOn="true"
tools:context="ink.activities.FullscreenActivity">

<ImageView
    android:id="@+id/fullscreen_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:scaleType="fitXY" />

<ProgressBar
    android:id="@+id/imageLoadingProgress"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:indeterminate="false"
    android:max="240780" />

And here is how i set progress to the bar.

 Ion.with(this).load(fullUrlToLoad).progressHandler(new ProgressCallback() {
            @Override
            public void onProgress(long downloaded, long total) {
                Log.d("fasfsafasfa", "downloaded: " + downloaded);
                Log.d("fasfsafasfa", "total: " + total);
                imageLoadingProgress.setProgress((int) downloaded);
            }
        }).intoImageView(mContentView).setCallback(new FutureCallback<ImageView>() {
            @Override
            public void onCompleted(Exception e, ImageView result) {
                imageLoadingProgress.setVisibility(View.GONE);
            }
        });

But unfortunatally as you know it keeps just being an free animating circle.How to fix that?

I want to achieve the circular determinate from the official guideline

https://material.google.com/components/progress-activity.html#progress-activity-types-of-indicators

Android Developer
  • 673
  • 1
  • 7
  • 19

0 Answers0