diff --git a/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactViewGroup.kt b/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactViewGroup.kt index f92580c7a80..fc9a9fcfb26 100644 --- a/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactViewGroup.kt +++ b/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactViewGroup.kt @@ -4,4 +4,4 @@ import com.facebook.react.views.view.ReactViewBackgroundDrawable import com.facebook.react.views.view.ReactViewGroup val ReactViewGroup.borderRadius: Float - get() = (background as? ReactViewBackgroundDrawable)?.fullBorderRadius ?: 0f \ No newline at end of file + get() = (background as? ReactViewBackgroundDrawable)?.fullBorderWidth ?: 0f diff --git a/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/LayoutDirectionApplier.kt b/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/LayoutDirectionApplier.kt index 89216ae0c6b..69a5c74f449 100644 --- a/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/LayoutDirectionApplier.kt +++ b/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/LayoutDirectionApplier.kt @@ -6,10 +6,11 @@ import com.reactnativenavigation.options.Options class LayoutDirectionApplier { fun apply(root: ViewController<*>, options: Options, instanceManager: ReactInstanceManager) { - if (options.layout.direction.hasValue() && instanceManager.currentReactContext != null) { - root.activity.window.decorView.layoutDirection = options.layout.direction.get() - I18nUtil.getInstance().allowRTL(instanceManager.currentReactContext, options.layout.direction.isRtl) - I18nUtil.getInstance().forceRTL(instanceManager.currentReactContext, options.layout.direction.isRtl) - } + if (options.layout.direction.hasValue()) { + instanceManager.currentReactContext?.let { context -> + root.activity.window.decorView.layoutDirection = options.layout.direction.get() + I18nUtil.getInstance().allowRTL(context, options.layout.direction.isRtl) + I18nUtil.getInstance().forceRTL(context, options.layout.direction.isRtl) + } } -} \ No newline at end of file +} diff --git a/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt b/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt index ea8516fee7f..1044bd8921a 100644 --- a/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt +++ b/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt @@ -49,17 +49,17 @@ class ModalContentLayout(context: Context?) : ReactViewGroup(context), RootView{ updateFirstChildView() } } - override fun onChildStartedNativeGesture(child: View, androidEvent: MotionEvent?) { + override fun onChildStartedNativeGesture(child: View, androidEvent: MotionEvent) { mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, this.getEventDispatcher()) } - override fun onChildStartedNativeGesture(androidEvent: MotionEvent?) { + override fun onChildStartedNativeGesture(androidEvent: MotionEvent) { mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, this.getEventDispatcher()) } - override fun onChildEndedNativeGesture(child: View, androidEvent: MotionEvent?) { + override fun onChildEndedNativeGesture(child: View, androidEvent: MotionEvent) { mJSTouchDispatcher.onChildEndedNativeGesture(androidEvent, this.getEventDispatcher()) } override fun requestDisallowInterceptTouchEvent(disallowIntercept: Boolean) {} - private fun getEventDispatcher(): EventDispatcher? { + private fun getEventDispatcher(): EventDispatcher { val reactContext: ReactContext = this.getReactContext() return reactContext.getNativeModule(UIManagerModule::class.java)!!.eventDispatcher } @@ -73,15 +73,15 @@ class ModalContentLayout(context: Context?) : ReactViewGroup(context), RootView{ return this.context as ReactContext } - override fun onInterceptTouchEvent(event: MotionEvent?): Boolean { + override fun onInterceptTouchEvent(event: MotionEvent): Boolean { mJSTouchDispatcher.handleTouchEvent(event, getEventDispatcher()) return super.onInterceptTouchEvent(event) } - override fun onTouchEvent(event: MotionEvent?): Boolean { + override fun onTouchEvent(event: MotionEvent): Boolean { mJSTouchDispatcher.handleTouchEvent(event, getEventDispatcher()) super.onTouchEvent(event) return true } -} \ No newline at end of file +}