|
@@ -19,7 +19,7 @@ import com.yyrh.constant.URLConstants;
|
|
|
import com.yyrh.networking.NetRequestApi;
|
|
|
import com.yyrh.sdk.SDKEntry;
|
|
|
import com.yyrh.sdk.YyrhSdkManager;
|
|
|
-import com.yyrh.ui.floatmenu.WvPageListDialog;
|
|
|
+import com.yyrh.ui.WvPageListDialog;
|
|
|
import com.yyrh.utils.ResourceUtil;
|
|
|
import com.yyrh.utils.SignUtils;
|
|
|
import com.yyrh.utils.TosUtil;
|
|
@@ -35,6 +35,8 @@ public class UserPhoneLoginFragment extends BaseFragment {
|
|
|
private CheckBox cb_register;
|
|
|
private TextView tv_tip,tv_private_policy;
|
|
|
private Button btn_get_code,btn_account_login,btn_guest_login,btn_reg_compete;
|
|
|
+ private CodeVerifyTimeCount codeVerifyTimeCount;
|
|
|
+ private RegTimeCount regTimeCount;
|
|
|
@Nullable
|
|
|
@Override
|
|
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
@@ -104,6 +106,7 @@ public class UserPhoneLoginFragment extends BaseFragment {
|
|
|
getPhoneCaptcha(getActivity(),phone,"register");
|
|
|
|
|
|
}else if(id == ResourceUtil.getId(getActivity(), "btn_account_login")){
|
|
|
+
|
|
|
Fragment accountLoginFragment = FragmentUtils.getSdkFragment(getActivity(),FragmentUtils.SDK_LOGIN_TAG);
|
|
|
replaceFragmentToActivity(getFragmentManager(),accountLoginFragment,ResourceUtil.getId(getActivity(),"qj_content"));
|
|
|
|
|
@@ -115,6 +118,19 @@ public class UserPhoneLoginFragment extends BaseFragment {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void onDestroy() {
|
|
|
+ super.onDestroy();
|
|
|
+ if (codeVerifyTimeCount != null){
|
|
|
+ codeVerifyTimeCount.cancel();
|
|
|
+ }
|
|
|
+ if (regTimeCount != null){
|
|
|
+ regTimeCount.cancel();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private void registerWithPhone(final Activity activity){
|
|
|
String code = et_user_code.getText().toString();
|
|
|
final String account = et_user_phone.getText().toString();
|
|
@@ -165,11 +181,12 @@ public class UserPhoneLoginFragment extends BaseFragment {
|
|
|
|
|
|
|
|
|
|
|
|
+ YyrhSdkManager.defaultManager(SDKEntry.getSdkInstance().gameAct).saveUserLoginInfo(SDKEntry.getSdkInstance().gameAct,account,pwd,msg);
|
|
|
|
|
|
+ SDKEntry.getSdkInstance().adSdkCallback.onRegisterSuccess(account);
|
|
|
|
|
|
- YyrhSdkManager.defaultManager(getActivity()).saveUserLoginInfo(getActivity(),account,pwd,msg);
|
|
|
+ getActivity().finish();
|
|
|
|
|
|
- SDKEntry.getSdkInstance().adSdkCallback.onRegisterSuccess(account);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -204,13 +221,13 @@ public class UserPhoneLoginFragment extends BaseFragment {
|
|
|
btn_get_code.setEnabled(false);
|
|
|
btn_get_code.setText("60s");
|
|
|
|
|
|
- TimeCount time = new TimeCount(60000, 1000);
|
|
|
- time.start();
|
|
|
+ codeVerifyTimeCount = new CodeVerifyTimeCount(60000, 1000);
|
|
|
+ codeVerifyTimeCount.start();
|
|
|
}
|
|
|
|
|
|
- class TimeCount extends CountDownTimer {
|
|
|
+ class CodeVerifyTimeCount extends CountDownTimer {
|
|
|
|
|
|
- public TimeCount(long millisInFuture, long countDownInterval) {
|
|
|
+ public CodeVerifyTimeCount(long millisInFuture, long countDownInterval) {
|
|
|
super(millisInFuture, countDownInterval);
|
|
|
// TODO Auto-generated constructor stub
|
|
|
}
|
|
@@ -256,8 +273,8 @@ public class UserPhoneLoginFragment extends BaseFragment {
|
|
|
btn_reg_compete.setEnabled(false);
|
|
|
btn_reg_compete.setText("3s");
|
|
|
btn_reg_compete.setBackgroundResource(ResourceUtil.getDrawableId(getActivity(),"qj_login_button_grayed_style"));
|
|
|
- RegTimeCount time = new RegTimeCount(3000, 1000);
|
|
|
- time.start();
|
|
|
+ regTimeCount = new RegTimeCount(3000, 1000);
|
|
|
+ regTimeCount.start();
|
|
|
}
|
|
|
|
|
|
class RegTimeCount extends CountDownTimer {
|