Skip to content

Commit

Permalink
[Android] fix update styles bug when only border change
Browse files Browse the repository at this point in the history
  • Loading branch information
yxping committed Nov 29, 2018
1 parent dda2359 commit 941b9ab
Showing 1 changed file with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class GraphicActionUpdateStyle extends BasicGraphicAction {
private Map<String, Object> mStyle;
private WXComponent component;
private boolean mIsCausedByPesudo;
private boolean mIsBorderSet;

public GraphicActionUpdateStyle(WXSDKInstance instance, String ref,
Map<String, Object> style,
Expand Down Expand Up @@ -77,6 +78,7 @@ public GraphicActionUpdateStyle(WXSDKInstance instance, String ref,
}

if (null != borders) {
mIsBorderSet = true;
component.setBorders(borders);
}
}
Expand Down Expand Up @@ -114,23 +116,26 @@ public GraphicActionUpdateStyle(WXSDKInstance instance, String ref,
}

if (null != borders) {
mIsBorderSet = true;
component.addShorthand(borders);
}
}

@Override
public void executeAction() {
if (component == null || mStyle == null) {
return;
}
if(component.getTransition() != null){
component.getTransition().updateTranstionParams(mStyle);
if(component.getTransition().hasTransitionProperty(mStyle)){
component.getTransition().startTransition(mStyle);
if (component == null) return;
if (mStyle != null) {
if(component.getTransition() != null){
component.getTransition().updateTranstionParams(mStyle);
if(component.getTransition().hasTransitionProperty(mStyle)){
component.getTransition().startTransition(mStyle);
}
} else {
component.setTransition(WXTransition.fromMap(mStyle, component));
component.updateStyles(mStyle);
}
} else {
component.setTransition(WXTransition.fromMap(mStyle, component));
component.updateStyles(mStyle);
} else if (mIsBorderSet) {
component.updateStyles(component);
}
}
}
Expand Down

0 comments on commit 941b9ab

Please sign in to comment.