Skip to content

Commit

Permalink
* [android] bug fix remove fixed node
Browse files Browse the repository at this point in the history
  • Loading branch information
zshshr committed May 30, 2016
1 parent cdcede9 commit f867bd1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,11 @@ public void remove(WXComponent child, boolean destroy){
}

mChildren.remove(child);
if (getRealView() != null) {
if(mInstance!=null
&&mInstance.getRootView()!=null
&& child.mDomObj.isFixed()){
mInstance.getRootView().removeView(child.getView());
}else if(getRealView() != null) {
getRealView().removeView(child.getView());
}
if(destroy) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@ public void remove(WXComponent child) {

@Override
public void remove(WXComponent child, boolean destroy) {
super.remove(child, destroy);
int index = mChildren.indexOf(child);
if(destroy) {
child.detachViewAndClearPreInfo();
}
super.remove(child, destroy);
getView().getAdapter().notifyItemRemoved(index);
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.d(TAG, "removeChild child at " + index);
Expand Down

0 comments on commit f867bd1

Please sign in to comment.