Skip to content

Commit c4196bc

Browse files
committed
优化执行效率的改进
1 parent 6a42b71 commit c4196bc

File tree

5 files changed

+34
-18
lines changed

5 files changed

+34
-18
lines changed

KJFrame/app/src/main/java/org/kymjs/blog/ui/Login.java

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343

4444
/**
4545
* 新用户登陆界面
46-
*
46+
*
47+
* @author kymjs (http://www.kymjs.com/)
4748
* @点击登陆 传递账号、密码、IMEI;
48-
* @第三方登陆 传递ID,token,IMEI,若返回201,表示未登陆过,跳转到注册界面
49+
* @第三方登陆 传递ID, token,IMEI,若返回201,表示未登陆过,跳转到注册界面
4950
* @注册 跳转到注册页面
50-
* @author kymjs (http://www.kymjs.com/)
5151
*/
5252
public class Login extends KJActivity {
5353

@@ -104,14 +104,17 @@ private void initEtUser() {
104104
mEtUid.addTextChangedListener(new TextWatcher() {
105105
@Override
106106
public void onTextChanged(CharSequence s, int start, int before,
107-
int count) {}
107+
int count) {
108+
}
108109

109110
@Override
110111
public void beforeTextChanged(CharSequence s, int start, int count,
111-
int after) {}
112+
int after) {
113+
}
112114

113115
@Override
114-
public void afterTextChanged(Editable s) {}
116+
public void afterTextChanged(Editable s) {
117+
}
115118
});
116119
}
117120

@@ -140,20 +143,21 @@ private void screenAdapter() {
140143
.getLayoutParams();
141144
logoParams.width = (int) (DensityUtils.getScreenW(aty) * 0.4);
142145
logoParams.height = (int) (logoParams.width / 2.3);
143-
logoParams.topMargin = (DensityUtils.getScreenH(aty) - layoutH - headH - logoParams.height) / 4;
146+
logoParams.topMargin = (DensityUtils.getScreenH(aty) - layoutH - headH - logoParams
147+
.height) / 4;
144148
mImgLogo.setLayoutParams(logoParams);
145149
}
146150

147151
@Override
148152
public void widgetClick(View v) {
149153
super.widgetClick(v);
150154
switch (v.getId()) {
151-
case R.id.login_btn_login:
152-
doLogin();
153-
break;
154-
case R.id.login_img_delete:
155-
mEtUid.setText(null);
156-
break;
155+
case R.id.login_btn_login:
156+
doLogin();
157+
break;
158+
case R.id.login_img_delete:
159+
mEtUid.setText(null);
160+
break;
157161
}
158162
}
159163

@@ -184,6 +188,12 @@ private void doLogin() {
184188
params.put("pwd", mEtPwd.getText().toString());
185189
kjh.post("http://www.oschina.net/action/api/login_validate", params,
186190
new HttpCallBack() {
191+
@Override
192+
public void onFailure(int errorNo, String strMsg) {
193+
super.onFailure(errorNo, strMsg);
194+
ViewInject.toast("网络不好" + strMsg);
195+
}
196+
187197
@Override
188198
public void onSuccess(
189199
java.util.Map<String, String> headers, byte[] t) {
@@ -214,7 +224,9 @@ public void onSuccess(
214224
mEtUid.setText(null);
215225
}
216226
}
217-
};
227+
}
228+
229+
;
218230
});
219231
}
220232
}

KJFrame/kjframe/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
22
apply plugin: 'com.jfrog.bintray'
33
apply plugin: 'com.github.dcendents.android-maven'
44

5-
version = "2.4.6.1"
5+
version = "2.4.6.2"
66

77
android {
88
compileSdkVersion 22

KJFrame/kjframe/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="org.kymjs.kjframe"
33
android:versionCode="224"
4-
android:versionName="2.2461" >
4+
android:versionName="2.2462" >
55

66
<uses-sdk
77
android:minSdkVersion="11"

KJFrame/kjframe/src/main/java/org/kymjs/kjframe/http/FormRequest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ public String getCacheKey() {
5454

5555
@Override
5656
public String getBodyContentType() {
57-
return mParams.getContentType().getValue();
57+
if (mParams.getContentType() != null) {
58+
return mParams.getContentType().getValue();
59+
} else {
60+
return super.getBodyContentType();
61+
}
5862
}
5963

6064
@Override

KJFrame/kjframe/src/main/java/org/kymjs/kjframe/utils/KJConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
public final class KJConfig {
2323

24-
public static final double VERSION = 2.2461;
24+
public static final double VERSION = 2.2462;
2525

2626
/** 错误处理广播 */
2727
public static final String RECEIVER_ERROR = KJConfig.class.getName()

0 commit comments

Comments
 (0)