Skip to content

Commit

Permalink
use non kotlin dependent max lookup (#7144)
Browse files Browse the repository at this point in the history
  • Loading branch information
swabbass authored Jun 1, 2021
1 parent 8e27f33 commit f2f2412
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ class TitleBarReactView(context: Context?, reactInstanceManager: ReactInstanceMa
// It's causing infinite measurements, that hung up the UI.
// Intercepting largest child by width, and use its width as (parent) ReactRootView width fixed that.
// See for more details https://github.com/wix/react-native-navigation/pull/7096
val measuredWidth = this.children.maxBy { it.measuredWidth }?.measuredWidth?:0
var measuredWidth = 0;
this.children.forEach {
if (it.measuredWidth > measuredWidth) {
measuredWidth = it.measuredWidth
}
}
return if (measuredWidth > 0) MeasureSpec.makeMeasureSpec(measuredWidth, MeasureSpec.EXACTLY) else
widthMeasureSpec
}
Expand Down

0 comments on commit f2f2412

Please sign in to comment.