Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,296 @@
|
||||
package com.diyidan.game.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import com.diyidan.game.common.DydPreferenceManager;
|
||||
import com.diyidan.game.util.PrivacyUtils;
|
||||
import com.diyidan.game.util.Utils;
|
||||
import com.diyidan.game.widget.DydToast;
|
||||
|
||||
/* JADX INFO: loaded from: C:\Users\11789\Documents\Projects\Codex_ws\myrzx_fang\analysis\base_classes.dex */
|
||||
public class LoginDialog extends Dialog implements View.OnClickListener {
|
||||
private BaseDialog dialog;
|
||||
private CheckBox mCbPrivacy;
|
||||
private Context mContext;
|
||||
private EditText mEtName;
|
||||
private EditText mEtPassword;
|
||||
private boolean mIsEyeOpen;
|
||||
private ImageView mIvClearInput;
|
||||
private ImageView mIvCloseDialog;
|
||||
private ImageView mIvIsOpenEyes;
|
||||
private ImageView mIvQQLogin;
|
||||
private ImageView mIvWbLogin;
|
||||
private ImageView mIvWxLogin;
|
||||
private OnDialogListener mOnDilaoglistener;
|
||||
private LinearLayout mRlThirdPartyLoginContainer;
|
||||
private LinearLayout mRlTouristContainner;
|
||||
private TextView mTvFindPassword;
|
||||
private TextView mTvLogin;
|
||||
private TextView mTvLoginOtherWay;
|
||||
private TextView mTvRegister;
|
||||
private TextView mTvTitle;
|
||||
private TextView mTvTouristLogin;
|
||||
private TextView mTxPrivacy;
|
||||
|
||||
public interface OnDialogListener {
|
||||
void onClose();
|
||||
|
||||
void onFindPassWord();
|
||||
|
||||
void onLogin(String str, String str2);
|
||||
|
||||
void onQQLogin();
|
||||
|
||||
void onRegister();
|
||||
|
||||
void onTouristLogin();
|
||||
|
||||
void onWeiboLogin();
|
||||
|
||||
void onWeixinLogin();
|
||||
}
|
||||
|
||||
public LoginDialog setTitle(String str) {
|
||||
return this;
|
||||
}
|
||||
|
||||
private LoginDialog(Context context) {
|
||||
super(context);
|
||||
this.mIsEyeOpen = false;
|
||||
this.dialog = new BaseDialog(context);
|
||||
this.mContext = context;
|
||||
View viewInflate = View.inflate(context, Utils.getLayoutId(context, "newdialog"), null);
|
||||
findViews(viewInflate);
|
||||
this.dialog.setContentView(viewInflate);
|
||||
}
|
||||
|
||||
public LoginDialog(Context context, String str) {
|
||||
super(context);
|
||||
this.mIsEyeOpen = false;
|
||||
this.dialog = new BaseDialog(context);
|
||||
this.mContext = context;
|
||||
View viewInflate = View.inflate(context, Utils.getLayoutId(context, "dialog_login"), null);
|
||||
findViews(viewInflate);
|
||||
this.dialog.setContentView(viewInflate);
|
||||
}
|
||||
|
||||
private void findViews(View view) {
|
||||
this.mEtName = (EditText) view.findViewById(Utils.getViewId(this.mContext, "et_name"));
|
||||
this.mEtPassword = (EditText) view.findViewById(Utils.getViewId(this.mContext, "et_password"));
|
||||
this.mIvClearInput = (ImageView) view.findViewById(Utils.getViewId(this.mContext, "iv_clear_input"));
|
||||
this.mIvIsOpenEyes = (ImageView) view.findViewById(Utils.getViewId(this.mContext, "iv_is_open_eyes"));
|
||||
this.mIvCloseDialog = (ImageView) view.findViewById(Utils.getViewId(this.mContext, "iv_close"));
|
||||
this.mTvLogin = (TextView) view.findViewById(Utils.getViewId(this.mContext, "tv_login"));
|
||||
this.mTvRegister = (TextView) view.findViewById(Utils.getViewId(this.mContext, "tv_register"));
|
||||
this.mTvTouristLogin = (TextView) view.findViewById(Utils.getViewId(this.mContext, "tv_tourist_login"));
|
||||
this.mTvFindPassword = (TextView) view.findViewById(Utils.getViewId(this.mContext, "tv_find_password"));
|
||||
this.mRlThirdPartyLoginContainer = (LinearLayout) view.findViewById(Utils.getViewId(this.mContext, "rl_third_party_login_container"));
|
||||
this.mIvQQLogin = (ImageView) view.findViewById(Utils.getViewId(this.mContext, "iv_qq_login"));
|
||||
this.mIvWxLogin = (ImageView) view.findViewById(Utils.getViewId(this.mContext, "iv_wx_login"));
|
||||
this.mIvWbLogin = (ImageView) view.findViewById(Utils.getViewId(this.mContext, "iv_wb_login"));
|
||||
this.mTvTitle = (TextView) view.findViewById(Utils.getViewId(this.mContext, "tv_title"));
|
||||
this.mRlTouristContainner = (LinearLayout) view.findViewById(Utils.getViewId(this.mContext, "rl_other_function_container"));
|
||||
this.mTvLoginOtherWay = (TextView) view.findViewById(Utils.getViewId(this.mContext, "tv_other_way"));
|
||||
this.mCbPrivacy = (CheckBox) view.findViewById(Utils.getViewId(this.mContext, "cb_privacy"));
|
||||
this.mTxPrivacy = (TextView) view.findViewById(Utils.getViewId(this.mContext, "tv_privacy"));
|
||||
this.mTvLogin.setOnClickListener(this);
|
||||
this.mTvRegister.setOnClickListener(this);
|
||||
this.mTvTouristLogin.setOnClickListener(this);
|
||||
this.mTvFindPassword.setOnClickListener(this);
|
||||
this.mIvClearInput.setOnClickListener(this);
|
||||
this.mIvCloseDialog.setOnClickListener(this);
|
||||
this.mIvIsOpenEyes.setOnClickListener(this);
|
||||
this.mIvQQLogin.setOnClickListener(this);
|
||||
this.mIvWxLogin.setOnClickListener(this);
|
||||
this.mIvWbLogin.setOnClickListener(this);
|
||||
this.mEtName.addTextChangedListener(new TextWatcher() { // from class: com.diyidan.game.dialog.LoginDialog.1
|
||||
CharSequence cs;
|
||||
|
||||
@Override // android.text.TextWatcher
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
||||
}
|
||||
|
||||
@Override // android.text.TextWatcher
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
||||
this.cs = charSequence;
|
||||
}
|
||||
|
||||
@Override // android.text.TextWatcher
|
||||
public void afterTextChanged(Editable editable) {
|
||||
if (this.cs.length() > 0) {
|
||||
LoginDialog.this.mIvClearInput.setVisibility(0);
|
||||
} else {
|
||||
LoginDialog.this.mIvClearInput.setVisibility(8);
|
||||
}
|
||||
}
|
||||
});
|
||||
TextView textView = this.mTxPrivacy;
|
||||
textView.setText(PrivacyUtils.getPrivacyText(this.mContext, textView.getText().toString()));
|
||||
this.mTxPrivacy.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
}
|
||||
|
||||
public static LoginDialog getDialog(Context context) {
|
||||
return new LoginDialog(context);
|
||||
}
|
||||
|
||||
public void dismissDialog() {
|
||||
this.dialog.dismiss();
|
||||
}
|
||||
|
||||
public void showDialog() {
|
||||
this.dialog.show();
|
||||
WindowManager.LayoutParams attributes = this.dialog.getWindow().getAttributes();
|
||||
attributes.width = Utils.getDimen(this.mContext, "x994");
|
||||
attributes.height = Utils.getDimen(this.mContext, "y737");
|
||||
this.dialog.getWindow().setAttributes(attributes);
|
||||
setThirdPartyVisible(false);
|
||||
this.mEtPassword.setText(DydPreferenceManager.getInstance(this.mContext).getPWD());
|
||||
this.mEtName.setText(DydPreferenceManager.getInstance(this.mContext).getUserMobile());
|
||||
}
|
||||
|
||||
public LoginDialog isCancelable(boolean z) {
|
||||
this.dialog.setCanceledOnTouchOutside(z);
|
||||
this.dialog.setCancelable(z);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (this.mOnDilaoglistener == null) {
|
||||
return;
|
||||
}
|
||||
int id = view.getId();
|
||||
if (id == Utils.getViewId(this.mContext, "tv_login")) {
|
||||
if (!this.mCbPrivacy.isChecked()) {
|
||||
DydToast.toastShort(this.mContext, "请勾选同意下方的用户协议,隐私协议,未成年人保护协议");
|
||||
return;
|
||||
}
|
||||
if (Utils.isNull(this.mEtName.getText().toString().trim())) {
|
||||
DydToast.toastShort(this.mContext, "手机号不能为空哦~");
|
||||
return;
|
||||
}
|
||||
if (!Utils.isMobileValid(this.mEtName.getText().toString().trim())) {
|
||||
DydToast.toastShort(this.mContext, "手机号不合法~");
|
||||
return;
|
||||
}
|
||||
if (Utils.isNull(this.mEtPassword.getText().toString().trim())) {
|
||||
DydToast.toastShort(this.mContext, "密码不能为空哦~");
|
||||
return;
|
||||
}
|
||||
if (this.mEtPassword.getText().toString().trim().length() < 6 || this.mEtPassword.getText().toString().trim().length() > 18) {
|
||||
DydToast.toastShort(this.mContext, "密码6-18位哦~");
|
||||
}
|
||||
this.mOnDilaoglistener.onLogin(this.mEtName.getText().toString(), this.mEtPassword.getText().toString());
|
||||
return;
|
||||
}
|
||||
if (id == Utils.getViewId(this.mContext, "tv_register")) {
|
||||
if (!this.mCbPrivacy.isChecked()) {
|
||||
DydToast.toastShort(this.mContext, "请勾选同意下方的用户协议,隐私协议,未成年人保护协议");
|
||||
return;
|
||||
} else {
|
||||
this.mOnDilaoglistener.onRegister();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (id == Utils.getViewId(this.mContext, "tv_tourist_login")) {
|
||||
if (!this.mCbPrivacy.isChecked()) {
|
||||
DydToast.toastShort(this.mContext, "请勾选同意下方的用户协议,隐私协议,未成年人保护协议");
|
||||
return;
|
||||
} else {
|
||||
this.mOnDilaoglistener.onTouristLogin();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (id == Utils.getViewId(this.mContext, "tv_find_password")) {
|
||||
this.mOnDilaoglistener.onFindPassWord();
|
||||
return;
|
||||
}
|
||||
if (id == Utils.getViewId(this.mContext, "iv_clear_input")) {
|
||||
this.mEtName.setText("");
|
||||
this.mIvClearInput.setVisibility(8);
|
||||
return;
|
||||
}
|
||||
if (id == Utils.getViewId(this.mContext, "iv_close")) {
|
||||
dismissDialog();
|
||||
this.mOnDilaoglistener.onClose();
|
||||
return;
|
||||
}
|
||||
if (id == Utils.getViewId(this.mContext, "iv_is_open_eyes")) {
|
||||
boolean z = !this.mIsEyeOpen;
|
||||
this.mIsEyeOpen = z;
|
||||
changeInputType(z);
|
||||
} else if (id == Utils.getViewId(this.mContext, "iv_qq_login")) {
|
||||
this.mOnDilaoglistener.onQQLogin();
|
||||
} else if (id == Utils.getViewId(this.mContext, "iv_wx_login")) {
|
||||
this.mOnDilaoglistener.onWeixinLogin();
|
||||
} else if (id == Utils.getViewId(this.mContext, "iv_wb_login")) {
|
||||
this.mOnDilaoglistener.onWeiboLogin();
|
||||
}
|
||||
}
|
||||
|
||||
public LoginDialog setDialogListener(OnDialogListener onDialogListener) {
|
||||
this.mOnDilaoglistener = onDialogListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
private void changeInputType(boolean z) {
|
||||
if (!z) {
|
||||
this.mIvIsOpenEyes.setImageResource(Utils.getDrawablelId(this.mContext, "eye_pass_invisible"));
|
||||
this.mEtPassword.setInputType(129);
|
||||
} else {
|
||||
this.mEtPassword.setInputType(144);
|
||||
this.mIvIsOpenEyes.setImageResource(Utils.getDrawablelId(this.mContext, "eye_pass_visible"));
|
||||
}
|
||||
EditText editText = this.mEtPassword;
|
||||
editText.setSelection(editText.getText().length());
|
||||
}
|
||||
|
||||
public LoginDialog setMobile(String str) {
|
||||
this.mEtName.setText(str);
|
||||
this.mEtName.setSelection(str.length());
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoginDialog setThirdPartyVisible(boolean z) {
|
||||
if (z) {
|
||||
this.mRlThirdPartyLoginContainer.setVisibility(0);
|
||||
} else {
|
||||
this.mRlThirdPartyLoginContainer.setVisibility(8);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoginDialog setLoginText(String str) {
|
||||
this.mTvLogin.setBackgroundResource(Utils.getDrawablelId(this.mContext, "icon_bind_account_menu"));
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoginDialog setRegisterText(String str) {
|
||||
this.mTvRegister.setText(str);
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoginDialog setTouristLoginVisible(boolean z) {
|
||||
if (z) {
|
||||
this.mRlTouristContainner.setVisibility(0);
|
||||
} else {
|
||||
this.mRlTouristContainner.setVisibility(8);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoginDialog setLoginWayText(String str) {
|
||||
this.mTvLoginOtherWay.setText(str);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user