Skip to content

Commit b0e79a7

Browse files
author
ablecao
committed
add ActionType.java
1 parent 7e2dbe4 commit b0e79a7

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.tencent.xinge.bean;
2+
3+
import com.fasterxml.jackson.annotation.JsonValue;
4+
5+
public enum ActionType {
6+
7+
OPEN_APP(0, "默认打开app"),
8+
OPEN_ACTIVITY_BY_CLASS_NAME(1, "显式通过类名打开activity或app本身"),
9+
OPEN_WEB(2, "打开浏览器"),
10+
OPEN_INTENT(3, "打开Intent"),
11+
OPEN_APP_BY_APK_NAME(4,"通过包名打开应用"),
12+
OPEN_ACTIVITY_BY_ACTION(5, "隐式通过action打开activity"), //SDK 4.1 以上支持
13+
OPEN_RECEIVER_BY_ACTION(6, "发送一个action广播"), //SDK 4.1 以上支持
14+
;
15+
16+
ActionType(int type, String name) {
17+
this.type = type;
18+
this.name = name;
19+
}
20+
21+
@JsonValue
22+
public int getType() {
23+
return type;
24+
}
25+
26+
public String getName() {
27+
return name;
28+
}
29+
30+
private int type;
31+
32+
private String name;
33+
34+
}

src/main/java/com/tencent/xinge/bean/ClickAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ public class ClickAction {
1414

1515
@JsonProperty(value = "action_type", required = true, defaultValue = "1")
1616
@ApiModelProperty(notes = "动作类型,1,打开activity或app本身;2,打开浏览器;3,打开Intent")
17-
private int action_type = 1;
17+
private int action_type = ActionType.OPEN_ACTIVITY_OR_APP.getType();
1818

1919
@JsonProperty(value = "activity", required = true, defaultValue = "")
20+
@ApiModelProperty(notes = "MyActivityClassName")
2021
private String activity = "";
2122

2223
@JsonProperty(value = "browser", required = true)

0 commit comments

Comments
 (0)