Fix smartspace width when scaling

This commit is contained in:
Suphon Thanakornpakapong committed 2022-05-13 23:47:15 +07:00
1 parent cef65bba26
commit e31add95cc
1 file changed
+2 -1
@@ -78,8 +78,9 @@ class BcSmartspaceView @JvmOverloads constructor(
}
val scale = height.toFloat() / smartspaceHeight.toFloat()
val width = (MeasureSpec.getSize(widthMeasureSpec).toFloat() / scale).roundToInt()
super.onMeasure(
makeMeasureSpec((height.toFloat() / scale).roundToInt(), EXACTLY),
makeMeasureSpec(width, EXACTLY),
makeMeasureSpec(smartspaceHeight, EXACTLY)
)
scaleX = scale