Skip to content

Commit

Permalink
优化执行效率的改进
Browse files Browse the repository at this point in the history
  • Loading branch information
kymjs committed Sep 16, 2015
1 parent 6a42b71 commit c4196bc
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 18 deletions.
40 changes: 26 additions & 14 deletions KJFrame/app/src/main/java/org/kymjs/blog/ui/Login.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@

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

Expand Down Expand Up @@ -104,14 +104,17 @@ private void initEtUser() {
mEtUid.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {}
int count) {
}

@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {}
int after) {
}

@Override
public void afterTextChanged(Editable s) {}
public void afterTextChanged(Editable s) {
}
});
}

Expand Down Expand Up @@ -140,20 +143,21 @@ private void screenAdapter() {
.getLayoutParams();
logoParams.width = (int) (DensityUtils.getScreenW(aty) * 0.4);
logoParams.height = (int) (logoParams.width / 2.3);
logoParams.topMargin = (DensityUtils.getScreenH(aty) - layoutH - headH - logoParams.height) / 4;
logoParams.topMargin = (DensityUtils.getScreenH(aty) - layoutH - headH - logoParams
.height) / 4;
mImgLogo.setLayoutParams(logoParams);
}

@Override
public void widgetClick(View v) {
super.widgetClick(v);
switch (v.getId()) {
case R.id.login_btn_login:
doLogin();
break;
case R.id.login_img_delete:
mEtUid.setText(null);
break;
case R.id.login_btn_login:
doLogin();
break;
case R.id.login_img_delete:
mEtUid.setText(null);
break;
}
}

Expand Down Expand Up @@ -184,6 +188,12 @@ private void doLogin() {
params.put("pwd", mEtPwd.getText().toString());
kjh.post("http://www.oschina.net/action/api/login_validate", params,
new HttpCallBack() {
@Override
public void onFailure(int errorNo, String strMsg) {
super.onFailure(errorNo, strMsg);
ViewInject.toast("网络不好" + strMsg);
}

@Override
public void onSuccess(
java.util.Map<String, String> headers, byte[] t) {
Expand Down Expand Up @@ -214,7 +224,9 @@ public void onSuccess(
mEtUid.setText(null);
}
}
};
}

;
});
}
}
2 changes: 1 addition & 1 deletion KJFrame/kjframe/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'

version = "2.4.6.1"
version = "2.4.6.2"

android {
compileSdkVersion 22
Expand Down
2 changes: 1 addition & 1 deletion KJFrame/kjframe/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.kymjs.kjframe"
android:versionCode="224"
android:versionName="2.2461" >
android:versionName="2.2462" >

<uses-sdk
android:minSdkVersion="11"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public String getCacheKey() {

@Override
public String getBodyContentType() {
return mParams.getContentType().getValue();
if (mParams.getContentType() != null) {
return mParams.getContentType().getValue();
} else {
return super.getBodyContentType();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
public final class KJConfig {

public static final double VERSION = 2.2461;
public static final double VERSION = 2.2462;

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

0 comments on commit c4196bc

Please sign in to comment.