作者 zhangtao

bug修改

... ... @@ -3,7 +3,7 @@ package com.hh.xuetubao.activity.login;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.util.Log;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
... ... @@ -52,6 +52,12 @@ public class LoginActivity extends BaseMvpActivity<CommonPresenter, AccountModel
tvYanzheng.setOnClickListener(this);
imgWechat.setOnClickListener(this);
imgJigou.setOnClickListener(this);
String accountOid = SharedPrefrenceUtils.getString(this, "AccountOid");
if (!TextUtils.isEmpty(accountOid)) {
startActivity(new Intent(this, MainActivity.class));
this.finish();
}
}
@Override
... ... @@ -80,24 +86,24 @@ public class LoginActivity extends BaseMvpActivity<CommonPresenter, AccountModel
UserBean bean = (UserBean) o;
if (bean.getSuccess()) {
Toast.makeText(this, "验证码发送成功", Toast.LENGTH_LONG).show();
time = 60;
timer = new CountDownTimer(60000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
time--;
try {
tvYanzheng.setText(String.valueOf(time) + "s");
tvYanzheng.setFocusable(false);
} catch (Exception e) {
Log.e("zhangtao", e.toString());
}
tvYanzheng.setText(String.valueOf(time) + "s");
tvYanzheng.setFocusable(false);
tvYanzheng.setFocusableInTouchMode(false);
tvYanzheng.setClickable(false);
}
@Override
public void onFinish() {
tvYanzheng.setText("获取验证码");
tvYanzheng.setFocusable(true);
time = 60;
tvYanzheng.setFocusableInTouchMode(true);
tvYanzheng.setClickable(true);
}
}.start();
} else {
... ... @@ -113,7 +119,7 @@ public class LoginActivity extends BaseMvpActivity<CommonPresenter, AccountModel
startActivity(new Intent(this, MainActivity.class));
this.finish();
} else {
Toast.makeText(this, "登录失败", Toast.LENGTH_LONG).show();
Toast.makeText(this, bean.getErrorMsg(), Toast.LENGTH_LONG).show();
}
}
... ... @@ -140,10 +146,13 @@ public class LoginActivity extends BaseMvpActivity<CommonPresenter, AccountModel
public void onClick(View v) {
switch (v.getId()) {
case R.id.login:
mPresenter.getPresenter(1, 2, edPhone.getText().toString(), edCode.getText().toString());
if (isCellphone(edPhone.getText().toString()) && !TextUtils.isEmpty(edPhone.getText().toString()))
mPresenter.getPresenter(1, 2, edPhone.getText().toString(), edCode.getText().toString());
else
Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_LONG).show();
break;
case R.id.tv_yanzheng:
if (isCellphone(edPhone.getText().toString()))
if (isCellphone(edPhone.getText().toString()) && !TextUtils.isEmpty(edPhone.getText().toString()))
mPresenter.getPresenter(1, 1, edPhone.getText().toString(), String.valueOf(0));
else
Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_LONG).show();
... ...
... ... @@ -5,6 +5,7 @@ import java.util.List;
public class UserBean implements Serializable {
private Boolean IsSuccess;
private String ErrorMsg;
private String AccountOid;
private String ImgUrl;
private String UserName;
... ... @@ -26,6 +27,14 @@ public class UserBean implements Serializable {
private List<String> Categories;
private List<String> Datas;
public String getErrorMsg() {
return ErrorMsg;
}
public void setErrorMsg(String errorMsg) {
ErrorMsg = errorMsg;
}
public List<String> getCategories() {
return Categories;
}
... ...
... ... @@ -16,6 +16,7 @@ import android.widget.TextView;
import com.hh.xuetubao.R;
import com.hh.xuetubao.activity.pratice.PracticeActivity;
import com.hh.xuetubao.activity.study.CourseDetailActivity;
import com.hh.xuetubao.activity.study.StudyActivity;
import com.hh.xuetubao.activity.work.CompanyActivity;
import com.hh.xuetubao.activity.work.CompanyDetailActivity;
import com.hh.xuetubao.adapter.GridHomeHotAdapter;
... ... @@ -196,10 +197,11 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
public void onClick(View v) {
switch (v.getId()) {
case R.id.tv_more_ke:
CourseFragment fragment = new CourseFragment();
/* CourseFragment fragment = new CourseFragment();
FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.frame, fragment);
transaction.commit();
transaction.commit();*/
startActivity(new Intent(getActivity(),StudyActivity.class));
break;
case R.id.tv_more_qiye:
startActivity(new Intent(getActivity(), CompanyActivity.class));
... ...
... ... @@ -57,6 +57,8 @@ public class MineFragment extends BaseMvpFragment<CommonPresenter, PersonalModel
TextView tvUser;
@BindView(R.id.rl_cuoti)
RelativeLayout rlCuoti;
@BindView(R.id.rl_end)
RelativeLayout rlEnd;
private Intent intent;
private FragmentTransaction transaction;
private PraticeWrongFragment wrongFragment;
... ... @@ -78,6 +80,7 @@ public class MineFragment extends BaseMvpFragment<CommonPresenter, PersonalModel
rlToudi.setOnClickListener(this);
rlStudy.setOnClickListener(this);
rlCuoti.setOnClickListener(this);
rlEnd.setOnClickListener(this);
}
... ... @@ -195,6 +198,9 @@ public class MineFragment extends BaseMvpFragment<CommonPresenter, PersonalModel
transaction.replace(R.id.frame, wrongFragment);
transaction.commit();
break;
case R.id.rl_end:
getActivity().finish();
break;
}
}
... ...
... ... @@ -71,7 +71,7 @@
android:layout_height="30dp"
android:layout_below="@+id/grid_hotLesson"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:background="@drawable/stroke_gray"
android:gravity="center"
... ...
... ... @@ -333,11 +333,12 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_end"
android:layout_width="@dimen/dp_335"
android:layout_height="@dimen/dp_50"
android:layout_below="@+id/rl_toudi"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_60"
android:layout_marginTop="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_20"
android:background="@drawable/circle_bigconners_orange">
... ...