11111
This commit is contained in:
parent
88278df77d
commit
cc438af7ca
@ -13,6 +13,7 @@ import androidx.fragment.app.FragmentTransaction;
|
|||||||
|
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.event.InstructorOperationEvent;
|
import com.yunbao.common.event.InstructorOperationEvent;
|
||||||
|
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
@ -77,6 +78,7 @@ public class InstructorOperationDialog extends AbsDialogFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
|
NoviceInstructorManager.get(getActivity()).setHomeZdyPop("");
|
||||||
mRootView.findViewById(R.id.hurry_contact).setOnClickListener(new View.OnClickListener() {
|
mRootView.findViewById(R.id.hurry_contact).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
@ -195,6 +195,7 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
|
|||||||
RongIMClient.getInstance().getTextMessageDraft(Conversation.ConversationType.PRIVATE, targetId, new RongIMClient.ResultCallback<String>() {
|
RongIMClient.getInstance().getTextMessageDraft(Conversation.ConversationType.PRIVATE, targetId, new RongIMClient.ResultCallback<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String s) {
|
public void onSuccess(String s) {
|
||||||
|
if (TextUtils.isEmpty(inputPanel.getPresetInformation()))
|
||||||
inputPanel.setPresetInformation(s);
|
inputPanel.setPresetInformation(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,7 +230,7 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
|
|||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
//获取输入框信息存进输入框
|
//获取输入框信息存进输入框
|
||||||
String content = inputPanel.getPresetInformation();
|
String content = inputPanel.getPresetInformation();
|
||||||
if (!TextUtils.isEmpty(content)){
|
if (!TextUtils.isEmpty(content)) {
|
||||||
IMCenter.getInstance().saveTextMessageDraft(Conversation.ConversationType.PRIVATE, targetId, content, null);
|
IMCenter.getInstance().saveTextMessageDraft(Conversation.ConversationType.PRIVATE, targetId, content, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@ import com.yunbao.common.http.HttpCallback;
|
|||||||
import com.yunbao.common.http.HttpClient;
|
import com.yunbao.common.http.HttpClient;
|
||||||
import com.yunbao.common.interfaces.CommonCallback;
|
import com.yunbao.common.interfaces.CommonCallback;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||||
import com.yunbao.common.utils.RouteUtil;
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
@ -736,6 +737,9 @@ public class EntryActivity extends AppCompatActivity {
|
|||||||
MainActivity.forward(EntryActivity.this, false);
|
MainActivity.forward(EntryActivity.this, false);
|
||||||
gotoLive(obj.getString("anchor_id"));
|
gotoLive(obj.getString("anchor_id"));
|
||||||
IMLoginManager.get(EntryActivity.this).setisNewUserOne(true);
|
IMLoginManager.get(EntryActivity.this).setisNewUserOne(true);
|
||||||
|
if (obj.containsKey("home_zdy_pop")) {
|
||||||
|
NoviceInstructorManager.get(activity).setHomeZdyPop(obj.getString("home_zdy_pop"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
MainActivity.forward(EntryActivity.this, false);
|
MainActivity.forward(EntryActivity.this, false);
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ import com.yunbao.common.http.HttpCallback;
|
|||||||
import com.yunbao.common.http.HttpClient;
|
import com.yunbao.common.http.HttpClient;
|
||||||
import com.yunbao.common.interfaces.CommonCallback;
|
import com.yunbao.common.interfaces.CommonCallback;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
@ -320,6 +321,9 @@ public class LoginActivity extends AbsActivity {
|
|||||||
MainActivity.forward(LoginActivity.this, false);
|
MainActivity.forward(LoginActivity.this, false);
|
||||||
gotoLive(obj.getString("anchor_id"));
|
gotoLive(obj.getString("anchor_id"));
|
||||||
IMLoginManager.get(mContext).setisNewUserOne(true);
|
IMLoginManager.get(mContext).setisNewUserOne(true);
|
||||||
|
if (obj.containsKey("home_zdy_pop")) {
|
||||||
|
NoviceInstructorManager.get(mContext).setHomeZdyPop(obj.getString("home_zdy_pop"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
MainActivity.forward(LoginActivity.this, false);
|
MainActivity.forward(LoginActivity.this, false);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.yunbao.main.activity;
|
package com.yunbao.main.activity;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
@ -32,16 +33,16 @@ import com.sahooz.library.Country;
|
|||||||
import com.sahooz.library.CountryPicker;
|
import com.sahooz.library.CountryPicker;
|
||||||
import com.sahooz.library.OnPick;
|
import com.sahooz.library.OnPick;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.HtmlConfig;
|
import com.yunbao.common.HtmlConfig;
|
||||||
import com.yunbao.common.activity.AbsActivity;
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
import com.yunbao.common.activity.WebViewActivity;
|
import com.yunbao.common.activity.WebViewActivity;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
import com.yunbao.common.bean.UserBean;
|
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.http.HttpClient;
|
import com.yunbao.common.http.HttpClient;
|
||||||
import com.yunbao.common.interfaces.CommonCallback;
|
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||||
import com.yunbao.common.utils.DialogUitl;
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
@ -97,6 +98,8 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
private LinearLayout yqm_view;
|
private LinearLayout yqm_view;
|
||||||
private ArrayList<Country> allCountries = new ArrayList<>();
|
private ArrayList<Country> allCountries = new ArrayList<>();
|
||||||
private RegisterActivity activity;
|
private RegisterActivity activity;
|
||||||
|
//网络请求的回执
|
||||||
|
private Handler netHandler = new Handler();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
@ -117,7 +120,7 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
CommonHttpUtil.setAdvertisingChannels("pooqmz", new HttpCallback() {
|
CommonHttpUtil.setAdvertisingChannels("pooqmz", new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
if(code == 0) {
|
if (code == 0) {
|
||||||
//谷歌
|
//谷歌
|
||||||
mFirebaseAnalytics.logEvent("FS_complete_2nd_loading", null);
|
mFirebaseAnalytics.logEvent("FS_complete_2nd_loading", null);
|
||||||
logger.logEvent("FB_complete_2nd_loading");
|
logger.logEvent("FB_complete_2nd_loading");
|
||||||
@ -276,11 +279,6 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void changeEnable() {
|
private void changeEnable() {
|
||||||
// String phone = mEditPhone.getText().toString();
|
|
||||||
// String code = mEditCode.getText().toString();
|
|
||||||
// String pwd1 = mEditPwd1.getText().toString();
|
|
||||||
// String pwd2 = mEditPwd2.getText().toString();
|
|
||||||
// mBtnRegister.setEnabled(!TextUtils.isEmpty(phone) && !TextUtils.isEmpty(code) && !TextUtils.isEmpty(pwd1) && !TextUtils.isEmpty(pwd2));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showCountryCode() {
|
private void showCountryCode() {
|
||||||
@ -297,8 +295,6 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
int i = v.getId();
|
int i = v.getId();
|
||||||
if (i == R.id.btn_code) {
|
if (i == R.id.btn_code) {
|
||||||
webview.setVisibility(View.VISIBLE);
|
webview.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
// getPromoCode();
|
|
||||||
//获取设备唯一标识符
|
//获取设备唯一标识符
|
||||||
getUuidDevice();
|
getUuidDevice();
|
||||||
//获取验证码
|
//获取验证码
|
||||||
@ -308,11 +304,8 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
logger.logEvent("FB_phone_getcode");
|
logger.logEvent("FB_phone_getcode");
|
||||||
} else if (i == R.id.btn_register) {
|
} else if (i == R.id.btn_register) {
|
||||||
register();
|
register();
|
||||||
|
|
||||||
AdjustEvent adjustEvent1 = new AdjustEvent("wrajax");
|
AdjustEvent adjustEvent1 = new AdjustEvent("wrajax");
|
||||||
Adjust.trackEvent(adjustEvent1);
|
Adjust.trackEvent(adjustEvent1);
|
||||||
Bundle params = new Bundle();
|
|
||||||
|
|
||||||
mFirebaseAnalytics.logEvent("FS_phone_clickregister", null);
|
mFirebaseAnalytics.logEvent("FS_phone_clickregister", null);
|
||||||
logger.logEvent("FB_phone_clickregister");
|
logger.logEvent("FB_phone_clickregister");
|
||||||
} else if (i == R.id.btn_tip2) {
|
} else if (i == R.id.btn_tip2) {
|
||||||
@ -339,13 +332,6 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
mEditPhone.requestFocus();
|
mEditPhone.requestFocus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//屏蔽,原因:国外手机号无法校验合法性
|
|
||||||
// if (!ValidatePhoneUtil.validateMobileNumber(phoneNum))
|
|
||||||
// {
|
|
||||||
// mEditPhone.setError(WordUtil.getString(R.string.login_phone_error));
|
|
||||||
// mEditPhone.requestFocus();
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
mEditCode.requestFocus();
|
mEditCode.requestFocus();
|
||||||
MainHttpUtil.getRegisterCode(Randstr, Ticket, phoneNum, mCountryCode, mGetCodeCallback);
|
MainHttpUtil.getRegisterCode(Randstr, Ticket, phoneNum, mCountryCode, mGetCodeCallback);
|
||||||
}
|
}
|
||||||
@ -378,12 +364,6 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
mEditPhone.requestFocus();
|
mEditPhone.requestFocus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//屏蔽,原因:国外手机号无法校验合法性
|
|
||||||
// if (!ValidatePhoneUtil.validateMobileNumber(phoneNum)) {
|
|
||||||
// mEditPhone.setError(WordUtil.getString(R.string.login_phone_error));
|
|
||||||
// mEditPhone.requestFocus();
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
String code = mEditCode.getText().toString().trim();
|
String code = mEditCode.getText().toString().trim();
|
||||||
if (TextUtils.isEmpty(code)) {
|
if (TextUtils.isEmpty(code)) {
|
||||||
mEditCode.setError(WordUtil.getString(R.string.reg_input_code));
|
mEditCode.setError(WordUtil.getString(R.string.reg_input_code));
|
||||||
@ -423,7 +403,7 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
CommonHttpUtil.setAdvertisingChannels("fhqx62", new HttpCallback() {
|
CommonHttpUtil.setAdvertisingChannels("fhqx62", new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
if(code == 0) {
|
if (code == 0) {
|
||||||
mFirebaseAnalytics.logEvent("FS_reg_phone", null);
|
mFirebaseAnalytics.logEvent("FS_reg_phone", null);
|
||||||
logger.logEvent("FB_reg_phone");
|
logger.logEvent("FB_reg_phone");
|
||||||
}
|
}
|
||||||
@ -432,10 +412,7 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
|
|
||||||
Bundle params1 = new Bundle();
|
Bundle params1 = new Bundle();
|
||||||
params1.putString(AppEventsConstants.EVENT_PARAM_REGISTRATION_METHOD, "Phone number");
|
params1.putString(AppEventsConstants.EVENT_PARAM_REGISTRATION_METHOD, "Phone number");
|
||||||
logger.logEvent(AppEventsConstants.EVENT_NAME_COMPLETED_REGISTRATION,
|
logger.logEvent(AppEventsConstants.EVENT_NAME_COMPLETED_REGISTRATION, params1);
|
||||||
params1);
|
|
||||||
|
|
||||||
|
|
||||||
login(phoneNum, pwd, mUuidDevice);
|
login(phoneNum, pwd, mUuidDevice);
|
||||||
OpenInstall.reportRegister();
|
OpenInstall.reportRegister();
|
||||||
} else {
|
} else {
|
||||||
@ -493,7 +470,16 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
IMLoginManager.get(activity).setupLoginUser(model);
|
IMLoginManager.get(activity).setupLoginUser(model);
|
||||||
//融云连接服务器
|
//融云连接服务器
|
||||||
RongcloudIMManager.connectIM(activity);
|
RongcloudIMManager.connectIM(activity);
|
||||||
getBaseUserInfo();
|
if (mFirstLogin) {
|
||||||
|
if (mDialog != null) {
|
||||||
|
mDialog.dismiss();
|
||||||
|
}
|
||||||
|
//绑定广告渠道用户
|
||||||
|
AdjustEvent adjustEvent = new AdjustEvent("s1or0t");
|
||||||
|
adjustEvent.addCallbackParameter("userid", CommonAppConfig.getInstance().getUid());
|
||||||
|
Adjust.trackEvent(adjustEvent);
|
||||||
|
netHandler.post(getRandJoinAnchor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -511,43 +497,40 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户信息
|
* 用户自动签到
|
||||||
*/
|
*/
|
||||||
private void getBaseUserInfo() {
|
private Runnable getRandJoinAnchor = new Runnable() {
|
||||||
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
|
||||||
@Override
|
@Override
|
||||||
public void callback(UserBean bean) {
|
public void run() {
|
||||||
if (mDialog != null) {
|
IMLoginModel userInfo = IMLoginManager.get(activity).getUserInfo();
|
||||||
mDialog.dismiss();
|
|
||||||
}
|
|
||||||
if (bean != null) {
|
|
||||||
if (mFirstLogin) {
|
|
||||||
//绑定广告渠道用户
|
|
||||||
AdjustEvent adjustEvent = new AdjustEvent("s1or0t");
|
|
||||||
adjustEvent.addCallbackParameter("userid", CommonAppConfig.getInstance().getUid());
|
|
||||||
Adjust.trackEvent(adjustEvent);
|
|
||||||
HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
|
HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
|
||||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
.params("uid", userInfo.getId())
|
||||||
.params("token", CommonAppConfig.getInstance().getToken())
|
.params("token", userInfo.getToken())
|
||||||
.execute(new HttpCallback() {
|
.execute(new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
if (info[0] != null) {
|
if (info[0] != null) {
|
||||||
JSONObject obj = JSON.parseObject(info[0]);
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
MainActivity.forward(RegisterActivity.this, false);
|
IMLoginManager.get(activity).setisNewUserOne(true);
|
||||||
gotoLive(obj.getString("anchor_id"));
|
gotoLive(obj.getString("anchor_id"));
|
||||||
IMLoginManager.get(RegisterActivity.this).setisNewUserOne(true);
|
if (obj.containsKey("home_zdy_pop")) {
|
||||||
|
NoviceInstructorManager.get(mContext).setHomeZdyPop(obj.getString("home_zdy_pop"));
|
||||||
|
}
|
||||||
|
jumpMain(false);
|
||||||
} else {
|
} else {
|
||||||
MainActivity.forward(RegisterActivity.this, false);
|
jumpMain(false);
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
EventBus.getDefault().post(new RegSuccessEvent());
|
EventBus.getDefault().post(new RegSuccessEvent());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private void jumpMain(boolean showInvite) {
|
||||||
|
Intent intent = new Intent(activity, MainActivity.class);
|
||||||
|
intent.putExtra(Constants.SHOW_INVITE, showInvite);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
private LiveRoomCheckLivePresenter mCheckLivePresenter;
|
private LiveRoomCheckLivePresenter mCheckLivePresenter;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user