Skip to content

Commit 6c0e571

Browse files
committed
Client:优化注释,全中文;Query改为Request
1 parent f016130 commit 6c0e571

File tree

17 files changed

+87
-93
lines changed

17 files changed

+87
-93
lines changed

APIJSON(Android)/APIJSON(ADT)/APIJSONDemoApp/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
</intent-filter>
2929
</activity>
3030
<activity
31-
android:name="apijson.demo.ui.QueryActivity"
32-
android:label="@string/query" >
31+
android:name="apijson.demo.ui.RequestActivity"
32+
android:label="@string/request" >
3333
</activity>
3434
</application>
3535

APIJSON(Android)/APIJSON(ADT)/APIJSONDemoApp/gen/apijson/demo/R.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static final class drawable {
2020
public static final int ic_launcher=0x7f020000;
2121
}
2222
public static final class id {
23-
public static final int btnQueryQuery=0x7f070003;
23+
public static final int btnRequestRequest=0x7f070003;
2424
public static final int btnSelectAccessError=0x7f07000c;
2525
public static final int btnSelectAccessPermitted=0x7f07000d;
2626
public static final int btnSelectArray=0x7f07000a;
@@ -32,12 +32,12 @@ public static final class id {
3232
public static final int btnSelectRely=0x7f070009;
3333
public static final int btnSelectSingle=0x7f070007;
3434
public static final int btnSelectUpdateLog=0x7f07000e;
35-
public static final int etQueryUrl=0x7f070002;
36-
public static final int pbQuery=0x7f070001;
37-
public static final int tvQueryResult=0x7f070000;
35+
public static final int etRequestUrl=0x7f070002;
36+
public static final int pbRequest=0x7f070001;
37+
public static final int tvRequestResult=0x7f070000;
3838
}
3939
public static final class layout {
40-
public static final int query_activity=0x7f030000;
40+
public static final int request_activity=0x7f030000;
4141
public static final int select_activity=0x7f030001;
4242
}
4343
public static final class string {
@@ -55,10 +55,10 @@ public static final class string {
5555
public static final int get=0x7f050006;
5656
public static final int post=0x7f050003;
5757
public static final int put=0x7f050005;
58-
public static final int query=0x7f050002;
59-
public static final int query_error=0x7f050011;
6058
public static final int received_result=0x7f05000f;
6159
public static final int rely=0x7f050009;
60+
public static final int request=0x7f050002;
61+
public static final int request_error=0x7f050011;
6262
public static final int single=0x7f050007;
6363
public static final int update_log=0x7f05000e;
6464
}

APIJSON(Android)/APIJSON(ADT)/APIJSONDemoApp/res/layout/query_activity.xml renamed to APIJSON(Android)/APIJSON(ADT)/APIJSONDemoApp/res/layout/request_activity.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
android:orientation="vertical" >
1313

1414
<TextView
15-
android:id="@+id/tvQueryResult"
15+
android:id="@+id/tvRequestResult"
1616
style="@style/select_json"
1717
android:hint="result"
1818
android:padding="@dimen/activity_horizontal_margin"
@@ -27,12 +27,12 @@
2727
android:orientation="horizontal" >
2828

2929
<ProgressBar
30-
android:id="@+id/pbQuery"
30+
android:id="@+id/pbRequest"
3131
android:layout_width="wrap_content"
3232
android:layout_height="match_parent" />
3333

3434
<EditText
35-
android:id="@+id/etQueryUrl"
35+
android:id="@+id/etRequestUrl"
3636
style="@style/select_name"
3737
android:layout_height="match_parent"
3838
android:layout_gravity="bottom"
@@ -42,10 +42,10 @@
4242
android:text="uri" />
4343

4444
<Button
45-
android:id="@+id/btnQueryQuery"
45+
android:id="@+id/btnRequestRequest"
4646
android:layout_width="wrap_content"
4747
android:layout_height="match_parent"
48-
android:text="Query" />
48+
android:text="Request" />
4949
</LinearLayout>
5050

5151
</LinearLayout>

APIJSON(Android)/APIJSON(ADT)/APIJSONDemoApp/res/values-en/strings.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
33

4-
<string name="query">Query</string>
4+
<string name="request">Request</string>
55
<string name="post">POST</string>
66
<string name="delete">DELETE</string>
77
<string name="put">PUT</string>
@@ -16,7 +16,7 @@
1616
<string name="update_log">Update Log</string>
1717
<string name="received_result">received result!</string>
1818
<string name="browser_can_only_receive_get_response">Browsers can only receive GET responses</string>
19-
<string name="query_error">There may be something wrong,you can follow by the steps:\n\n1.Check your net connection\n\n2.Check the url whether it\'s an available ipv4 address\n\n3.Long click the [ %1$s ] button to open the request by web browser\n\n4.Check logs outputed on the target server\n\n5.Try again</string>
19+
<string name="request_error">There may be something wrong,you can follow by the steps:\n\n1.Check your net connection\n\n2.Check the url whether it\'s an available ipv4 address\n\n3.Long click the [ %1$s ] button to open the request by web browser\n\n4.Check logs outputed on the target server\n\n5.Try again</string>
2020
<string name="apijson_slogan">APIJSON,&#160;let&#160;interfaces&#160;go&#160;to&#160;hell!</string>
2121
<string name="apijson_info">APIJSON&#160;is&#160;a&#160;JSON&#160;Transmission&#160;Structure&#160;Protocol&#8230;</string>
2222
</resources>

APIJSON(Android)/APIJSON(ADT)/APIJSONDemoApp/res/values/strings.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<string name="app_name">APIJSON</string>
55
<string name="app_version">2.0</string>
6-
<string name="query">请求</string>
6+
<string name="request">请求</string>
77
<string name="post">增</string>
88
<string name="delete">删</string>
99
<string name="put">改</string>
@@ -18,7 +18,8 @@
1818
<string name="update_log">更新日志</string>
1919
<string name="received_result">已获得结果!</string>
2020
<string name="browser_can_only_receive_get_response">用浏览器只能获取GET结果</string>
21-
<string name="query_error">可能出现了一些问题,可以按照以下步骤解决:\n\n1.检查网络连接\n\n2.检查url是否为一个可用的IPV4地址\n\n3.长按[ %1$s ]按钮用浏览器发送请求\n\n4.查看目标服务器上的log\n\n5.再试一次</string>
21+
<string name="request_error">可能出现了一些问题,可以按照以下步骤解决:\n\n1.检查网络连接\n\n2.检查url是否为一个可用的IPV4地址\n\n3.长按[ %1$s ]按钮用浏览器发送请求\n\n4.查看目标服务器上的log\n\n5.再试一次</string>
2222
<string name="apijson_slogan">APIJSON,&#160;let&#160;interfaces&#160;go&#160;to&#160;hell!</string>
2323
<string name="apijson_info">APIJSON&#160;is&#160;a&#160;JSON&#160;Transmission&#160;Structure&#160;Protocol&#8230;</string>
24+
2425
</resources>

APIJSON(Android)/APIJSON(ADT)/APIJSONDemoApp/src/apijson/demo/RequestUtil.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
import apijson.demo.model.User;
2727
import apijson.demo.model.Wallet;
2828

29-
/**create request JSONObjects
29+
/**请求工具类
30+
* 设置encode参数只为方便展示,实际使用时并不需要
3031
* @author Lemon
3132
*/
3233
public class RequestUtil {
@@ -54,12 +55,12 @@ public static JSONObject newPostRequest(boolean encode) {
5455

5556
public static JSONObject newPutRequest(long id, boolean encode) {
5657
Moment data = new Moment(id <= 0 ? DEFAULT_MOMENT_ID : id);
57-
// data.setContent(context.getString(R.string.apijson_info));
58-
List<Long> list = new ArrayList<>();
59-
list.add((long) 10000);
60-
list.add((long) 10001);
58+
// data.setContent(context.getString(R.string.apijson_info));//一般可用这种方式,encode是为了展示方便
59+
List<Long> list = new ArrayList<>();
60+
list.add((long) 10000);
61+
list.add((long) 10001);
6162
JSONObject momentObject = new JSONObject(data, encode);
62-
momentObject.put("praiseUserIdList+", list, encode);//测试 +和- 通过
63+
momentObject.put("praiseUserIdList+", list, encode);//测试 +和- 通过
6364
momentObject.put("content", context.getString(R.string.apijson_info), encode);//测试 +和- 通过
6465
return new JSONRequest(Moment.class.getSimpleName(), momentObject, encode).setTag(Moment.class.getSimpleName());
6566
}

APIJSON(Android)/APIJSON(ADT)/APIJSONDemoApp/src/apijson/demo/StringUtil.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
import android.widget.TextView;
44

5-
5+
/**String工具类
6+
* @author Lemon
7+
*/
68
public class StringUtil extends zuo.biao.apijson.StringUtil {
79

810
public static String getString(TextView tv) {

APIJSON(Android)/APIJSON(ADT)/APIJSONDemoApp/src/apijson/demo/application/DemoApplication.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
/**Application
2222
* @author Lemon
23-
* @see #init
2423
*/
2524
public class DemoApplication extends Application {
2625
private static final String TAG = "DemoApplication";
@@ -34,23 +33,11 @@ public static Application getInstance() {
3433
@Override
3534
public void onCreate() {
3635
super.onCreate();
36+
instance = this;
3737
Log.d(TAG, "项目启动 >>>>>>>>>>>>>>>>>>>> \n\n");
3838

39-
init(this);
4039
}
4140

42-
/**初始化方法
43-
* @param application
44-
* @must 调用init方法且只能调用一次,如果extends BaseApplication会自动调用
45-
*/
46-
public static void init(Application application) {
47-
instance = application;
48-
if (instance == null) {
49-
Log.e(TAG, "\n\n\n\n\n !!!!!! 调用BaseApplication中的init方法,instance不能为null !!!" +
50-
"\n <<<<<< init instance == null !!! >>>>>>>> \n\n\n\n");
51-
}
52-
53-
}
5441

5542
/**获取应用名
5643
* @return

APIJSON(Android)/APIJSON(ADT)/APIJSONDemoApp/src/apijson/demo/application/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
limitations under the License.*/
1414

1515
/**
16-
* application package
16+
* application所在包
1717
*/
1818
/**
1919
* @author Lemon

APIJSON(Android)/APIJSON(ADT)/APIJSONDemoApp/src/apijson/demo/model/BaseModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import java.io.Serializable;
1818

19-
/**base model for reduce model codes
19+
/**基础model,继承它可减少部分代码
2020
* @author Lemon
2121
* @use extends BaseModel
2222
*/

0 commit comments

Comments
 (0)