Skip to content

Commit 5bcae74

Browse files
pekingmedrchen
authored andcommitted
[Button] Updated spring specs for responsive touch.
PiperOrigin-RevId: 660117556
1 parent b36919f commit 5bcae74

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/java/com/google/android/material/button/MaterialButton.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,8 @@ interface OnPressedChangeListener {
204204

205205
private static final int DEF_STYLE_RES = R.style.Widget_MaterialComponents_Button;
206206

207-
private static final float TOGGLE_BUTTON_SPRING_DAMPING = 0.8f;
208-
private static final float DEFAULT_BUTTON_CORNER_SPRING_DAMPING = 0.5f;
209-
private static final float DEFAULT_BUTTON_SPRING_STIFFNESS = 800;
207+
private static final float DEFAULT_BUTTON_CORNER_SPRING_DAMPING = 0.8f;
208+
private static final float DEFAULT_BUTTON_SPRING_STIFFNESS = 380;
210209

211210
@NonNull private final MaterialButtonHelper materialButtonHelper;
212211

@@ -283,8 +282,7 @@ public MaterialButton(@NonNull Context context, @Nullable AttributeSet attrs, in
283282

284283
private SpringForce createSpringForce() {
285284
return new SpringForce()
286-
.setDampingRatio(
287-
isCheckable() ? TOGGLE_BUTTON_SPRING_DAMPING : DEFAULT_BUTTON_CORNER_SPRING_DAMPING)
285+
.setDampingRatio(DEFAULT_BUTTON_CORNER_SPRING_DAMPING)
288286
.setStiffness(DEFAULT_BUTTON_SPRING_STIFFNESS);
289287
}
290288

0 commit comments

Comments
 (0)