method @Nullable public android.graphics.PorterDuff.Mode getIndeterminateTintMode();
method public android.view.animation.Interpolator getInterpolator();
method @android.view.ViewDebug.ExportedProperty(category="progress") public int getMax();
+ method @Px public int getMaxHeight();
+ method @Px public int getMaxWidth();
method @android.view.ViewDebug.ExportedProperty(category="progress") public int getMin();
+ method @Px public int getMinHeight();
+ method @Px public int getMinWidth();
method @android.view.ViewDebug.ExportedProperty(category="progress") public int getProgress();
method @Nullable public android.content.res.ColorStateList getProgressBackgroundTintList();
method @Nullable public android.graphics.PorterDuff.Mode getProgressBackgroundTintMode();
method public void setInterpolator(android.content.Context, @InterpolatorRes int);
method public void setInterpolator(android.view.animation.Interpolator);
method public void setMax(int);
+ method public void setMaxHeight(@Px int);
+ method public void setMaxWidth(@Px int);
method public void setMin(int);
+ method public void setMinHeight(@Px int);
+ method public void setMinWidth(@Px int);
method public void setProgress(int);
method public void setProgress(int, boolean);
method public void setProgressBackgroundTintList(@Nullable android.content.res.ColorStateList);
import android.annotation.InterpolatorRes;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.Px;
import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.content.res.ColorStateList;
/** Duration of smooth progress animations. */
private static final int PROGRESS_ANIM_DURATION = 80;
- @UnsupportedAppUsage
+ /**
+ * Outside the framework, please use {@link ProgressBar#getMinWidth()} and
+ * {@link ProgressBar#setMinWidth(int)} instead of accessing these directly.
+ */
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
int mMinWidth;
int mMaxWidth;
- @UnsupportedAppUsage
+ /**
+ * Outside the framework, please use {@link ProgressBar#getMinHeight()} and
+ * {@link ProgressBar#setMinHeight(int)} instead of accessing these directly.
+ */
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
int mMinHeight;
- @UnsupportedAppUsage
+ /**
+ * Outside the framework, please use {@link ProgressBar#getMaxHeight()} ()} and
+ * {@link ProgressBar#setMaxHeight(int)} (int)} instead of accessing these directly.
+ */
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
int mMaxHeight;
private int mProgress;
}
/**
+ * Sets the minimum width the progress bar can have.
+ * @param minWidth the minimum width to be set, in pixels
+ * @attr ref android.R.styleable#ProgressBar_minWidth
+ */
+ public void setMinWidth(@Px int minWidth) {
+ mMinWidth = minWidth;
+ requestLayout();
+ }
+
+ /**
+ * @return the minimum width the progress bar can have, in pixels
+ */
+ @Px public int getMinWidth() {
+ return mMinWidth;
+ }
+
+ /**
+ * Sets the maximum width the progress bar can have.
+ * @param maxWidth the maximum width to be set, in pixels
+ * @attr ref android.R.styleable#ProgressBar_maxWidth
+ */
+ public void setMaxWidth(@Px int maxWidth) {
+ mMaxWidth = maxWidth;
+ requestLayout();
+ }
+
+ /**
+ * @return the maximum width the progress bar can have, in pixels
+ */
+ @Px public int getMaxWidth() {
+ return mMaxWidth;
+ }
+
+ /**
+ * Sets the minimum height the progress bar can have.
+ * @param minHeight the minimum height to be set, in pixels
+ * @attr ref android.R.styleable#ProgressBar_minHeight
+ */
+ public void setMinHeight(@Px int minHeight) {
+ mMinHeight = minHeight;
+ requestLayout();
+ }
+
+ /**
+ * @return the minimum height the progress bar can have, in pixels
+ */
+ @Px public int getMinHeight() {
+ return mMinHeight;
+ }
+
+ /**
+ * Sets the maximum height the progress bar can have.
+ * @param maxHeight the maximum height to be set, in pixels
+ * @attr ref android.R.styleable#ProgressBar_maxHeight
+ */
+ public void setMaxHeight(@Px int maxHeight) {
+ mMaxHeight = maxHeight;
+ requestLayout();
+ }
+
+ /**
+ * @return the maximum height the progress bar can have, in pixels
+ */
+ @Px public int getMaxHeight() {
+ return mMaxHeight;
+ }
+
+ /**
* Returns {@code true} if the target drawable needs to be tileified.
*
* @param dr the drawable to check