Skip to content

Commit 134ba34

Browse files
committed
fix(Android): Kotlin build issues with RN 0.75.3
1 parent f7aa750 commit 134ba34

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactViewGroup.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import com.facebook.react.views.view.ReactViewBackgroundDrawable
44
import com.facebook.react.views.view.ReactViewGroup
55

66
val ReactViewGroup.borderRadius: Float
7-
get() = (background as? ReactViewBackgroundDrawable)?.fullBorderRadius ?: 0f
7+
get() = (background as? ReactViewBackgroundDrawable)?.fullBorderWidth ?: 0f

lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/LayoutDirectionApplier.kt

+7-6
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import com.reactnativenavigation.options.Options
66

77
class LayoutDirectionApplier {
88
fun apply(root: ViewController<*>, options: Options, instanceManager: ReactInstanceManager) {
9-
if (options.layout.direction.hasValue() && instanceManager.currentReactContext != null) {
10-
root.activity.window.decorView.layoutDirection = options.layout.direction.get()
11-
I18nUtil.getInstance().allowRTL(instanceManager.currentReactContext, options.layout.direction.isRtl)
12-
I18nUtil.getInstance().forceRTL(instanceManager.currentReactContext, options.layout.direction.isRtl)
13-
}
9+
if (options.layout.direction.hasValue()) {
10+
instanceManager.currentReactContext?.let { context ->
11+
root.activity.window.decorView.layoutDirection = options.layout.direction.get()
12+
I18nUtil.getInstance().allowRTL(context, options.layout.direction.isRtl)
13+
I18nUtil.getInstance().forceRTL(context, options.layout.direction.isRtl)
14+
}
1415
}
15-
}
16+
}

lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt

+7-7
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ class ModalContentLayout(context: Context?) : ReactViewGroup(context), RootView{
4949
updateFirstChildView()
5050
}
5151
}
52-
override fun onChildStartedNativeGesture(child: View, androidEvent: MotionEvent?) {
52+
override fun onChildStartedNativeGesture(child: View, androidEvent: MotionEvent) {
5353
mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, this.getEventDispatcher())
5454
}
55-
override fun onChildStartedNativeGesture(androidEvent: MotionEvent?) {
55+
override fun onChildStartedNativeGesture(androidEvent: MotionEvent) {
5656
mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, this.getEventDispatcher())
5757
}
58-
override fun onChildEndedNativeGesture(child: View, androidEvent: MotionEvent?) {
58+
override fun onChildEndedNativeGesture(child: View, androidEvent: MotionEvent) {
5959
mJSTouchDispatcher.onChildEndedNativeGesture(androidEvent, this.getEventDispatcher())
6060
}
6161
override fun requestDisallowInterceptTouchEvent(disallowIntercept: Boolean) {}
62-
private fun getEventDispatcher(): EventDispatcher? {
62+
private fun getEventDispatcher(): EventDispatcher {
6363
val reactContext: ReactContext = this.getReactContext()
6464
return reactContext.getNativeModule(UIManagerModule::class.java)!!.eventDispatcher
6565
}
@@ -73,15 +73,15 @@ class ModalContentLayout(context: Context?) : ReactViewGroup(context), RootView{
7373
return this.context as ReactContext
7474
}
7575

76-
override fun onInterceptTouchEvent(event: MotionEvent?): Boolean {
76+
override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
7777
mJSTouchDispatcher.handleTouchEvent(event, getEventDispatcher())
7878
return super.onInterceptTouchEvent(event)
7979
}
8080

81-
override fun onTouchEvent(event: MotionEvent?): Boolean {
81+
override fun onTouchEvent(event: MotionEvent): Boolean {
8282
mJSTouchDispatcher.handleTouchEvent(event, getEventDispatcher())
8383
super.onTouchEvent(event)
8484
return true
8585
}
8686

87-
}
87+
}

0 commit comments

Comments
 (0)