react-native-navigation 8.7.5-snapshot.2323 → 8.7.5-snapshot.2330

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,8 @@ typealias TitleBottom = Int
17
17
 
18
18
  fun makeTitleAtMostWidthMeasureSpec(containerWidth: Int, rightBarWidth: Int, leftBarWidth: Int, isCenter: Boolean, isFill: Boolean = false): Int {
19
19
  return if (isCenter) {
20
- View.MeasureSpec.makeMeasureSpec(containerWidth, View.MeasureSpec.AT_MOST)
20
+ val availableWidth = containerWidth - rightBarWidth - leftBarWidth
21
+ View.MeasureSpec.makeMeasureSpec(availableWidth, View.MeasureSpec.AT_MOST)
21
22
  } else {
22
23
  val availableWidth = containerWidth - rightBarWidth - leftBarWidth - 2 * DEFAULT_LEFT_MARGIN_PX
23
24
  View.MeasureSpec.makeMeasureSpec(
@@ -3,25 +3,22 @@ package com.reactnativenavigation.views.stack.topbar.titlebar
3
3
  import android.annotation.SuppressLint
4
4
  import android.content.Context
5
5
  import android.view.View
6
- import android.view.ViewGroup
7
- import androidx.core.view.children
8
- import com.facebook.react.ReactInstanceManager
9
6
  import com.reactnativenavigation.react.ReactView
10
7
 
11
8
  @SuppressLint("ViewConstructor")
12
9
  class TitleBarReactView(context: Context?, componentId: String?,
13
10
  componentName: String?) : ReactView(context, componentId, componentName) {
14
11
  var centered: Boolean = false
12
+
15
13
  override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
16
- var titleHeightMeasureSpec: Int
17
- var titleWidthMeasureSpec: Int
18
14
  if (centered) {
19
- titleHeightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)
20
- titleWidthMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)
15
+ val availableWidth = MeasureSpec.getSize(widthMeasureSpec)
16
+ super.onMeasure(
17
+ MeasureSpec.makeMeasureSpec(availableWidth, MeasureSpec.AT_MOST),
18
+ heightMeasureSpec
19
+ )
21
20
  } else {
22
- titleHeightMeasureSpec = heightMeasureSpec
23
- titleWidthMeasureSpec = widthMeasureSpec
21
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec)
24
22
  }
25
- super.onMeasure(titleWidthMeasureSpec, titleHeightMeasureSpec)
26
23
  }
27
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation",
3
- "version": "8.7.5-snapshot.2323",
3
+ "version": "8.7.5-snapshot.2330",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android",
5
5
  "license": "MIT",
6
6
  "nativePackage": true,