Skip to content

Commit 4440547

Browse files
committed
change TabScreen to take full height, below the tab bar
1 parent fae84f2 commit 4440547

File tree

1 file changed

+12
-11
lines changed
  • android/src/main/java/com/swmansion/rnscreens/gamma/tabs

1 file changed

+12
-11
lines changed

android/src/main/java/com/swmansion/rnscreens/gamma/tabs/TabsHost.kt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package com.swmansion.rnscreens.gamma.tabs
22

33
import android.content.res.Configuration
44
import android.view.Choreographer
5+
import android.view.Gravity
56
import android.view.MenuItem
67
import android.view.View
78
import android.widget.FrameLayout
8-
import android.widget.LinearLayout
99
import androidx.appcompat.view.ContextThemeWrapper
1010
import androidx.fragment.app.FragmentManager
1111
import com.facebook.react.modules.core.ReactChoreographer
@@ -22,7 +22,7 @@ import kotlin.properties.Delegates
2222

2323
class TabsHost(
2424
val reactContext: ThemedReactContext,
25-
) : LinearLayout(reactContext),
25+
) : FrameLayout(reactContext),
2626
TabScreenDelegate,
2727
SafeAreaProvider,
2828
View.OnLayoutChangeListener {
@@ -99,19 +99,21 @@ class TabsHost(
9999

100100
private val bottomNavigationView: BottomNavigationView =
101101
BottomNavigationView(wrappedContext).apply {
102-
layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)
102+
layoutParams =
103+
LayoutParams(
104+
LayoutParams.MATCH_PARENT,
105+
LayoutParams.WRAP_CONTENT,
106+
Gravity.BOTTOM,
107+
)
103108
}
104109

105110
private val contentView: FrameLayout =
106111
FrameLayout(reactContext).apply {
107112
layoutParams =
108-
LinearLayout
109-
.LayoutParams(
110-
LayoutParams.MATCH_PARENT,
111-
LayoutParams.WRAP_CONTENT,
112-
).apply {
113-
weight = 1f
114-
}
113+
LayoutParams(
114+
LayoutParams.MATCH_PARENT,
115+
LayoutParams.MATCH_PARENT,
116+
)
115117
id = ViewIdGenerator.generateViewId()
116118
}
117119

@@ -201,7 +203,6 @@ class TabsHost(
201203
}
202204

203205
init {
204-
orientation = VERTICAL
205206
addView(contentView)
206207
addView(bottomNavigationView)
207208

0 commit comments

Comments
 (0)