Skip to content

Commit a1df621

Browse files
committed
Update README.md
1 parent 397014c commit a1df621

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-18
lines changed

README.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
附带生成二维码小工具,方便实用。体积小巧,无广告,无多余权限。
1717

1818
## 更新说明
19+
`v 2.0`
20+
* 全新UI,高仿“支付宝-我的快递”
21+
* 新增智能识别快递公司
22+
* 新增扫一扫
23+
1924
`v 1.5`
2025
* 新增自动更新
2126

@@ -34,41 +39,39 @@ fir.im:http://fir.im/ponyexpress<br>
3439
* 快递查询:[快递100](http://www.kuaidi100.com/)(自己抓包拿到的接口^_^)
3540

3641
### 开源技术
37-
* 条码扫描:[ZXing](https://github.com/zxing/zxing)
38-
* 网络请求:[Volley](https://developer.android.com/training/volley/index.html)
39-
* Json解析:[Gson](https://github.com/google/gson)
40-
* 数据存储:[ormlite](https://github.com/j256/ormlite-android)
42+
* [ZXing](https://github.com/zxing/zxing)
43+
* [Volley](https://developer.android.com/training/volley/index.html)
44+
* [Gson](https://github.com/google/gson)
45+
* [ormlite](https://github.com/j256/ormlite-android)
46+
* [Glide](https://github.com/bumptech/glide)
4147

4248
### 关键代码
4349
网络请求`Volley+Gson`
4450
```java
45-
private void query() {
46-
GsonRequest<QueryResult> request = new GsonRequest<QueryResult>(Utils.getQueryUrl(mExpressInfo),
47-
QueryResult.class, new Listener<QueryResult>() {
51+
private void search() {
52+
GsonRequest<SearchResult> request = new GsonRequest<SearchResult>(Utils.formatSearchUrl(mSearchInfo),
53+
SearchResult.class, new Response.Listener<SearchResult>() {
4854
@Override
49-
public void onResponse(QueryResult queryResult) {
50-
Log.i("Query", queryResult.getMessage());
51-
if (queryResult.getStatus().equals("200")) {
52-
onQuerySuccess(queryResult);
53-
} else {
54-
onQueryFailure(queryResult);
55-
}
55+
public void onResponse(SearchResult searchResult) {
56+
Log.i(TAG, searchResult.getMessage());
57+
onSearch(searchResult);
5658
}
57-
}, new ErrorListener() {
59+
}, new Response.ErrorListener() {
5860
@Override
5961
public void onErrorResponse(VolleyError volleyError) {
60-
Log.e("Query", volleyError.getMessage(), volleyError);
62+
Log.e(TAG, volleyError.getMessage(), volleyError);
63+
onError();
6164
}
6265
}) {
6366
@Override
6467
public Map<String, String> getHeaders() throws AuthFailureError {
6568
Map<String, String> headers = new HashMap<>();
66-
headers.put(Utils.HEADER_REFERER, Utils.REFERER);
69+
headers.put(Constants.HEADER_REFERER, Constants.REFERER);
6770
return headers;
6871
}
6972
};
7073
request.setShouldCache(false);
71-
mRequestQueue.add(request);
74+
ExpressApplication.getInstance().getRequestQueue().add(request);
7275
}
7376
```
7477
封装GsonRequest
@@ -113,6 +116,7 @@ public class GsonRequest<T> extends Request<T> {
113116
![](https://raw.githubusercontent.com/ChanWong21/PonyExpress/master/art/screenshot_02.jpg)
114117
![](https://raw.githubusercontent.com/ChanWong21/PonyExpress/master/art/screenshot_03.jpg)
115118
![](https://raw.githubusercontent.com/ChanWong21/PonyExpress/master/art/screenshot_04.jpg)
119+
![](https://raw.githubusercontent.com/ChanWong21/PonyExpress/master/art/screenshot_05.jpg)
116120

117121
## 关于作者
118122
简书:http://www.jianshu.com/users/3231579893ac<br>

art/screenshot_01.jpg

3.84 KB
Loading

art/screenshot_02.jpg

12.9 KB
Loading

art/screenshot_03.jpg

-16.5 KB
Loading

art/screenshot_04.jpg

-1.78 KB
Loading

art/screenshot_05.jpg

41.2 KB
Loading

0 commit comments

Comments
 (0)