mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-05 16:04:38 +00:00
Merge remote-tracking branch 'philoinc/master'
This commit is contained in:
@@ -72,6 +72,12 @@ public class SvgView extends ViewGroup {
|
|||||||
SvgViewManager.setSvgView(this);
|
SvgViewManager.setSvgView(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDetachedFromWindow() {
|
||||||
|
super.onDetachedFromWindow();
|
||||||
|
SvgViewManager.dropSvgView(this);
|
||||||
|
}
|
||||||
|
|
||||||
public void setBitmap(Bitmap bitmap) {
|
public void setBitmap(Bitmap bitmap) {
|
||||||
if (mBitmap != null) {
|
if (mBitmap != null) {
|
||||||
mBitmap.recycle();
|
mBitmap.recycle();
|
||||||
|
|||||||
@@ -51,6 +51,12 @@ class SvgViewManager extends ViewGroupManager<SvgView> {
|
|||||||
mTagToSvgView.put(svg.getId(), svg);
|
mTagToSvgView.put(svg.getId(), svg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void dropSvgView(SvgView view) {
|
||||||
|
int tag = view.getId();
|
||||||
|
mTagToShadowNode.remove(tag);
|
||||||
|
mTagToSvgView.remove(tag);
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
static @Nullable SvgView getSvgViewByTag(int tag) {
|
static @Nullable SvgView getSvgViewByTag(int tag) {
|
||||||
return mTagToSvgView.get(tag);
|
return mTagToSvgView.get(tag);
|
||||||
@@ -77,13 +83,6 @@ class SvgViewManager extends ViewGroupManager<SvgView> {
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDropViewInstance(SvgView view) {
|
|
||||||
int tag = view.getId();
|
|
||||||
mTagToShadowNode.remove(tag);
|
|
||||||
mTagToSvgView.remove(tag);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SvgView createViewInstance(ThemedReactContext reactContext) {
|
protected SvgView createViewInstance(ThemedReactContext reactContext) {
|
||||||
return new SvgView(reactContext);
|
return new SvgView(reactContext);
|
||||||
|
|||||||
Reference in New Issue
Block a user