Skip to content

Commit 100c0bf

Browse files
committed
feat: wip move to jetpack compose
1 parent c6f9a8f commit 100c0bf

File tree

8 files changed

+252
-239
lines changed

8 files changed

+252
-239
lines changed

packages/react-native-bottom-tabs/android/build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ android {
7070

7171
buildFeatures {
7272
buildConfig true
73+
compose true
7374
}
7475

7576
buildTypes {
@@ -78,6 +79,10 @@ android {
7879
}
7980
}
8081

82+
composeOptions {
83+
kotlinCompilerExtensionVersion = "1.5.14"
84+
}
85+
8186
lintOptions {
8287
disable "GradleCompatible"
8388
}
@@ -122,6 +127,14 @@ dependencies {
122127
implementation("io.coil-kt.coil3:coil:${COIL_VERSION}")
123128
implementation("io.coil-kt.coil3:coil-network-okhttp:${COIL_VERSION}")
124129
implementation("io.coil-kt.coil3:coil-svg:${COIL_VERSION}")
130+
def composeBom = platform('androidx.compose:compose-bom:2024.11.00')
131+
implementation composeBom
132+
androidTestImplementation composeBom
133+
implementation 'androidx.compose.material3:material3'
134+
implementation 'androidx.compose.ui:ui'
135+
implementation 'androidx.compose.material3.adaptive:adaptive'
136+
implementation 'androidx.compose.material3:material3-adaptive-navigation-suite'
137+
125138
}
126139

127140
if (isNewArchitectureEnabled()) {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.rcttabview
2+
3+
import com.facebook.react.bridge.Arguments
4+
import com.facebook.react.uimanager.events.Event
5+
import com.facebook.react.uimanager.events.RCTEventEmitter
6+
7+
class OnLayoutEvent(viewTag: Int, private val width: Double, private val height: Double) :
8+
Event<OnLayoutEvent>(viewTag) {
9+
10+
companion object {
11+
const val EVENT_NAME = "onTabViewLayout"
12+
}
13+
14+
override fun getEventName(): String {
15+
return EVENT_NAME
16+
}
17+
18+
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
19+
val event = Arguments.createMap().apply {
20+
putDouble("width", width)
21+
putDouble("height", height)
22+
}
23+
rctEventEmitter.receiveEvent(viewTag, eventName, event)
24+
}
25+
}

0 commit comments

Comments
 (0)