Skip to content

Commit

Permalink
[Slider] Do not invoke OnChangeListeners when restoring states
Browse files Browse the repository at this point in the history
Calling setValueInternal() will invoke OnChangeListeners if the values have been changed. We shouldn't unconditionally invoke listeners again, otherwise:

- If values haven't changed, OnChangeListeners will still be fired.
- If values have changed, OnChangeListeners will be fired twice.

Removes the unconditional invocation to solve the issue.

PiperOrigin-RevId: 382785198
  • Loading branch information
drchen authored and veganafro committed Jul 7, 2021
1 parent 655dde0 commit db8b239
Showing 1 changed file with 0 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2411,7 +2411,6 @@ protected void onRestoreInstanceState(Parcelable state) {
if (sliderState.hasFocus) {
requestFocus();
}
dispatchOnChangedProgramatically();
}

static class SliderState extends BaseSavedState {
Expand Down

0 comments on commit db8b239

Please sign in to comment.