Tab Stacking for Fenix
Is this fairly simple patch a step in the right direction?
diff --git a/browser/components/tabs/TabStack.kt b/browser/components/tabs/TabStack.kt
index 99684d7..50b0304 100644
--- a/browser/components/tabs/TabStack.kt
+++ b/browser/components/tabs/TabStack.kt
@@ -41,6 +41,7 @@ class TabStack(
val tabs: List = emptyList(),
val onTabSelected: (Tab) -> Unit = {}
) : FrameLayout(context) {
+ val tabStackCompose = TabStackCompose(tabs, onTabSelected)
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
@@ -54,6 +55,17 @@ class TabStack(
tabStackCompose.measure(widthMeasureSpec, heightMeasureSpec)
}
+ override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
+ tabStackCompose.layout(left, top, right, bottom)
+ }
+
+ companion object {
+ fun create(tabs: List, onTabSelected: (Tab) -> Unit = {}): TabStack {
+ return TabStack(tabs, onTabSelected)
+ }
+ }
}
Betteridge's Law of Headlines says No, but I don't know enough about the code to say yes or no for sure