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

Commit

Permalink
[Android] Support to use loading-indicator separately. (#2249)
Browse files Browse the repository at this point in the history
* feature: Support to use loading-indicator separately. Use animating property to control.
* doc pr: apache/incubator-weex-site#363
  • Loading branch information
sunshl authored and YorkShen committed Apr 1, 2019
1 parent 58e96ee commit 857c463
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public interface Name {
String MAXLENGTH = "maxlength";
String ROWS = "rows";
String CHECKED = "checked";
String ANIMATING = "animating";
String VISIBILITY = "visibility";
String ITEM_COLOR = "itemColor";
String ITEM_SELECTED_COLOR = "itemSelectedColor";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ protected boolean setProperty(String key, Object param) {
if (color != null)
setColor(color);
return true;
case Constants.Name.ANIMATING:
Boolean result = WXUtils.getBoolean(param, null);
if (result != null) {
setAnimating(result);
}
return true;
}
return super.setProperty(key, param);
}
Expand All @@ -63,4 +69,13 @@ public void setColor(String color) {
getHostView().setColorSchemeColors(parseColor);
}
}

@WXComponentProp(name = Constants.Name.ANIMATING)
public void setAnimating(boolean animating) {
if (animating) {
getHostView().start();
} else {
getHostView().stop();
}
}
}

0 comments on commit 857c463

Please sign in to comment.