111
This commit is contained in:
@@ -665,78 +665,76 @@ public class EntryActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void callback(UserBean bean) {
|
||||
|
||||
gotoLive("97714");
|
||||
//
|
||||
// if (mFirstLogin) {
|
||||
// //绑定广告渠道用户
|
||||
// AdjustEvent adjustEvent = new AdjustEvent("s1or0t");
|
||||
// adjustEvent.addCallbackParameter("userid", "bar");
|
||||
// Adjust.trackEvent(adjustEvent);
|
||||
//
|
||||
// //完成第三方登录
|
||||
// if(mLoginType.equals("twitter")){
|
||||
// AdjustEvent adjustEvent1 = new AdjustEvent("ea6lld");
|
||||
// Adjust.trackEvent(adjustEvent1);
|
||||
// CommonHttpUtil.setAdvertisingChannels("ea6lld", new HttpCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(int code, String msg, String[] info) {
|
||||
// if(code == 0) {
|
||||
// mFirebaseAnalytics.logEvent("FS_reg_twitter", null);
|
||||
// logger.logEvent("FB_reg_twitter");
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// }else if(mLoginType.equals("facebook")){
|
||||
// AdjustEvent adjustEvent1 = new AdjustEvent("5jbk95");
|
||||
// Adjust.trackEvent(adjustEvent1);
|
||||
// CommonHttpUtil.setAdvertisingChannels("5jbk95", new HttpCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(int code, String msg, String[] info) {
|
||||
// if(code == 0) {
|
||||
// mFirebaseAnalytics.logEvent("FS_reg_fb", null);
|
||||
// logger.logEvent("FB_reg_fb");
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// }else if(mLoginType.equals("google")){
|
||||
// AdjustEvent adjustEvent1 = new AdjustEvent("krap47");
|
||||
// Adjust.trackEvent(adjustEvent1);
|
||||
// CommonHttpUtil.setAdvertisingChannels("krap47", new HttpCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(int code, String msg, String[] info) {
|
||||
// if(code == 0) {
|
||||
// mFirebaseAnalytics.logEvent("FS_reg_google", null);
|
||||
// logger.logEvent("FB_reg_google");
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// }else if(mLoginType.equals("line")){
|
||||
// AdjustEvent adjustEvent1 = new AdjustEvent("uaacbn");
|
||||
// Adjust.trackEvent(adjustEvent1);
|
||||
//
|
||||
// CommonHttpUtil.setAdvertisingChannels("uaacbn", new HttpCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(int code, String msg, String[] info) {
|
||||
// if(code == 0) {
|
||||
// mFirebaseAnalytics.logEvent("FS_reg_line", null);
|
||||
// logger.logEvent("FB_reg_line");
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
|
||||
// EntryActivity.this.startActivity(new Intent(EntryActivity.this, OneLoginActivity.class));
|
||||
// }else{
|
||||
// gotoLive("97714");
|
||||
// MainActivity.forward(EntryActivity.this, false);
|
||||
// }
|
||||
// } else {
|
||||
// MainActivity.forward(EntryActivity.this, false);
|
||||
// }
|
||||
// EntryActivity.activity.finish();
|
||||
if (mFirstLogin) {
|
||||
//绑定广告渠道用户
|
||||
AdjustEvent adjustEvent = new AdjustEvent("s1or0t");
|
||||
adjustEvent.addCallbackParameter("userid", "bar");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
|
||||
//完成第三方登录
|
||||
if(mLoginType.equals("twitter")){
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("ea6lld");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
CommonHttpUtil.setAdvertisingChannels("ea6lld", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if(code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_reg_twitter", null);
|
||||
logger.logEvent("FB_reg_twitter");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}else if(mLoginType.equals("facebook")){
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("5jbk95");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
CommonHttpUtil.setAdvertisingChannels("5jbk95", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if(code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_reg_fb", null);
|
||||
logger.logEvent("FB_reg_fb");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}else if(mLoginType.equals("google")){
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("krap47");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
CommonHttpUtil.setAdvertisingChannels("krap47", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if(code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_reg_google", null);
|
||||
logger.logEvent("FB_reg_google");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}else if(mLoginType.equals("line")){
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("uaacbn");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
|
||||
CommonHttpUtil.setAdvertisingChannels("uaacbn", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if(code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_reg_line", null);
|
||||
logger.logEvent("FB_reg_line");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
|
||||
EntryActivity.this.startActivity(new Intent(EntryActivity.this, OneLoginActivity.class));
|
||||
}else{
|
||||
gotoLive("97714");
|
||||
MainActivity.forward(EntryActivity.this, false);
|
||||
}
|
||||
} else {
|
||||
MainActivity.forward(EntryActivity.this, false);
|
||||
}
|
||||
EntryActivity.activity.finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -245,6 +245,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
|
||||
ConversationIMListManager.get(this);
|
||||
//谷歌支付
|
||||
GoogleBillingUtil.setIsAutoAcknowledgePurchase(true);//设置自动确认购买
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yunbao.main.dialog;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import android.view.Gravity;
|
||||
@@ -12,6 +13,8 @@ import android.widget.TextView;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
@@ -21,7 +24,12 @@ import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.live.bean.LiveBean;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.EntryActivity;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
@@ -74,11 +82,11 @@ public class OneLoginDialog extends AbsDialogFragment {
|
||||
return;
|
||||
}
|
||||
ImgLoader.displayAvatar(mContext, CommonAppConfig.getInstance().getUserBean().getAvatar(), avatar);
|
||||
text_username.setText( WordUtil.getString(R.string.edit_profile_nickname)+":"+bundle.getString("name"));
|
||||
if(!bundle.getString("code").equals("")) {
|
||||
text_code.setText( WordUtil.getString(R.string.invite_code)+":"+bundle.getString("code"));
|
||||
}else{
|
||||
text_code.setText( WordUtil.getString(R.string.invite_code)+":無");
|
||||
text_username.setText(WordUtil.getString(R.string.edit_profile_nickname) + ":" + bundle.getString("name"));
|
||||
if (!bundle.getString("code").equals("")) {
|
||||
text_code.setText(WordUtil.getString(R.string.invite_code) + ":" + bundle.getString("code"));
|
||||
} else {
|
||||
text_code.setText(WordUtil.getString(R.string.invite_code) + ":無");
|
||||
}
|
||||
|
||||
btn_enter.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -92,23 +100,37 @@ public class OneLoginDialog extends AbsDialogFragment {
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if(code == 0){
|
||||
if (code == 0) {
|
||||
AdjustEvent adjustEvent = new AdjustEvent("neb317");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
CommonHttpUtil.setAdvertisingChannels("neb317", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if(code == 0) {
|
||||
if (code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_binding_success", null);
|
||||
logger.logEvent("FB_binding_success");
|
||||
}
|
||||
}
|
||||
});
|
||||
MainActivity.forward(getContext(), false);
|
||||
}else{
|
||||
if(msg.contains("暱稱重複,請重新輸入")){
|
||||
HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
|
||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||
.params("token", CommonAppConfig.getInstance().getToken())
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (info[0]!=null) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
CommonAppConfig.isNewUser = true;
|
||||
gotoLive(obj.getString("anchor_id"));
|
||||
}else{
|
||||
MainActivity.forward(getContext(), false);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (msg.contains("暱稱重複,請重新輸入")) {
|
||||
ToastUtil.show(R.string.edit_one_5);
|
||||
}else if(msg.contains("該邀請碼不存在,請重新輸入")){
|
||||
} else if (msg.contains("該邀請碼不存在,請重新輸入")) {
|
||||
ToastUtil.show(R.string.edit_one_6);
|
||||
} else if (msg.contains("暱稱不合法")) {
|
||||
ToastUtil.show(R.string.edit_one_7);
|
||||
@@ -120,4 +142,34 @@ public class OneLoginDialog extends AbsDialogFragment {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
private LiveRoomCheckLivePresenter mCheckLivePresenter;
|
||||
|
||||
private void gotoLive(final String live_id) {
|
||||
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
|
||||
if (mCheckLivePresenter == null) {
|
||||
mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
} else {
|
||||
MainActivity.forward(mContext, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user