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

[WEEX-228][android] ShouldStopPropagation Use ShortName StopPropagation #1042

Merged
merged 2 commits into from
Mar 1, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ interface SLOT_LIFECYCLE{
}


String SHOULD_STOP_PROPAGATION = "shouldStopPropagation";
String STOP_PROPAGATION = "stopPropagation";



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ private boolean needGestureDetector(String type) {
}
}
}
if(Constants.Event.SHOULD_STOP_PROPAGATION.equals(type)){
if(Constants.Event.STOP_PROPAGATION.equals(type)){
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import java.util.List;
import java.util.Map;

import static com.taobao.weex.common.Constants.Event.SHOULD_STOP_PROPAGATION;
import static com.taobao.weex.common.Constants.Event.STOP_PROPAGATION;

public class WXGesture extends GestureDetector.SimpleOnGestureListener implements OnTouchListener {

Expand Down Expand Up @@ -130,7 +130,7 @@ public boolean isTouchEventConsumedByAdvancedGesture(){
* shouldBubbleEvent default true
* */
private boolean shouldBubbleTouchEvent(MotionEvent event){
if(component.containsEvent(SHOULD_STOP_PROPAGATION)){
if(component.containsEvent(STOP_PROPAGATION)){
if(shouldBubbleInterval > 0 && shouldBubbleCallRemainTimes > 0){
shouldBubbleCallRemainTimes--;
return shouldBubbleResult;
Expand All @@ -145,9 +145,10 @@ private boolean shouldBubbleTouchEvent(MotionEvent event){
}else{
eventMap.put("action", MOVE);
}
EventResult result = component.fireEventWait(SHOULD_STOP_PROPAGATION, eventMap);
EventResult result = component.fireEventWait(STOP_PROPAGATION, eventMap);
if(result.isSuccess() && result.getResult() != null){
shouldBubbleResult = WXUtils.getBoolean(result.getResult(), shouldBubbleResult);
boolean stopPropagation = WXUtils.getBoolean(result.getResult(), !shouldBubbleResult);
shouldBubbleResult = !stopPropagation;
}
shouldBubbleCallRemainTimes = shouldBubbleInterval;
return shouldBubbleResult;
Expand Down Expand Up @@ -194,7 +195,7 @@ public boolean onTouch(View v, MotionEvent event) {
result |= handlePanMotionEvent(event);
break;
}
if(component.containsEvent(SHOULD_STOP_PROPAGATION)){
if(component.containsEvent(STOP_PROPAGATION)){
ViewGroup parent = (ViewGroup) v.getParent();
boolean requestDisallowInterceptTouchEvent = false;
if(parent != null){
Expand Down