react-native-navigation 8.8.3-snapshot.2534 → 8.8.3-snapshot.2536

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.
@@ -2,6 +2,7 @@ package com.reactnativenavigation.views.stack.topbar.titlebar;
2
2
 
3
3
  import android.annotation.SuppressLint;
4
4
  import android.content.Context;
5
+ import android.util.TypedValue;
5
6
  import android.view.View;
6
7
 
7
8
  import com.facebook.react.ReactInstanceManager;
@@ -10,7 +11,6 @@ import com.reactnativenavigation.options.params.Number;
10
11
  import com.reactnativenavigation.react.ReactView;
11
12
 
12
13
  import static android.view.View.MeasureSpec.EXACTLY;
13
- import static android.view.View.MeasureSpec.UNSPECIFIED;
14
14
  import static android.view.View.MeasureSpec.makeMeasureSpec;
15
15
  import static com.reactnativenavigation.utils.UiUtils.dpToPx;
16
16
 
@@ -39,7 +39,19 @@ public class TitleBarReactButtonView extends ReactView {
39
39
  if (dimension.hasValue()) {
40
40
  return makeMeasureSpec(MeasureSpec.getSize(dpToPx(getContext(), dimension.get())), EXACTLY);
41
41
  } else {
42
- return makeMeasureSpec(MeasureSpec.getSize(measureSpec), UNSPECIFIED);
42
+ // When JS doesn't pass width/height, default to the theme's actionBarSize (48dp on Material).
43
+ // Yoga's intrinsic measurement of the React view collapses `paddingHorizontal` on the
44
+ // trailing edge in RTL (RN/Fabric measurement quirk), so we cannot trust UNSPECIFIED here -
45
+ // it produces a 0dp visible inset against the screen edge in RTL.
46
+ return makeMeasureSpec(resolveActionBarSize(), EXACTLY);
43
47
  }
44
48
  }
49
+
50
+ private int resolveActionBarSize() {
51
+ TypedValue tv = new TypedValue();
52
+ if (getContext().getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
53
+ return TypedValue.complexToDimensionPixelSize(tv.data, getContext().getResources().getDisplayMetrics());
54
+ }
55
+ return (int) dpToPx(getContext(), 48f);
56
+ }
45
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation",
3
- "version": "8.8.3-snapshot.2534",
3
+ "version": "8.8.3-snapshot.2536",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android",
5
5
  "license": "MIT",
6
6
  "nativePackage": true,