Commit 20108deb by 罗翻

登录逻辑修改,增加忘记密码,修改密码

parent 15877b45
Showing with 263 additions and 117 deletions
...@@ -150,7 +150,7 @@ public class SettingPresenter extends SettingContract.Presenter { ...@@ -150,7 +150,7 @@ public class SettingPresenter extends SettingContract.Presenter {
public void modifyPwd() { public void modifyPwd() {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString(UserConstant.PHONE, UserManager.getInstance().getUserPhone()); bundle.putString(UserConstant.PHONE, UserManager.getInstance().getUserPhone());
mView.startActivityAndFinish(ModifyPwdActivity.class, bundle); mView.startActivity(ModifyPwdActivity.class, bundle);
} }
} }
...@@ -319,6 +319,9 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin ...@@ -319,6 +319,9 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onDownloadEvent(DownloadBean event) { public void onDownloadEvent(DownloadBean event) {
int progress = (int) Math.round(event.getBytesReaded() / (double) event.getTotal() * 100); int progress = (int) Math.round(event.getBytesReaded() / (double) event.getTotal() * 100);
if (builder==null){
return;
}
builder.setContentInfo(String.valueOf(progress) + "%").setProgress(100, progress, false); builder.setContentInfo(String.valueOf(progress) + "%").setProgress(100, progress, false);
notificationManager.notify(0, builder.build()); notificationManager.notify(0, builder.build());
if (progress == 100) { if (progress == 100) {
......
...@@ -25,6 +25,8 @@ public class SettingActivity extends BaseActivity<SettingPresenter, ActivitySett ...@@ -25,6 +25,8 @@ public class SettingActivity extends BaseActivity<SettingPresenter, ActivitySett
@Override @Override
public void initView() { public void initView() {
mBind.toolbar.setNavigationOnClickListener(v->dumpBack());
mBind.tvTitle.setText(getString(R.string.setting_center));
} }
@Override @Override
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data> <data>
...@@ -15,19 +16,18 @@ ...@@ -15,19 +16,18 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout style="@style/title"> <android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
<ImageView android:layout_width="match_parent"
android:id="@+id/title_back" android:layout_height="?attr/actionBarSize"
style="@style/title_image_back" android:layout_marginBottom="2dp"
android:onClick="@{()->presenter.dumpBack()}" /> android:background="?attr/colorPrimary"
app:navigationIcon="@drawable/back_btn_normal">
<TextView <TextView
style="@style/text_title" android:id="@+id/tv_title"
android:text="@string/setting_center" /> style="@style/toolbar_title" />
</RelativeLayout> </android.support.v7.widget.Toolbar>
<ImageView style="@style/card_line" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -63,6 +63,7 @@ public class ServerException extends Exception { ...@@ -63,6 +63,7 @@ public class ServerException extends Exception {
message = BaseApplication.getContext().getString(R.string.sms_code_unsend_or_expire); message = BaseApplication.getContext().getString(R.string.sms_code_unsend_or_expire);
break; break;
case "USER0021": case "USER0021":
case "USER0012":
message = BaseApplication.getContext().getString(R.string.sms_code_error); message = BaseApplication.getContext().getString(R.string.sms_code_error);
break; break;
case "USER0003": case "USER0003":
......
...@@ -152,7 +152,7 @@ public class Constants { ...@@ -152,7 +152,7 @@ public class Constants {
public static final String HX_STATE = "hx_state"; public static final String HX_STATE = "hx_state";
public static final String CETIFICATION_STATE = "cetificaiton_state";//1:接单跳转0:待预约,登录页跳转 public static final String CETIFICATION_STATE = "cetificaiton_state";//1:接单跳转0:待预约,登录页,个人中心跳转
/** /**
......
...@@ -64,9 +64,7 @@ public class AppManager { ...@@ -64,9 +64,7 @@ public class AppManager {
*/ */
public void finishActivity(Activity activity) { public void finishActivity(Activity activity) {
if (activity != null) { if (activity != null) {
activityStack.remove(activity);
activity.finish(); activity.finish();
activity = null;
} }
} }
......
...@@ -82,13 +82,14 @@ public class UIUtils { ...@@ -82,13 +82,14 @@ public class UIUtils {
/** /**
* convert sp to its equivalent px * convert sp to its equivalent px
* * <p>
* 将sp转换为px * 将sp转换为px
*/ */
public static float sp2px(Context context, float spValue) { public static float sp2px(Context context, float spValue) {
final float fontScale = context.getResources().getDisplayMetrics().scaledDensity; final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
return (spValue*fontScale+0.5f); return (spValue * fontScale + 0.5f);
} }
/** /**
* 判断TextView的内容宽度是否超出其可用宽度 * 判断TextView的内容宽度是否超出其可用宽度
* *
...@@ -139,6 +140,14 @@ public class UIUtils { ...@@ -139,6 +140,14 @@ public class UIUtils {
public static void showSoftInputFromWindow(Activity activity) { public static void showSoftInputFromWindow(Activity activity) {
activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
} }
public static void hideSoftInputFromWindow(Activity activity) {
InputMethodManager imm = (InputMethodManager) activity
.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null && activity.getCurrentFocus() != null) {
imm.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0);
}
}
} }
...@@ -29,6 +29,15 @@ ...@@ -29,6 +29,15 @@
<item name="android:textSize">@dimen/size_text_title</item> <item name="android:textSize">@dimen/size_text_title</item>
</style> </style>
<style name="toolbar_title">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_gravity">center</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/cl_home_title_text_color</item>
<item name="android:textSize">@dimen/size_text_title</item>
</style>
<style name="title_image_back"> <style name="title_image_back">
<item name="android:layout_width">@dimen/dp_40</item> <item name="android:layout_width">@dimen/dp_40</item>
<item name="android:layout_height">@dimen/dp_40</item> <item name="android:layout_height">@dimen/dp_40</item>
......
package com.dayu.location.base; package com.dayu.location.base;
import android.content.ActivityNotFoundException;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri;
import android.os.Handler; import android.os.Handler;
import android.widget.Toast; import android.widget.Toast;
...@@ -135,7 +137,7 @@ public class LocationUtils { ...@@ -135,7 +137,7 @@ public class LocationUtils {
return new File("/data/data/" + "com.autonavi.minimap").exists(); return new File("/data/data/" + "com.autonavi.minimap").exists();
} }
public static void openMap(Context mContext,String address){ public static void openMap(Context mContext, String address) {
if (isInstallPackage()) { if (isInstallPackage()) {
Intent intent = new Intent("android.intent.action.VIEW" Intent intent = new Intent("android.intent.action.VIEW"
, android.net.Uri.parse("androidamap://poi?sourceApplication=softname&keywords=" + address)); , android.net.Uri.parse("androidamap://poi?sourceApplication=softname&keywords=" + address));
...@@ -143,7 +145,19 @@ public class LocationUtils { ...@@ -143,7 +145,19 @@ public class LocationUtils {
intent.addCategory("android.intent.category.DEFAULT"); intent.addCategory("android.intent.category.DEFAULT");
mContext.startActivity(intent); mContext.startActivity(intent);
} else { } else {
Toast.makeText(mContext,R.string.install_gd_map,Toast.LENGTH_SHORT).show(); Toast.makeText(mContext, R.string.install_gd_map, Toast.LENGTH_SHORT).show();
goToMarket(mContext, "com.autonavi.minimap");
} }
} }
private static void goToMarket(Context context, String packageName) {
Uri uri = Uri.parse("market://details?id=" + packageName);
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
context.startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
e.printStackTrace();
}
}
} }
...@@ -7,7 +7,7 @@ import android.support.v4.app.Fragment; ...@@ -7,7 +7,7 @@ import android.support.v4.app.Fragment;
import com.dayu.base.ui.adapter.FragmentBaseAdapter; import com.dayu.base.ui.adapter.FragmentBaseAdapter;
import com.dayu.base.ui.fragment.DataBindingFragment; import com.dayu.base.ui.fragment.DataBindingFragment;
import com.dayu.message.R; import com.dayu.message.R;
import com.dayu.message.databinding.FragmentMessageBinding; import com.dayu.message.databinding.FragmentMessage1Binding;
import com.dayu.utils.TabLayoutUtils; import com.dayu.utils.TabLayoutUtils;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;
...@@ -22,7 +22,7 @@ import io.reactivex.functions.Function; ...@@ -22,7 +22,7 @@ import io.reactivex.functions.Function;
* on 2017/11/20. * on 2017/11/20.
*/ */
public class HomeMessageFragment extends DataBindingFragment<FragmentMessageBinding> { public class HomeMessageFragment extends DataBindingFragment<FragmentMessage1Binding> {
private int mIndex = 0; private int mIndex = 0;
private String mUmTag = "serverMessage"; private String mUmTag = "serverMessage";
...@@ -35,7 +35,7 @@ public class HomeMessageFragment extends DataBindingFragment<FragmentMessageBind ...@@ -35,7 +35,7 @@ public class HomeMessageFragment extends DataBindingFragment<FragmentMessageBind
@Override @Override
public int getLayoutId() { public int getLayoutId() {
return R.layout.fragment_message; return R.layout.fragment_message1;
} }
......
...@@ -110,4 +110,5 @@ public class ReceivingPresenter extends ReceivingContract.Presenter { ...@@ -110,4 +110,5 @@ public class ReceivingPresenter extends ReceivingContract.Presenter {
public int getmUserId() { public int getmUserId() {
return mUserId; return mUserId;
} }
} }
package com.dayu.order.ui.activity; package com.dayu.order.ui.activity;
import android.os.Bundle;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.dayu.base.ui.activity.BaseActivity; import com.dayu.base.ui.activity.BaseActivity;
import com.dayu.baselibrary.databinding.ActivityCommomRecycleBinding; import com.dayu.baselibrary.databinding.ActivityCommomRecycleBinding;
import com.dayu.common.Constants;
import com.dayu.order.R; import com.dayu.order.R;
import com.dayu.order.api.protocol.Order; import com.dayu.order.api.protocol.Order;
import com.dayu.order.databinding.FragmentOrderdoingItemBinding; import com.dayu.order.databinding.FragmentOrderdoingItemBinding;
...@@ -21,7 +24,6 @@ import com.umeng.analytics.MobclickAgent; ...@@ -21,7 +24,6 @@ import com.umeng.analytics.MobclickAgent;
* on 2017/8/28. * on 2017/8/28.
* Created by yu * Created by yu
*/ */
public class ReceivingActivity extends BaseActivity<ReceivingPresenter, ActivityCommomRecycleBinding> implements public class ReceivingActivity extends BaseActivity<ReceivingPresenter, ActivityCommomRecycleBinding> implements
ReceivingContract.View { ReceivingContract.View {
private OrderAdapter mAdapter; private OrderAdapter mAdapter;
...@@ -71,7 +73,9 @@ public class ReceivingActivity extends BaseActivity<ReceivingPresenter, Activity ...@@ -71,7 +73,9 @@ public class ReceivingActivity extends BaseActivity<ReceivingPresenter, Activity
CustomDialog customDialog = new CustomDialog(mActivity, R.style.CustomDialog, getString(R.string.engineer_identity_not_audite) CustomDialog customDialog = new CustomDialog(mActivity, R.style.CustomDialog, getString(R.string.engineer_identity_not_audite)
, (dialog, confirm) -> { , (dialog, confirm) -> {
if (confirm) { if (confirm) {
ARouter.getInstance().build(RouterPath.PATH_CERTIFICAITON).navigation(); Bundle bundle = new Bundle();
bundle.putInt(Constants.CETIFICATION_STATE, 1);
ARouter.getInstance().build(RouterPath.PATH_CERTIFICAITON).withBundle(Constants.BUNDLE, bundle).navigation();
} }
}); });
customDialog.setTitle(getString(R.string.identity_not_audite)) customDialog.setTitle(getString(R.string.identity_not_audite))
......
...@@ -13,7 +13,7 @@ import com.dayu.base.ui.adapter.FragmentAdapter; ...@@ -13,7 +13,7 @@ import com.dayu.base.ui.adapter.FragmentAdapter;
import com.dayu.base.ui.fragment.BaseFragment; import com.dayu.base.ui.fragment.BaseFragment;
import com.dayu.order.R; import com.dayu.order.R;
import com.dayu.order.api.protocol.Tab; import com.dayu.order.api.protocol.Tab;
import com.dayu.order.databinding.FragmentOrderHomeBinding; import com.dayu.order.databinding.FragmentOrderHome1Binding;
import com.dayu.order.presenter.homeorder.HomeOrderContract; import com.dayu.order.presenter.homeorder.HomeOrderContract;
import com.dayu.order.presenter.homeorder.HomeOrderPresenter; import com.dayu.order.presenter.homeorder.HomeOrderPresenter;
import com.dayu.provider.event.RefreshTab; import com.dayu.provider.event.RefreshTab;
...@@ -33,7 +33,7 @@ import java.util.List; ...@@ -33,7 +33,7 @@ import java.util.List;
* on 2017/11/20. * on 2017/11/20.
*/ */
public class HomeOrderFragment extends BaseFragment<HomeOrderPresenter, FragmentOrderHomeBinding> public class HomeOrderFragment extends BaseFragment<HomeOrderPresenter, FragmentOrderHome1Binding>
implements HomeOrderContract.View { implements HomeOrderContract.View {
public List<Fragment> list_fragments; public List<Fragment> list_fragments;
private FragmentAdapter adapter; private FragmentAdapter adapter;
...@@ -52,7 +52,7 @@ public class HomeOrderFragment extends BaseFragment<HomeOrderPresenter, Fragment ...@@ -52,7 +52,7 @@ public class HomeOrderFragment extends BaseFragment<HomeOrderPresenter, Fragment
@Override @Override
public int getLayoutId() { public int getLayoutId() {
return R.layout.fragment_order_home; return R.layout.fragment_order_home1;
} }
@Override @Override
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="presenter"
type="com.dayu.order.presenter.homeorder.HomeOrderPresenter" />
</data>
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cl_white">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp"
>
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways|snap">
<TextView
style="@style/text_title"
android:layout_gravity="center"
android:text="@string/order_title" />
<TextView
android:id="@+id/tv_right_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginRight="@dimen/dp_13.3"
android:onClick="@{()->presenter.dumpToOrderRecordActivity()}"
android:text="@string/history_order"
android:textColor="#3faafc"
android:textSize="@dimen/dp_13.3" />
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="@+id/tb_home"
android:layout_width="match_parent"
android:layout_height="78dp"
app:tabIndicatorColor="@color/cl_tab_line"
app:tabMaxWidth="0dp"
app:tabMode="fixed" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/vp_home"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
</layout>
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.dayu.usercenter.presenter.certification; ...@@ -3,6 +3,7 @@ package com.dayu.usercenter.presenter.certification;
import android.os.Bundle; import android.os.Bundle;
import com.dayu.base.api.BaseApiFactory; import com.dayu.base.api.BaseApiFactory;
import com.dayu.common.Constants;
import com.dayu.usercenter.common.UserConstant; import com.dayu.usercenter.common.UserConstant;
import com.dayu.usercenter.ui.activity.FaceCertificationActivity; import com.dayu.usercenter.ui.activity.FaceCertificationActivity;
...@@ -19,8 +20,14 @@ import okhttp3.RequestBody; ...@@ -19,8 +20,14 @@ import okhttp3.RequestBody;
*/ */
public class CertificaitonPresenter extends CertificaitonContract.Presenter { public class CertificaitonPresenter extends CertificaitonContract.Presenter {
private int mCertState;
@Override @Override
public void onAttached() { public void onAttached() {
Bundle bundle = mView.getBundle();
if (bundle!=null){
mCertState = bundle.getInt(Constants.CETIFICATION_STATE,0);
}
} }
@Override @Override
...@@ -30,6 +37,7 @@ public class CertificaitonPresenter extends CertificaitonContract.Presenter { ...@@ -30,6 +37,7 @@ public class CertificaitonPresenter extends CertificaitonContract.Presenter {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString(UserConstant.FRONT_URL, list.get(0)); bundle.putString(UserConstant.FRONT_URL, list.get(0));
bundle.putString(UserConstant.BACK_URL, list.get(1)); bundle.putString(UserConstant.BACK_URL, list.get(1));
bundle.putInt(Constants.CETIFICATION_STATE,mCertState);
mView.startActivity(FaceCertificationActivity.class, bundle); mView.startActivity(FaceCertificationActivity.class, bundle);
})); }));
} }
......
...@@ -3,6 +3,7 @@ package com.dayu.usercenter.presenter.facecertification; ...@@ -3,6 +3,7 @@ package com.dayu.usercenter.presenter.facecertification;
import android.os.Bundle; import android.os.Bundle;
import com.dayu.base.api.BaseApiFactory; import com.dayu.base.api.BaseApiFactory;
import com.dayu.common.Constants;
import com.dayu.event.UserInfo; import com.dayu.event.UserInfo;
import com.dayu.usercenter.R; import com.dayu.usercenter.R;
import com.dayu.usercenter.api.UserApiFactory; import com.dayu.usercenter.api.UserApiFactory;
...@@ -31,6 +32,7 @@ public class FaceCertificaitonPresenter extends FaceCertificaitonContract.Presen ...@@ -31,6 +32,7 @@ public class FaceCertificaitonPresenter extends FaceCertificaitonContract.Presen
private String mFrontCardUrl; private String mFrontCardUrl;
private String mBackCardUrl; private String mBackCardUrl;
private int accountId; private int accountId;
private int mCertState;
@Override @Override
public void onAttached() { public void onAttached() {
...@@ -38,6 +40,7 @@ public class FaceCertificaitonPresenter extends FaceCertificaitonContract.Presen ...@@ -38,6 +40,7 @@ public class FaceCertificaitonPresenter extends FaceCertificaitonContract.Presen
Bundle bundle = mView.getBundle(); Bundle bundle = mView.getBundle();
mFrontCardUrl = bundle.getString(UserConstant.FRONT_URL); mFrontCardUrl = bundle.getString(UserConstant.FRONT_URL);
mBackCardUrl = bundle.getString(UserConstant.BACK_URL); mBackCardUrl = bundle.getString(UserConstant.BACK_URL);
mCertState = bundle.getInt(Constants.CETIFICATION_STATE, 0);
} }
@Override @Override
...@@ -83,7 +86,8 @@ public class FaceCertificaitonPresenter extends FaceCertificaitonContract.Presen ...@@ -83,7 +86,8 @@ public class FaceCertificaitonPresenter extends FaceCertificaitonContract.Presen
info.setDetectStatus(1); info.setDetectStatus(1);
UserManager.getInstance().saveUser(info); UserManager.getInstance().saveUser(info);
bundle.putString(UserConstant.DETECT_STATE, UIUtils.getString(R.string.certification_success)); bundle.putString(UserConstant.DETECT_STATE, UIUtils.getString(R.string.certification_success));
mView.startActivity(CertificationResultActivity.class, bundle); bundle.putInt(Constants.CETIFICATION_STATE, mCertState);
mView.startActivityAndFinish(CertificationResultActivity.class, bundle);
} }
}, responeThrowable -> { }, responeThrowable -> {
if ("DETECT_ERROR00001".equals(responeThrowable.subCode)) { if ("DETECT_ERROR00001".equals(responeThrowable.subCode)) {
...@@ -115,7 +119,7 @@ public class FaceCertificaitonPresenter extends FaceCertificaitonContract.Presen ...@@ -115,7 +119,7 @@ public class FaceCertificaitonPresenter extends FaceCertificaitonContract.Presen
} else { } else {
ToastUtils.showShortToast(R.string.certification_not_pass); ToastUtils.showShortToast(R.string.certification_not_pass);
} }
mView.startActivity(CertificationResultActivity.class, bundle); mView.startActivityAndFinish(CertificationResultActivity.class, bundle);
})); }));
} }
} }
...@@ -17,7 +17,8 @@ public class AgreementActivity extends DataBindingActivity<ActivityAgreementBind ...@@ -17,7 +17,8 @@ public class AgreementActivity extends DataBindingActivity<ActivityAgreementBind
@Override @Override
public void initView() { public void initView() {
mBind.titleBack.setOnClickListener(o -> finish()); mBind.tvTitle.setText(getString(R.string.title_agreement));
mBind.toolbar.setNavigationOnClickListener(o -> finish());
} }
} }
...@@ -6,11 +6,14 @@ import android.os.Bundle; ...@@ -6,11 +6,14 @@ import android.os.Bundle;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.dayu.base.ui.activity.DataBindingActivity; import com.dayu.base.ui.activity.DataBindingActivity;
import com.dayu.common.Constants; import com.dayu.common.Constants;
import com.dayu.event.UserInfo;
import com.dayu.provider.event.CertificationEvent; import com.dayu.provider.event.CertificationEvent;
import com.dayu.provider.router.RouterPath; import com.dayu.provider.router.RouterPath;
import com.dayu.usercenter.R; import com.dayu.usercenter.R;
import com.dayu.usercenter.common.UserConstant; import com.dayu.usercenter.common.UserConstant;
import com.dayu.usercenter.databinding.ActivityCertificationResultBinding; import com.dayu.usercenter.databinding.ActivityCertificationResultBinding;
import com.dayu.utils.AppManager;
import com.dayu.utils.UserManager;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
...@@ -28,8 +31,10 @@ public class CertificationResultActivity extends DataBindingActivity<ActivityCer ...@@ -28,8 +31,10 @@ public class CertificationResultActivity extends DataBindingActivity<ActivityCer
@Override @Override
public void initView() { public void initView() {
mBind.tvTitle.setText(getString(R.string.certification_title)); mBind.tvTitle.setText(getString(R.string.certification_title));
Bundle bundle = getIntent().getBundleExtra(Constants.BUNDLE); Bundle bundle = getIntent().getBundleExtra(Constants.BUNDLE);
String state = bundle.getString(UserConstant.DETECT_STATE); String state = bundle.getString(UserConstant.DETECT_STATE);
int certState = bundle.getInt(Constants.CETIFICATION_STATE, 0);
if (!getString(R.string.certification_success).equals(state)) { if (!getString(R.string.certification_success).equals(state)) {
mBind.ivIcon.setImageResource(R.drawable.icon_certification_failure); mBind.ivIcon.setImageResource(R.drawable.icon_certification_failure);
mBind.tvResult.setText(getString(R.string.certification_fail)); mBind.tvResult.setText(getString(R.string.certification_fail));
...@@ -48,8 +53,16 @@ public class CertificationResultActivity extends DataBindingActivity<ActivityCer ...@@ -48,8 +53,16 @@ public class CertificationResultActivity extends DataBindingActivity<ActivityCer
}); });
} else { } else {
mBind.tvCommite.setOnClickListener(v -> { mBind.tvCommite.setOnClickListener(v -> {
UserInfo info = UserManager.getInstance().getUser();
info.setDetectStatus(1);
UserManager.getInstance().saveUser(info);
EventBus.getDefault().post(new CertificationEvent(1)); EventBus.getDefault().post(new CertificationEvent(1));
ARouter.getInstance().build(RouterPath.PATH_MAIN).navigation(); if (certState == 1) {
AppManager.getInstance().finishActivity(IdentityCertificationActivity.class);
finish();
} else {
ARouter.getInstance().build(RouterPath.PATH_MAIN).navigation();
}
}); });
} }
......
...@@ -27,6 +27,7 @@ public class ForgetPwdActivity extends BaseActivity<ForgetPwdPresenter, ForgetPw ...@@ -27,6 +27,7 @@ public class ForgetPwdActivity extends BaseActivity<ForgetPwdPresenter, ForgetPw
@Override @Override
public void initView() { public void initView() {
mBind.tvTitle.setText(R.string.forget_passworid); mBind.tvTitle.setText(R.string.forget_passworid);
mBind.toolbar.setNavigationOnClickListener(v -> dumpBack());
mBind.mobile.addTextChangedListener(new MyTextWatcher() { mBind.mobile.addTextChangedListener(new MyTextWatcher() {
@Override @Override
public void afterTextChanged(Editable s) { public void afterTextChanged(Editable s) {
...@@ -46,8 +47,6 @@ public class ForgetPwdActivity extends BaseActivity<ForgetPwdPresenter, ForgetPw ...@@ -46,8 +47,6 @@ public class ForgetPwdActivity extends BaseActivity<ForgetPwdPresenter, ForgetPw
isMatch(mPresenter.phoneNume.get(), s.toString()); isMatch(mPresenter.phoneNume.get(), s.toString());
} }
}); });
mBind.next.setOnClickListener(v -> {
});
mBind.getCode.setEnabled(false); mBind.getCode.setEnabled(false);
mBind.next.setEnabled(false); mBind.next.setEnabled(false);
} }
......
...@@ -37,6 +37,7 @@ public class ModifyPwdActivity extends BaseActivity<ModifyPwdPresenter, Activity ...@@ -37,6 +37,7 @@ public class ModifyPwdActivity extends BaseActivity<ModifyPwdPresenter, Activity
@Override @Override
public void initView() { public void initView() {
mBind.tvTitle.setText(UIUtils.getString(R.string.modify_pwd)); mBind.tvTitle.setText(UIUtils.getString(R.string.modify_pwd));
mBind.toolbar.setNavigationOnClickListener(v->dumpBack());
mBind.oldCode.addTextChangedListener(new MyTextWatcher() { mBind.oldCode.addTextChangedListener(new MyTextWatcher() {
@Override @Override
public void afterTextChanged(Editable s) { public void afterTextChanged(Editable s) {
......
...@@ -32,6 +32,7 @@ public class NewPwdActivity extends BaseActivity<NewPwdPresenter, ActivityNewPwd ...@@ -32,6 +32,7 @@ public class NewPwdActivity extends BaseActivity<NewPwdPresenter, ActivityNewPwd
@Override @Override
public void initView() { public void initView() {
mBind.tvTitle.setText(getString(R.string.set_new_pwd)); mBind.tvTitle.setText(getString(R.string.set_new_pwd));
mBind.toolbar.setNavigationOnClickListener(v->dumpBack());
mBind.showPwd.setOnClickListener(v -> { mBind.showPwd.setOnClickListener(v -> {
if (mPwdState == 1) { if (mPwdState == 1) {
mBind.pwd.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); mBind.pwd.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
......
...@@ -32,6 +32,7 @@ public class PwLoginActivity extends BaseActivity<PwLoginPresenter, ActivityPwlo ...@@ -32,6 +32,7 @@ public class PwLoginActivity extends BaseActivity<PwLoginPresenter, ActivityPwlo
@Override @Override
public void initView() { public void initView() {
mBind.toolbar.setNavigationOnClickListener(v -> startActvityAndFinish(SmsLoginActivity.class));
mBind.showPwd.setOnClickListener(v -> { mBind.showPwd.setOnClickListener(v -> {
if (mPwdState == 1) { if (mPwdState == 1) {
mBind.pwd.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); mBind.pwd.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
......
...@@ -5,6 +5,7 @@ import android.content.Intent; ...@@ -5,6 +5,7 @@ import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.text.Editable; import android.text.Editable;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View;
import com.dayu.base.ui.activity.DataBindingActivity; import com.dayu.base.ui.activity.DataBindingActivity;
import com.dayu.common.BaseApplication; import com.dayu.common.BaseApplication;
...@@ -13,7 +14,9 @@ import com.dayu.common.MyTextWatcher; ...@@ -13,7 +14,9 @@ import com.dayu.common.MyTextWatcher;
import com.dayu.usercenter.R; import com.dayu.usercenter.R;
import com.dayu.usercenter.common.UserConstant; import com.dayu.usercenter.common.UserConstant;
import com.dayu.usercenter.databinding.ActivitySmsLoginBinding; import com.dayu.usercenter.databinding.ActivitySmsLoginBinding;
import com.dayu.utils.AppUtils;
import com.dayu.utils.ToastUtils; import com.dayu.utils.ToastUtils;
import com.dayu.utils.UIUtils;
import com.dayu.utils.UtilsUserAccountMatcher; import com.dayu.utils.UtilsUserAccountMatcher;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;
...@@ -31,6 +34,17 @@ public class SmsLoginActivity extends DataBindingActivity<ActivitySmsLoginBindin ...@@ -31,6 +34,17 @@ public class SmsLoginActivity extends DataBindingActivity<ActivitySmsLoginBindin
@Override @Override
public void initView() { public void initView() {
String versionCode = AppUtils.getPackageNum();
if (Constants.ENVIROMENT.equals("debug")) {
mBind.environment.setText(String.format(getString(R.string.enviroment_debug),versionCode));
mBind.environment.setVisibility(View.VISIBLE);
} else if (Constants.ENVIROMENT.equals("uat")) {
mBind.environment.setVisibility(View.VISIBLE);
mBind.environment.setText(String.format(getString(R.string.enviroment_uat),versionCode));
} else if (Constants.ENVIROMENT.equals("demons")) {
mBind.environment.setVisibility(View.VISIBLE);
mBind.environment.setText(String.format(getString(R.string.enviroment_demons),versionCode));
}
mBind.tvAgreement.setOnClickListener(v -> { mBind.tvAgreement.setOnClickListener(v -> {
Intent intent = new Intent(mActivity, AgreementActivity.class); Intent intent = new Intent(mActivity, AgreementActivity.class);
startActivity(intent); startActivity(intent);
...@@ -49,6 +63,7 @@ public class SmsLoginActivity extends DataBindingActivity<ActivitySmsLoginBindin ...@@ -49,6 +63,7 @@ public class SmsLoginActivity extends DataBindingActivity<ActivitySmsLoginBindin
} }
}); });
mBind.next.setOnClickListener(v -> { mBind.next.setOnClickListener(v -> {
UIUtils.hideSoftInputFromWindow(mActivity);
String phone = mBind.mobile.getText().toString().trim(); String phone = mBind.mobile.getText().toString().trim();
if (!UtilsUserAccountMatcher.isPhoneNum(phone)) { if (!UtilsUserAccountMatcher.isPhoneNum(phone)) {
ToastUtils.showShortToast(R.string.alipay_phone_error); ToastUtils.showShortToast(R.string.alipay_phone_error);
......
...@@ -95,19 +95,21 @@ public class HomePersonFragment extends BaseFragment<HomePersonPresenter, Fragme ...@@ -95,19 +95,21 @@ public class HomePersonFragment extends BaseFragment<HomePersonPresenter, Fragme
public void getPersonalInfoSuccess(EngineerInfo info) { public void getPersonalInfoSuccess(EngineerInfo info) {
mUserName = info.getRealName(); mUserName = info.getRealName();
mBind.tvName.setText(mUserName); mBind.tvName.setText(mUserName);
mBind.tvAge.setText(info.getAge() + mActivity.getString(R.string.age));
if (info.getGender() == 1) { if (info.getGender() == 1) {
mBind.tvSex.setText(mActivity.getString(R.string.man)); mBind.tvSex.setText(mActivity.getString(R.string.man));
} else if (info.getGender() == 0) { } else if (info.getGender() == 0) {
mBind.tvSex.setText(mActivity.getString(R.string.female)); mBind.tvSex.setText(mActivity.getString(R.string.female));
} else { } else if (TextUtils.isEmpty(info.getIdentity())) {
mBind.tvSex.setText(mActivity.getString(R.string.unknown)); mBind.tvSex.setText(mActivity.getString(R.string.unknown));
mBind.tvAge.setText(mActivity.getString(R.string.unknown));
} }
if (mDetectStatus == 1 && !TextUtils.isEmpty((String) SPUtils.get("USER_IDENTITY", ""))) { SPUtils.put("USER_IDENTITY", info.getIdentity());
if (UserManager.getInstance().getUser().getDetectStatus() == 1 && !TextUtils.isEmpty((String) SPUtils.get("USER_IDENTITY", ""))) {
mBind.ivAudited.setImageResource(R.drawable.icon_authentication); mBind.ivAudited.setImageResource(R.drawable.icon_authentication);
} else { } else {
mBind.ivAudited.setImageResource(R.drawable.icon_unauthentication); mBind.ivAudited.setImageResource(R.drawable.icon_unauthentication);
} }
mBind.tvAge.setText(info.getAge() + mActivity.getString(R.string.age));
mUserPhone = info.getMobile(); mUserPhone = info.getMobile();
mBind.tvPhone.setText(mUserPhone); mBind.tvPhone.setText(mUserPhone);
SPUtils.put("USER_PHONE", mUserPhone); SPUtils.put("USER_PHONE", mUserPhone);
......
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.activity.PwLoginActivity" android:name=".ui.activity.PwLoginActivity"
android:windowSoftInputMode="stateVisible|adjustResize"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.activity.CertificationResultActivity" android:name=".ui.activity.CertificationResultActivity"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <android.support.v7.widget.Toolbar
android:id="@+id/time_title" android:id="@+id/toolbar"
style="@style/title" android:layout_width="match_parent"
> android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:navigationIcon="@drawable/back_btn_normal">
<TextView <TextView
android:id="@+id/title_text" android:id="@+id/tv_title"
style="@style/text_title" style="@style/toolbar_title" />
android:text="@string/title_agreement" </android.support.v7.widget.Toolbar>
/>
<ImageView
android:id="@+id/title_back"
style="@style/title_image_back"
/>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_6"
android:layout_alignParentBottom="true"
android:src="@drawable/line_shape"
/>
</RelativeLayout>
<ScrollView <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="?attr/colorPrimary"
android:layout_marginTop="2dp">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:text="@string/agreement" android:textSize="16sp"
/> android:text="@string/agreement" />
</ScrollView> </ScrollView>
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data> <data>
...@@ -12,20 +13,17 @@ ...@@ -12,20 +13,17 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<android.support.v7.widget.Toolbar
<RelativeLayout android:id="@+id/toolbar"
android:id="@+id/title_back" android:layout_width="match_parent"
style="@style/title"> android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:navigationIcon="@drawable/back_btn_normal">
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
style="@style/text_title" /> style="@style/toolbar_title" />
</android.support.v7.widget.Toolbar>
<ImageView
android:id="@+id/receiving_back"
style="@style/title_image_back"
android:onClick="@{()->presenter.dumpBack()}" />
</RelativeLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data> <data>
...@@ -14,25 +15,23 @@ ...@@ -14,25 +15,23 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <android.support.v7.widget.Toolbar
android:id="@+id/title_back" android:id="@+id/toolbar"
style="@style/title"> android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:navigationIcon="@drawable/back_btn_normal">
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
style="@style/text_title" /> style="@style/toolbar_title" />
</android.support.v7.widget.Toolbar>
<ImageView
android:id="@+id/receiving_back"
style="@style/title_image_back"
android:onClick="@{()->presenter.dumpBack()}" />
</RelativeLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="66dp" android:layout_height="66dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:layout_marginTop="1dp" android:layout_marginTop="2dp"
android:background="@color/white" android:background="@color/white"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="15dp" android:paddingLeft="15dp"
......
...@@ -7,6 +7,15 @@ ...@@ -7,6 +7,15 @@
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/environment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:textColor="@color/text_color"
android:visibility="gone" />
<TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -36,9 +45,9 @@ ...@@ -36,9 +45,9 @@
android:layout_toRightOf="@id/tv_86" android:layout_toRightOf="@id/tv_86"
android:background="@null" android:background="@null"
android:hint="@string/tv_login_phone_editext_hint" android:hint="@string/tv_login_phone_editext_hint"
android:textColor="@color/default_text_color"
android:maxEms="11"
android:inputType="phone" android:inputType="phone"
android:maxEms="11"
android:textColor="@color/default_text_color"
android:textSize="17sp" /> android:textSize="17sp" />
<View <View
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="presenter"
type="com.dayu.usercenter.presenter.forgetpwd.ForgetPwdPresenter" />
</data>
<data>
<variable
name="presenter"
type="com.dayu.usercenter.presenter.forgetpwd.ForgetPwdPresenter"/>
</data>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <android.support.v7.widget.Toolbar
android:id="@+id/title_back" android:id="@+id/toolbar"
style="@style/title"> android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:navigationIcon="@drawable/back_btn_normal">
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
style="@style/text_title" /> style="@style/toolbar_title" />
</android.support.v7.widget.Toolbar>
<ImageView
android:id="@+id/receiving_back"
style="@style/title_image_back"
android:onClick="@{()->presenter.dumpBack()}"
/>
</RelativeLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:paddingLeft="15dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:paddingRight="15dp"
android:background="@color/white" android:background="@color/white"
android:gravity="center_vertical"> android:gravity="center_vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -48,9 +48,9 @@ ...@@ -48,9 +48,9 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@null"
android:hint="@string/tv_login_phone_editext_hint" android:hint="@string/tv_login_phone_editext_hint"
android:inputType="phone" android:inputType="phone"
android:background="@null"
android:text="@={presenter.phoneNume}" android:text="@={presenter.phoneNume}"
android:textColor="@color/default_text_color" android:textColor="@color/default_text_color"
android:textSize="15sp" /> android:textSize="15sp" />
...@@ -65,10 +65,10 @@ ...@@ -65,10 +65,10 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:background="@color/white" android:background="@color/white"
android:gravity="center_vertical"> android:gravity="center_vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -84,9 +84,9 @@ ...@@ -84,9 +84,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1" android:layout_weight="1"
android:background="@null"
android:hint="@string/input_sms_code" android:hint="@string/input_sms_code"
android:inputType="number" android:inputType="number"
android:background="@null"
android:text="@={presenter.code}" android:text="@={presenter.code}"
android:textColor="@color/default_text_color" android:textColor="@color/default_text_color"
android:textSize="15sp" /> android:textSize="15sp" />
...@@ -101,9 +101,9 @@ ...@@ -101,9 +101,9 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:text="@string/tv_login_register_button_text"
android:alpha="0.35" android:alpha="0.35"
android:onClick="@{()->presenter.sendCode()}" android:onClick="@{()->presenter.sendCode()}"
android:text="@string/tv_login_register_button_text"
android:textColor="@color/bg_button" /> android:textColor="@color/bg_button" />
</LinearLayout> </LinearLayout>
...@@ -117,8 +117,8 @@ ...@@ -117,8 +117,8 @@
android:alpha="0.35" android:alpha="0.35"
android:background="@drawable/tab_blue_react" android:background="@drawable/tab_blue_react"
android:gravity="center" android:gravity="center"
android:text="@string/next_step"
android:onClick="@{()->presenter.next()}" android:onClick="@{()->presenter.next()}"
android:text="@string/next_step"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" /> android:textSize="16sp" />
</LinearLayout> </LinearLayout>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment