|
84 | 84 | import androidx.annotation.ColorInt; |
85 | 85 | import androidx.annotation.ColorRes; |
86 | 86 | import androidx.annotation.DimenRes; |
87 | | -import androidx.annotation.Dimension; |
88 | 87 | import androidx.annotation.DrawableRes; |
89 | 88 | import androidx.annotation.IntDef; |
90 | 89 | import androidx.annotation.IntRange; |
|
103 | 102 | import com.google.android.material.internal.ThemeEnforcement; |
104 | 103 | import com.google.android.material.internal.ViewUtils; |
105 | 104 | import com.google.android.material.motion.MotionUtils; |
| 105 | +import com.google.android.material.resources.MaterialAttributes; |
106 | 106 | import com.google.android.material.resources.MaterialResources; |
107 | 107 | import com.google.android.material.shape.MaterialShapeDrawable; |
108 | 108 | import com.google.android.material.shape.ShapeAppearanceModel; |
@@ -294,9 +294,6 @@ abstract class BaseSlider< |
294 | 294 | private static final float RIGHT_LABEL_PIVOT_X = -0.2f; |
295 | 295 | private static final float RIGHT_LABEL_PIVOT_Y = 0.5f; |
296 | 296 |
|
297 | | - @Dimension(unit = Dimension.DP) |
298 | | - private static final int MIN_TOUCH_TARGET_DP = 48; |
299 | | - |
300 | 297 | @NonNull private final Paint inactiveTrackPaint; |
301 | 298 | @NonNull private final Paint activeTrackPaint; |
302 | 299 | @NonNull private final Paint thumbPaint; |
@@ -547,8 +544,7 @@ private void processAttributes(Context context, AttributeSet attrs, int defStyle |
547 | 544 | setCentered(a.getBoolean(R.styleable.Slider_centered, false)); |
548 | 545 | stepSize = a.getFloat(R.styleable.Slider_android_stepSize, 0.0f); |
549 | 546 |
|
550 | | - float defaultMinTouchTargetSize = |
551 | | - (float) Math.ceil(ViewUtils.dpToPx(getContext(), MIN_TOUCH_TARGET_DP)); |
| 547 | + float defaultMinTouchTargetSize = MaterialAttributes.resolveMinimumAccessibleTouchTarget(context); |
552 | 548 | minTouchTargetSize = |
553 | 549 | (int) |
554 | 550 | Math.ceil( |
|
0 commit comments