mac
2023-10-25 28880ba7540c523d3e50d35416422396ef802c50
app/src/main/java/com/hdl/photovoltaic/ui/me/MeChangePasswordActivity.java
@@ -2,7 +2,6 @@
import androidx.appcompat.content.res.AppCompatResources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
@@ -21,7 +20,6 @@
import com.hdl.photovoltaic.listener.CloudCallBeak;
import com.hdl.photovoltaic.other.HdlAccountLogic;
import com.hdl.photovoltaic.other.HdlThreadLogic;
import com.hdl.photovoltaic.widget.FlashingBoxDialog;
/**
 * 我的-修改密码-界面
@@ -99,7 +97,7 @@
        String newPsw = viewBinding.meChangePasswordNewIc.mePswEt.getText().toString().replaceAll(" +", "");
        String affirmPsw = viewBinding.meChangePasswordAffirmIc.mePswEt.getText().toString().replaceAll(" +", "");
        if (!isEditTextPassword(newPsw, affirmPsw)) {
            tipFlashingBox(AppCompatResources.getDrawable(_mActivity, R.drawable.tip_fail), getString(R.string.home_login_input_unlike_psw), -1);
            HdlThreadLogic.tipFlashingBox(_mActivity, true, getString(R.string.home_login_input_unlike_psw), -1);
            return;
        }
        if (UserConfigManage.getInstance().isBAccount()) {
@@ -107,12 +105,12 @@
            HdlAccountLogic.getInstance().updateBPassword(oldPsw, newPsw, new CloudCallBeak<String>() {
                @Override
                public void onSuccess(String str) {
                    tipFlashingBox(AppCompatResources.getDrawable(_mActivity, R.drawable.tip_succeed), getString(R.string.home_login_pws_reset_succeeded), 0);
                    HdlThreadLogic.tipFlashingBox(_mActivity, true, getString(R.string.home_login_pws_reset_succeeded), 0);
                }
                @Override
                public void onFailure(HDLException e) {
                    tipFlashingBox(AppCompatResources.getDrawable(_mActivity, R.drawable.tip_fail), e.getMsg(), e.getCode());
                    HdlThreadLogic.tipFlashingBox(_mActivity, false, e.getMsg(), e.getCode());
                }
            });
        } else {
@@ -120,12 +118,12 @@
            HdlAccountLogic.getInstance().updateCPassword(oldPsw, newPsw, new CloudCallBeak<String>() {
                @Override
                public void onSuccess(String obj) {
                    tipFlashingBox(AppCompatResources.getDrawable(_mActivity, R.drawable.tip_succeed), getString(R.string.home_login_pws_reset_succeeded), 0);
                    HdlThreadLogic.tipFlashingBox(_mActivity, true, getString(R.string.home_login_pws_reset_succeeded), 0);
                }
                @Override
                public void onFailure(HDLException e) {
                    tipFlashingBox(AppCompatResources.getDrawable(_mActivity, R.drawable.tip_fail), e.getMsg(), e.getCode());
                    HdlThreadLogic.tipFlashingBox(_mActivity, false, e.getMsg(), e.getCode());
                }
            });
@@ -134,31 +132,12 @@
    /**
     * 提示框
     *
     * @param drawable 图标
     * @param msg      信息
     * @param code     状态
     */
    private void tipFlashingBox(Drawable drawable, String msg, int code) {
        HdlThreadLogic.runMainThread(new Runnable() {
            @Override
            public void run() {
                FlashingBoxDialog flashingBoxDialog = new FlashingBoxDialog(_mActivity);
                flashingBoxDialog.setImage(drawable);
                flashingBoxDialog.setContent(msg + "\r\n(" + code + ")");
                flashingBoxDialog.show();
            }
        }, null, null);
    }
    /**
     * 初始化
     */
    private void initView() {
        viewBinding.toolbarTopFragmentHouseListRl.topBarView.setBackgroundColor(getResources().getColor(R.color.text_FFFFFFFF));
        viewBinding.toolbarTopFragmentHouseListRl.topBarView.setBackgroundColor(getResources().getColor(R.color.text_FFFFFFFF,null));
        viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setText(R.string.home_login_change_password);
        viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setTextColor(getResources().getColor(R.color.text_030D1C));
        viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setTextColor(getResources().getColor(R.color.text_030D1C,null));
        viewBinding.toolbarTopFragmentHouseListRl.topBackBtn.setVisibility(View.VISIBLE);
        viewBinding.meChangePasswordOldIc.mePswTitleTv.setText(R.string.home_login_old_pws);
        viewBinding.meChangePasswordOldIc.mePswEt.setHint(R.string.home_login_input_old_pws);