@Override public boolean getUseIntrinsicPadding() { return getIntrinsicPaddingDrawable().getUseIntrinsicPadding(); }
@Override public void setUseIntrinsicPadding(boolean useIntrinsicPadding) { getIntrinsicPaddingDrawable().setUseIntrinsicPadding(useIntrinsicPadding); }
/** * Get whether the current drawable is showing a background. The default is {@code true}. * * @return Whether the current drawable is showing a background, or {@code false} if the * drawable does not implement {@link ShowBackgroundDrawable}. */ public boolean getShowProgressBackground() { Drawable drawable = getCurrentDrawable(); if (drawable instanceof ShowBackgroundDrawable) { return ((ShowBackgroundDrawable) drawable).getShowBackground(); } else { return false; } }
private void applyProgressTints() { if (getProgressDrawable() == null) { return; } applyPrimaryProgressTint(); applyProgressBackgroundTint(); applySecondaryProgressTint(); }
private void fixCanvasScalingAndColorFilterWhenHardwareAccelerated() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { // Canvas scaling when hardware accelerated results in artifacts on API < 18, and color // filter with alpha results in some dark color on API < 20, so we need to use software // layer. if (isHardwareAccelerated() && getLayerType() != LAYER_TYPE_SOFTWARE) { setLayerType(LAYER_TYPE_SOFTWARE, null); } } }
private void applyPrimaryProgressTint() { if (getProgressDrawable() == null) { return; } if (mProgressTintInfo.mHasProgressTint || mProgressTintInfo.mHasProgressTintMode) { Drawable target = getTintTargetFromProgressDrawable(android.R.id.progress, true); if (target != null) { applyTintForDrawable(target, mProgressTintInfo.mProgressTint, mProgressTintInfo.mHasProgressTint, mProgressTintInfo.mProgressTintMode, mProgressTintInfo.mHasProgressTintMode); } } }
/** * {@inheritDoc} */ @Override public void draw(@NonNull Canvas canvas) { super.draw(canvas); if (isStarted()) { invalidateSelf(); } }
/** * Get whether the current drawable is using an intrinsic padding. The default is {@code true}. * * @return Whether the current drawable is using an intrinsic padding, or {@code false} if the * drawable does not implement {@link IntrinsicPaddingDrawable}. */ public boolean getUseIntrinsicPadding() { Drawable drawable = getCurrentDrawable(); if (drawable instanceof IntrinsicPaddingDrawable) { return ((IntrinsicPaddingDrawable) drawable).getUseIntrinsicPadding(); } else { return false; } }
/** * {@inheritDoc} */ @Override public void setShowBackground(boolean show) { if (mBackgroundDrawable.getShowBackground() != show) { mBackgroundDrawable.setShowBackground(show); mSecondaryProgressDrawable.setShowBackground(!show); } }
/** * Create a new {@code HorizontalProgressDrawable}. * * @param context the {@code Context} for retrieving style information. */ public HorizontalProgressDrawable(@NonNull Context context) { super(new Drawable[] { new HorizontalProgressBackgroundDrawable(context), new SingleHorizontalProgressDrawable(context), new SingleHorizontalProgressDrawable(context) }, context); } }
public AnimationScaleIndeterminateCircularProgressDrawable(@NonNull Context context) { super(new Drawable[] { new StaticIndeterminateCircularProgressDrawable(context), new IndeterminateCircularProgressDrawable(context) }); }
/** * {@inheritDoc} */ @Override public boolean getUseIntrinsicPadding() { return mBackgroundDrawable.getUseIntrinsicPadding(); }
@Override public void setShowBackground(boolean show) { if (mShow != show) { mShow = show; invalidateSelf(); } }
/** * {@inheritDoc} */ @Override public void setUseIntrinsicPadding(boolean useIntrinsicPadding) { mBackgroundDrawable.setUseIntrinsicPadding(useIntrinsicPadding); mSecondaryProgressDrawable.setUseIntrinsicPadding(useIntrinsicPadding); mProgressDrawable.setUseIntrinsicPadding(useIntrinsicPadding); }
/** * {@inheritDoc} */ @Override public void setShowBackground(boolean show) { if (mShowBackground != show) { mShowBackground = show; invalidateSelf(); } }
/** * {@inheritDoc} */ @Override public void setUseIntrinsicPadding(boolean useIntrinsicPadding) { if (mUseIntrinsicPadding != useIntrinsicPadding) { mUseIntrinsicPadding = useIntrinsicPadding; invalidateSelf(); } } }
@Override public void setShowBackground(boolean show) { if (mShowBackground != show) { mShowBackground = show; invalidateSelf(); } }
@Override public void setShowBackground(boolean show) { if (mShow != show) { mShow = show; invalidateSelf(); } }
/** * {@inheritDoc} */ @Override public boolean getShowBackground() { return mBackgroundDrawable.getShowBackground(); }
@Override public void setShowBackground(boolean show) { if (mShowBackground != show) { mShowBackground = show; invalidateSelf(); } }