Skip to content

Commit

Permalink
修改
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyuan0217 committed May 20, 2017
1 parent a1d9004 commit 3768607
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies {
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.tencent.bugly:crashreport:latest.release'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha6'
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.4'
compile 'com.android.support:recyclerview-v7:25.1.1'
testCompile 'junit:junit:4.12'
Expand Down
22 changes: 12 additions & 10 deletions app/src/main/java/com/libo/testwechat/AutoReplyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ public void onAccessibilityEvent(final AccessibilityEvent event) {
&& text.toString().contains("期")
&& text.toString().contains("----")) {
//提交开奖结果
end(text.toString());
hasAction = true;
count++;
if (count == 2)
openWechatByNotification(event);
end(text.toString());

} else if (text.toString().contains("在线")
&& text.toString().contains("总分")
Expand Down Expand Up @@ -244,10 +244,9 @@ public String findLastChatMessage() {
for (int i = list.size() - 1; i > -1; i--) {
AccessibilityNodeInfo lastNode = list.get(i);
String str = lastNode.getText().toString();
if (str.contains("总分")
&& str.contains("在线")
&& str.contains("欢迎你")) {
return str;
if (str.contains("总分") && str.contains("在线") && str.contains("欢迎你")) {
returnStr = str;
break;
}
}
}
Expand Down Expand Up @@ -296,7 +295,10 @@ public void postBill(String billName) {
}
String lastMessage = findLastChatMessage();
System.out.println("======lastMsg====" + lastMessage);
if (TextUtils.isEmpty(lastMessage)) return;
if (TextUtils.isEmpty(lastMessage)) {
back2MeRightNow();
return;
}
final String bill = Utils.findBill(billName, lastMessage);
System.out.println("=======bill====" + bill);
Apis.getInstance().postBill(uid, bill, new MyCallback() {
Expand Down Expand Up @@ -361,16 +363,16 @@ public void end(String msg) {
Apis.getInstance().end(uid, phase, last, new MyCallback() {
@Override
public void responeData(String body, JSONObject json) {
hasAction = false;
back2Me();
// hasAction = false;
// back2Me();
}

@Override
public void responeDataFail(int responseStatus, String errMsg) {
hasAction = false;
// hasAction = false;
if (responseStatus == 400) {
}
back2Me();
// back2Me();
}
});
}
Expand Down

0 comments on commit 3768607

Please sign in to comment.