0

I know this question has been asked before, but I've spent a lot of time trying to interpret answers with no success.

I'm trying to get an animated circular progress bar with image. I refer this link for basic understanding but how can i create customized progress bar with image..

Thanks in advance!

Nikita Sukhadiya
  • 367
  • 2
  • 4
  • 10

1 Answers1

0

I made a custom class which extend by dialog. may be this will helpful for you

public class CProgressDialog extends Dialog {

private ImageView iv;

public CProgressDialog(Context context) {
    super(context, R.style.TransparentProgressDialog);
    WindowManager.LayoutParams wlmp = getWindow().getAttributes();
    wlmp.gravity = Gravity.CENTER_HORIZONTAL;
    getWindow().setAttributes(wlmp);
    setTitle(null);
    setCancelable(false);
    setOnCancelListener(null);
    LinearLayout layout = new LinearLayout(context);
    layout.setOrientation(LinearLayout.VERTICAL);
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
            LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
    iv = new ImageView(context);
    iv.setImageResource(R.drawable.spiner_green);
    layout.addView(iv, params);
    addContentView(layout, params); 
}

@Override
public void show() {
    super.show();
    RotateAnimation anim = new RotateAnimation(0.0f, 360.0f,
            Animation.RELATIVE_TO_SELF, .5f, Animation.RELATIVE_TO_SELF,
            .5f);
    anim.setInterpolator(new LinearInterpolator());
    anim.setRepeatCount(Animation.INFINITE);
    anim.setDuration(2000);
    iv.setAnimation(anim);
    iv.startAnimation(anim);
}
curiousMind
  • 2,812
  • 1
  • 17
  • 38
  • kindly describe me that how to use this class in progressbar.. please check this [link](https://lh6.googleusercontent.com/-Wlp3VRI4nnk/Vlfm65p1UhI/AAAAAAAABb8/LNfRuEdaRWU/w191-h212-no/progressBar.png) i want to do like this image. – Nikita Sukhadiya Dec 02 '15 at 07:03
  • well what i suggested you is not that what you are looking for... use third party library or take idea from there... https://github.com/Todd-Davies/ProgressWheel and https://bitbucket.org/mythings/circleprogressbutton – curiousMind Dec 02 '15 at 07:21