react-native-tvos 0.68.2-1 → 0.68.2-2

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.
Files changed (75) hide show
  1. package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +6 -6
  2. package/Libraries/Components/Pressable/Pressable.js +3 -3
  3. package/Libraries/Components/Pressable/useAndroidRippleForView.js +3 -1
  4. package/Libraries/Components/{AppleTV → TV}/NativeTVNavigationEventEmitter.js +0 -0
  5. package/Libraries/Components/{AppleTV → TV}/TVEventControl.js +0 -0
  6. package/Libraries/Components/{AppleTV → TV}/TVEventHandler.js +0 -0
  7. package/Libraries/Components/{AppleTV → TV}/TVFocusEventHandler.js +0 -0
  8. package/Libraries/Components/TV/TVFocusGuideView.js +135 -0
  9. package/Libraries/Components/{AppleTV → TV}/TVTextScrollView.js +0 -0
  10. package/Libraries/Components/{AppleTV → TV}/TVViewPropTypes.js +0 -0
  11. package/Libraries/Components/{AppleTV → TV}/tagForComponentOrHandle.js +0 -0
  12. package/Libraries/Components/{AppleTV → TV}/useTVEventHandler.js +0 -0
  13. package/Libraries/Components/Touchable/TVTouchable.js +1 -1
  14. package/Libraries/Components/Touchable/Touchable.js +1 -1
  15. package/Libraries/Components/Touchable/TouchableHighlight.js +2 -2
  16. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -2
  17. package/Libraries/Components/Touchable/TouchableOpacity.js +2 -2
  18. package/Libraries/Components/View/ReactNativeViewViewConfig.js +1 -1
  19. package/Libraries/Components/View/ViewPropTypes.js +1 -1
  20. package/Libraries/Lists/VirtualizedSectionList.js +2 -1
  21. package/Libraries/LogBox/UI/AnsiHighlight.js +4 -2
  22. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +2 -2
  23. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +1 -1
  24. package/Libraries/Utilities/BackHandler.ios.js +1 -1
  25. package/Libraries/Utilities/ReactNativeTestTools.js +5 -7
  26. package/README.md +6 -1
  27. package/ReactAndroid/gradle.properties +1 -1
  28. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +173 -103
  29. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java +20 -0
  30. package/android/com/facebook/react/react-native/{0.68.2-1/react-native-0.68.2-1-sources.jar → 0.68.2-2/react-native-0.68.2-2-sources.jar} +0 -0
  31. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2-sources.jar.md5 +1 -0
  32. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2-sources.jar.sha1 +1 -0
  33. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2-sources.jar.sha256 +1 -0
  34. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2-sources.jar.sha512 +1 -0
  35. package/android/com/facebook/react/react-native/{0.68.2-1/react-native-0.68.2-1.aar → 0.68.2-2/react-native-0.68.2-2.aar} +0 -0
  36. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2.aar.md5 +1 -0
  37. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2.aar.sha1 +1 -0
  38. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2.aar.sha256 +1 -0
  39. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2.aar.sha512 +1 -0
  40. package/android/com/facebook/react/react-native/{0.68.2-1/react-native-0.68.2-1.module → 0.68.2-2/react-native-0.68.2-2.module} +15 -15
  41. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2.module.md5 +1 -0
  42. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2.module.sha1 +1 -0
  43. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2.module.sha256 +1 -0
  44. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2.module.sha512 +1 -0
  45. package/android/com/facebook/react/react-native/{0.68.2-1/react-native-0.68.2-1.pom → 0.68.2-2/react-native-0.68.2-2.pom} +1 -1
  46. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2.pom.md5 +1 -0
  47. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2.pom.sha1 +1 -0
  48. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2.pom.sha256 +1 -0
  49. package/android/com/facebook/react/react-native/0.68.2-2/react-native-0.68.2-2.pom.sha512 +1 -0
  50. package/android/com/facebook/react/react-native/maven-metadata.xml +4 -4
  51. package/android/com/facebook/react/react-native/maven-metadata.xml.md5 +1 -1
  52. package/android/com/facebook/react/react-native/maven-metadata.xml.sha1 +1 -1
  53. package/android/com/facebook/react/react-native/maven-metadata.xml.sha256 +1 -1
  54. package/android/com/facebook/react/react-native/maven-metadata.xml.sha512 +1 -1
  55. package/index.js +11 -11
  56. package/package.json +1 -1
  57. package/template/package.json +1 -1
  58. package/tvos-types.d.ts +4 -0
  59. package/Libraries/Components/AppleTV/TVFocusGuideView.js +0 -79
  60. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1-sources.jar.md5 +0 -1
  61. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1-sources.jar.sha1 +0 -1
  62. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1-sources.jar.sha256 +0 -1
  63. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1-sources.jar.sha512 +0 -1
  64. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1.aar.md5 +0 -1
  65. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1.aar.sha1 +0 -1
  66. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1.aar.sha256 +0 -1
  67. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1.aar.sha512 +0 -1
  68. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1.module.md5 +0 -1
  69. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1.module.sha1 +0 -1
  70. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1.module.sha256 +0 -1
  71. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1.module.sha512 +0 -1
  72. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1.pom.md5 +0 -1
  73. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1.pom.sha1 +0 -1
  74. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1.pom.sha256 +0 -1
  75. package/android/com/facebook/react/react-native/0.68.2-1/react-native-0.68.2-1.pom.sha512 +0 -1
@@ -23,9 +23,14 @@ import android.os.Build;
23
23
  import android.view.MotionEvent;
24
24
  import android.view.View;
25
25
  import android.view.ViewGroup;
26
+ import android.view.ViewParent;
26
27
  import android.view.ViewStructure;
27
28
  import android.view.animation.Animation;
29
+ import android.widget.Toast;
30
+
31
+ import androidx.annotation.NonNull;
28
32
  import androidx.annotation.Nullable;
33
+
29
34
  import com.facebook.common.logging.FLog;
30
35
  import com.facebook.infer.annotation.Assertions;
31
36
  import com.facebook.react.bridge.ReactContext;
@@ -61,12 +66,12 @@ import com.facebook.yoga.YogaConstants;
61
66
  */
62
67
  @TargetApi(Build.VERSION_CODES.LOLLIPOP)
63
68
  public class ReactViewGroup extends ViewGroup
64
- implements ReactInterceptingViewGroup,
65
- ReactClippingViewGroup,
66
- ReactPointerEventsView,
67
- ReactHitSlopView,
68
- ReactZIndexedViewGroup,
69
- ReactOverflowViewWithInset {
69
+ implements ReactInterceptingViewGroup,
70
+ ReactClippingViewGroup,
71
+ ReactPointerEventsView,
72
+ ReactHitSlopView,
73
+ ReactZIndexedViewGroup,
74
+ ReactOverflowViewWithInset {
70
75
 
71
76
  private static final int ARRAY_CAPACITY_INCREMENT = 12;
72
77
  private static final int DEFAULT_BACKGROUND_COLOR = Color.TRANSPARENT;
@@ -74,6 +79,7 @@ public class ReactViewGroup extends ViewGroup
74
79
  private final Rect mOverflowInset = new Rect();
75
80
  /* should only be used in {@link #updateClippingToRect} */
76
81
  private static final Rect sHelperRect = new Rect();
82
+ private @NonNull int[] focusDestinations = new int[0];
77
83
 
78
84
  /**
79
85
  * This listener will be set for child views when removeClippedSubview property is enabled. When
@@ -93,15 +99,15 @@ public class ReactViewGroup extends ViewGroup
93
99
 
94
100
  @Override
95
101
  public void onLayoutChange(
96
- View v,
97
- int left,
98
- int top,
99
- int right,
100
- int bottom,
101
- int oldLeft,
102
- int oldTop,
103
- int oldRight,
104
- int oldBottom) {
102
+ View v,
103
+ int left,
104
+ int top,
105
+ int right,
106
+ int bottom,
107
+ int oldLeft,
108
+ int oldTop,
109
+ int oldRight,
110
+ int oldBottom) {
105
111
  if (mParent.getRemoveClippedSubviews()) {
106
112
  mParent.updateSubviewClipStatus(v);
107
113
  }
@@ -117,18 +123,27 @@ public class ReactViewGroup extends ViewGroup
117
123
  // {@link ViewGroup#getChildCount} so those methods may return views that are not attached.
118
124
  // This is risky but allows us to perform a correct cleanup in {@link NativeViewHierarchyManager}.
119
125
  private boolean mRemoveClippedSubviews = false;
120
- private @Nullable View[] mAllChildren = null;
126
+ private @Nullable
127
+ View[] mAllChildren = null;
121
128
  private int mAllChildrenCount;
122
- private @Nullable Rect mClippingRect;
123
- private @Nullable Rect mHitSlopRect;
124
- private @Nullable String mOverflow;
129
+ private @Nullable
130
+ Rect mClippingRect;
131
+ private @Nullable
132
+ Rect mHitSlopRect;
133
+ private @Nullable
134
+ String mOverflow;
125
135
  private PointerEvents mPointerEvents = PointerEvents.AUTO;
126
- private @Nullable ChildrenLayoutChangeListener mChildrenLayoutChangeListener;
127
- private @Nullable ReactViewBackgroundDrawable mReactBackgroundDrawable;
128
- private @Nullable OnInterceptTouchEventListener mOnInterceptTouchEventListener;
136
+ private @Nullable
137
+ ChildrenLayoutChangeListener mChildrenLayoutChangeListener;
138
+ private @Nullable
139
+ ReactViewBackgroundDrawable mReactBackgroundDrawable;
140
+ private @Nullable
141
+ OnInterceptTouchEventListener mOnInterceptTouchEventListener;
129
142
  private boolean mNeedsOffscreenAlphaCompositing = false;
130
- private @Nullable ViewGroupDrawingOrderHelper mDrawingOrderHelper = null;
131
- private @Nullable Path mPath;
143
+ private @Nullable
144
+ ViewGroupDrawingOrderHelper mDrawingOrderHelper = null;
145
+ private @Nullable
146
+ Path mPath;
132
147
  private int mLayoutDirection;
133
148
  private float mBackfaceOpacity = 1.f;
134
149
  private String mBackfaceVisibility = "visible";
@@ -150,7 +165,7 @@ public class ReactViewGroup extends ViewGroup
150
165
  MeasureSpecAssertions.assertExplicitMeasureSpec(widthMeasureSpec, heightMeasureSpec);
151
166
 
152
167
  setMeasuredDimension(
153
- MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.getSize(heightMeasureSpec));
168
+ MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.getSize(heightMeasureSpec));
154
169
  }
155
170
 
156
171
  @Override
@@ -194,7 +209,7 @@ public class ReactViewGroup extends ViewGroup
194
209
  @Override
195
210
  public void setBackground(Drawable drawable) {
196
211
  throw new UnsupportedOperationException(
197
- "This method is not supported for ReactViewGroup instances");
212
+ "This method is not supported for ReactViewGroup instances");
198
213
  }
199
214
 
200
215
  public void setTranslucentBackgroundDrawable(@Nullable Drawable background) {
@@ -205,7 +220,7 @@ public class ReactViewGroup extends ViewGroup
205
220
  updateBackgroundDrawable(null);
206
221
  if (mReactBackgroundDrawable != null && background != null) {
207
222
  LayerDrawable layerDrawable =
208
- new LayerDrawable(new Drawable[] {mReactBackgroundDrawable, background});
223
+ new LayerDrawable(new Drawable[]{mReactBackgroundDrawable, background});
209
224
  updateBackgroundDrawable(layerDrawable);
210
225
  } else if (background != null) {
211
226
  updateBackgroundDrawable(background);
@@ -220,7 +235,7 @@ public class ReactViewGroup extends ViewGroup
220
235
  @Override
221
236
  public boolean onInterceptTouchEvent(MotionEvent ev) {
222
237
  if (mOnInterceptTouchEventListener != null
223
- && mOnInterceptTouchEventListener.onInterceptTouchEvent(this, ev)) {
238
+ && mOnInterceptTouchEventListener.onInterceptTouchEvent(this, ev)) {
224
239
  return true;
225
240
  }
226
241
  // We intercept the touch event if the children are not supposed to receive it.
@@ -253,7 +268,9 @@ public class ReactViewGroup extends ViewGroup
253
268
  return mNeedsOffscreenAlphaCompositing;
254
269
  }
255
270
 
256
- /** See the documentation of needsOffscreenAlphaCompositing in View.js. */
271
+ /**
272
+ * See the documentation of needsOffscreenAlphaCompositing in View.js.
273
+ */
257
274
  public void setNeedsOffscreenAlphaCompositing(boolean needsOffscreenAlphaCompositing) {
258
275
  mNeedsOffscreenAlphaCompositing = needsOffscreenAlphaCompositing;
259
276
  }
@@ -356,8 +373,8 @@ public class ReactViewGroup extends ViewGroup
356
373
  View child = Assertions.assertNotNull(mAllChildren)[idx];
357
374
  sHelperRect.set(child.getLeft(), child.getTop(), child.getRight(), child.getBottom());
358
375
  boolean intersects =
359
- clippingRect.intersects(
360
- sHelperRect.left, sHelperRect.top, sHelperRect.right, sHelperRect.bottom);
376
+ clippingRect.intersects(
377
+ sHelperRect.left, sHelperRect.top, sHelperRect.right, sHelperRect.bottom);
361
378
  boolean needUpdateClippingRecursive = false;
362
379
  // We never want to clip children that are being animated, as this can easily break layout :
363
380
  // when layout animation changes size and/or position of views contained inside a listview that
@@ -403,8 +420,8 @@ public class ReactViewGroup extends ViewGroup
403
420
  // do fast check whether intersect state changed
404
421
  sHelperRect.set(subview.getLeft(), subview.getTop(), subview.getRight(), subview.getBottom());
405
422
  boolean intersects =
406
- mClippingRect.intersects(
407
- sHelperRect.left, sHelperRect.top, sHelperRect.right, sHelperRect.bottom);
423
+ mClippingRect.intersects(
424
+ sHelperRect.left, sHelperRect.top, sHelperRect.right, sHelperRect.bottom);
408
425
 
409
426
  // If it was intersecting before, should be attached to the parent
410
427
  boolean oldIntersects = (subview.getParent() != null);
@@ -556,7 +573,7 @@ public class ReactViewGroup extends ViewGroup
556
573
  }
557
574
 
558
575
  /*package*/ void addViewWithSubviewClippingEnabled(
559
- final View child, int index, ViewGroup.LayoutParams params) {
576
+ final View child, int index, ViewGroup.LayoutParams params) {
560
577
  Assertions.assertCondition(mRemoveClippedSubviews);
561
578
  Assertions.assertNotNull(mClippingRect);
562
579
  Assertions.assertNotNull(mAllChildren);
@@ -574,25 +591,25 @@ public class ReactViewGroup extends ViewGroup
574
591
 
575
592
  if (child instanceof ReactClippingProhibitedView) {
576
593
  UiThreadUtil.runOnUiThread(
577
- new Runnable() {
578
- @Override
579
- public void run() {
580
- if (!child.isShown()) {
581
- ReactSoftExceptionLogger.logSoftException(
582
- TAG,
583
- new ReactNoCrashSoftException(
584
- "Child view has been added to Parent view in which it is clipped and not visible."
585
- + " This is not legal for this particular child view. Child: ["
586
- + child.getId()
587
- + "] "
588
- + child.toString()
589
- + " Parent: ["
590
- + getId()
591
- + "] "
592
- + toString()));
593
- }
594
+ new Runnable() {
595
+ @Override
596
+ public void run() {
597
+ if (!child.isShown()) {
598
+ ReactSoftExceptionLogger.logSoftException(
599
+ TAG,
600
+ new ReactNoCrashSoftException(
601
+ "Child view has been added to Parent view in which it is clipped and not visible."
602
+ + " This is not legal for this particular child view. Child: ["
603
+ + child.getId()
604
+ + "] "
605
+ + child.toString()
606
+ + " Parent: ["
607
+ + getId()
608
+ + "] "
609
+ + toString()));
594
610
  }
595
- });
611
+ }
612
+ });
596
613
  }
597
614
  }
598
615
 
@@ -691,25 +708,26 @@ public class ReactViewGroup extends ViewGroup
691
708
  mReactBackgroundDrawable = new ReactViewBackgroundDrawable(getContext());
692
709
  Drawable backgroundDrawable = getBackground();
693
710
  updateBackgroundDrawable(
694
- null); // required so that drawable callback is cleared before we add the
711
+ null); // required so that drawable callback is cleared before we add the
695
712
  // drawable back as a part of LayerDrawable
696
713
  if (backgroundDrawable == null) {
697
714
  updateBackgroundDrawable(mReactBackgroundDrawable);
698
715
  } else {
699
716
  LayerDrawable layerDrawable =
700
- new LayerDrawable(new Drawable[] {mReactBackgroundDrawable, backgroundDrawable});
717
+ new LayerDrawable(new Drawable[]{mReactBackgroundDrawable, backgroundDrawable});
701
718
  updateBackgroundDrawable(layerDrawable);
702
719
  }
703
720
 
704
721
  mLayoutDirection =
705
- I18nUtil.getInstance().isRTL(getContext()) ? LAYOUT_DIRECTION_RTL : LAYOUT_DIRECTION_LTR;
722
+ I18nUtil.getInstance().isRTL(getContext()) ? LAYOUT_DIRECTION_RTL : LAYOUT_DIRECTION_LTR;
706
723
  mReactBackgroundDrawable.setResolvedLayoutDirection(mLayoutDirection);
707
724
  }
708
725
  return mReactBackgroundDrawable;
709
726
  }
710
727
 
711
728
  @Override
712
- public @Nullable Rect getHitSlopRect() {
729
+ public @Nullable
730
+ Rect getHitSlopRect() {
713
731
  return mHitSlopRect;
714
732
  }
715
733
 
@@ -723,7 +741,8 @@ public class ReactViewGroup extends ViewGroup
723
741
  }
724
742
 
725
743
  @Override
726
- public @Nullable String getOverflow() {
744
+ public @Nullable
745
+ String getOverflow() {
727
746
  return mOverflow;
728
747
  }
729
748
 
@@ -742,7 +761,7 @@ public class ReactViewGroup extends ViewGroup
742
761
  * #setBackground(Drawable)} or {@link #setBackgroundDrawable(Drawable)} based on the sdk version.
743
762
  *
744
763
  * @param drawable {@link Drawable} The Drawable to use as the background, or null to remove the
745
- * background
764
+ * background
746
765
  */
747
766
  private void updateBackgroundDrawable(Drawable drawable) {
748
767
  super.setBackground(drawable);
@@ -763,7 +782,7 @@ public class ReactViewGroup extends ViewGroup
763
782
  if (getContext() instanceof ReactContext) {
764
783
  ReactContext reactContext = (ReactContext) getContext();
765
784
  reactContext.handleException(
766
- new IllegalViewOperationException("StackOverflowException", this, e));
785
+ new IllegalViewOperationException("StackOverflowException", this, e));
767
786
  } else {
768
787
  throw e;
769
788
  }
@@ -774,7 +793,7 @@ public class ReactViewGroup extends ViewGroup
774
793
  @Override
775
794
  protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
776
795
  boolean drawWithZ =
777
- child.getElevation() > 0 && ReactFeatureFlags.insertZReorderBarriersOnViewGroupChildren;
796
+ child.getElevation() > 0 && ReactFeatureFlags.insertZReorderBarriersOnViewGroupChildren;
778
797
 
779
798
  if (drawWithZ) {
780
799
  CanvasUtil.enableZ(canvas, true);
@@ -809,9 +828,9 @@ public class ReactViewGroup extends ViewGroup
809
828
  final RectF borderWidth = mReactBackgroundDrawable.getDirectionAwareBorderInsets();
810
829
 
811
830
  if (borderWidth.top > 0
812
- || borderWidth.left > 0
813
- || borderWidth.bottom > 0
814
- || borderWidth.right > 0) {
831
+ || borderWidth.left > 0
832
+ || borderWidth.bottom > 0
833
+ || borderWidth.right > 0) {
815
834
  left += borderWidth.left;
816
835
  top += borderWidth.top;
817
836
  right -= borderWidth.right;
@@ -820,31 +839,31 @@ public class ReactViewGroup extends ViewGroup
820
839
 
821
840
  final float borderRadius = mReactBackgroundDrawable.getFullBorderRadius();
822
841
  float topLeftBorderRadius =
823
- mReactBackgroundDrawable.getBorderRadiusOrDefaultTo(
824
- borderRadius, ReactViewBackgroundDrawable.BorderRadiusLocation.TOP_LEFT);
842
+ mReactBackgroundDrawable.getBorderRadiusOrDefaultTo(
843
+ borderRadius, ReactViewBackgroundDrawable.BorderRadiusLocation.TOP_LEFT);
825
844
  float topRightBorderRadius =
826
- mReactBackgroundDrawable.getBorderRadiusOrDefaultTo(
827
- borderRadius, ReactViewBackgroundDrawable.BorderRadiusLocation.TOP_RIGHT);
845
+ mReactBackgroundDrawable.getBorderRadiusOrDefaultTo(
846
+ borderRadius, ReactViewBackgroundDrawable.BorderRadiusLocation.TOP_RIGHT);
828
847
  float bottomLeftBorderRadius =
829
- mReactBackgroundDrawable.getBorderRadiusOrDefaultTo(
830
- borderRadius, ReactViewBackgroundDrawable.BorderRadiusLocation.BOTTOM_LEFT);
848
+ mReactBackgroundDrawable.getBorderRadiusOrDefaultTo(
849
+ borderRadius, ReactViewBackgroundDrawable.BorderRadiusLocation.BOTTOM_LEFT);
831
850
  float bottomRightBorderRadius =
832
- mReactBackgroundDrawable.getBorderRadiusOrDefaultTo(
833
- borderRadius, ReactViewBackgroundDrawable.BorderRadiusLocation.BOTTOM_RIGHT);
851
+ mReactBackgroundDrawable.getBorderRadiusOrDefaultTo(
852
+ borderRadius, ReactViewBackgroundDrawable.BorderRadiusLocation.BOTTOM_RIGHT);
834
853
 
835
854
  final boolean isRTL = mLayoutDirection == View.LAYOUT_DIRECTION_RTL;
836
855
  float topStartBorderRadius =
837
- mReactBackgroundDrawable.getBorderRadius(
838
- ReactViewBackgroundDrawable.BorderRadiusLocation.TOP_START);
856
+ mReactBackgroundDrawable.getBorderRadius(
857
+ ReactViewBackgroundDrawable.BorderRadiusLocation.TOP_START);
839
858
  float topEndBorderRadius =
840
- mReactBackgroundDrawable.getBorderRadius(
841
- ReactViewBackgroundDrawable.BorderRadiusLocation.TOP_END);
859
+ mReactBackgroundDrawable.getBorderRadius(
860
+ ReactViewBackgroundDrawable.BorderRadiusLocation.TOP_END);
842
861
  float bottomStartBorderRadius =
843
- mReactBackgroundDrawable.getBorderRadius(
844
- ReactViewBackgroundDrawable.BorderRadiusLocation.BOTTOM_START);
862
+ mReactBackgroundDrawable.getBorderRadius(
863
+ ReactViewBackgroundDrawable.BorderRadiusLocation.BOTTOM_START);
845
864
  float bottomEndBorderRadius =
846
- mReactBackgroundDrawable.getBorderRadius(
847
- ReactViewBackgroundDrawable.BorderRadiusLocation.BOTTOM_END);
865
+ mReactBackgroundDrawable.getBorderRadius(
866
+ ReactViewBackgroundDrawable.BorderRadiusLocation.BOTTOM_END);
848
867
 
849
868
  if (I18nUtil.getInstance().doLeftAndRightSwapInRTL(getContext())) {
850
869
  if (YogaConstants.isUndefined(topStartBorderRadius)) {
@@ -864,13 +883,13 @@ public class ReactViewGroup extends ViewGroup
864
883
  }
865
884
 
866
885
  final float directionAwareTopLeftRadius =
867
- isRTL ? topEndBorderRadius : topStartBorderRadius;
886
+ isRTL ? topEndBorderRadius : topStartBorderRadius;
868
887
  final float directionAwareTopRightRadius =
869
- isRTL ? topStartBorderRadius : topEndBorderRadius;
888
+ isRTL ? topStartBorderRadius : topEndBorderRadius;
870
889
  final float directionAwareBottomLeftRadius =
871
- isRTL ? bottomEndBorderRadius : bottomStartBorderRadius;
890
+ isRTL ? bottomEndBorderRadius : bottomStartBorderRadius;
872
891
  final float directionAwareBottomRightRadius =
873
- isRTL ? bottomStartBorderRadius : bottomEndBorderRadius;
892
+ isRTL ? bottomStartBorderRadius : bottomEndBorderRadius;
874
893
 
875
894
  topLeftBorderRadius = directionAwareTopLeftRadius;
876
895
  topRightBorderRadius = directionAwareTopRightRadius;
@@ -878,13 +897,13 @@ public class ReactViewGroup extends ViewGroup
878
897
  bottomRightBorderRadius = directionAwareBottomRightRadius;
879
898
  } else {
880
899
  final float directionAwareTopLeftRadius =
881
- isRTL ? topEndBorderRadius : topStartBorderRadius;
900
+ isRTL ? topEndBorderRadius : topStartBorderRadius;
882
901
  final float directionAwareTopRightRadius =
883
- isRTL ? topStartBorderRadius : topEndBorderRadius;
902
+ isRTL ? topStartBorderRadius : topEndBorderRadius;
884
903
  final float directionAwareBottomLeftRadius =
885
- isRTL ? bottomEndBorderRadius : bottomStartBorderRadius;
904
+ isRTL ? bottomEndBorderRadius : bottomStartBorderRadius;
886
905
  final float directionAwareBottomRightRadius =
887
- isRTL ? bottomStartBorderRadius : bottomEndBorderRadius;
906
+ isRTL ? bottomStartBorderRadius : bottomEndBorderRadius;
888
907
 
889
908
  if (!YogaConstants.isUndefined(directionAwareTopLeftRadius)) {
890
909
  topLeftBorderRadius = directionAwareTopLeftRadius;
@@ -904,27 +923,27 @@ public class ReactViewGroup extends ViewGroup
904
923
  }
905
924
 
906
925
  if (topLeftBorderRadius > 0
907
- || topRightBorderRadius > 0
908
- || bottomRightBorderRadius > 0
909
- || bottomLeftBorderRadius > 0) {
926
+ || topRightBorderRadius > 0
927
+ || bottomRightBorderRadius > 0
928
+ || bottomLeftBorderRadius > 0) {
910
929
  if (mPath == null) {
911
930
  mPath = new Path();
912
931
  }
913
932
 
914
933
  mPath.rewind();
915
934
  mPath.addRoundRect(
916
- new RectF(left, top, right, bottom),
917
- new float[] {
918
- Math.max(topLeftBorderRadius - borderWidth.left, 0),
919
- Math.max(topLeftBorderRadius - borderWidth.top, 0),
920
- Math.max(topRightBorderRadius - borderWidth.right, 0),
921
- Math.max(topRightBorderRadius - borderWidth.top, 0),
922
- Math.max(bottomRightBorderRadius - borderWidth.right, 0),
923
- Math.max(bottomRightBorderRadius - borderWidth.bottom, 0),
924
- Math.max(bottomLeftBorderRadius - borderWidth.left, 0),
925
- Math.max(bottomLeftBorderRadius - borderWidth.bottom, 0),
926
- },
927
- Path.Direction.CW);
935
+ new RectF(left, top, right, bottom),
936
+ new float[]{
937
+ Math.max(topLeftBorderRadius - borderWidth.left, 0),
938
+ Math.max(topLeftBorderRadius - borderWidth.top, 0),
939
+ Math.max(topRightBorderRadius - borderWidth.right, 0),
940
+ Math.max(topRightBorderRadius - borderWidth.top, 0),
941
+ Math.max(bottomRightBorderRadius - borderWidth.right, 0),
942
+ Math.max(bottomRightBorderRadius - borderWidth.bottom, 0),
943
+ Math.max(bottomLeftBorderRadius - borderWidth.left, 0),
944
+ Math.max(bottomLeftBorderRadius - borderWidth.bottom, 0),
945
+ },
946
+ Path.Direction.CW);
928
947
  canvas.clipPath(mPath);
929
948
  hasClipPath = true;
930
949
  }
@@ -962,7 +981,7 @@ public class ReactViewGroup extends ViewGroup
962
981
  float rotationY = getRotationY();
963
982
 
964
983
  boolean isFrontfaceVisible =
965
- (rotationX >= -90.f && rotationX < 90.f) && (rotationY >= -90.f && rotationY < 90.f);
984
+ (rotationX >= -90.f && rotationX < 90.f) && (rotationY >= -90.f && rotationY < 90.f);
966
985
 
967
986
  if (isFrontfaceVisible) {
968
987
  setAlpha(mBackfaceOpacity);
@@ -971,4 +990,55 @@ public class ReactViewGroup extends ViewGroup
971
990
 
972
991
  setAlpha(0);
973
992
  }
993
+
994
+ private View findDestinationView() {
995
+ for (int focusDestination : focusDestinations) {
996
+ View childViewWithTag = findViewById(focusDestination);
997
+ if (childViewWithTag != null) return childViewWithTag;
998
+ View viewWithTag = getRootView().findViewById(focusDestination);
999
+ if (viewWithTag != null) return viewWithTag;
1000
+ }
1001
+ return null;
1002
+ }
1003
+
1004
+ private static boolean requestFocusViewOrAncestor(View destination) {
1005
+ View v = destination;
1006
+ while (v != null) {
1007
+ if (v.requestFocus()) {
1008
+ return true;
1009
+ }
1010
+ ViewParent parent = v.getParent();
1011
+ if (parent instanceof View) {
1012
+ v = (View) parent;
1013
+ } else {
1014
+ v = null;
1015
+ }
1016
+ }
1017
+ return false;
1018
+ }
1019
+
1020
+ @Override
1021
+ public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
1022
+ if (focusDestinations.length == 0) {
1023
+ return super.requestFocus(direction, previouslyFocusedRect);
1024
+ }
1025
+
1026
+ View destination = findDestinationView();
1027
+
1028
+ if (destination != null && requestFocusViewOrAncestor(destination)) {
1029
+ return true;
1030
+ }
1031
+
1032
+ for (int i = 0; i < getChildCount(); i++) {
1033
+ if (getChildAt(i).requestFocus()) {
1034
+ return true;
1035
+ }
1036
+ }
1037
+
1038
+ return false;
1039
+ }
1040
+
1041
+ public void setFocusDestinations(@NonNull int[] focusDestinations) {
1042
+ this.focusDestinations = focusDestinations;
1043
+ }
974
1044
  }
@@ -31,6 +31,7 @@ import com.facebook.react.uimanager.annotations.ReactProp;
31
31
  import com.facebook.react.uimanager.annotations.ReactPropGroup;
32
32
  import com.facebook.react.uimanager.events.EventDispatcher;
33
33
  import com.facebook.yoga.YogaConstants;
34
+
34
35
  import java.util.Map;
35
36
 
36
37
  /** View manager for AndroidViews (plain React Views). */
@@ -263,6 +264,14 @@ public class ReactViewManager extends ReactClippingViewManager<ReactViewGroup> {
263
264
  }
264
265
  }
265
266
 
267
+ @ReactProp(name = "tvFocusable")
268
+ public void setTvFocusable(final ReactViewGroup view, boolean focusable) {
269
+ setFocusable(view, focusable);
270
+ if (!focusable) {
271
+ view.setFocusable(false);
272
+ }
273
+ }
274
+
266
275
  @ReactProp(name = ViewProps.OVERFLOW)
267
276
  public void setOverflow(ReactViewGroup view, String overflow) {
268
277
  view.setOverflow(overflow);
@@ -349,4 +358,15 @@ public class ReactViewManager extends ReactClippingViewManager<ReactViewGroup> {
349
358
  float y = PixelUtil.toPixelFromDIP(args.getDouble(1));
350
359
  root.drawableHotspotChanged(x, y);
351
360
  }
361
+
362
+
363
+ @ReactProp(name = "destinations")
364
+ public void setDestinations(final ReactViewGroup view, final ReadableArray destinations) {
365
+ int[] fd = new int[destinations.size()];
366
+ for (int i = 0; i < fd.length; i++) {
367
+ fd[i] = destinations.getInt(i);
368
+ }
369
+ view.setFocusDestinations(fd);
370
+ }
371
+
352
372
  }
@@ -0,0 +1 @@
1
+ e8bf990fb7a6c93cb0e42d91eab3024f7ef2d656
@@ -0,0 +1 @@
1
+ 4fb5d99c1f5423840fd1f9998ec7f9c4bb91bf15bc6a4ead66ff6070107d930a
@@ -0,0 +1 @@
1
+ 72771154745c9a0444a51a0c5543c742c66a4044a918f55c18052b5d8771972d37fc47c526424f8a86d7af147a622ebaeb7d2e6ff0b151ea9d436ff6740b8416
@@ -0,0 +1 @@
1
+ e6c084c0ba9698856027b9f6d22d482b
@@ -0,0 +1 @@
1
+ 63806325774315959769b4896a09fefcc7e4592d
@@ -0,0 +1 @@
1
+ 6c0110f5d44a005462a63dae9505fc7d3e739b216c85e67836802a6d6a3e053e
@@ -0,0 +1 @@
1
+ c45d3cf086332c39cb82a89e7a4a07371343951aed7e7008533a31ad319367832072d269844ddabfb5dc3e896b3eb54a35edbd38bcbaf72a409c12cb5905ea1a
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "com.facebook.react",
5
5
  "module": "react-native",
6
- "version": "0.68.2-1",
6
+ "version": "0.68.2-2",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -131,13 +131,13 @@
131
131
  ],
132
132
  "files": [
133
133
  {
134
- "name": "react-native-0.68.2-1.aar",
135
- "url": "react-native-0.68.2-1.aar",
136
- "size": 16399304,
137
- "sha512": "0a010823f5151ec11a66955ba2de7d3d18962d3a5b787d7c2ac43e7d12b700d49ea67feb141d63b6cbcd63a9c64bd6793fed44a67b47fdce02014a849b9affa0",
138
- "sha256": "7d3a36321a4d7b5516578d5befa3025a2b27ae06c4fc25cc1327d065ea94e124",
139
- "sha1": "3f08f6b86adb963e3efe72786f2c8660535261d4",
140
- "md5": "dff581d81a597312cf1c16730d137bb9"
134
+ "name": "react-native-0.68.2-2.aar",
135
+ "url": "react-native-0.68.2-2.aar",
136
+ "size": 16400239,
137
+ "sha512": "c45d3cf086332c39cb82a89e7a4a07371343951aed7e7008533a31ad319367832072d269844ddabfb5dc3e896b3eb54a35edbd38bcbaf72a409c12cb5905ea1a",
138
+ "sha256": "6c0110f5d44a005462a63dae9505fc7d3e739b216c85e67836802a6d6a3e053e",
139
+ "sha1": "63806325774315959769b4896a09fefcc7e4592d",
140
+ "md5": "e6c084c0ba9698856027b9f6d22d482b"
141
141
  }
142
142
  ]
143
143
  },
@@ -258,13 +258,13 @@
258
258
  ],
259
259
  "files": [
260
260
  {
261
- "name": "react-native-0.68.2-1.aar",
262
- "url": "react-native-0.68.2-1.aar",
263
- "size": 16399304,
264
- "sha512": "0a010823f5151ec11a66955ba2de7d3d18962d3a5b787d7c2ac43e7d12b700d49ea67feb141d63b6cbcd63a9c64bd6793fed44a67b47fdce02014a849b9affa0",
265
- "sha256": "7d3a36321a4d7b5516578d5befa3025a2b27ae06c4fc25cc1327d065ea94e124",
266
- "sha1": "3f08f6b86adb963e3efe72786f2c8660535261d4",
267
- "md5": "dff581d81a597312cf1c16730d137bb9"
261
+ "name": "react-native-0.68.2-2.aar",
262
+ "url": "react-native-0.68.2-2.aar",
263
+ "size": 16400239,
264
+ "sha512": "c45d3cf086332c39cb82a89e7a4a07371343951aed7e7008533a31ad319367832072d269844ddabfb5dc3e896b3eb54a35edbd38bcbaf72a409c12cb5905ea1a",
265
+ "sha256": "6c0110f5d44a005462a63dae9505fc7d3e739b216c85e67836802a6d6a3e053e",
266
+ "sha1": "63806325774315959769b4896a09fefcc7e4592d",
267
+ "md5": "e6c084c0ba9698856027b9f6d22d482b"
268
268
  }
269
269
  ]
270
270
  }
@@ -0,0 +1 @@
1
+ cabe220417395a9761fbb06c9b262e49
@@ -0,0 +1 @@
1
+ 5e286157aac0e322d05f2cc7b86363ce052e6cde
@@ -0,0 +1 @@
1
+ 351c562500dc51f68faacc27a626e5d06f1f73ec50bc71eae13d5d305b7f0005
@@ -0,0 +1 @@
1
+ ea4184a953fdb76f6a516cf19ba4c50ecb63e02aa38cc6728c7b8574d2d0e6bfa3ca01ae2fddbb0d644005347f6408daa6e0e181c248cf27d392212a7e870e25
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>com.facebook.react</groupId>
11
11
  <artifactId>react-native</artifactId>
12
- <version>0.68.2-1</version>
12
+ <version>0.68.2-2</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>ReactNative</name>
15
15
  <description>A framework for building native apps with React</description>
@@ -0,0 +1 @@
1
+ 0943019b71f9862aa919cb3c07830a7f
@@ -0,0 +1 @@
1
+ ba64e99d1f31fb4f9e0f71330b27836e37c7f8cf
@@ -0,0 +1 @@
1
+ 250ee9e2bd0268fda5a6ab01f4a3d67d542775f7fe0690492c2c0e6549e865be
@@ -0,0 +1 @@
1
+ d4d8fb2ea71278b0adf3e58ecd3d9adc925a6491e83b169bca72dd5ce929e2d4837d60d158edfd93166ef60799ae029fb56371a43aa7d9a6f25234b394528c26