/** * Create a new {@code IndeterminateCircularProgressDrawable}. * * @param context the {@code Context} for retrieving style information. */ public IndeterminateCircularProgressDrawable(@NonNull Context context) { super(context); float density = context.getResources().getDisplayMetrics().density; mProgressIntrinsicSize = Math.round(PROGRESS_INTRINSIC_SIZE_DP * density); mPaddedIntrinsicSize = Math.round(PADDED_INTRINSIC_SIZE_DP * density); mAnimators = new Animator[] { Animators.createIndeterminate(mRingPathTransform), Animators.createIndeterminateRotation(mRingRotation) }; }
/** * Create a new {@code IndeterminateHorizontalProgressDrawable}. * * @param context the {@code Context} for retrieving style information. */ public IndeterminateHorizontalProgressDrawable(@NonNull Context context) { super(context); float density = context.getResources().getDisplayMetrics().density; mProgressIntrinsicHeight = Math.round(PROGRESS_INTRINSIC_HEIGHT_DP * density); mPaddedIntrinsicHeight = Math.round(PADDED_INTRINSIC_HEIGHT_DP * density); mBackgroundAlpha = ThemeUtils.getFloatFromAttrRes(android.R.attr.disabledAlpha, 0, context); mAnimators = new Animator[] { Animators.createIndeterminateHorizontalRect1(mRect1TransformX), Animators.createIndeterminateHorizontalRect2(mRect2TransformX) }; }