Fix settings gear visibility
When the settings gear is first initialized the width can be reported as 0, which lead to NaN in the `map` function and throwing off the other calculations. This adds a check to the width so it will simply be set invisible in that case instead Fixes: 185929062 Test: manual (repro steps in bug) Change-Id: Id2a8582e8342d807825536bfcaac7d79a042c7cc
This commit is contained in:
@@ -236,7 +236,7 @@ class MediaCarouselScrollHandler(
|
||||
}
|
||||
|
||||
private fun updateSettingsPresentation() {
|
||||
if (showsSettingsButton) {
|
||||
if (showsSettingsButton && settingsButton.width > 0) {
|
||||
val settingsOffset = MathUtils.map(
|
||||
0.0f,
|
||||
getMaxTranslation().toFloat(),
|
||||
|
||||
Reference in New Issue
Block a user