Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
* [Android] Fix that moveElement doesn't work when parent is not a list
Browse files Browse the repository at this point in the history
  • Loading branch information
YorkShen committed Oct 18, 2017
1 parent db5b1e0 commit e264c25
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,8 @@ public void executeRender(RenderActionContext context) {
WXVContainer oldParent = component.getParent();
oldParent.remove(component,false);
((WXVContainer) newParent).addChild(component, mNewIndex);
if(!component.isVirtualComponent()){
((WXVContainer) newParent).addSubView(component.getHostView(), mNewIndex);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private boolean shouldReport(int x, int y) {
* Intercept refresh view and loading view
*/
@Override
protected void addSubView(View child, int index) {
public void addSubView(View child, int index) {
if (child == null || getRealView() == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public ViewGroup getRealView() {
}

@Override
protected void addSubView(View view, int index) {
public void addSubView(View view, int index) {
if (view == null || mAdapter == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ ZoomTransformer createTransformer() {
}

@Override
protected void addSubView(View view, final int index) {
public void addSubView(View view, final int index) {
if (view == null || mAdapter == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
package com.taobao.weex.ui.component;

import android.content.Intent;
import android.support.annotation.RestrictTo;
import android.support.annotation.RestrictTo.Scope;
import android.util.Pair;
import android.support.annotation.Nullable;
import android.view.Menu;
Expand Down Expand Up @@ -303,7 +305,8 @@ protected Pair<WXComponent, Integer> rearrangeIndexAndGetChild(int index){
}
}

protected void addSubView(View child, int index) {
@RestrictTo(Scope.LIBRARY)
public void addSubView(View child, int index) {
if (child == null || getRealView() == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ private void relocateAppearanceHelper() {
* com.taobao.weex.ui.view.listview.WXRecyclerView}
*/
@Override
protected void addSubView(View child, int index) {
public void addSubView(View child, int index) {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ && getDomObject() instanceof WXRecyclerDomObject){
* com.taobao.weex.ui.view.listview.WXRecyclerView}
*/
@Override
protected void addSubView(View child, int index) {
public void addSubView(View child, int index) {

}

Expand Down

0 comments on commit e264c25

Please sign in to comment.