Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Android): Kotlin build issues with RN 0.75.3 #7913

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.views.text.ReactFontManager;
import com.facebook.react.views.text.ReactTextShadowNode;
import com.facebook.react.common.ReactConstants;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -96,12 +97,12 @@ public static Typeface applyStyles(

int want = 0;
if ((weight == Typeface.BOLD)
|| ((oldStyle & Typeface.BOLD) != 0 && weight == ReactTextShadowNode.UNSET)) {
|| ((oldStyle & Typeface.BOLD) != 0 && weight == ReactConstants.UNSET)) {
want |= Typeface.BOLD;
}

if ((style == Typeface.ITALIC)
|| ((oldStyle & Typeface.ITALIC) != 0 && style == ReactTextShadowNode.UNSET)) {
|| ((oldStyle & Typeface.ITALIC) != 0 && style == ReactConstants.UNSET)) {
want |= Typeface.ITALIC;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
get() = (background as? ReactViewBackgroundDrawable)?.fullBorderWidth ?: 0f
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ 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)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}

}
}