|
24 | 24 | import com.facebook.react.uimanager.Spacing;
|
25 | 25 | import com.facebook.react.uimanager.ThemedReactContext;
|
26 | 26 | import com.facebook.react.uimanager.UIManagerModule;
|
27 |
| -import com.facebook.react.uimanager.ViewGroupManager; |
28 | 27 | import com.facebook.react.uimanager.ViewProps;
|
29 | 28 | import com.facebook.react.uimanager.annotations.ReactProp;
|
30 | 29 | import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
|
35 | 34 |
|
36 | 35 | /** View manager for AndroidViews (plain React Views). */
|
37 | 36 | @ReactModule(name = ReactViewManager.REACT_CLASS)
|
38 |
| -public class ReactViewManager extends ViewGroupManager<ReactViewGroup> { |
| 37 | +public class ReactViewManager extends ReactClippingViewManager<ReactViewGroup> { |
39 | 38 |
|
40 | 39 | @VisibleForTesting public static final String REACT_CLASS = ViewProps.VIEW_CLASS_NAME;
|
41 | 40 |
|
@@ -182,12 +181,6 @@ public void setNativeForeground(ReactViewGroup view, @Nullable ReadableMap fg) {
|
182 | 181 | fg == null ? null : ReactDrawableHelper.createDrawableFromJSDescription(view, fg));
|
183 | 182 | }
|
184 | 183 |
|
185 |
| - @ReactProp( |
186 |
| - name = com.facebook.react.uimanager.ReactClippingViewGroupHelper.PROP_REMOVE_CLIPPED_SUBVIEWS) |
187 |
| - public void setRemoveClippedSubviews(ReactViewGroup view, boolean removeClippedSubviews) { |
188 |
| - view.setRemoveClippedSubviews(removeClippedSubviews); |
189 |
| - } |
190 |
| - |
191 | 184 | @ReactProp(name = ViewProps.NEEDS_OFFSCREEN_ALPHA_COMPOSITING)
|
192 | 185 | public void setNeedsOffscreenAlphaCompositing(
|
193 | 186 | ReactViewGroup view, boolean needsOffscreenAlphaCompositing) {
|
@@ -354,58 +347,4 @@ private void handleHotspotUpdate(ReactViewGroup root, @Nullable ReadableArray ar
|
354 | 347 | root.drawableHotspotChanged(x, y);
|
355 | 348 | }
|
356 | 349 | }
|
357 |
| - |
358 |
| - @Override |
359 |
| - public void addView(ReactViewGroup parent, View child, int index) { |
360 |
| - boolean removeClippedSubviews = parent.getRemoveClippedSubviews(); |
361 |
| - if (removeClippedSubviews) { |
362 |
| - parent.addViewWithSubviewClippingEnabled(child, index); |
363 |
| - } else { |
364 |
| - parent.addView(child, index); |
365 |
| - } |
366 |
| - } |
367 |
| - |
368 |
| - @Override |
369 |
| - public int getChildCount(ReactViewGroup parent) { |
370 |
| - boolean removeClippedSubviews = parent.getRemoveClippedSubviews(); |
371 |
| - if (removeClippedSubviews) { |
372 |
| - return parent.getAllChildrenCount(); |
373 |
| - } else { |
374 |
| - return parent.getChildCount(); |
375 |
| - } |
376 |
| - } |
377 |
| - |
378 |
| - @Override |
379 |
| - public View getChildAt(ReactViewGroup parent, int index) { |
380 |
| - boolean removeClippedSubviews = parent.getRemoveClippedSubviews(); |
381 |
| - if (removeClippedSubviews) { |
382 |
| - return parent.getChildAtWithSubviewClippingEnabled(index); |
383 |
| - } else { |
384 |
| - return parent.getChildAt(index); |
385 |
| - } |
386 |
| - } |
387 |
| - |
388 |
| - @Override |
389 |
| - public void removeViewAt(ReactViewGroup parent, int index) { |
390 |
| - boolean removeClippedSubviews = parent.getRemoveClippedSubviews(); |
391 |
| - if (removeClippedSubviews) { |
392 |
| - View child = getChildAt(parent, index); |
393 |
| - if (child.getParent() != null) { |
394 |
| - parent.removeView(child); |
395 |
| - } |
396 |
| - parent.removeViewWithSubviewClippingEnabled(child); |
397 |
| - } else { |
398 |
| - parent.removeViewAt(index); |
399 |
| - } |
400 |
| - } |
401 |
| - |
402 |
| - @Override |
403 |
| - public void removeAllViews(ReactViewGroup parent) { |
404 |
| - boolean removeClippedSubviews = parent.getRemoveClippedSubviews(); |
405 |
| - if (removeClippedSubviews) { |
406 |
| - parent.removeAllViewsWithSubviewClippingEnabled(); |
407 |
| - } else { |
408 |
| - parent.removeAllViews(); |
409 |
| - } |
410 |
| - } |
411 | 350 | }
|
0 commit comments