mirror of
https://github.com/BetterAndroid/FlexiUI.git
synced 2025-09-08 11:34:18 +08:00
refactor: make Tab some component @Immutable
This commit is contained in:
@@ -264,7 +264,7 @@ data class TabPosition(val left: Dp, val width: Dp, val tabWidth: Dp) {
|
|||||||
fun calculateCenter(currentWidth: Dp) = left + width / 2 - currentWidth / 2
|
fun calculateCenter(currentWidth: Dp) = left + width / 2 - currentWidth / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
@Stable
|
@Immutable
|
||||||
class TabRow internal constructor(
|
class TabRow internal constructor(
|
||||||
val selectedTabIndex: Int,
|
val selectedTabIndex: Int,
|
||||||
val colors: TabColors,
|
val colors: TabColors,
|
||||||
@@ -360,7 +360,7 @@ class TabRow internal constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Stable
|
@Immutable
|
||||||
private class ScrollableTabData(private val scrollState: ScrollState, private val coroutineScope: CoroutineScope) {
|
private class ScrollableTabData(private val scrollState: ScrollState, private val coroutineScope: CoroutineScope) {
|
||||||
|
|
||||||
private var selectedTab: Int? = null
|
private var selectedTab: Int? = null
|
||||||
|
Reference in New Issue
Block a user