|
|
|
@ -64,32 +64,33 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|
|
|
|
LoginActivity loginActivity = (LoginActivity) weakReference.get();
|
|
|
|
|
Bundle bundle = msg.getData();
|
|
|
|
|
ReturnData messageJSON = (ReturnData) bundle.getSerializable("msg");
|
|
|
|
|
Log.i("msg",messageJSON+"");
|
|
|
|
|
if(messageJSON.getCode() == ConditionCode.loginsucess) {
|
|
|
|
|
weakReference.get().mName.setVisibility(View.INVISIBLE);
|
|
|
|
|
weakReference.get().mPsw.setVisibility(View.INVISIBLE);
|
|
|
|
|
int mWidth = weakReference.get().mBtnLogin.getMeasuredWidth();
|
|
|
|
|
int mHeight =weakReference.get().mBtnLogin.getMeasuredHeight();
|
|
|
|
|
|
|
|
|
|
weakReference.get().inputAnimator(weakReference.get().mInputLayout, mWidth, mHeight);
|
|
|
|
|
// weakReference.get().mName.setVisibility(View.INVISIBLE);
|
|
|
|
|
// weakReference.get().mPsw.setVisibility(View.INVISIBLE);
|
|
|
|
|
// int mWidth = weakReference.get().mBtnLogin.getMeasuredWidth();
|
|
|
|
|
// int mHeight =weakReference.get().mBtnLogin.getMeasuredHeight();
|
|
|
|
|
//
|
|
|
|
|
// weakReference.get().inputAnimator(weakReference.get().mInputLayout, mWidth, mHeight);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String ReturnUsername = (String) messageJSON.getData();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ToolTip.FadeCenter(weakReference.get(),"登陆成功");
|
|
|
|
|
|
|
|
|
|
User.setLogin(true);
|
|
|
|
|
User.getUser().setUsername(ReturnUsername);
|
|
|
|
|
try {
|
|
|
|
|
Thread.sleep(500);
|
|
|
|
|
loginActivity.finish();
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
Log.i("fjldsk==","fasf++++");
|
|
|
|
|
|
|
|
|
|
// 这里要让那个输入输出框还原
|
|
|
|
|
// weakReference.get().animatorSet.cancel();
|
|
|
|
|
|
|
|
|
|
// weakReference.get().recovery();
|
|
|
|
|
weakReference.get().recovery();//执行复原动作
|
|
|
|
|
ToolTip.FadeCenter(weakReference.get(),messageJSON.getMsg());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -158,15 +159,28 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|
|
|
|
ToolTip.FlyTocenter(this,"请输入正确手机号码");
|
|
|
|
|
}else {
|
|
|
|
|
// 基本没错误,就要请求登陆了
|
|
|
|
|
mName.setVisibility(View.INVISIBLE);
|
|
|
|
|
mPsw.setVisibility(View.INVISIBLE);
|
|
|
|
|
int mWidth = mBtnLogin.getMeasuredWidth();
|
|
|
|
|
int mHeight =mBtnLogin.getMeasuredHeight();
|
|
|
|
|
|
|
|
|
|
animatorSet = inputAnimator(mInputLayout, mWidth, mHeight);
|
|
|
|
|
|
|
|
|
|
new Thread(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
String argslogin = "phonenumber="+phonenumber+"&password="+password;
|
|
|
|
|
ReturnData retuData = cmkgWebServiceGet.executeHttpGet(argslogin, publicStringUtil.loginURL);
|
|
|
|
|
try {
|
|
|
|
|
Thread.sleep(2000);
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
Log.i("returndat--", "-----" + retuData);
|
|
|
|
|
Message m = new Message();
|
|
|
|
|
Bundle b = new Bundle();
|
|
|
|
|
b.putSerializable("msg",retuData);
|
|
|
|
|
|
|
|
|
|
m.setData(b);
|
|
|
|
|
loginHandler.sendMessage(m);
|
|
|
|
|
}
|
|
|
|
@ -212,10 +226,11 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|
|
|
|
|
|
|
|
|
ObjectAnimator animator2 = ObjectAnimator.ofFloat(mInputLayout,
|
|
|
|
|
"scaleX", 1f, 0.5f);
|
|
|
|
|
|
|
|
|
|
set.setDuration(500);
|
|
|
|
|
set.setInterpolator(new AccelerateDecelerateInterpolator());
|
|
|
|
|
set.playTogether(animator,animator2);
|
|
|
|
|
set.start();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set.addListener(new Animator.AnimatorListener() {
|
|
|
|
|
|
|
|
|
@ -231,22 +246,27 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onAnimationEnd(Animator animation) {
|
|
|
|
|
/**
|
|
|
|
|
* 动画结束后,先显示加载的动画,然后再隐藏输入框
|
|
|
|
|
*/
|
|
|
|
|
Log.i("hkfd","End方法调用了");
|
|
|
|
|
progress.setVisibility(View.VISIBLE);
|
|
|
|
|
// progress.setVisibility(View.GONE);
|
|
|
|
|
// progressAnimator(progress);
|
|
|
|
|
progressAnimator(progress);
|
|
|
|
|
mInputLayout.setVisibility(View.INVISIBLE);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 动画结束后,先显示加载的动画,然后再隐藏输入框
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onAnimationCancel(Animator animation) {
|
|
|
|
|
Log.i("jie","=====Cancle方法");
|
|
|
|
|
progress.setVisibility(View.GONE);
|
|
|
|
|
recovery();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
set.start();
|
|
|
|
|
return set;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -257,7 +277,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|
|
|
|
0.5f, 1f);
|
|
|
|
|
ObjectAnimator animator3 = ObjectAnimator.ofPropertyValuesHolder(view,
|
|
|
|
|
animator, animator2);
|
|
|
|
|
animator3.setDuration(1000);
|
|
|
|
|
animator3.setDuration(500);
|
|
|
|
|
animator3.setInterpolator(new JellyInterpolator());
|
|
|
|
|
animator3.start();
|
|
|
|
|
// animator3.cancel();
|
|
|
|
@ -265,7 +285,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|
|
|
|
}
|
|
|
|
|
//登录错误,恢复初始状态
|
|
|
|
|
private void recovery() {
|
|
|
|
|
progress.setVisibility(View.GONE);
|
|
|
|
|
progress.setVisibility(View.INVISIBLE);
|
|
|
|
|
mInputLayout.setVisibility(View.VISIBLE);
|
|
|
|
|
mName.setVisibility(View.VISIBLE);
|
|
|
|
|
mPsw.setVisibility(View.VISIBLE);
|
|
|
|
@ -277,7 +297,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ObjectAnimator animator2 = ObjectAnimator.ofFloat(mInputLayout, "scaleX", 0.5f,1f );
|
|
|
|
|
animator2.setDuration(500);
|
|
|
|
|
animator2.setDuration(1000);
|
|
|
|
|
animator2.setInterpolator(new AccelerateDecelerateInterpolator());
|
|
|
|
|
animator2.start();
|
|
|
|
|
}
|
|
|
|
|