Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bubble animation breaks when setting new max value #124

Open
EZL0512 opened this issue Nov 29, 2018 · 0 comments
Open

Bubble animation breaks when setting new max value #124

EZL0512 opened this issue Nov 29, 2018 · 0 comments

Comments

@EZL0512
Copy link

EZL0512 commented Nov 29, 2018

I have the following onStopTrackingTouch listener:

 @Override
  public void onStopTrackingTouch(DiscreteSeekBar seekBar) {
       viewModel.updateValue(seekBar.getProgress());
  }

The viewModel observer eventually updates the max value of the seekbar:

this.viewModel.getSettings().observe(this, settings -> {
        this.boostValueSeekBar.setMax(settings.getMax());
        this.boostValueSeekBar.setProgress(settings.getValue());
});

Even if the max value does not change, the thumb handle disappears forever. The animation is also gone.

This only appears to happen if the max value is changed as a direct result of onStopTrackingTouch.

An easy test case is the following:

 @Override
  public void onStopTrackingTouch(DiscreteSeekBar seekBar) {
       seekBar.setMax(seekBar.getMax());
  }

This will permanently break the indicator until the activity or fragment is reloaded.

Expected behaviour
At the very least I would expect setting the max value to the same value to do nothing (this can of course be done by the consumer as well).
In all other cases I would expect the indicator to keep working when setting the max value from onStopTrackingTouch();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant