Fix spontaneous crashes in android station screen
This commit is contained in:
parent
ffa0e3d6d5
commit
6f67912041
@ -450,6 +450,10 @@ private enum class PreviewScrollers(
|
||||
LEFT_TO_RIGHT(
|
||||
init = { it, random ->
|
||||
it.xOffset = it.width
|
||||
|
||||
if (it.childrenRectHeight == 0f)
|
||||
it.yOffset = 0f
|
||||
else
|
||||
it.yOffset = random.nextFloat(-it.childrenRectHeight + 18f, 0f)
|
||||
},
|
||||
|
||||
@ -462,6 +466,10 @@ private enum class PreviewScrollers(
|
||||
RIGHT_TO_LEFT(
|
||||
init = { it, random ->
|
||||
it.xOffset = -it.childrenRectWidth
|
||||
|
||||
if (it.childrenRectHeight == 0f)
|
||||
it.yOffset = 0f
|
||||
else
|
||||
it.yOffset = random.nextFloat(-it.childrenRectHeight + 18f, 0f)
|
||||
},
|
||||
|
||||
@ -474,6 +482,10 @@ private enum class PreviewScrollers(
|
||||
BOTTOM_TO_TOP(
|
||||
init = { it, random ->
|
||||
it.yOffset = -it.childrenRectHeight
|
||||
|
||||
if (it.childrenRectWidth == 0f)
|
||||
it.xOffset = 0f
|
||||
else
|
||||
it.xOffset = random.nextFloat(-it.childrenRectWidth + 18f, 0f)
|
||||
},
|
||||
|
||||
@ -486,6 +498,10 @@ private enum class PreviewScrollers(
|
||||
TOP_TO_BOTTOM(
|
||||
init = { it, random ->
|
||||
it.yOffset = it.height
|
||||
|
||||
if (it.childrenRectWidth == 0f)
|
||||
it.xOffset = 0f
|
||||
else
|
||||
it.xOffset = random.nextFloat(-it.childrenRectWidth + 18f, 0f)
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user