Browse Source

Satisfied some lint warnings

Aidan Follestad 9 năm trước cách đây
mục cha
commit
3f83299130

+ 1 - 0
commons/build.gradle

@@ -13,6 +13,7 @@ android {
     }
     lintOptions {
         abortOnError false
+        checkReleaseBuilds false
     }
 }
 

+ 1 - 0
core/build.gradle

@@ -13,6 +13,7 @@ android {
     }
     lintOptions {
         abortOnError false
+        checkReleaseBuilds false
     }
 }
 

+ 1 - 34
core/src/main/java/com/afollestad/materialdialogs/internal/progress/HorizontalProgressDrawable.java

@@ -15,9 +15,6 @@ import android.os.Build;
 
 import com.afollestad.materialdialogs.util.DialogUtils;
 
-/**
- * A backported {@code Drawable} for determinate horizontal {@code ProgressBar}.
- */
 @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
 public class HorizontalProgressDrawable extends LayerDrawable {
 
@@ -26,11 +23,6 @@ public class HorizontalProgressDrawable extends LayerDrawable {
     private SingleHorizontalProgressDrawable mSecondaryProgressDrawable;
     private SingleHorizontalProgressDrawable mProgressDrawable;
 
-    /**
-     * Create a new {@code HorizontalProgressDrawable}.
-     *
-     * @param context the {@code Context} for retrieving style information.
-     */
     public HorizontalProgressDrawable(Context context) {
         super(new Drawable[]{
                 new SingleHorizontalProgressDrawable(context),
@@ -53,18 +45,10 @@ public class HorizontalProgressDrawable extends LayerDrawable {
         mProgressDrawable.setShowTrack(false);
     }
 
-    /**
-     * Get whether this {@code Drawable} is showing a track. The default is true.
-     *
-     * @return Whether this {@code Drawable} is showing a track.
-     */
     public boolean getShowTrack() {
         return mTrackDrawable.getShowTrack();
     }
 
-    /**
-     * Set whether this {@code Drawable} should show a track. The default is true.
-     */
     public void setShowTrack(boolean showTrack) {
         if (mTrackDrawable.getShowTrack() != showTrack) {
             mTrackDrawable.setShowTrack(showTrack);
@@ -73,18 +57,10 @@ public class HorizontalProgressDrawable extends LayerDrawable {
         }
     }
 
-    /**
-     * Get whether this {@code Drawable} is using an intrinsic padding. The default is true.
-     *
-     * @return Whether this {@code Drawable} is using an intrinsic padding.
-     */
     public boolean getUseIntrinsicPadding() {
         return mTrackDrawable.getUseIntrinsicPadding();
     }
 
-    /**
-     * Set whether this {@code Drawable} should use an intrinsic padding. The default is true.
-     */
     public void setUseIntrinsicPadding(boolean useIntrinsicPadding) {
 
         mTrackDrawable.setUseIntrinsicPadding(useIntrinsicPadding);
@@ -92,9 +68,6 @@ public class HorizontalProgressDrawable extends LayerDrawable {
         mProgressDrawable.setUseIntrinsicPadding(useIntrinsicPadding);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     // Rewrite for compatibility and workaround lint.
     @Override
     @TargetApi(Build.VERSION_CODES.LOLLIPOP)
@@ -104,9 +77,6 @@ public class HorizontalProgressDrawable extends LayerDrawable {
         mProgressDrawable.setTint(tint);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     // Rewrite for compatibility and workaround lint.
     @Override
     @TargetApi(Build.VERSION_CODES.LOLLIPOP)
@@ -116,9 +86,6 @@ public class HorizontalProgressDrawable extends LayerDrawable {
         mProgressDrawable.setTintList(tint);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     // Rewrite for compatibility and workaround lint.
     @Override
     @TargetApi(Build.VERSION_CODES.LOLLIPOP)
@@ -127,4 +94,4 @@ public class HorizontalProgressDrawable extends LayerDrawable {
         mSecondaryProgressDrawable.setTintMode(tintMode);
         mProgressDrawable.setTintMode(tintMode);
     }
-}
+}

+ 1 - 23
core/src/main/java/com/afollestad/materialdialogs/internal/progress/IndeterminateHorizontalProgressDrawable.java

@@ -17,9 +17,6 @@ import android.support.annotation.Keep;
 
 import com.afollestad.materialdialogs.util.DialogUtils;
 
-/**
- * A backported {@code Drawable} for indeterminate horizontal {@code ProgressBar}.
- */
 @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
 public class IndeterminateHorizontalProgressDrawable extends IndeterminateProgressDrawableBase {
 
@@ -39,11 +36,6 @@ public class IndeterminateHorizontalProgressDrawable extends IndeterminateProgre
     private RectTransformX mRect1TransformX = new RectTransformX(RECT_1_TRANSFORM_X);
     private RectTransformX mRect2TransformX = new RectTransformX(RECT_2_TRANSFORM_X);
 
-    /**
-     * Create a new {@code IndeterminateHorizontalProgressDrawable}.
-     *
-     * @param context the {@code Context} for retrieving style information.
-     */
     public IndeterminateHorizontalProgressDrawable(Context context) {
         super(context);
 
@@ -59,18 +51,10 @@ public class IndeterminateHorizontalProgressDrawable extends IndeterminateProgre
         };
     }
 
-    /**
-     * Get whether this {@code Drawable} is showing a track. The default is true.
-     *
-     * @return Whether this {@code Drawable} is showing a track.
-     */
     public boolean getShowTrack() {
         return mShowTrack;
     }
 
-    /**
-     * Set whether this {@code Drawable} should show a track. The default is true.
-     */
     public void setShowTrack(boolean showTrack) {
         if (mShowTrack != showTrack) {
             mShowTrack = showTrack;
@@ -78,17 +62,11 @@ public class IndeterminateHorizontalProgressDrawable extends IndeterminateProgre
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public int getIntrinsicHeight() {
         return mUseIntrinsicPadding ? mPaddedIntrinsicHeight : mProgressIntrinsicHeight;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public int getOpacity() {
         if (mAlpha == 0) {
@@ -167,4 +145,4 @@ public class IndeterminateHorizontalProgressDrawable extends IndeterminateProgre
             mScaleX = scaleX;
         }
     }
-}
+}

+ 1 - 18
core/src/main/java/com/afollestad/materialdialogs/internal/progress/IndeterminateProgressDrawable.java

@@ -15,9 +15,6 @@ import android.graphics.RectF;
 import android.os.Build;
 import android.support.annotation.Keep;
 
-/**
- * A backported {@code Drawable} for indeterminate circular {@code ProgressBar}.
- */
 @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
 public class IndeterminateProgressDrawable extends IndeterminateProgressDrawableBase {
 
@@ -33,11 +30,6 @@ public class IndeterminateProgressDrawable extends IndeterminateProgressDrawable
     private RingPathTransform mRingPathTransform = new RingPathTransform();
     private RingRotation mRingRotation = new RingRotation();
 
-    /**
-     * Create a new {@code IndeterminateProgressDrawable}.
-     *
-     * @param context the {@code Context} for retrieving style information.
-     */
     public IndeterminateProgressDrawable(Context context) {
         super(context);
 
@@ -55,25 +47,16 @@ public class IndeterminateProgressDrawable extends IndeterminateProgressDrawable
         return mUseIntrinsicPadding ? mPaddedIntrinsicSize : mProgressIntrinsicSize;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public int getIntrinsicWidth() {
         return getIntrinsicSize();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public int getIntrinsicHeight() {
         return getIntrinsicSize();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public int getOpacity() {
         if (mAlpha == 0) {
@@ -157,4 +140,4 @@ public class IndeterminateProgressDrawable extends IndeterminateProgressDrawable
             mRotation = rotation;
         }
     }
-}
+}

+ 1 - 13
core/src/main/java/com/afollestad/materialdialogs/internal/progress/IndeterminateProgressDrawableBase.java

@@ -22,9 +22,6 @@ abstract class IndeterminateProgressDrawableBase extends ProgressDrawableBase
         super(context);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void draw(Canvas canvas) {
         super.draw(canvas);
@@ -34,9 +31,6 @@ abstract class IndeterminateProgressDrawableBase extends ProgressDrawableBase
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void start() {
 
@@ -59,9 +53,6 @@ abstract class IndeterminateProgressDrawableBase extends ProgressDrawableBase
         return false;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void stop() {
         for (Animator animator : mAnimators) {
@@ -69,9 +60,6 @@ abstract class IndeterminateProgressDrawableBase extends ProgressDrawableBase
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean isRunning() {
         for (Animator animator : mAnimators) {
@@ -81,4 +69,4 @@ abstract class IndeterminateProgressDrawableBase extends ProgressDrawableBase
         }
         return false;
     }
-}
+}

+ 15 - 30
core/src/main/java/com/afollestad/materialdialogs/internal/progress/Interpolators.java

@@ -12,22 +12,16 @@ import android.support.v4.view.animation.PathInterpolatorCompat;
 import android.view.animation.Interpolator;
 import android.view.animation.LinearInterpolator;
 
-/**
- * Interpolators backported for Animators in this library.
- */
 @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
 class Interpolators {
 
-    /**
-     * Backported Interpolator for
-     * {@code @android:interpolator/progress_indeterminate_horizontal_rect1_translatex}.
-     */
     public static class INDETERMINATE_HORIZONTAL_RECT1_TRANSLATE_X {
         // M 0.0,0.0
         // L 0.2 0
         // C 0.3958333333336,0.0 0.474845090492,0.206797621729 0.5916666666664,0.417082932942
         // C 0.7151610251224,0.639379624869 0.81625,0.974556908664 1.0,1.0
         private static final Path PATH_INDETERMINATE_HORIZONTAL_RECT1_TRANSLATE_X;
+
         static {
             PATH_INDETERMINATE_HORIZONTAL_RECT1_TRANSLATE_X = new Path();
             PATH_INDETERMINATE_HORIZONTAL_RECT1_TRANSLATE_X.moveTo(0, 0);
@@ -37,20 +31,18 @@ class Interpolators {
             PATH_INDETERMINATE_HORIZONTAL_RECT1_TRANSLATE_X.cubicTo(0.7151610251224f,
                     0.639379624869f, 0.81625f, 0.974556908664f, 1, 1);
         }
+
         public static final Interpolator INSTANCE =
                 PathInterpolatorCompat.create(PATH_INDETERMINATE_HORIZONTAL_RECT1_TRANSLATE_X);
     }
 
-    /**
-     * Backported Interpolator for
-     * {@code @android:interpolator/progress_indeterminate_horizontal_rect1_scalex}.
-     */
     public static class INDETERMINATE_HORIZONTAL_RECT1_SCALE_X {
         // M 0 0
         // L 0.3665 0
         // C 0.47252618112021,0.062409910275 0.61541608570164,0.5 0.68325,0.5
         // C 0.75475061236836,0.5 0.75725829093844,0.814510098964 1.0,1.0
         private static final Path PATH_INDETERMINATE_HORIZONTAL_RECT1_SCALE_X;
+
         static {
             PATH_INDETERMINATE_HORIZONTAL_RECT1_SCALE_X = new Path();
             PATH_INDETERMINATE_HORIZONTAL_RECT1_SCALE_X.moveTo(0, 0);
@@ -60,14 +52,11 @@ class Interpolators {
             PATH_INDETERMINATE_HORIZONTAL_RECT1_SCALE_X.cubicTo(0.75475061236836f, 0.5f,
                     0.75725829093844f, 0.814510098964f, 1, 1);
         }
+
         public static final Interpolator INSTANCE =
                 PathInterpolatorCompat.create(PATH_INDETERMINATE_HORIZONTAL_RECT1_SCALE_X);
     }
 
-    /**
-     * Backported Interpolator for
-     * {@code @android:interpolator/progress_indeterminate_horizontal_rect2_translatex}.
-     */
     public static class INDETERMINATE_HORIZONTAL_RECT2_TRANSLATE_X {
         // M 0.0,0.0
         // C 0.0375,0.0 0.128764607715,0.0895380946618 0.25,0.218553507947
@@ -75,6 +64,7 @@ class Interpolators {
         //     0.483333333333,0.489826169306
         // C 0.69,0.80972296795 0.793333333333,0.950016125212 1.0,1.0
         private static final Path PATH_INDETERMINATE_HORIZONTAL_RECT2_TRANSLATE_X;
+
         static {
             PATH_INDETERMINATE_HORIZONTAL_RECT2_TRANSLATE_X = new Path();
             PATH_INDETERMINATE_HORIZONTAL_RECT2_TRANSLATE_X.moveTo(0, 0);
@@ -85,14 +75,11 @@ class Interpolators {
             PATH_INDETERMINATE_HORIZONTAL_RECT2_TRANSLATE_X.cubicTo(0.69f, 0.80972296795f,
                     0.793333333333f, 0.950016125212f, 1, 1);
         }
+
         public static final Interpolator INSTANCE =
                 PathInterpolatorCompat.create(PATH_INDETERMINATE_HORIZONTAL_RECT2_TRANSLATE_X);
     }
 
-    /**
-     * Backported Interpolator for
-     * {@code @android:interpolator/progress_indeterminate_horizontal_rect2_scalex}.
-     */
     public static class INDETERMINATE_HORIZONTAL_RECT2_SCALE_X {
         // M 0,0
         // C 0.06834272400867,0.01992566661414 0.19220331656133,0.15855429260523 0.33333333333333,
@@ -101,6 +88,7 @@ class Interpolators {
         //     0.68279962777002
         // C 0.752586273196,0.68179620963216 0.737253971954,0.878896194318 1,1
         private static final Path PATH_INDETERMINATE_HORIZONTAL_RECT2_SCALE_X;
+
         static {
             PATH_INDETERMINATE_HORIZONTAL_RECT2_SCALE_X = new Path();
             PATH_INDETERMINATE_HORIZONTAL_RECT2_SCALE_X.moveTo(0, 0);
@@ -111,47 +99,44 @@ class Interpolators {
             PATH_INDETERMINATE_HORIZONTAL_RECT2_SCALE_X.cubicTo(0.752586273196f, 0.68179620963216f,
                     0.737253971954f, 0.878896194318f, 1, 1);
         }
+
         public static final Interpolator INSTANCE =
                 PathInterpolatorCompat.create(PATH_INDETERMINATE_HORIZONTAL_RECT2_SCALE_X);
     }
 
-    /**
-     * Backported Interpolator for {@code @android:interpolator/trim_start_interpolator}.
-     */
     public static class TRIM_PATH_START {
         // L 0.5,0
         // C 0.7,0 0.6,1 1,1
         private static final Path PATH_TRIM_PATH_START;
+
         static {
             PATH_TRIM_PATH_START = new Path();
             PATH_TRIM_PATH_START.lineTo(0.5f, 0);
             PATH_TRIM_PATH_START.cubicTo(0.7f, 0, 0.6f, 1, 1, 1);
         }
+
         public static final Interpolator INSTANCE =
                 PathInterpolatorCompat.create(PATH_TRIM_PATH_START);
     }
 
-    /**
-     * Backported Interpolator for {@code @android:interpolator/trim_end_interpolator}.
-     */
     public static class TRIM_PATH_END {
         // C 0.2,0 0.1,1 0.5,1
         // L 1,1
         private static final Path PATH_TRIM_PATH_END;
+
         static {
             PATH_TRIM_PATH_END = new Path();
             PATH_TRIM_PATH_END.cubicTo(0.2f, 0, 0.1f, 1, 0.5f, 1);
             PATH_TRIM_PATH_END.lineTo(1, 1);
         }
+
         public static final Interpolator INSTANCE = PathInterpolatorCompat.create(PATH_TRIM_PATH_END);
     }
 
-    /**
-     * Lazy-initialized singleton Interpolator for {@code @android:interpolator/linear}.
-     */
     public static class LINEAR {
         public static final Interpolator INSTANCE = new LinearInterpolator();
     }
 
-    private Interpolators() {}
-}
+    private Interpolators() {
+    }
+}

+ 3 - 92
core/src/main/java/com/afollestad/materialdialogs/internal/progress/ObjectAnimatorCompat.java

@@ -11,29 +11,12 @@ import android.graphics.Path;
 import android.os.Build;
 import android.util.Property;
 
-/**
- * Helper for accessing features in {@link ObjectAnimator} introduced after API level 11 (for
- * {@link android.animation.PropertyValuesHolder}) in a backward compatible fashion.
- */
 @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
 public class ObjectAnimatorCompat {
 
-    private ObjectAnimatorCompat() {}
+    private ObjectAnimatorCompat() {
+    }
 
-    /**
-     * Constructs and returns an ObjectAnimator that animates between color values. A single
-     * value implies that that value is the one being animated to. Two values imply starting
-     * and ending values. More than two values imply a starting value, values to animate through
-     * along the way, and an ending value (these values will be distributed evenly across
-     * the duration of the animation).
-     *
-     * @param target The object whose property is to be animated. This object should
-     * have a public method on it called <code>setName()</code>, where <code>name</code> is
-     * the value of the <code>propertyName</code> parameter.
-     * @param propertyName The name of the property being animated.
-     * @param values A set of values that the animation will animate between over time.
-     * @return An ObjectAnimator object that is set up to animate between the given values.
-     */
     public static ObjectAnimator ofArgb(Object target, String propertyName, int... values) {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
             return ObjectAnimatorCompatLollipop.ofArgb(target, propertyName, values);
@@ -41,18 +24,6 @@ public class ObjectAnimatorCompat {
         return ObjectAnimatorCompatBase.ofArgb(target, propertyName, values);
     }
 
-    /**
-     * Constructs and returns an ObjectAnimator that animates between color values. A single
-     * value implies that that value is the one being animated to. Two values imply starting
-     * and ending values. More than two values imply a starting value, values to animate through
-     * along the way, and an ending value (these values will be distributed evenly across
-     * the duration of the animation).
-     *
-     * @param target The object whose property is to be animated.
-     * @param property The property being animated.
-     * @param values A set of values that the animation will animate between over time.
-     * @return An ObjectAnimator object that is set up to animate between the given values.
-     */
     public static <T> ObjectAnimator ofArgb(T target, Property<T, Integer> property,
                                             int... values) {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
@@ -61,23 +32,6 @@ public class ObjectAnimatorCompat {
         return ObjectAnimatorCompatBase.ofArgb(target, property, values);
     }
 
-    /**
-     * Constructs and returns an ObjectAnimator that animates coordinates along a <code>Path</code>
-     * using two properties. A <code>Path</code></> animation moves in two dimensions, animating
-     * coordinates <code>(x, y)</code> together to follow the line. In this variation, the
-     * coordinates are floats that are set to separate properties designated by
-     * <code>xPropertyName</code> and <code>yPropertyName</code>.
-     *
-     * @param target The object whose properties are to be animated. This object should
-     *               have public methods on it called <code>setNameX()</code> and
-     *               <code>setNameY</code>, where <code>nameX</code> and <code>nameY</code>
-     *               are the value of the <code>xPropertyName</code> and <code>yPropertyName</code>
-     *               parameters, respectively.
-     * @param xPropertyName The name of the property for the x coordinate being animated.
-     * @param yPropertyName The name of the property for the y coordinate being animated.
-     * @param path The <code>Path</code> to animate values along.
-     * @return An ObjectAnimator object that is set up to animate along <code>path</code>.
-     */
     public static ObjectAnimator ofFloat(Object target, String xPropertyName, String yPropertyName,
                                          Path path) {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
@@ -86,19 +40,6 @@ public class ObjectAnimatorCompat {
         return ObjectAnimatorCompatBase.ofFloat(target, xPropertyName, yPropertyName, path);
     }
 
-    /**
-     * Constructs and returns an ObjectAnimator that animates coordinates along a <code>Path</code>
-     * using two properties. A <code>Path</code></> animation moves in two dimensions, animating
-     * coordinates <code>(x, y)</code> together to follow the line. In this variation, the
-     * coordinates are floats that are set to separate properties, <code>xProperty</code> and
-     * <code>yProperty</code>.
-     *
-     * @param target The object whose properties are to be animated.
-     * @param xProperty The property for the x coordinate being animated.
-     * @param yProperty The property for the y coordinate being animated.
-     * @param path The <code>Path</code> to animate values along.
-     * @return An ObjectAnimator object that is set up to animate along <code>path</code>.
-     */
     public static <T> ObjectAnimator ofFloat(T target, Property<T, Float> xProperty,
                                              Property<T, Float> yProperty, Path path) {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
@@ -107,23 +48,6 @@ public class ObjectAnimatorCompat {
         return ObjectAnimatorCompatBase.ofFloat(target, xProperty, yProperty, path);
     }
 
-    /**
-     * Constructs and returns an ObjectAnimator that animates coordinates along a <code>Path</code>
-     * using two properties. A <code>Path</code></> animation moves in two dimensions, animating
-     * coordinates <code>(x, y)</code> together to follow the line. In this variation, the
-     * coordinates are integers that are set to separate properties designated by
-     * <code>xPropertyName</code> and <code>yPropertyName</code>.
-     *
-     * @param target The object whose properties are to be animated. This object should
-     *               have public methods on it called <code>setNameX()</code> and
-     *               <code>setNameY</code>, where <code>nameX</code> and <code>nameY</code>
-     *               are the value of <code>xPropertyName</code> and <code>yPropertyName</code>
-     *               parameters, respectively.
-     * @param xPropertyName The name of the property for the x coordinate being animated.
-     * @param yPropertyName The name of the property for the y coordinate being animated.
-     * @param path The <code>Path</code> to animate values along.
-     * @return An ObjectAnimator object that is set up to animate along <code>path</code>.
-     */
     public static ObjectAnimator ofInt(Object target, String xPropertyName, String yPropertyName,
                                        Path path) {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
@@ -132,19 +56,6 @@ public class ObjectAnimatorCompat {
         return ObjectAnimatorCompatBase.ofInt(target, xPropertyName, yPropertyName, path);
     }
 
-    /**
-     * Constructs and returns an ObjectAnimator that animates coordinates along a <code>Path</code>
-     * using two properties.  A <code>Path</code></> animation moves in two dimensions, animating
-     * coordinates <code>(x, y)</code> together to follow the line. In this variation, the
-     * coordinates are integers that are set to separate properties, <code>xProperty</code> and
-     * <code>yProperty</code>.
-     *
-     * @param target The object whose properties are to be animated.
-     * @param xProperty The property for the x coordinate being animated.
-     * @param yProperty The property for the y coordinate being animated.
-     * @param path The <code>Path</code> to animate values along.
-     * @return An ObjectAnimator object that is set up to animate along <code>path</code>.
-     */
     public static <T> ObjectAnimator ofInt(T target, Property<T, Integer> xProperty,
                                            Property<T, Integer> yProperty, Path path) {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
@@ -152,4 +63,4 @@ public class ObjectAnimatorCompat {
         }
         return ObjectAnimatorCompatBase.ofInt(target, xProperty, yProperty, path);
     }
-}
+}

+ 1 - 1
core/src/main/java/com/afollestad/materialdialogs/internal/progress/ObjectAnimatorCompatBase.java

@@ -116,4 +116,4 @@ class ObjectAnimatorCompatBase {
             yValues[i] = Math.round(position[1]);
         }
     }
-}
+}

+ 4 - 37
core/src/main/java/com/afollestad/materialdialogs/internal/progress/ProgressDrawableBase.java

@@ -5,6 +5,7 @@
 
 package com.afollestad.materialdialogs.internal.progress;
 
+import android.annotation.SuppressLint;
 import android.annotation.TargetApi;
 import android.content.Context;
 import android.content.res.ColorStateList;
@@ -17,6 +18,7 @@ import android.graphics.PorterDuffColorFilter;
 import android.graphics.Rect;
 import android.graphics.drawable.Drawable;
 import android.os.Build;
+import android.support.annotation.NonNull;
 import android.support.v4.view.ViewCompat;
 
 import com.afollestad.materialdialogs.R;
@@ -42,18 +44,10 @@ abstract class ProgressDrawableBase extends Drawable {
         setTint(colorControlActivated);
     }
 
-    /**
-     * Get whether this {@code Drawable} is showing a track. The default is true.
-     *
-     * @return Whether this {@code Drawable} is showing a track.
-     */
     public boolean getUseIntrinsicPadding() {
         return mUseIntrinsicPadding;
     }
 
-    /**
-     * Set whether this {@code Drawable} should show a track. The default is true.
-     */
     public void setUseIntrinsicPadding(boolean useIntrinsicPadding) {
         if (mUseIntrinsicPadding != useIntrinsicPadding) {
             mUseIntrinsicPadding = useIntrinsicPadding;
@@ -61,9 +55,6 @@ abstract class ProgressDrawableBase extends Drawable {
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void setAlpha(int alpha) {
         if (mAlpha != alpha) {
@@ -72,35 +63,22 @@ abstract class ProgressDrawableBase extends Drawable {
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
-    // Rewrite for compatibility.
     @Override
     public void setTint(int tint) {
         setTintList(ColorStateList.valueOf(tint));
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public ColorFilter getColorFilter() {
         return mColorFilter;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void setColorFilter(ColorFilter colorFilter) {
         mColorFilter = colorFilter;
         invalidateSelf();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void setTintList(ColorStateList tint) {
         mTint = tint;
@@ -108,11 +86,8 @@ abstract class ProgressDrawableBase extends Drawable {
         invalidateSelf();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
-    public void setTintMode(PorterDuff.Mode tintMode) {
+    public void setTintMode(@NonNull PorterDuff.Mode tintMode) {
         mTintMode = tintMode;
         mTintFilter = makeTintFilter(mTint, tintMode);
         invalidateSelf();
@@ -129,17 +104,11 @@ abstract class ProgressDrawableBase extends Drawable {
         return new PorterDuffColorFilter(color, tintMode);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean isAutoMirrored() {
         return mAutoMirrored;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void setAutoMirrored(boolean autoMirrored) {
         if (mAutoMirrored != autoMirrored) {
@@ -148,13 +117,11 @@ abstract class ProgressDrawableBase extends Drawable {
         }
     }
 
+    @SuppressLint("NewApi")
     private boolean needMirroring() {
         return isAutoMirrored() && getLayoutDirection() == ViewCompat.LAYOUT_DIRECTION_RTL;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void draw(Canvas canvas) {
 

+ 0 - 6
core/src/main/java/com/afollestad/materialdialogs/internal/progress/SingleHorizontalProgressDrawable.java

@@ -50,17 +50,11 @@ class SingleHorizontalProgressDrawable extends ProgressDrawableBase {
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public int getIntrinsicHeight() {
         return mUseIntrinsicPadding ? mPaddedIntrinsicHeight : mProgressIntrinsicHeight;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public int getOpacity() {
         if (mAlpha == 0) {