AnderWeb / AnderWeb/discreteSeekBar
Bubble animation breaks when setting new max value
- 主要语言
- Java
- 星标
- 2.1k
- 派生
- 417
- PR 合并指标
- 30 天内没有已合并 PR
描述
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();
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。