From 85cdfcd1f78fa70ff913570d831c9994f604fab0 Mon Sep 17 00:00:00 2001 From: Denis Koroskin Date: Thu, 17 Dec 2015 13:30:35 -0800 Subject: [PATCH] Turn FlatViewManager into ViewGroupManager Summary: Views that can contain other Views need to have their ViewManager to extend ViewGroupManager. Otherwise, it may not remove child Views correctly when a parent View is being detached. This diff is changing FlatViewManager that create FlatViewGroups (that can have child Views) to extend from ViewGroupManager. Reviewed By: ahmedre Differential Revision: D2768667 --- .../java/com/facebook/react/flat/FlatViewManager.java | 8 ++------ .../java/com/facebook/react/flat/RCTImageViewManager.java | 2 +- .../main/java/com/facebook/react/flat/RCTTextManager.java | 2 +- .../main/java/com/facebook/react/flat/RCTViewManager.java | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/flat/FlatViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/flat/FlatViewManager.java index ab92cf740..dd807c80a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/FlatViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/FlatViewManager.java @@ -10,9 +10,9 @@ package com.facebook.react.flat; import com.facebook.react.uimanager.ThemedReactContext; -import com.facebook.react.uimanager.BaseViewManager; +import com.facebook.react.uimanager.ViewGroupManager; -abstract class FlatViewManager extends BaseViewManager { +abstract class FlatViewManager extends ViewGroupManager { @Override protected FlatViewGroup createViewInstance(ThemedReactContext reactContext) { @@ -23,8 +23,4 @@ abstract class FlatViewManager extends BaseViewManager public void setBackgroundColor(FlatViewGroup view, int backgroundColor) { // suppress } - - @Override - public void updateExtraData(FlatViewGroup root, Object extraData) { - } } diff --git a/ReactAndroid/src/main/java/com/facebook/react/flat/RCTImageViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/flat/RCTImageViewManager.java index 82c121165..eb7a38e22 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/RCTImageViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/RCTImageViewManager.java @@ -9,7 +9,7 @@ package com.facebook.react.flat; -/* package */ final class RCTImageViewManager extends FlatViewManager { +/* package */ final class RCTImageViewManager extends FlatViewManager { @Override public String getName() { diff --git a/ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextManager.java b/ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextManager.java index b1794980f..feb5240d0 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextManager.java @@ -12,7 +12,7 @@ package com.facebook.react.flat; /** * ViewManager that creates instances of RCTText. */ -/* package */ final class RCTTextManager extends FlatViewManager { +/* package */ final class RCTTextManager extends FlatViewManager { @Override public String getName() { diff --git a/ReactAndroid/src/main/java/com/facebook/react/flat/RCTViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/flat/RCTViewManager.java index 3644eef90..c6a285031 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/RCTViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/RCTViewManager.java @@ -12,7 +12,7 @@ package com.facebook.react.flat; /** * ViewManager that creates instances of RCTView. */ -/* package */ final class RCTViewManager extends FlatViewManager { +/* package */ final class RCTViewManager extends FlatViewManager { @Override public String getName() {