添加注册按钮
This commit is contained in:
parent
7e29a523d3
commit
49b0b8ffbd
@ -25,6 +25,8 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:ignore="LockedOrientationActivity">
|
||||
<activity android:name=".activitys.BindUserInfoActivity"></activity>
|
||||
<activity android:name=".activitys.RegisterActivity" />
|
||||
<activity
|
||||
android:name=".activitys.QuestionDetailActivity"
|
||||
android:launchMode="singleTop"
|
||||
|
@ -0,0 +1,333 @@
|
||||
package com.tengshisoft.course.activitys;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.annotations.NonNull;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.beans.AreaBean;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.api.BaseApiService;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.RegexUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UIUtil;
|
||||
import com.tengshisoft.course.R;
|
||||
import com.tengshisoft.course.R2;
|
||||
import com.tengshisoft.course.modules.AreaListBean;
|
||||
import com.tengshisoft.course.net.HomeApi;
|
||||
import com.tengshisoft.moduleijkplayer.render.TextureRenderView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 绑定个人基本信息
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_MAIN_BIND_USER_INFO)
|
||||
public class BindUserInfoActivity extends BaseActivity {
|
||||
@BindView(R2.id.et_id_card)
|
||||
EditText mEtIDCard;
|
||||
@BindView(R2.id.et_area_detail)
|
||||
EditText mEtAreaDetail;
|
||||
@BindView(R2.id.tv_area1)
|
||||
TextView mTvArea1;
|
||||
@BindView(R2.id.tv_area2)
|
||||
TextView mTvArea2;
|
||||
@BindView(R2.id.tv_area3)
|
||||
TextView mTvArea3;
|
||||
@BindView(R2.id.tv_area4)
|
||||
TextView mTvArea4;
|
||||
@BindView(R2.id.tv_area5)
|
||||
TextView mTvArea5;
|
||||
@BindView(R2.id.btn_save)
|
||||
Button mBtnSave;
|
||||
private String mSelArea1;
|
||||
private String mSelArea2;
|
||||
private String mSelArea3;
|
||||
private String mSelArea4;
|
||||
private String mSelArea5;
|
||||
private List<AreaListBean> mAreaList1;
|
||||
private List<AreaListBean> mAreaList2;
|
||||
private List<AreaListBean> mAreaList3;
|
||||
private List<AreaListBean> mAreaList4;
|
||||
private List<AreaListBean> mAreaList5;
|
||||
private OptionsPickerView<AreaListBean> mArea1Picker;
|
||||
private OptionsPickerView<AreaListBean> mArea2Picker;
|
||||
private OptionsPickerView<AreaListBean> mArea3Picker;
|
||||
private OptionsPickerView<AreaListBean> mArea4Picker;
|
||||
private OptionsPickerView<AreaListBean> mArea5Picker;
|
||||
|
||||
private Unbinder mBind;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_bind_user_info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mTvBaseTitle.setText("绑定信息");
|
||||
mTvArea1.setOnClickListener(v -> showArea1Sel());
|
||||
mTvArea2.setOnClickListener(v -> showArea2Sel());
|
||||
mTvArea3.setOnClickListener(v -> showArea3Sel());
|
||||
mTvArea4.setOnClickListener(v -> showArea4Sel());
|
||||
mTvArea5.setOnClickListener(v -> showArea5Sel());
|
||||
mBtnSave.setOnClickListener(v -> doBindInfo());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 进行个人信息绑定
|
||||
*/
|
||||
private void doBindInfo() {
|
||||
|
||||
}
|
||||
|
||||
private void getAreaList(String id, int type) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "加载中...");
|
||||
dialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(HomeApi.class)
|
||||
.getAreaListByPid("0")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<AreaListBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull List<AreaListBean> areaListBeans) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 一级区域
|
||||
*/
|
||||
private void showArea1Sel() {
|
||||
hideSoftKeyboard();
|
||||
if (null == mAreaList1 || mAreaList1.size() <= 0) {
|
||||
getAreaList("0", 0);
|
||||
} else {
|
||||
mArea1Picker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
|
||||
AreaListBean bean = mAreaList1.get(options1);
|
||||
mTvArea1.setText(bean.getAreaName());
|
||||
mSelArea1 = bean.getAreaId();
|
||||
|
||||
mTvArea2.setText("");
|
||||
mSelArea2 = "";
|
||||
mAreaList2 = null;
|
||||
|
||||
mTvArea3.setText("");
|
||||
mSelArea3 = "";
|
||||
mAreaList3 = null;
|
||||
|
||||
mTvArea4.setText("");
|
||||
mSelArea4 = "";
|
||||
mAreaList4 = null;
|
||||
|
||||
mTvArea5.setText("");
|
||||
mSelArea5 = "";
|
||||
mAreaList5 = null;
|
||||
})
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mArea1Picker.setPicker(mAreaList1);
|
||||
mArea1Picker.show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 二级区域
|
||||
*/
|
||||
private void showArea2Sel() {
|
||||
hideSoftKeyboard();
|
||||
if (null == mAreaList2 || mAreaList2.size() <= 0) {
|
||||
getAreaList("0", 0);
|
||||
} else {
|
||||
mArea2Picker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
|
||||
AreaListBean bean = mAreaList2.get(options1);
|
||||
mTvArea2.setText(bean.getAreaName());
|
||||
mSelArea2 = bean.getAreaId();
|
||||
|
||||
mTvArea3.setText("");
|
||||
mSelArea3 = "";
|
||||
mAreaList3 = null;
|
||||
|
||||
mTvArea4.setText("");
|
||||
mSelArea4 = "";
|
||||
mAreaList4 = null;
|
||||
|
||||
mTvArea5.setText("");
|
||||
mSelArea5 = "";
|
||||
mAreaList5 = null;
|
||||
|
||||
})
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mArea2Picker.setPicker(mAreaList2);
|
||||
mArea2Picker.show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 三级区域
|
||||
*/
|
||||
private void showArea3Sel() {
|
||||
hideSoftKeyboard();
|
||||
if (null == mAreaList3 || mAreaList3.size() <= 0) {
|
||||
getAreaList("0", 0);
|
||||
} else {
|
||||
mArea3Picker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
|
||||
AreaListBean bean = mAreaList3.get(options1);
|
||||
mTvArea3.setText(bean.getAreaName());
|
||||
mSelArea3 = bean.getAreaId();
|
||||
|
||||
mTvArea4.setText("");
|
||||
mSelArea4 = "";
|
||||
mAreaList4 = null;
|
||||
|
||||
mTvArea5.setText("");
|
||||
mSelArea5 = "";
|
||||
mAreaList5 = null;
|
||||
|
||||
})
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mArea3Picker.setPicker(mAreaList3);
|
||||
mArea3Picker.show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 四级区域
|
||||
*/
|
||||
private void showArea4Sel() {
|
||||
hideSoftKeyboard();
|
||||
if (null == mAreaList4 || mAreaList4.size() <= 0) {
|
||||
getAreaList("0", 0);
|
||||
} else {
|
||||
mArea4Picker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
|
||||
AreaListBean bean = mAreaList4.get(options1);
|
||||
mTvArea4.setText(bean.getAreaName());
|
||||
mSelArea4 = bean.getAreaId();
|
||||
|
||||
mTvArea5.setText("");
|
||||
mSelArea5 = "";
|
||||
mAreaList5 = null;
|
||||
})
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mArea4Picker.setPicker(mAreaList4);
|
||||
mArea4Picker.show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 五级区域
|
||||
*/
|
||||
private void showArea5Sel() {
|
||||
hideSoftKeyboard();
|
||||
if (null == mAreaList5 || mAreaList5.size() <= 0) {
|
||||
getAreaList("0", 0);
|
||||
} else {
|
||||
mArea5Picker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
|
||||
AreaListBean bean = mAreaList5.get(options1);
|
||||
mTvArea5.setText(bean.getAreaName());
|
||||
mSelArea5 = bean.getAreaId();
|
||||
|
||||
})
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mArea5Picker.setPicker(mAreaList5);
|
||||
mArea5Picker.show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数合法性
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean checkParams() {
|
||||
String idCard = mEtIDCard.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(idCard) || !RegexUtils.isIDNumber(idCard)) {
|
||||
ToastUtils.showShort("请输入合法的身份证号码");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(mSelArea1)) {
|
||||
ToastUtils.showShort("请选择省份");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(mSelArea2)) {
|
||||
ToastUtils.showShort("请选择城市");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(mSelArea3)) {
|
||||
ToastUtils.showShort("请选择区、县");
|
||||
return false;
|
||||
}
|
||||
String areaDetail = mEtAreaDetail.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(areaDetail)) {
|
||||
ToastUtils.showShort("请输入详细地址");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
}
|
||||
}
|
@ -10,6 +10,7 @@ import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
@ -57,6 +58,8 @@ public class LoginActivity extends BaseActivity {
|
||||
Button mBtnLogin;
|
||||
@BindView(R2.id.iv_show_pwd)
|
||||
ImageView mIvShowPwd;
|
||||
@BindView(R2.id.tv_register)
|
||||
TextView mTvRegister;
|
||||
private Unbinder mBind;
|
||||
private boolean isShowPwd = false;
|
||||
private Disposable mD1;
|
||||
@ -87,6 +90,7 @@ public class LoginActivity extends BaseActivity {
|
||||
mEtPwd.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
|
||||
}
|
||||
});
|
||||
mTvRegister.setOnClickListener(v -> ARouter.getInstance().build(PathConfig.PATH_MODULE_MAIN_REGISTER).navigation());
|
||||
}
|
||||
|
||||
|
||||
|
@ -19,6 +19,7 @@ import com.sucstepsoft.cm_utils.core.retrofit_net.api.BaseApiService;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.bean.VersionBean;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.FragmentUtils;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.CenterDialogFuncView;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.CenterDialogUpdateView;
|
||||
import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
@ -153,6 +154,32 @@ public class MainActivity extends BaseActivity {
|
||||
checkAppVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* 没有填写个人信息的Dialog
|
||||
*/
|
||||
private void showHintInfoDialog() {
|
||||
CenterDialogFuncView.DialogBuilder builder = new CenterDialogFuncView.DialogBuilder(mActivity);
|
||||
CenterDialogFuncView build = builder.build();
|
||||
build.addOnChoseListener(new CenterDialogFuncView.OnChoseListener() {
|
||||
@Override
|
||||
public void shareWeChart() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shareWeibo() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shareQQ() {
|
||||
ARouter.getInstance().build(PathConfig.PATH_MODULE_MAIN_BIND_USER_INFO).navigation();
|
||||
}
|
||||
});
|
||||
build.show();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* App版本校验
|
||||
*/
|
||||
|
@ -0,0 +1,302 @@
|
||||
package com.tengshisoft.course.activitys;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ProgressDialog;
|
||||
import android.text.Editable;
|
||||
import android.text.Selection;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.HideReturnsTransformationMethod;
|
||||
import android.text.method.PasswordTransformationMethod;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.google.gson.Gson;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.constant.RegexConstants;
|
||||
import com.sucstepsoft.cm_utils.core.beans.BaseSuccessBean;
|
||||
import com.sucstepsoft.cm_utils.core.beans.UserRegisterPostBean;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.api.BaseApiService;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
|
||||
import com.sucstepsoft.cm_utils.utils.EncryptUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
|
||||
import com.sucstepsoft.cm_utils.utils.RegexUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UIUtil;
|
||||
import com.tengshisoft.course.R;
|
||||
import com.tengshisoft.course.R2;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
/**
|
||||
* 注册页
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_MAIN_REGISTER)
|
||||
public class RegisterActivity extends BaseActivity {
|
||||
|
||||
|
||||
@BindView(R2.id.et_phone)
|
||||
EditText mEtPhone;
|
||||
@BindView(R2.id.et_verify_code)
|
||||
EditText mEtVerifyCode;
|
||||
@BindView(R2.id.btn_verify_code)
|
||||
Button mBtnVerifyCode;
|
||||
@BindView(R2.id.et_pwd)
|
||||
EditText mEtPwd;
|
||||
@BindView(R2.id.iv_show_pwd)
|
||||
ImageView mIvShowPwd;
|
||||
@BindView(R2.id.et_confirm_pwd)
|
||||
EditText mEtConfirmPwd;
|
||||
@BindView(R2.id.iv_confirm_show_pwd)
|
||||
ImageView mIvConfirmShowPwd;
|
||||
@BindView(R2.id.btn_do_register)
|
||||
TextView mBtnDoRegister;
|
||||
private Unbinder mBind;
|
||||
private boolean isShowPwd;
|
||||
private boolean isShowConfirmPwd;
|
||||
private int mCountDownNum = 120;//倒计时秒
|
||||
private Disposable mCountDownDis;
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
super.initData();
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("注册");
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mIvShowPwd.setOnClickListener(v -> {
|
||||
Editable etext = mEtPwd.getText();
|
||||
Selection.setSelection(etext, etext.length());
|
||||
if (isShowPwd) {
|
||||
isShowPwd = false;
|
||||
mEtPwd.setTransformationMethod(PasswordTransformationMethod.getInstance());
|
||||
mIvShowPwd.setBackgroundResource(R.drawable.ic_hide_pwd);
|
||||
} else {
|
||||
isShowPwd = true;
|
||||
mIvShowPwd.setBackgroundResource(R.drawable.ic_show_pwd);
|
||||
mEtPwd.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
|
||||
}
|
||||
});
|
||||
mIvConfirmShowPwd.setOnClickListener(v -> {
|
||||
Editable etext = mEtConfirmPwd.getText();
|
||||
Selection.setSelection(etext, etext.length());
|
||||
if (isShowConfirmPwd) {
|
||||
isShowConfirmPwd = false;
|
||||
mEtConfirmPwd.setTransformationMethod(PasswordTransformationMethod.getInstance());
|
||||
mIvConfirmShowPwd.setBackgroundResource(R.drawable.ic_hide_pwd);
|
||||
} else {
|
||||
isShowConfirmPwd = true;
|
||||
mIvConfirmShowPwd.setBackgroundResource(R.drawable.ic_show_pwd);
|
||||
mEtConfirmPwd.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
|
||||
}
|
||||
});
|
||||
mBtnVerifyCode.setOnClickListener(v -> getVerifyCode());
|
||||
setEditTextInputSpeChar(mEtPwd);
|
||||
setEditTextInputSpeChar(mEtConfirmPwd);
|
||||
mBtnDoRegister.setOnClickListener(v -> doRegister());
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证码倒计时
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
private void countDown() {
|
||||
Observable.interval(0, 1, TimeUnit.SECONDS).take(mCountDownNum)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<Long>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mCountDownDis = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(Long aLong) {
|
||||
long l = mCountDownNum - aLong;
|
||||
if (l == 1) {
|
||||
mBtnVerifyCode.setEnabled(true);
|
||||
mBtnVerifyCode.setText("重新获取");
|
||||
} else {
|
||||
mBtnVerifyCode.setEnabled(false);
|
||||
mBtnVerifyCode.setText(l + "s后重新获取");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ExceptionHandler.handleException(e);
|
||||
mBtnVerifyCode.setEnabled(true);
|
||||
mBtnVerifyCode.setText("重新获取");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 进行注册
|
||||
*/
|
||||
private void doRegister() {
|
||||
if (checkAllParams()) {
|
||||
String phone = mEtPhone.getText().toString().trim();
|
||||
String code = mEtVerifyCode.getText().toString().trim();
|
||||
String pwd = mEtPwd.getText().toString().trim();
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "注册中...");
|
||||
dialog.show();
|
||||
UserRegisterPostBean info = new UserRegisterPostBean();
|
||||
String md5Pwd = EncryptUtils.encryptMD5ToStringTimes(pwd, 3);
|
||||
info.setPassword(md5Pwd);
|
||||
info.setPhone(phone);
|
||||
info.setVerificationCode(code);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(info);
|
||||
RequestBody body = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.doRegisterUser(body)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseSuccessBean) {
|
||||
ToastUtils.showShort("注册成功");
|
||||
dialog.dismiss();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ExceptionHandler.handleException(e);
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean checkAllParams() {
|
||||
String phone = mEtPhone.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(phone) || !RegexUtils.isMobileExact(phone)) {
|
||||
ToastUtils.showShort("请输入合法的手机号码");
|
||||
return false;
|
||||
}
|
||||
String code = mEtVerifyCode.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(code)) {
|
||||
ToastUtils.showShort("请输入验证码");
|
||||
return false;
|
||||
}
|
||||
String pwd = mEtPwd.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(pwd) || !RegexUtils.isMatch(RegexConstants.REGEX_PWD, pwd)) {
|
||||
ToastUtils.showShort("密码最少为6位且包含数字和字母");
|
||||
return false;
|
||||
}
|
||||
String confirmpwd = mEtConfirmPwd.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(confirmpwd)) {
|
||||
ToastUtils.showShort("请输入确认密码");
|
||||
return false;
|
||||
}
|
||||
if (!confirmpwd.equals(pwd)) {
|
||||
ToastUtils.showShort("密码与确认密码不符");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean checkPhone() {
|
||||
String phone = mEtPhone.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(phone) || !RegexUtils.isMobileExact(phone)) {
|
||||
ToastUtils.showShort("请输入合法的手机号码");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
private void getVerifyCode() {
|
||||
if (checkPhone()) {
|
||||
String phone = mEtPhone.getText().toString().trim();
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "获取中...");
|
||||
dialog.show();
|
||||
mBtnVerifyCode.setEnabled(false);
|
||||
RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.getVerifyCodeBean(phone)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseSuccessBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showShort("获取成功");
|
||||
countDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
mBtnVerifyCode.setEnabled(true);
|
||||
mBtnVerifyCode.setText("重新获取");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_register;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (mCountDownDis != null && !mCountDownDis.isDisposed()) {
|
||||
mCountDownDis.dispose();
|
||||
}
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
@ -0,0 +1,204 @@
|
||||
package com.tengshisoft.course.modules;
|
||||
|
||||
import com.contrarywind.interfaces.IPickerViewData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/7/21 - 10:49 AM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class AreaListBean implements IPickerViewData {
|
||||
|
||||
/**
|
||||
* areaCityCode : string
|
||||
* areaCode : string
|
||||
* areaFirst : string
|
||||
* areaId : string
|
||||
* areaLat : string
|
||||
* areaLevel : string
|
||||
* areaLng : string
|
||||
* areaMergerName : string
|
||||
* areaName : string
|
||||
* areaParentId : string
|
||||
* areaParentName : string
|
||||
* areaPinyin : string
|
||||
* areaShortName : string
|
||||
* areaZipCode : string
|
||||
* parent : true
|
||||
* subArea : [{}]
|
||||
*/
|
||||
|
||||
private String areaCityCode;
|
||||
private String areaCode;
|
||||
private String areaFirst;
|
||||
private String areaId;
|
||||
private String areaLat;
|
||||
private String areaLevel;
|
||||
private String areaLng;
|
||||
private String areaMergerName;
|
||||
private String areaName;
|
||||
private String areaParentId;
|
||||
private String areaParentName;
|
||||
private String areaPinyin;
|
||||
private String areaShortName;
|
||||
private String areaZipCode;
|
||||
private boolean parent;
|
||||
private boolean checkEd;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AreaListBean{" +
|
||||
"areaName='" + areaName + '\'' +
|
||||
", checkEd=" + checkEd +
|
||||
'}';
|
||||
}
|
||||
|
||||
public boolean isCheckEd() {
|
||||
return checkEd;
|
||||
}
|
||||
|
||||
public void setCheckEd(boolean checkEd) {
|
||||
this.checkEd = checkEd;
|
||||
}
|
||||
|
||||
private List<SubAreaBean> subArea;
|
||||
|
||||
public String getAreaCityCode() {
|
||||
return areaCityCode;
|
||||
}
|
||||
|
||||
public void setAreaCityCode(String areaCityCode) {
|
||||
this.areaCityCode = areaCityCode;
|
||||
}
|
||||
|
||||
public String getAreaCode() {
|
||||
return areaCode;
|
||||
}
|
||||
|
||||
public void setAreaCode(String areaCode) {
|
||||
this.areaCode = areaCode;
|
||||
}
|
||||
|
||||
public String getAreaFirst() {
|
||||
return areaFirst;
|
||||
}
|
||||
|
||||
public void setAreaFirst(String areaFirst) {
|
||||
this.areaFirst = areaFirst;
|
||||
}
|
||||
|
||||
public String getAreaId() {
|
||||
return areaId;
|
||||
}
|
||||
|
||||
public void setAreaId(String areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public String getAreaLat() {
|
||||
return areaLat;
|
||||
}
|
||||
|
||||
public void setAreaLat(String areaLat) {
|
||||
this.areaLat = areaLat;
|
||||
}
|
||||
|
||||
public String getAreaLevel() {
|
||||
return areaLevel;
|
||||
}
|
||||
|
||||
public void setAreaLevel(String areaLevel) {
|
||||
this.areaLevel = areaLevel;
|
||||
}
|
||||
|
||||
public String getAreaLng() {
|
||||
return areaLng;
|
||||
}
|
||||
|
||||
public void setAreaLng(String areaLng) {
|
||||
this.areaLng = areaLng;
|
||||
}
|
||||
|
||||
public String getAreaMergerName() {
|
||||
return areaMergerName;
|
||||
}
|
||||
|
||||
public void setAreaMergerName(String areaMergerName) {
|
||||
this.areaMergerName = areaMergerName;
|
||||
}
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getAreaParentId() {
|
||||
return areaParentId;
|
||||
}
|
||||
|
||||
public void setAreaParentId(String areaParentId) {
|
||||
this.areaParentId = areaParentId;
|
||||
}
|
||||
|
||||
public String getAreaParentName() {
|
||||
return areaParentName;
|
||||
}
|
||||
|
||||
public void setAreaParentName(String areaParentName) {
|
||||
this.areaParentName = areaParentName;
|
||||
}
|
||||
|
||||
public String getAreaPinyin() {
|
||||
return areaPinyin;
|
||||
}
|
||||
|
||||
public void setAreaPinyin(String areaPinyin) {
|
||||
this.areaPinyin = areaPinyin;
|
||||
}
|
||||
|
||||
public String getAreaShortName() {
|
||||
return areaShortName;
|
||||
}
|
||||
|
||||
public void setAreaShortName(String areaShortName) {
|
||||
this.areaShortName = areaShortName;
|
||||
}
|
||||
|
||||
public String getAreaZipCode() {
|
||||
return areaZipCode;
|
||||
}
|
||||
|
||||
public void setAreaZipCode(String areaZipCode) {
|
||||
this.areaZipCode = areaZipCode;
|
||||
}
|
||||
|
||||
public boolean isParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setParent(boolean parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public List<SubAreaBean> getSubArea() {
|
||||
return subArea;
|
||||
}
|
||||
|
||||
public void setSubArea(List<SubAreaBean> subArea) {
|
||||
this.subArea = subArea;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPickerViewText() {
|
||||
return this.areaName;
|
||||
}
|
||||
|
||||
public static class SubAreaBean {
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ import com.sucstepsoft.cm_utils.core.beans.BaseSuccessBean;
|
||||
import com.sucstepsoft.cm_utils.core.beans.BaseUserBean;
|
||||
import com.sucstepsoft.cm_utils.core.beans.UserLoginBean;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.bean.VersionBean;
|
||||
import com.tengshisoft.course.modules.AreaListBean;
|
||||
import com.tengshisoft.course.modules.CourseBean;
|
||||
import com.tengshisoft.course.modules.CourseDetailBean;
|
||||
import com.tengshisoft.course.modules.ErrorAnalyzeBean;
|
||||
@ -163,4 +164,14 @@ public interface HomeApi {
|
||||
@Headers({"base_url_name:study", "Content-Type:application/json", "Accept:application/json"})
|
||||
@GET("app/question/getquestionbyid/{questionId}")
|
||||
Observable<QuestionDetailBean> getQuestionLibDetail(@Path("questionId") String id, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 统一用户-获取区域
|
||||
*
|
||||
* @param pId
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-Type:application/json", "Accept:application/json"})
|
||||
@GET("app/dataarea/listareabyparentidrelease/{areaParentId}")
|
||||
Observable<List<AreaListBean>> getAreaListByPid(@Path("areaParentId") String pId);
|
||||
}
|
||||
|
BIN
app/src/main/res/drawable-xhdpi/ic_start_hint.png
Executable file
BIN
app/src/main/res/drawable-xhdpi/ic_start_hint.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 487 B |
6
app/src/main/res/drawable/sel_register_btn_verify_bg.xml
Normal file
6
app/src/main/res/drawable/sel_register_btn_verify_bg.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/sp_btn_enable_true" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/sp_btn_enable_true" android:state_enabled="true" />
|
||||
<item android:drawable="@drawable/sp_btn_enable_false" />
|
||||
</selector>
|
159
app/src/main/res/layout/activity_bind_user_info.xml
Normal file
159
app/src/main/res/layout/activity_bind_user_info.xml
Normal file
@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activitys.BindUserInfoActivity">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="65dp"
|
||||
android:overScrollMode="never">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView style="@style/style_hint_star" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="身份证号:" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_id_card"
|
||||
style="@style/item_content"
|
||||
android:hint="请输入身份证号码"
|
||||
android:inputType="textVisiblePassword" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView style="@style/style_hint_star" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="省        份:" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_area1"
|
||||
style="@style/sel_text_arrow"
|
||||
android:hint="请选择省、自治区、直辖市" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView style="@style/style_hint_star" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="城        市:" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_area2"
|
||||
style="@style/sel_text_arrow"
|
||||
android:hint="请选择城市" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView style="@style/style_hint_star" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="区        县:" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_area3"
|
||||
style="@style/sel_text_arrow"
|
||||
android:hint="请选择区、县" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView
|
||||
style="@style/style_hint_star"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="乡镇街道:" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_area4"
|
||||
style="@style/sel_text_arrow"
|
||||
android:hint="请选择乡镇、街道、社区" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView
|
||||
style="@style/style_hint_star"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="村        :" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_area5"
|
||||
style="@style/sel_text_arrow"
|
||||
android:hint="请选择村" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView style="@style/style_hint_star" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="详细地址:" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_area_detail"
|
||||
style="@style/item_content"
|
||||
android:hint="请输入详细地址(用于邮寄相关课件)"
|
||||
android:minLines="3" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_save"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/sel_btn_green_gray"
|
||||
android:text="保存"
|
||||
android:textColor="@color/col_verify_text" />
|
||||
</RelativeLayout>
|
@ -79,4 +79,22 @@
|
||||
android:text="登录"
|
||||
android:textColor="@color/col_verify_text" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_register"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/btn_login"
|
||||
android:layout_alignRight="@id/btn_login"
|
||||
android:layout_marginTop="15dp"
|
||||
android:background="@drawable/sel_btn_green_gray"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="注册"
|
||||
android:textColor="@color/col_verify_text"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</RelativeLayout>
|
168
app/src/main/res/layout/activity_register.xml
Normal file
168
app/src/main/res/layout/activity_register.xml
Normal file
@ -0,0 +1,168 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="用  户  名:"
|
||||
android:textColor="@color/text_detail_24"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_phone"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_bottom_line"
|
||||
android:hint="请输入用户名"
|
||||
android:inputType="text"
|
||||
android:padding="8dp"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="5dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="验  证  码:"
|
||||
android:textColor="@color/text_detail_24"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
|
||||
android:background="@drawable/shape_bottom_line"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_verify_code"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:hint="请输入验证码"
|
||||
android:inputType="number"
|
||||
android:padding="8dp"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_verify_code"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/sel_register_btn_verify_bg"
|
||||
android:minHeight="0dp"
|
||||
android:padding="5dp"
|
||||
android:text="获取验证码"
|
||||
android:textColor="@color/col_activity_code"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="密         码:"
|
||||
android:textColor="@color/text_detail_24"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_pwd"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_bottom_line"
|
||||
android:hint="请输入密码(最少6位且包含字母和数字)"
|
||||
android:inputType="textPassword"
|
||||
android:padding="8dp"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_show_pwd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ic_hide_pwd" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="确认密码:"
|
||||
android:textColor="@color/text_detail_24"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_confirm_pwd"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_bottom_line"
|
||||
android:hint="请确认密码"
|
||||
android:inputType="textPassword"
|
||||
android:padding="8dp"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_confirm_show_pwd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ic_hide_pwd" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_do_register"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_margin="30dp"
|
||||
android:background="@drawable/sel_btn_green_gray"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:padding="10dp"
|
||||
android:text="立即注册"
|
||||
android:textColor="@color/col_verify_text"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
</RelativeLayout>
|
@ -68,4 +68,61 @@
|
||||
<!-- <item name="android:windowEnterAnimation">@anim/pop_show</item>-->
|
||||
<!-- <item name="android:windowExitAnimation">@anim/pop_hide</item>-->
|
||||
<!-- </style>-->
|
||||
<style name="item_gray">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_marginLeft">10dp</item>
|
||||
<item name="android:layout_marginTop">5dp</item>
|
||||
<item name="android:layout_marginRight">10dp</item>
|
||||
<item name="android:layout_marginBottom">5dp</item>
|
||||
<item name="android:background">@drawable/shp_rectangle_gray</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
<item name="android:padding">2dp</item>
|
||||
</style>
|
||||
|
||||
<style name="item_title">
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_weight">0.3</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
</style>
|
||||
|
||||
<style name="item_content">
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:gravity">right</item>
|
||||
<item name="android:padding">5dp</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
</style>
|
||||
|
||||
<style name="sel_text_arrow">
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:drawablePadding">5dp</item>
|
||||
<item name="android:drawableRight">@drawable/ic_arrow_gray_down</item>
|
||||
<item name="android:gravity">right</item>
|
||||
<item name="android:padding">5dp</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:clickable">true</item>
|
||||
<item name="android:focusable">true</item>
|
||||
</style>
|
||||
|
||||
<style name="vertical_line">
|
||||
<item name="android:layout_width">1dp</item>
|
||||
<item name="android:layout_height">10dp</item>
|
||||
<item name="android:layout_gravity">center_vertical</item>
|
||||
<item name="android:layout_marginTop">3dp</item>
|
||||
<item name="android:layout_marginBottom">3dp</item>
|
||||
<item name="android:background">@color/black_70</item>
|
||||
</style>
|
||||
|
||||
<style name="style_hint_star">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:background">@drawable/ic_start_hint</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
@ -121,6 +121,10 @@ public class PathConfig {
|
||||
public static final String PATH_MODULE_MAIN_FREEDOM_LIST = "/modulemain/activity/freedomlist";//自主选列表
|
||||
public static final String PATH_MODULE_MAIN_FRAGMENT_FREEDOM_LIST = "/modulemain/fragment/freedomlist";//自主选课列表fragment
|
||||
public static final String PATH_MODULE_MAIN_FRAGMENT_FIXED_LIST = "/modulemain/fragment/fixedlsit";//固定课程列表 fragment
|
||||
|
||||
public static final String PATH_MODULE_MAIN_BIND_USER_INFO = "/modulemain/activity/bindUserInfo";//绑定个人信息
|
||||
|
||||
|
||||
public static final String PATH_MODULE_MAIN_NEWS_LIST = "/modulemain/activity/newslist";
|
||||
public static final String PATH_MODULE_MAIN_NEWS_PDF = "/modulemain/activity/newspdf";//新闻PDF页面
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.sucstepsoft.cm_utils.core.beans;
|
||||
|
||||
import com.contrarywind.interfaces.IPickerViewData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -8,7 +10,7 @@ import java.util.List;
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class AreaBean {
|
||||
public class AreaBean implements IPickerViewData {
|
||||
|
||||
/**
|
||||
* areaCityCode : string
|
||||
@ -174,6 +176,11 @@ public class AreaBean {
|
||||
this.subArea = subArea;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPickerViewText() {
|
||||
return this.areaName;
|
||||
}
|
||||
|
||||
public static class SubAreaBean {
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,165 @@
|
||||
package com.sucstepsoft.cm_utils.core.widget.views;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Display;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.sucstepsoft.cm_utils.R;
|
||||
|
||||
import androidx.constraintlayout.solver.widgets.WidgetContainer;
|
||||
|
||||
|
||||
/**
|
||||
* 作者 : Adam on 2018/7/23.
|
||||
* 邮箱 : itgaojian@163.com
|
||||
* 描述 : 提示dialog
|
||||
*/
|
||||
public class CenterDialogFuncView extends Dialog {
|
||||
|
||||
private View view;
|
||||
private Context context;
|
||||
private OnChoseListener mListener;
|
||||
public ImageView mIvImg;
|
||||
|
||||
|
||||
private CenterDialogFuncView(Context context) {
|
||||
super(context, R.style.Dialog_ChoseFile);
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
view = LayoutInflater.from(context).inflate(R.layout.dialog_center_func, null);
|
||||
view.findViewById(R.id.tv_bind).setOnClickListener(v -> mListener.shareQQ());
|
||||
setContentView(view);
|
||||
setCancelable(false);
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = this.getWindow();
|
||||
window.setGravity(Gravity.CENTER);
|
||||
window.setWindowAnimations(R.style.Dialog_ChoseFile);
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
manager.getDefaultDisplay().getMetrics(metrics);
|
||||
int widthPixels = metrics.widthPixels;
|
||||
params.width = (int) (widthPixels * 0.8);
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
window.setAttributes(params);
|
||||
window.setBackgroundDrawable(new ColorDrawable());
|
||||
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
private void showSoftKeyBoardDialog(EditText editText) {
|
||||
if (editText != null) {
|
||||
editText.setFocusable(true);
|
||||
editText.setFocusableInTouchMode(true);
|
||||
//请求获得焦点
|
||||
editText.requestFocus();
|
||||
//调用系统输入法
|
||||
InputMethodManager inputManager = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
inputManager.showSoftInput(editText, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void addOnChoseListener(OnChoseListener listener) {
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择
|
||||
*
|
||||
* @param i
|
||||
*/
|
||||
private void choseType(int i) {
|
||||
if (mListener != null) {
|
||||
switch (i) {
|
||||
case 1:
|
||||
mListener.shareWeChart();
|
||||
break;
|
||||
case 2:
|
||||
mListener.shareWeibo();
|
||||
break;
|
||||
case 3:
|
||||
mListener.shareQQ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.dismiss();
|
||||
}
|
||||
|
||||
public interface OnChoseListener {
|
||||
void shareWeChart();
|
||||
|
||||
void shareWeibo();
|
||||
|
||||
void shareQQ();
|
||||
}
|
||||
|
||||
public static class DialogBuilder {
|
||||
private Context mContext;
|
||||
private boolean isCancelable;
|
||||
private boolean mIsBackable;
|
||||
private int mGravity = Gravity.BOTTOM;
|
||||
private OnChoseListener mListener;
|
||||
private boolean mIsShowOther;
|
||||
private boolean isCommentImg;
|
||||
|
||||
public DialogBuilder(Context context) {
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
public DialogBuilder setIscancelable(boolean iscancelable) {
|
||||
this.isCancelable = iscancelable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogBuilder setIsBackCancelable(boolean isBackCancelable) {
|
||||
this.mIsBackable = isBackCancelable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogBuilder setShowLocation(int gravity) {
|
||||
this.mGravity = gravity;
|
||||
return this;
|
||||
}
|
||||
|
||||
private boolean mIsShow;
|
||||
|
||||
public DialogBuilder setIsShowFile(boolean isShowFile) {
|
||||
mIsShow = isShowFile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogBuilder setIsShowOther(boolean isShow) {
|
||||
mIsShowOther = isShow;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CenterDialogFuncView build() {
|
||||
return new CenterDialogFuncView(this.mContext);
|
||||
}
|
||||
|
||||
public DialogBuilder setIsShowPhoto(String isCommentImg) {
|
||||
if ("0".equals(isCommentImg)) {
|
||||
this.isCommentImg = false;
|
||||
} else {
|
||||
this.isCommentImg = true;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
41
cm_utils/src/main/res/layout/dialog_center_func.xml
Executable file
41
cm_utils/src/main/res/layout/dialog_center_func.xml
Executable file
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/transparent"
|
||||
android:orientation="vertical"
|
||||
tools:background="@color/black">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/shape_btn_gray_re"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="20dp"
|
||||
android:text="使用App需要先绑定个人信息,请先绑定个人信息"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bind"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:background="@drawable/sel_btn_verify"
|
||||
android:gravity="center"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="去绑定"
|
||||
android:textColor="@color/col_verify_text" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user