mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-08 17:46:35 +08:00
Summary: Groups encountered a pretty major crash where, in many cases, we would find that DrawCommands and Views were out of sync. This turns out to be due to the fact that when we drop views from the root view, we remove each child using removeChildAt (which ultimately causes an invalidate and redraw). If this happens for a FlatViewGroup, this causes issues where the Views are all removed, but there are some DrawCommands (potentially DrawViews) that aren't removed, hence them going out of sync. Reviewed By: astreet Differential Revision: D3473916
32 lines
887 B
Java
32 lines
887 B
Java
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
package com.facebook.react.flat;
|
|
|
|
import com.facebook.react.uimanager.ThemedReactContext;
|
|
import com.facebook.react.uimanager.ViewGroupManager;
|
|
|
|
abstract class FlatViewManager extends ViewGroupManager<FlatViewGroup> {
|
|
|
|
@Override
|
|
protected FlatViewGroup createViewInstance(ThemedReactContext reactContext) {
|
|
return new FlatViewGroup(reactContext);
|
|
}
|
|
|
|
@Override
|
|
public void setBackgroundColor(FlatViewGroup view, int backgroundColor) {
|
|
// suppress
|
|
}
|
|
|
|
@Override
|
|
public void removeAllViews(FlatViewGroup parent) {
|
|
parent.removeAllViewsInLayout();
|
|
}
|
|
}
|