登录页部分UI
This commit is contained in:
@@ -433,6 +433,17 @@
|
||||
android:label="登录界面"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.login.LoginPhoneActivity"
|
||||
android:label="输入手机号界面"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".ui.login.LoginVertificationActivity"
|
||||
android:label="输入验证码界面"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".ui.login.QQLoginSelectMemberTypeActivity"
|
||||
android:label="QQ登录界面"
|
||||
|
@@ -182,6 +182,7 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
mTitleBar.setImmersive(false);
|
||||
mTitleBar.setTitleColor(getResources().getColor(R.color.back_font));
|
||||
mTitleBar.setLeftImageResource(R.mipmap.common_ic_back);
|
||||
mTitleBar.setCommonBackgroundColor(getResources().getColor(R.color.transparent));
|
||||
mTitleBar.setLeftClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@@ -0,0 +1,169 @@
|
||||
package com.yizhuan.erban.ui.login;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.text.Editable;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import com.ishumei.smantifraud.SmAntiFraud;
|
||||
import com.netease.mobsec.rjsb.watchman;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.trello.rxlifecycle2.android.ActivityEvent;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.UIHelper;
|
||||
import com.yizhuan.erban.base.BaseActivity;
|
||||
import com.yizhuan.erban.base.BaseLoginAct;
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity;
|
||||
import com.yizhuan.erban.utils.KeyBoardUtils;
|
||||
import com.yizhuan.xchat_android_constants.XChatConstants;
|
||||
import com.yizhuan.xchat_android_core.UriProvider;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.auth.event.LoginEvent;
|
||||
import com.yizhuan.xchat_android_core.auth.exception.BanAccountException;
|
||||
import com.yizhuan.xchat_android_core.auth.exception.IsSuperAdminException;
|
||||
import com.yizhuan.xchat_android_core.auth.exception.ShowPhoneCodeException;
|
||||
import com.yizhuan.xchat_android_core.code.CodeModel;
|
||||
import com.yizhuan.xchat_android_core.code.CodeType;
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||
import com.yizhuan.xchat_android_library.utils.DeviceUuidFactory;
|
||||
import com.yizhuan.xchat_android_library.utils.TextWatcherWrapper;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/**
|
||||
* @author zhouxiangfeng
|
||||
* @date 17/2/26
|
||||
*/
|
||||
public class LoginPhoneActivity extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
private static final String TAG = "LoginPhoneActivity";
|
||||
|
||||
private EditText accountEt;
|
||||
private Button btnNext;
|
||||
|
||||
private AccountValidator accountValidator = new AccountValidator();
|
||||
private TextWatcher textWatcher = new TextWatcherWrapper() {
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
checkInput();
|
||||
}
|
||||
};
|
||||
private boolean isSuperAdmin = false;
|
||||
|
||||
public static void start(Context context) {
|
||||
Intent intent = new Intent(context, LoginPhoneActivity.class);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
public static void startForResult(Activity context, int requestCode) {
|
||||
Intent intent = new Intent(context, LoginPhoneActivity.class);
|
||||
context.startActivityForResult(intent, requestCode); // startActivityForResult会导致singletop,singletask失效
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_login_phone);
|
||||
initTitleBar("");
|
||||
onFindViews();
|
||||
onSetListener();
|
||||
// permission();
|
||||
// showLoginTip();
|
||||
// AuthModel.get().isFromLogin = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setStatusBar() {
|
||||
StatusBarLightModes(true);
|
||||
}
|
||||
|
||||
private void onFindViews() {
|
||||
accountEt = findViewById(R.id.et_account);
|
||||
btnNext = findViewById(R.id.btn_next);
|
||||
}
|
||||
|
||||
private void onSetListener() {
|
||||
btnNext.setOnClickListener(this);
|
||||
btnNext.setEnabled(false);
|
||||
accountEt.addTextChangedListener(textWatcher);
|
||||
|
||||
}
|
||||
|
||||
private void checkInput() {
|
||||
if (!TextUtils.isEmpty(accountEt.getText().toString()) && accountEt.getText().toString().length() == 11) {
|
||||
btnNext.setEnabled(true);
|
||||
} else {
|
||||
btnNext.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_next:
|
||||
if (!accountValidator.isValid(accountEt.getText().toString())) {
|
||||
toast(accountValidator.getErrorMessage());
|
||||
return;
|
||||
}
|
||||
LoginVertificationActivity.start(LoginPhoneActivity.this,accountEt.getText().toString());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean needSteepStateBar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
accountEt = null;
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
View view = getCurrentFocus();
|
||||
boolean isPressEdit = false;
|
||||
if (view instanceof EditText) {
|
||||
if (event.getRawX() >= view.getX() && event.getRawX() <= view.getX() + view.getWidth() && event.getRawY() >= view.getY() && event.getRawY() <= view.getY() + view.getHeight()) {
|
||||
isPressEdit = true;
|
||||
}
|
||||
}
|
||||
if (!isPressEdit) {
|
||||
hideIME();
|
||||
}
|
||||
return super.onTouchEvent(event);
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,115 @@
|
||||
package com.yizhuan.erban.ui.login;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.base.BaseActivity;
|
||||
import com.yizhuan.erban.ui.login.ui.CodeEditText;
|
||||
import com.yizhuan.xchat_android_library.utils.TextWatcherWrapper;
|
||||
|
||||
/**
|
||||
* @author zhouxiangfeng
|
||||
* @date 17/2/26
|
||||
*/
|
||||
public class LoginVertificationActivity extends BaseActivity {
|
||||
|
||||
private static final String TAG = "LoginVertificationActivity";
|
||||
|
||||
private com.yizhuan.erban.ui.login.ui.CodeEditText codeEt;
|
||||
private TextView tvGetCode,tvDesc,tvSecond;
|
||||
private String mPhone;
|
||||
|
||||
public static void start(Context context,String phone) {
|
||||
Intent intent = new Intent(context, LoginVertificationActivity.class);
|
||||
intent.putExtra("phone",phone);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
public static void startForResult(Activity context, int requestCode) {
|
||||
Intent intent = new Intent(context, LoginVertificationActivity.class);
|
||||
context.startActivityForResult(intent, requestCode); // startActivityForResult会导致singletop,singletask失效
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_login_vertification);
|
||||
initTitleBar("");
|
||||
onFindViews();
|
||||
initData();
|
||||
onSetListener();
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void initData() {
|
||||
mPhone = getIntent().getStringExtra("phone");
|
||||
tvDesc.setText(getString(R.string.str_send_code_success)+mPhone);
|
||||
|
||||
|
||||
tvSecond.setText("60");
|
||||
tvGetCode.setText(Html.fromHtml("<font color=#F770FF font-size=10dp>s </font>" + "后可重新获取验证码"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setStatusBar() {
|
||||
StatusBarLightModes(true);
|
||||
}
|
||||
|
||||
private void onFindViews() {
|
||||
codeEt = findViewById(R.id.et_code);
|
||||
tvGetCode = findViewById(R.id.tv_get_code);
|
||||
tvDesc = findViewById(R.id.tv_desc);
|
||||
tvSecond = findViewById(R.id.tv_second);
|
||||
}
|
||||
|
||||
private void onSetListener() {
|
||||
codeEt.setOnTextFinishListener(new CodeEditText.OnTextFinishListener() {
|
||||
@Override
|
||||
public void onTextFinish(CharSequence text, int length) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean needSteepStateBar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
codeEt = null;
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
View view = getCurrentFocus();
|
||||
boolean isPressEdit = false;
|
||||
if (view instanceof EditText) {
|
||||
if (event.getRawX() >= view.getX() && event.getRawX() <= view.getX() + view.getWidth() && event.getRawY() >= view.getY() && event.getRawY() <= view.getY() + view.getHeight()) {
|
||||
isPressEdit = true;
|
||||
}
|
||||
}
|
||||
if (!isPressEdit) {
|
||||
hideIME();
|
||||
}
|
||||
return super.onTouchEvent(event);
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,238 @@
|
||||
package com.yizhuan.erban.ui.login.ui;
|
||||
|
||||
import android.animation.ValueAnimator;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.TextPaint;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.TypedValue;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
import com.yizhuan.erban.R;
|
||||
|
||||
/**
|
||||
* 验证码输入框,重写EditText的绘制方法实现。
|
||||
* @author RAE
|
||||
*/
|
||||
public class CodeEditText extends android.support.v7.widget.AppCompatEditText {
|
||||
|
||||
|
||||
private int mTextColor;
|
||||
|
||||
public interface OnTextFinishListener {
|
||||
|
||||
void onTextFinish(CharSequence text, int length);
|
||||
}
|
||||
|
||||
// 输入的最大长度
|
||||
private int mMaxLength = 4;
|
||||
// 边框宽度
|
||||
private int mStrokeWidth;
|
||||
// 边框高度
|
||||
private int mStrokeHeight;
|
||||
// 边框之间的距离
|
||||
private int mStrokePadding = 20;
|
||||
|
||||
|
||||
private final Rect mRect = new Rect();
|
||||
|
||||
|
||||
/**
|
||||
* 输入结束监听
|
||||
*/
|
||||
private OnTextFinishListener mOnInputFinishListener;
|
||||
|
||||
// 方框的背景
|
||||
private Drawable mStrokeDrawable;
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
*
|
||||
*/
|
||||
public CodeEditText(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.CodeEditText);
|
||||
int indexCount = typedArray.getIndexCount();
|
||||
for (int i = 0; i < indexCount; i++) {
|
||||
int index = typedArray.getIndex(i);
|
||||
if (index == R.styleable.CodeEditText_strokeHeight) {
|
||||
this.mStrokeHeight = (int) typedArray.getDimension(index, 60);
|
||||
} else if (index == R.styleable.CodeEditText_strokeWidth) {
|
||||
this.mStrokeWidth = (int) typedArray.getDimension(index, 60);
|
||||
|
||||
} else if (index == R.styleable.CodeEditText_strokePadding) {
|
||||
this.mStrokePadding = (int) typedArray.getDimension(index, 20);
|
||||
|
||||
} else if (index == R.styleable.CodeEditText_strokeBackground) {
|
||||
this.mStrokeDrawable = typedArray.getDrawable(index);
|
||||
|
||||
} else if (index == R.styleable.CodeEditText_strokeLength) {
|
||||
this.mMaxLength = typedArray.getInteger(index, 4);
|
||||
}
|
||||
}
|
||||
typedArray.recycle();
|
||||
|
||||
if (mStrokeDrawable == null) {
|
||||
throw new NullPointerException("stroke drawable not allowed to be null!");
|
||||
}
|
||||
|
||||
setMaxLength(mMaxLength);
|
||||
setLongClickable(false);
|
||||
// 去掉背景颜色
|
||||
setBackgroundColor(Color.TRANSPARENT);
|
||||
// 不显示光标
|
||||
setCursorVisible(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTextContextMenuItem(int id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// private int px(int size) {
|
||||
// return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, size, getResources().getDisplayMetrics());
|
||||
// }
|
||||
|
||||
/**
|
||||
* 设置最大长度
|
||||
*/
|
||||
private void setMaxLength(int maxLength) {
|
||||
if (maxLength >= 0) {
|
||||
setFilters(new InputFilter[]{new InputFilter.LengthFilter(maxLength)});
|
||||
} else {
|
||||
setFilters(new InputFilter[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
|
||||
int width = getMeasuredWidth();
|
||||
int height = getMeasuredHeight();
|
||||
int widthMode = MeasureSpec.getMode(widthMeasureSpec);
|
||||
int heightMode = MeasureSpec.getMode(heightMeasureSpec);
|
||||
|
||||
// 判断高度是否小于推荐高度
|
||||
if (height < mStrokeHeight) {
|
||||
height = mStrokeHeight;
|
||||
}
|
||||
|
||||
// 判断高度是否小于推荐宽度
|
||||
int recommendWidth = mStrokeWidth * mMaxLength + mStrokePadding * (mMaxLength - 1);
|
||||
if (width < recommendWidth) {
|
||||
width = recommendWidth;
|
||||
}
|
||||
|
||||
widthMeasureSpec = MeasureSpec.makeMeasureSpec(width, widthMode);
|
||||
heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, heightMode);
|
||||
setMeasuredDimension(widthMeasureSpec, heightMeasureSpec);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
mTextColor = getCurrentTextColor();
|
||||
setTextColor(Color.TRANSPARENT);
|
||||
super.onDraw(canvas);
|
||||
setTextColor(mTextColor);
|
||||
// 重绘背景颜色
|
||||
drawStrokeBackground(canvas);
|
||||
// 重绘文本
|
||||
drawText(canvas);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 重绘背景
|
||||
*/
|
||||
private void drawStrokeBackground(Canvas canvas) {
|
||||
// 绘制方框背景颜色
|
||||
mRect.left = 0;
|
||||
mRect.top = 0;
|
||||
mRect.right = mStrokeWidth;
|
||||
mRect.bottom = mStrokeHeight;
|
||||
int count = canvas.getSaveCount();
|
||||
canvas.save();
|
||||
for (int i = 0; i < mMaxLength; i++) {
|
||||
mStrokeDrawable.setBounds(mRect);
|
||||
mStrokeDrawable.setState(new int[]{android.R.attr.state_enabled});
|
||||
mStrokeDrawable.draw(canvas);
|
||||
float dx = mRect.right + mStrokePadding;
|
||||
// 移动画布
|
||||
canvas.save();
|
||||
canvas.translate(dx, 0);
|
||||
}
|
||||
canvas.restoreToCount(count);
|
||||
canvas.translate(0, 0);
|
||||
|
||||
// 绘制激活状态的边框
|
||||
// 当前激活的索引
|
||||
int activatedIndex = Math.max(0, getEditableText().length());
|
||||
mRect.left = mStrokeWidth * activatedIndex + mStrokePadding * activatedIndex;
|
||||
mRect.right = mRect.left + mStrokeWidth;
|
||||
mStrokeDrawable.setState(new int[]{android.R.attr.state_focused});
|
||||
mStrokeDrawable.setBounds(mRect);
|
||||
mStrokeDrawable.draw(canvas);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 重绘文本
|
||||
*/
|
||||
private void drawText(Canvas canvas) {
|
||||
int count = canvas.getSaveCount();
|
||||
canvas.translate(0, 0);
|
||||
int length = getEditableText().length();
|
||||
for (int i = 0; i < length; i++) {
|
||||
String text = String.valueOf(getEditableText().charAt(i));
|
||||
TextPaint textPaint = getPaint();
|
||||
textPaint.setColor(mTextColor);
|
||||
// 获取文本大小
|
||||
textPaint.getTextBounds(text, 0, 1, mRect);
|
||||
// 计算(x,y) 坐标
|
||||
int x = mStrokeWidth / 2 + (mStrokeWidth + mStrokePadding) * i - (mRect.centerX());
|
||||
int y = canvas.getHeight() / 2 + mRect.height() / 2;
|
||||
canvas.drawText(text, x, y, textPaint);
|
||||
}
|
||||
canvas.restoreToCount(count);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onTextChanged(CharSequence text, int start,
|
||||
int lengthBefore, int lengthAfter) {
|
||||
super.onTextChanged(text, start, lengthBefore, lengthAfter);
|
||||
|
||||
// 当前文本长度
|
||||
int textLength = getEditableText().length();
|
||||
|
||||
if (textLength == mMaxLength) {
|
||||
hideSoftInput();
|
||||
if (mOnInputFinishListener != null) {
|
||||
mOnInputFinishListener.onTextFinish(getEditableText().toString(), mMaxLength);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void hideSoftInput() {
|
||||
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (imm != null)
|
||||
imm.hideSoftInputFromWindow(getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置输入完成监听
|
||||
*/
|
||||
public void setOnTextFinishListener(OnTextFinishListener onInputFinishListener) {
|
||||
this.mOnInputFinishListener = onInputFinishListener;
|
||||
}
|
||||
|
||||
}
|
BIN
app/src/main/res/drawable-xhdpi/ic_login_next_disable.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_login_next_disable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_login_next_enable.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_login_next_enable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
6
app/src/main/res/drawable/bg_code_edit.xml
Normal file
6
app/src/main/res/drawable/bg_code_edit.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#30ffffff" />
|
||||
<corners android:radius="10dp" />
|
||||
</shape>
|
6
app/src/main/res/drawable/selector_login_phone_next.xml
Normal file
6
app/src/main/res/drawable/selector_login_phone_next.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:state_enabled="false" android:drawable="@drawable/ic_login_next_disable"/>
|
||||
<item android:state_enabled="true" android:drawable="@drawable/ic_login_next_enable"/>
|
||||
|
||||
</selector>
|
@@ -325,4 +325,12 @@
|
||||
<declare-styleable name="LivingIconView">
|
||||
<attr name="cus_drawable" format="reference"/>
|
||||
</declare-styleable>
|
||||
<declare-styleable name="CodeEditText">
|
||||
<attr name="strokeLength" format="integer" />
|
||||
<attr name="strokeWidth" format="dimension" />
|
||||
<attr name="strokeHeight" format="dimension" />
|
||||
<attr name="strokePadding" format="dimension" />
|
||||
<attr name="strokeBackground" format="reference" />
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
|
@@ -529,6 +529,7 @@
|
||||
<color name="color_1CE9E7">#1CE9E7</color>
|
||||
<color name="color_45F1E5">#45F1E5</color>
|
||||
<color name="color_ABAAB2">#ABAAB2</color>
|
||||
<color name="color_F770FF">#F770FF</color>
|
||||
|
||||
|
||||
</resources>
|
||||
|
@@ -14,7 +14,7 @@
|
||||
<string name="title_activity_scrolling">ScrollingActivity</string>
|
||||
|
||||
|
||||
<string name="hint_login_account">请输入您的手机号/66陪玩ID</string>
|
||||
<string name="hint_login_account">手机号</string>
|
||||
<string name="hint_login_account_2">请输入您的手机号/兔兔ID</string>
|
||||
<string name="hint_login_password">请输入您的密码</string>
|
||||
<string name="hint_login_password_2">请输入密码</string>
|
||||
@@ -868,6 +868,7 @@
|
||||
<string name="my_room">我的房间</string>
|
||||
<string name="collect_room">收藏房间</string>
|
||||
<string name="ranking">榜单</string>
|
||||
<string name="str_send_code_success">验证码已发送至</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
@@ -510,6 +510,10 @@
|
||||
<item name="colorControlActivated">@color/color_333333</item>
|
||||
</style>
|
||||
|
||||
<style name="common_login_edit_style" parent="Theme.AppCompat.Light">
|
||||
<item name="android:background">@drawable/shape_trans_radius_10</item>
|
||||
</style>
|
||||
|
||||
<style name="style_login_btn">
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">43dp</item>
|
||||
|
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout 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:background="@mipmap/bg_login">
|
||||
|
||||
<com.yizhuan.erban.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/transparent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="你的手机号是多少"
|
||||
android:textStyle="bold"
|
||||
android:textSize="@dimen/text_size_18"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="170dp"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_account"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title"
|
||||
android:layout_marginStart="75dp"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginEnd="75dp"
|
||||
android:background="@drawable/shape_trans_radius_10"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:text="+86"
|
||||
/>
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/et_account"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="number"
|
||||
android:maxLength="11"
|
||||
android:paddingBottom="@dimen/dp_15"
|
||||
android:paddingTop="@dimen/dp_15"
|
||||
android:textColor="@color/white"
|
||||
android:background="@null"
|
||||
android:textSize="@dimen/dp_15"
|
||||
android:text="15692013142"
|
||||
tools:ignore="SpUsage" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_next"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@drawable/selector_login_phone_next"
|
||||
android:layout_marginTop="45dp"
|
||||
android:enabled="false"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_account" />
|
||||
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout 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:background="@mipmap/bg_login">
|
||||
|
||||
<com.yizhuan.erban.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/transparent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="填写验证码"
|
||||
android:textSize="@dimen/text_size_18"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="170dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:text="验证码已发送"
|
||||
/>
|
||||
|
||||
<com.yizhuan.erban.ui.login.ui.CodeEditText
|
||||
android:id="@+id/et_code"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="number"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_desc"
|
||||
android:layout_marginTop="30dp"
|
||||
app:strokeHeight="@dimen/dp_45"
|
||||
app:strokeLength="5"
|
||||
app:strokePadding="@dimen/dp_10"
|
||||
app:strokeWidth="@dimen/dp_36"
|
||||
app:strokeBackground="@drawable/bg_code_edit"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@id/et_code"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_second"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_F770FF"
|
||||
android:textSize="@dimen/sp_15"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_get_code"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:textColor="@color/white"
|
||||
android:text="s 后可重新获取"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#30ffffff" />
|
||||
<corners android:radius="10dp" />
|
||||
</shape>
|
@@ -25,14 +25,19 @@ import com.tongdaxing.erban.upgrade.AppUpgradeHelper;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.base.BaseLoginAct;
|
||||
import com.yizhuan.erban.ui.login.LoginActivity;
|
||||
import com.yizhuan.erban.ui.login.LoginPhoneActivity;
|
||||
import com.yizhuan.xchat_android_constants.XChatConstants;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.auth.event.LoginEvent;
|
||||
import com.yizhuan.xchat_android_core.auth.exception.BanAccountException;
|
||||
import com.yizhuan.xchat_android_core.auth.exception.IsSuperAdminException;
|
||||
import com.yizhuan.xchat_android_core.initial.InitialModel;
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
@@ -114,7 +119,6 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
switch (v.getId()) {
|
||||
case R.id.img_wx_login:
|
||||
wxLogin();
|
||||
@@ -131,11 +135,11 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
break;
|
||||
|
||||
case R.id.img_phone_login:
|
||||
phoneLogin.setEnabled(false);
|
||||
// phoneLogin.setEnabled(false);
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.Event.EVENT_ONE_CLICK_LOGIN_CHANGE_ID, "一键登录-切换账号");
|
||||
getDialogManager().showProgressDialog(QuickPassLoginAct.this);
|
||||
LoginActivity.startForResult(QuickPassLoginAct.this, quickPassRequestCode);
|
||||
// getDialogManager().showProgressDialog(QuickPassLoginAct.this);
|
||||
LoginPhoneActivity.start(QuickPassLoginAct.this);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -169,7 +173,7 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
toast("一键登录失败,请使用其他方式登录");
|
||||
LogUtil.e("QuickPassLogin", msg);
|
||||
getDialogManager().dismissDialog();
|
||||
// LoginActivity.startForResult(QuickPassLoginAct.this, quickPassRequestCode);
|
||||
// LoginPhoneActivity.startForResult(QuickPassLoginAct.this, quickPassRequestCode);
|
||||
tvLoginQuickPass.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
});
|
||||
@@ -219,7 +223,7 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
@Override
|
||||
public void onGetTokenError(String s, String s1) {
|
||||
toast("一键登录失败,请使用其他登录方式");
|
||||
LoginActivity.startForResult(QuickPassLoginAct.this, quickPassRequestCode);
|
||||
LoginPhoneActivity.startForResult(QuickPassLoginAct.this, quickPassRequestCode);
|
||||
setClickEnable(true);
|
||||
}
|
||||
|
||||
@@ -256,7 +260,7 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
spannableString, "确定", "取消", null);
|
||||
} else {
|
||||
toast(e.getMessage());
|
||||
LoginActivity.startForResult(QuickPassLoginAct.this, quickPassRequestCode);
|
||||
LoginPhoneActivity.startForResult(QuickPassLoginAct.this, quickPassRequestCode);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -274,7 +278,7 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
getDialogManager().dismissDialog();
|
||||
phoneLogin.setEnabled(true);
|
||||
// phoneLogin.setEnabled(true);
|
||||
|
||||
if (resultCode == RESULT_OK) {
|
||||
if (requestCode == quickPassRequestCode) {
|
||||
@@ -300,10 +304,21 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
if (qqLogin != null) {
|
||||
qqLogin.setEnabled(enable);
|
||||
}
|
||||
if (phoneLogin != null) {
|
||||
phoneLogin.setEnabled(enable);
|
||||
}
|
||||
// if (phoneLogin != null) {
|
||||
// phoneLogin.setEnabled(enable);
|
||||
// }
|
||||
canClick = enable;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册成功后发送过来的事件
|
||||
*/
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void onLoginEvent(LoginEvent event) {
|
||||
// getDialogManager().dismissDialog();
|
||||
// setResult(RESULT_OK);
|
||||
// finish();
|
||||
// }
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user