Skip to content

Instantly share code, notes, and snippets.

@netodevel
Created May 30, 2017 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netodevel/e146976de2684f015da41ae6bb0976d4 to your computer and use it in GitHub Desktop.
Save netodevel/e146976de2684f015da41ae6bb0976d4 to your computer and use it in GitHub Desktop.
imageViewProfile = (ImageView) findViewById(R.id.image_profile);
int arcWidth = 15;
mAnimatedDrawable = new CircularAnimatedDrawable(imageViewProfile, arcWidth, Color.WHITE);
int offset = (imageViewProfile.getLayoutParams().width - imageViewProfile.getLayoutParams().height) / 2;
int left = offset;
int right = imageViewProfile.getLayoutParams().width - offset;
int bottom = imageViewProfile.getLayoutParams().height;
int top = 0;
mAnimatedDrawable.setBounds(left, top, right, bottom);
mAnimatedDrawable.setCallback(imageViewProfile);
mAnimatedDrawable.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment