Github user Rowandjj commented on a diff in the pull request:
https://github.com/apache/incubator-weex/pull/416#discussion_r120097125
--- Diff:
android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXListComponent.java
---
@@ -237,4 +360,68 @@ private void removeFooterOrHeader(WXComponent child) {
getHostView().removeHeaderView(child);
}
}
+
+ @Nullable
+ private WXComponent findComponentByAnchorName(@NonNull WXComponent root,
@NonNull String anchorName) {
+ long start = 0;
+ if (WXEnvironment.isApkDebugable()) {
+ start = System.currentTimeMillis();
+ }
+
+ Deque<WXComponent> deque = new ArrayDeque<>();
+ deque.add(root);
+ while (!deque.isEmpty()) {
+ WXComponent curComponent = deque.removeFirst();
+ ImmutableDomObject object = curComponent.getDomObject();
+ if (object != null) {
+ String isAnchorSet =
WXUtils.getString(object.getAttrs().get(anchorName), null);
+
+ //hit
+ if (isAnchorSet != null && isAnchorSet.equals("true")) {
+ if (WXEnvironment.isApkDebugable()) {
+ WXLogUtils.d("dragPerf", "findComponentByAnchorName time: " +
(System.currentTimeMillis() - start) + "ms");
+ }
+ return curComponent;
+ }
+ }
+ if (curComponent instanceof WXVContainer) {
+ WXVContainer container = (WXVContainer) curComponent;
+ for (int i = 0, len = container.childCount(); i < len; i++) {
+ WXComponent child = container.getChild(i);
+ deque.add(child);
+ }
+ }
+ }
+
+ if (WXEnvironment.isApkDebugable()) {
+ WXLogUtils.d("dragPerf", "findComponentByAnchorName elapsed time: "
+ (System.currentTimeMillis() - start) + "ms");
+ }
+ return null;
+
+ }
+
+ private String getTriggerType(@Nullable ImmutableDomObject domObject) {
+ String triggerType = DEFAULT_TRIGGER_TYPE;
+ if (domObject == null) {
+ return triggerType;
+ }
+ triggerType =
WXUtils.getString(domObject.getAttrs().get(DRAG_TRIGGER_TYPE),
DEFAULT_TRIGGER_TYPE);
+ if (!DragTriggerType.LONG_PRESS.equals(triggerType) &&
!DragTriggerType.PAN.equals(triggerType)) {
+ triggerType = DEFAULT_TRIGGER_TYPE;
+ }
+
+ if (WXEnvironment.isApkDebugable()) {
+ WXLogUtils.d(TAG, "trigger type is " + triggerType);
+ }
+
+ return triggerType;
+ }
+
+ private boolean getExcluded(@Nullable ImmutableDomObject domObject) {
--- End diff --
okay
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---