|
79 | 79 | import androidx.annotation.ColorInt;
|
80 | 80 | import androidx.annotation.ColorRes;
|
81 | 81 | import androidx.annotation.DimenRes;
|
82 |
| -import androidx.annotation.Dimension; |
83 | 82 | import androidx.annotation.DrawableRes;
|
84 | 83 | import androidx.annotation.IntDef;
|
85 | 84 | import androidx.annotation.IntRange;
|
|
99 | 98 | import com.google.android.material.internal.ViewOverlayImpl;
|
100 | 99 | import com.google.android.material.internal.ViewUtils;
|
101 | 100 | import com.google.android.material.motion.MotionUtils;
|
| 101 | +import com.google.android.material.resources.MaterialAttributes; |
102 | 102 | import com.google.android.material.resources.MaterialResources;
|
103 | 103 | import com.google.android.material.shape.MaterialShapeDrawable;
|
104 | 104 | import com.google.android.material.shape.ShapeAppearanceModel;
|
@@ -286,9 +286,6 @@ abstract class BaseSlider<
|
286 | 286 | private static final float RIGHT_LABEL_PIVOT_X = -0.2f;
|
287 | 287 | private static final float RIGHT_LABEL_PIVOT_Y = 0.5f;
|
288 | 288 |
|
289 |
| - @Dimension(unit = Dimension.DP) |
290 |
| - private static final int MIN_TOUCH_TARGET_DP = 48; |
291 |
| - |
292 | 289 | @NonNull private final Paint inactiveTrackPaint;
|
293 | 290 | @NonNull private final Paint activeTrackPaint;
|
294 | 291 | @NonNull private final Paint thumbPaint;
|
@@ -536,8 +533,7 @@ private void processAttributes(Context context, AttributeSet attrs, int defStyle
|
536 | 533 | setValues(valueFrom);
|
537 | 534 | stepSize = a.getFloat(R.styleable.Slider_android_stepSize, 0.0f);
|
538 | 535 |
|
539 |
| - float defaultMinTouchTargetSize = |
540 |
| - (float) Math.ceil(ViewUtils.dpToPx(getContext(), MIN_TOUCH_TARGET_DP)); |
| 536 | + float defaultMinTouchTargetSize = MaterialAttributes.resolveMinimumAccessibleTouchTarget(context); |
541 | 537 | minTouchTargetSize =
|
542 | 538 | (int)
|
543 | 539 | Math.ceil(
|
|
0 commit comments