Skip to content

Commit

Permalink
fix: 优化代码格式
Browse files Browse the repository at this point in the history
  • Loading branch information
a2633063 committed Dec 13, 2020
1 parent 7d10e4e commit 1abd614
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Binary file modified app/release/app-release.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void onRefresh() {
});
//endregion

edt_string=view.findViewById(R.id.edt_string);
edt_string = view.findViewById(R.id.edt_string);
btn_string = view.findViewById(R.id.btn_string);
btn_string.setOnClickListener(new View.OnClickListener() {
@Override
Expand All @@ -173,17 +173,15 @@ public void onClick(View v) {
str = str.replace("\r\n", "\n").replace("\n", " ");
if (str.length() > 0 && str.length() < 500) {
//json中 需要替换符号: " => \" \ => \\
str= str.replace("\\","\\\\").replace("\"","\\\"");
str = str.replace("\\", "\\\\").replace("\"", "\\\"");
Send("{\"mac\":\"" + device.getMac() + "\",\"string\":\"" + str + "\"}");
Log("发送滚动字符串");
} else if (str.length() < 1) {
Log("未输入有效的滚动字符串");
// Toast.makeText(getContext(), "发送文本为空", Toast.LENGTH_SHORT).show();
}else {
} else {
Log("滚动字符串长度过长");
// Toast.makeText(getContext(), "滚动字符串长度过长", Toast.LENGTH_SHORT).show();
}
}
}
});

//region log 相关
Expand Down

0 comments on commit 1abd614

Please sign in to comment.