|
|
@@ -6,6 +6,7 @@ import android.support.v4.app.Fragment;
|
|
|
import android.text.TextUtils;
|
|
|
import android.text.method.HideReturnsTransformationMethod;
|
|
|
import android.text.method.PasswordTransformationMethod;
|
|
|
+import android.view.KeyEvent;
|
|
|
import android.view.View;
|
|
|
import android.widget.CheckBox;
|
|
|
import android.widget.EditText;
|
|
|
@@ -16,12 +17,7 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.LoginEntity;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.module.login.controller.LoginController;
|
|
|
-import com.sheep.gamegroup.util.ChannelContent;
|
|
|
-import com.sheep.gamegroup.util.DataUtil;
|
|
|
-import com.sheep.gamegroup.util.Jump2View;
|
|
|
-import com.sheep.gamegroup.util.PreferenceUtils;
|
|
|
-import com.sheep.gamegroup.util.StringUtils;
|
|
|
-import com.sheep.gamegroup.util.UMConfigUtils;
|
|
|
+import com.sheep.gamegroup.util.*;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.base.BaseFragment;
|
|
|
@@ -33,6 +29,8 @@ import butterknife.OnClick;
|
|
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
|
import io.reactivex.schedulers.Schedulers;
|
|
|
|
|
|
+import static com.sheep.gamegroup.module.login.controller.LoginController.PLATFORM_PHONE;
|
|
|
+
|
|
|
/**
|
|
|
* A simple {@link Fragment} subclass.
|
|
|
*/
|
|
|
@@ -64,13 +62,14 @@ public class SignUpFgt extends AbsLoginFgt {
|
|
|
TextView registerToggleText;
|
|
|
@BindView(R.id.tv_login_title)
|
|
|
TextView tvLoginTitle;
|
|
|
-
|
|
|
+ @BindView(R.id.back_login_btn)
|
|
|
+ TextView tvBackLogin;
|
|
|
|
|
|
//用户协议
|
|
|
@BindView(R.id.tel_agreement_cb)
|
|
|
CheckBox tel_agreement_cb;
|
|
|
|
|
|
- private int registerType = LoginController.PLATFORM_PHONE;
|
|
|
+ private int registerType = PLATFORM_PHONE;
|
|
|
|
|
|
public SignUpFgt() {
|
|
|
// Required empty public constructor
|
|
|
@@ -104,6 +103,10 @@ public class SignUpFgt extends AbsLoginFgt {
|
|
|
tvLoginTitle.setText("手机号注册");
|
|
|
registerToggleIcon.setImageResource(R.drawable.zhanghao);
|
|
|
}
|
|
|
+ tvBackLogin.setOnClickListener(v -> {
|
|
|
+ KeyEventUtil.sendKeyDownUp(KeyEvent.KEYCODE_BACK);
|
|
|
+ //mController.whenToLogin(PLATFORM_PHONE);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@OnClick(R.id.show_hide_pwd_btn)
|
|
|
@@ -166,7 +169,7 @@ public class SignUpFgt extends AbsLoginFgt {
|
|
|
|
|
|
@OnClick(R.id.login_type_toggle)
|
|
|
public void doToggleLoginType(View view) {
|
|
|
- registerType = registerType == LoginController.PLATFORM_ACCOUNT ? LoginController.PLATFORM_PHONE : LoginController.PLATFORM_ACCOUNT;
|
|
|
+ registerType = registerType == LoginController.PLATFORM_ACCOUNT ? PLATFORM_PHONE : LoginController.PLATFORM_ACCOUNT;
|
|
|
onViewCreated();
|
|
|
}
|
|
|
|
|
|
@@ -174,7 +177,7 @@ public class SignUpFgt extends AbsLoginFgt {
|
|
|
public void doRegister(View v) {
|
|
|
if (registerType == LoginController.PLATFORM_ACCOUNT) {
|
|
|
registerAccount();
|
|
|
- } else if (registerType == LoginController.PLATFORM_PHONE) {
|
|
|
+ } else if (registerType == PLATFORM_PHONE) {
|
|
|
registerPhone();
|
|
|
}
|
|
|
}
|
|
|
@@ -214,7 +217,7 @@ public class SignUpFgt extends AbsLoginFgt {
|
|
|
SpUtils.saveToken(SheepApp.getInstance(), loginEty.getToken());
|
|
|
DataUtil.getInstance().initUserEntity(loginEty.getUser());
|
|
|
}
|
|
|
- mController.whenLoginSuccess(LoginController.PLATFORM_PHONE, loginEty);
|
|
|
+ mController.whenLoginSuccess(PLATFORM_PHONE, loginEty);
|
|
|
}
|
|
|
}
|
|
|
});
|