Merge branch 'master' into dev_random_pk
# Conflicts: # live/src/main/res/values/strings.xml
This commit is contained in:
@@ -85,4 +85,5 @@ dependencies {
|
||||
//引导层
|
||||
implementation 'com.binioter:guideview:1.0.0'
|
||||
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.yunbao.main.activity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_cn;
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_us;
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
@@ -33,8 +31,6 @@ import android.widget.VideoView;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -77,9 +73,9 @@ import com.yunbao.common.HtmlConfig;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.FaceBookUpModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.LoginData;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.http.main.MainNetManager;
|
||||
@@ -91,8 +87,6 @@ import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.main.R;
|
||||
@@ -238,18 +232,6 @@ public class EntryActivity extends AppCompatActivity {
|
||||
|
||||
getPromoCode();
|
||||
getUuidDevice();
|
||||
AdjustEvent adjustEvent2 = new AdjustEvent("tyqsyf");
|
||||
Adjust.trackEvent(adjustEvent2);
|
||||
CommonHttpUtil.setAdvertisingChannels("tyqsyf", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_registration", null);
|
||||
logger.logEvent("FB_registration");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
video_view = findViewById(R.id.video_view);
|
||||
video_view.setVideoPath(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.login_video) + "");
|
||||
video_view.start();
|
||||
@@ -278,17 +260,6 @@ public class EntryActivity extends AppCompatActivity {
|
||||
return;
|
||||
}
|
||||
timerOutBtn(view);
|
||||
AdjustEvent adjustEvent = new AdjustEvent("umk7ri");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
CommonHttpUtil.setAdvertisingChannels("umk7ri", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_click_fb", null);
|
||||
logger.logEvent("FB_click_fb");
|
||||
}
|
||||
}
|
||||
});
|
||||
MainNetManager.get(EntryActivity.this)
|
||||
.FaceBookUp(new com.yunbao.common.http.base.HttpCallback<FaceBookUpModel>() {
|
||||
@Override
|
||||
@@ -307,25 +278,6 @@ public class EntryActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
});
|
||||
// LoginManager.getInstance().logInWithReadPermissions(EntryActivity.this, Arrays.asList("public_profile"));
|
||||
// MainNetManager.get(EntryActivity.this)
|
||||
// .FaceBookUp(new com.yunbao.common.http.base.HttpCallback<FaceBookUpModel>() {
|
||||
// @Override
|
||||
// public void onSuccess(FaceBookUpModel data) {
|
||||
// if(data.getType().equals("1")){
|
||||
// LoginManager.getInstance().logInWithReadPermissions(EntryActivity.this, Arrays.asList("public_profile"));
|
||||
// }else{
|
||||
// WebViewActivity.forward(EntryActivity.this, data.getLink()+"?");
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(String error) {
|
||||
//
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
});
|
||||
|
||||
@@ -356,17 +308,6 @@ public class EntryActivity extends AppCompatActivity {
|
||||
return;
|
||||
}
|
||||
timerOutBtn(v);
|
||||
AdjustEvent adjustEvent = new AdjustEvent("iqd6b7");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
CommonHttpUtil.setAdvertisingChannels("iqd6b7", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_click_google", null);
|
||||
logger.logEvent("FB_click_google");
|
||||
}
|
||||
}
|
||||
});
|
||||
Intent signInIntent = mGoogleSignInClient.getSignInIntent();
|
||||
startActivityForResult(signInIntent, 1002);
|
||||
}
|
||||
@@ -379,17 +320,6 @@ public class EntryActivity extends AppCompatActivity {
|
||||
return;
|
||||
}
|
||||
timerOutBtn(v);
|
||||
AdjustEvent adjustEvent = new AdjustEvent("le2qca");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
CommonHttpUtil.setAdvertisingChannels("le2qca", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_click_twitter", null);
|
||||
logger.logEvent("FB_click_twitter");
|
||||
}
|
||||
}
|
||||
});
|
||||
tt_login_button.performClick();
|
||||
}
|
||||
});
|
||||
@@ -432,17 +362,6 @@ public class EntryActivity extends AppCompatActivity {
|
||||
}
|
||||
timerOutBtn(view);
|
||||
try {
|
||||
AdjustEvent adjustEvent = new AdjustEvent("gev462");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
CommonHttpUtil.setAdvertisingChannels("gev462", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_click_line", null);
|
||||
logger.logEvent("FB_click_line");
|
||||
}
|
||||
}
|
||||
});
|
||||
// App-to-app login
|
||||
Intent loginIntent = LineLoginApi.getLoginIntent(
|
||||
view.getContext(),
|
||||
@@ -600,17 +519,17 @@ public class EntryActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCurrentProfileChanged(@Nullable Profile pf, @Nullable Profile profile1) {
|
||||
if(!enableButtons){
|
||||
stopTracking();
|
||||
return;
|
||||
}
|
||||
if(pf!=null){
|
||||
loginFaceBookUpdateUI(pf);
|
||||
}else if(profile1!=null){
|
||||
loginFaceBookUpdateUI(profile1);
|
||||
}else{
|
||||
ToastUtil.show(getResources().getString(R.string.user_login_outtime));
|
||||
}
|
||||
if (!enableButtons) {
|
||||
stopTracking();
|
||||
return;
|
||||
}
|
||||
if (pf != null) {
|
||||
loginFaceBookUpdateUI(pf);
|
||||
} else if (profile1 != null) {
|
||||
loginFaceBookUpdateUI(profile1);
|
||||
} else {
|
||||
ToastUtil.show(getResources().getString(R.string.user_login_outtime));
|
||||
}
|
||||
stopTracking();
|
||||
}
|
||||
};
|
||||
@@ -672,49 +591,13 @@ public class EntryActivity extends AppCompatActivity {
|
||||
*/
|
||||
private void loginBuyThird(LoginData data) {
|
||||
mLoginType = data.getType();
|
||||
if(CommonAppConfig.IS_GOOGLE_PLAY==true) {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
|
||||
mPromoCode = "";
|
||||
}
|
||||
MainHttpUtil.loginByThird(data.getOpenID(), mPromoCode, mUuidDevice, data.getNickName(), data.getAvatar(), data.getType(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
onLoginSuccess(code, msg, info);
|
||||
if (code == 0) {
|
||||
//完成第三方登录
|
||||
if (mLoginType.equals("twitter")) {
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("winf6e");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
mFirebaseAnalytics.logEvent("FS_log_twitter", null);
|
||||
logger.logEvent("FB_log_twitter");
|
||||
} else if (mLoginType.equals("facebook")) {
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("oywoff");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
mFirebaseAnalytics.logEvent("FS_log_fb", null);
|
||||
logger.logEvent("FB_log_fb");
|
||||
} else if (mLoginType.equals("google")) {
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("1cm8gl");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
mFirebaseAnalytics.logEvent("FS_log_google", null);
|
||||
logger.logEvent("FB_log_google");
|
||||
} else if (mLoginType.equals("line")) {
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("71p74r");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
mFirebaseAnalytics.logEvent("FS_log_line", null);
|
||||
logger.logEvent("FB_log_line");
|
||||
}
|
||||
}
|
||||
CommonHttpUtil.setAdvertisingChannels("1com4k", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_createdRole", null);
|
||||
logger.logEvent("FB_createdRole");
|
||||
}
|
||||
}
|
||||
});
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("1com4k");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -755,65 +638,6 @@ public class EntryActivity extends AppCompatActivity {
|
||||
public void callback(UserBean bean) {
|
||||
|
||||
if (mFirstLogin) {
|
||||
//绑定广告渠道用户
|
||||
AdjustEvent adjustEvent = new AdjustEvent("s1or0t");
|
||||
adjustEvent.addCallbackParameter("userid", CommonAppConfig.getInstance().getUid());
|
||||
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 {
|
||||
@@ -849,7 +673,6 @@ public class EntryActivity extends AppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
private LiveRoomCheckLivePresenter mCheckLivePresenter;
|
||||
|
||||
private void gotoLive(final String live_id) {
|
||||
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
||||
@@ -857,20 +680,23 @@ public class EntryActivity extends AppCompatActivity {
|
||||
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(EntryActivity.this, new LiveRoomCheckLivePresenter.ActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
LiveAudienceActivity.forward(EntryActivity.this, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
||||
NoviceInstructorManager.get(activity).setFrist(false);
|
||||
}
|
||||
});
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
new LiveRoomCheckLivePresenter(activity, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
NoviceInstructorManager.get(activity).setFrist(false);
|
||||
|
||||
|
||||
} else {
|
||||
MainActivity.forward(EntryActivity.this, false);
|
||||
}
|
||||
@@ -879,7 +705,7 @@ public class EntryActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void timerOutBtn(View btn) {
|
||||
if(mBtnClick){
|
||||
if (mBtnClick) {
|
||||
return;
|
||||
}
|
||||
loginLoadingDialog = DialogUitl.loadingDialog(EntryActivity.this, WordUtil.getString(R.string.login_wait));
|
||||
@@ -888,9 +714,9 @@ public class EntryActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void run() {
|
||||
mBtnClick = false;
|
||||
if(loginLoadingDialog!=null){
|
||||
if (loginLoadingDialog != null) {
|
||||
loginLoadingDialog.dismiss();
|
||||
loginLoadingDialog=null;
|
||||
loginLoadingDialog = null;
|
||||
}
|
||||
}
|
||||
}, 3000);
|
||||
@@ -907,11 +733,11 @@ public class EntryActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if(loginLoadingDialog!=null){
|
||||
if(loginLoadingDialog.isShowing()){
|
||||
if (loginLoadingDialog != null) {
|
||||
if (loginLoadingDialog.isShowing()) {
|
||||
loginLoadingDialog.dismiss();
|
||||
}
|
||||
loginLoadingDialog=null;
|
||||
loginLoadingDialog = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
import static com.yunbao.main.activity.MyWalletActivity.dis;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ProgressDialog;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
@@ -18,9 +15,6 @@ import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.android.billingclient.api.Purchase;
|
||||
import com.facebook.appevents.AppEventsConstants;
|
||||
import com.google.android.gms.ads.identifier.AdvertisingIdClient;
|
||||
@@ -111,8 +105,8 @@ public class GoogleFragment extends Fragment {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private Handler payHandler = new Handler();
|
||||
|
||||
//js调用原生
|
||||
public class JsInteration {
|
||||
|
||||
@@ -140,18 +134,9 @@ public class GoogleFragment extends Fragment {
|
||||
Bundle params = new Bundle();
|
||||
params.putString("currency", "HKD");
|
||||
params.putString("money", MoneyUsds);
|
||||
logger.logEvent("FB_iap_Play", params);
|
||||
|
||||
|
||||
Bundle fb_params = new Bundle();
|
||||
fb_params.putString(AppEventsConstants.EVENT_PARAM_CURRENCY, "HKD");
|
||||
fb_params.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, mProductId);
|
||||
|
||||
//fb官方事件记录充值
|
||||
logger.logEvent(AppEventsConstants.EVENT_NAME_PURCHASED,
|
||||
Double.parseDouble(MoneyUsds),
|
||||
fb_params);
|
||||
|
||||
//Google官方充值通知
|
||||
Bundle google_params = new Bundle();
|
||||
google_params.putString("currency", "HKD");
|
||||
@@ -160,31 +145,6 @@ public class GoogleFragment extends Fragment {
|
||||
google_params.putString("value", MoneyUsds);
|
||||
google_params.putString("price", MoneyUsds);
|
||||
google_params.putString("quantity", "1");
|
||||
|
||||
mFirebaseAnalytics.logEvent("FS_iap_Play", google_params);
|
||||
|
||||
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("cgssol");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
CommonHttpUtil.setAdvertisingChannels("cgssol", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
logger.logEvent("FB_iap_users", null);
|
||||
mFirebaseAnalytics.logEvent("FS_iap_users", null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
AdjustEvent adjustEvent2 = new AdjustEvent("tr8lb9");
|
||||
adjustEvent2.setRevenue(Double.parseDouble(MoneyUsds),"HKD");
|
||||
adjustEvent2.addCallbackParameter("GOrderid",purchase.getOrderId());
|
||||
adjustEvent2.addCallbackParameter("POrderid",mOrderid);
|
||||
adjustEvent2.addCallbackParameter("Uid", CommonAppConfig.getInstance().getUid());
|
||||
adjustEvent2.addCallbackParameter("GADid",adid);
|
||||
adjustEvent2.setOrderId(mOrderid);
|
||||
Adjust.trackEvent(adjustEvent2);
|
||||
|
||||
dis();
|
||||
ToastUtil.show("支付成功");
|
||||
}
|
||||
@@ -201,15 +161,7 @@ public class GoogleFragment extends Fragment {
|
||||
public void onPayFailed(int code, String msg) {
|
||||
|
||||
}
|
||||
}).checkSku(ProductId)
|
||||
;
|
||||
//下单
|
||||
Bundle params = new Bundle();
|
||||
params.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, mProductId);
|
||||
params.putString(AppEventsConstants.EVENT_PARAM_CURRENCY, "HKD");
|
||||
logger.logEvent(AppEventsConstants.EVENT_NAME_INITIATED_CHECKOUT, Double.parseDouble(MoneyUsds),
|
||||
params);
|
||||
|
||||
}).checkSku(ProductId);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
|
||||
@@ -14,12 +14,13 @@ import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.live.utils.LiveStorge;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.adapter.MainHomeFollowAdapter;
|
||||
import com.yunbao.main.http.MainHttpConsts;
|
||||
import com.yunbao.main.http.MainHttpUtil;
|
||||
import com.yunbao.main.presenter.CheckLivePresenter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -33,7 +34,6 @@ public class LiveClassActivity extends AbsActivity implements OnItemClickListene
|
||||
private int mClassId;
|
||||
private CommonRefreshView mRefreshView;
|
||||
private MainHomeFollowAdapter mAdapter;
|
||||
private CheckLivePresenter mCheckLivePresenter;
|
||||
|
||||
public static void forward(Context context, int classId, String className) {
|
||||
Intent intent = new Intent(context, LiveClassActivity.class);
|
||||
@@ -116,14 +116,18 @@ public class LiveClassActivity extends AbsActivity implements OnItemClickListene
|
||||
* 观看直播
|
||||
*/
|
||||
public void watchLive(LiveBean liveBean, int position) {
|
||||
if (mCheckLivePresenter == null) {
|
||||
mCheckLivePresenter = new CheckLivePresenter(mContext);
|
||||
}
|
||||
if (CommonAppConfig.LIVE_ROOM_SCROLL) {
|
||||
mCheckLivePresenter.watchLive(liveBean, Constants.LIVE_CLASS_PREFIX + mClassId, position);
|
||||
} else {
|
||||
mCheckLivePresenter.watchLive(liveBean);
|
||||
}
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_cn;
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_us;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
@@ -16,8 +16,8 @@ import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.DeviceUtils;
|
||||
@@ -34,6 +34,7 @@ import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.LoginData;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
@@ -45,10 +46,9 @@ import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.main.R;
|
||||
@@ -60,11 +60,6 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_cn;
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_us;
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/17.
|
||||
@@ -108,12 +103,6 @@ public class LoginActivity extends AbsActivity {
|
||||
mRoot = findViewById(R.id.root);
|
||||
Contexts = this;
|
||||
activity = this;
|
||||
//进入登录页面
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("2gar15");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
mFirebaseAnalytics.logEvent("FS_loginpage", null);
|
||||
logger.logEvent("FB_loginpage");
|
||||
|
||||
OpenInstall.getInstall(new AppInstallAdapter() {
|
||||
@Override
|
||||
public void onInstall(AppData appData) {
|
||||
@@ -180,16 +169,7 @@ public class LoginActivity extends AbsActivity {
|
||||
login();
|
||||
|
||||
} else if (i == R.id.btn_register) {
|
||||
//去手机注册
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("orgi58");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
|
||||
|
||||
mFirebaseAnalytics.logEvent("FS_phone_click", null);
|
||||
logger.logEvent("FB_phone_click");
|
||||
|
||||
register();
|
||||
|
||||
} else if (i == R.id.btn_forget_pwd) {
|
||||
forgetPwd();
|
||||
|
||||
@@ -250,7 +230,6 @@ public class LoginActivity extends AbsActivity {
|
||||
WebViewActivity.forward(mContext, HtmlConfig.LOGIN_PRIVCAY);
|
||||
}
|
||||
|
||||
private LiveRoomCheckLivePresenter mCheckLivePresenter;
|
||||
|
||||
private void gotoLive(final String live_id) {
|
||||
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
||||
@@ -258,20 +237,22 @@ public class LoginActivity extends AbsActivity {
|
||||
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(LoginActivity.this, new LiveRoomCheckLivePresenter.ActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
LiveAudienceActivity.forward(LoginActivity.this, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
||||
NoviceInstructorManager.get(activity).setFrist(false);
|
||||
}
|
||||
});
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
NoviceInstructorManager.get(activity).setFrist(false);
|
||||
|
||||
} else {
|
||||
MainActivity.forward(LoginActivity.this, false);
|
||||
}
|
||||
@@ -291,11 +272,7 @@ public class LoginActivity extends AbsActivity {
|
||||
//设置登录信息
|
||||
IMLoginModel model = GsonUtils.fromJson(info[0], IMLoginModel.class);
|
||||
IMLoginManager.get(activity).setupLoginUser(model);
|
||||
|
||||
getBaseUserInfo();
|
||||
mFirebaseAnalytics.logEvent("FS_createdRole", null);
|
||||
logger.logEvent("FB_createdRole");
|
||||
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
@@ -310,11 +287,6 @@ public class LoginActivity extends AbsActivity {
|
||||
public void callback(UserBean bean) {
|
||||
//融云连接服务器
|
||||
RongcloudIMManager.connectIM(activity);
|
||||
//完成手机号密码登录
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("4ncwlv");
|
||||
mFirebaseAnalytics.logEvent("FS_login", null);
|
||||
logger.logEvent("FB_login");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
@@ -343,7 +315,7 @@ public class LoginActivity extends AbsActivity {
|
||||
public void onError(Response<JsonBean> response) {
|
||||
super.onError(response);
|
||||
String message = response.message();
|
||||
System.out.println(">>>>>"+message);
|
||||
System.out.println(">>>>>" + message);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -106,7 +106,6 @@ import com.yunbao.main.http.MainHttpConsts;
|
||||
import com.yunbao.main.http.MainHttpUtil;
|
||||
import com.yunbao.main.interfaces.MainAppBarLayoutListener;
|
||||
import com.yunbao.main.manager.imrongcloud.ConversationIMListManager;
|
||||
import com.yunbao.main.presenter.CheckLivePresenter;
|
||||
import com.yunbao.main.utils.GenerateTestUserSig;
|
||||
import com.yunbao.main.views.FloatBannerView;
|
||||
import com.yunbao.main.views.MainHomeCommunityViewHolder;
|
||||
@@ -168,10 +167,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
private boolean mHided;
|
||||
|
||||
private ProcessResultUtil mProcessResultUtil;
|
||||
private CheckLivePresenter mCheckLivePresenter;
|
||||
private boolean mFristLoad;
|
||||
private long mLastClickBackTime;//上次点击back键的时间
|
||||
private HttpCallback mGetLiveSdkCallback;
|
||||
private String mUrlCsd;
|
||||
private TextView v_table_redpoint;
|
||||
private View v_table_redpoint_me;
|
||||
@@ -241,19 +238,17 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
|
||||
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() {
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
} else {
|
||||
ToastUtil.show("直播已结束");
|
||||
}
|
||||
@@ -424,20 +419,17 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
|
||||
|
||||
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() {
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
} else {
|
||||
RouteUtil.forwardUserHome(mContext, Uid, 0);
|
||||
}
|
||||
@@ -679,7 +671,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
DialogUitl.showSimpleTipDialog(mContext, WordUtil.getString(R.string.main_maintain_notice), configBean.getMaintainTips());
|
||||
}
|
||||
if (!VersionUtil.isLatest(configBean.getVersion())) {
|
||||
VersionUtil.showDialog(mContext, configBean, configBean.getDownloadApkUrl());
|
||||
VersionUtil versionUtil = new VersionUtil();
|
||||
versionUtil.showDialog(mContext, configBean, configBean.getDownloadApkUrl());
|
||||
} else {
|
||||
requestBonus();
|
||||
}
|
||||
@@ -881,9 +874,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
MainHttpUtil.cancel(MainHttpConsts.REQUEST_BONUS);
|
||||
MainHttpUtil.cancel(MainHttpConsts.GET_BONUS);
|
||||
MainHttpUtil.cancel(MainHttpConsts.SET_DISTRIBUT);
|
||||
if (mCheckLivePresenter != null) {
|
||||
mCheckLivePresenter.cancel();
|
||||
}
|
||||
|
||||
LocationUtil.getInstance().stopLocation();
|
||||
if (mProcessResultUtil != null) {
|
||||
mProcessResultUtil.release();
|
||||
@@ -910,14 +901,17 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
* 观看直播
|
||||
*/
|
||||
public void watchLive(LiveBean liveBean, String key, int position) {
|
||||
if (mCheckLivePresenter == null) {
|
||||
mCheckLivePresenter = new CheckLivePresenter(mContext);
|
||||
}
|
||||
if (CommonAppConfig.LIVE_ROOM_SCROLL) {
|
||||
mCheckLivePresenter.watchLive(liveBean, key, position);
|
||||
} else {
|
||||
mCheckLivePresenter.watchLive(liveBean);
|
||||
}
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
@@ -16,9 +14,6 @@ import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.android.billingclient.api.BillingResult;
|
||||
import com.android.billingclient.api.Purchase;
|
||||
@@ -65,10 +60,6 @@ public class MyWalletActivity extends AbsActivity {
|
||||
super.main();
|
||||
mw = MyWalletActivity.this;
|
||||
setTitle(WordUtil.getString(R.string.wallet));
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("eap1ec");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
mFirebaseAnalytics.logEvent("FS_initiated_checkout", null);
|
||||
logger.logEvent("FB_initiated_checkout");
|
||||
GoogleBillingUtilNew.getInstance().initGooglePay(mContext);
|
||||
vp_content = (ViewPager) findViewById(R.id.vp_content);
|
||||
TextView rView = (TextView) findViewById(R.id.rView);
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
@@ -27,8 +24,6 @@ import android.widget.ProgressBar;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -52,11 +47,11 @@ import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.ProcessImageUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.live.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
@@ -253,26 +248,33 @@ public class MyWebViewActivity extends AbsActivity {
|
||||
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) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
|
||||
if (LiveRoomViewHolder.mHandler != null) {
|
||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
if (!"".endsWith(Constants.mStream)) {
|
||||
finish();
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
if (LiveRoomViewHolder.mHandler != null) {
|
||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
if (!"".equals(Constants.mStream)) {
|
||||
finish();
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal));
|
||||
} else {
|
||||
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
||||
} else {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
||||
}
|
||||
});
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -555,12 +557,6 @@ public class MyWebViewActivity extends AbsActivity {
|
||||
} else if (TextUtils.equals(event.getMethod(), "androidMethodLookToLive")) {
|
||||
//看直播
|
||||
gotoLive(event.getLiveId());
|
||||
} else if (TextUtils.equals(event.getMethod(), "AndroidFellow")) {
|
||||
mFirebaseAnalytics.logEvent("FS_Follow", null);
|
||||
logger.logEvent("FB_Follow", null);
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("oess6a");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
|
||||
} else if (TextUtils.equals(event.getMethod(), "androidClickSayHiBack")) {
|
||||
Constants.firstInto = 0;
|
||||
EventBus.getDefault().post(new MainHomeCommunityToChatEvent().setTargetId(event.getUserId()));
|
||||
|
||||
@@ -35,10 +35,10 @@ import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.live.activity.SystemMessageActivity;
|
||||
import com.yunbao.live.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
@@ -225,27 +225,33 @@ public class MyWebViewActivity2 extends AbsActivity {
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
|
||||
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) {
|
||||
if (LiveRoomViewHolder.mHandler != null) {
|
||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
if (!"".endsWith(Constants.mStream)) {
|
||||
finish();
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
if (LiveRoomViewHolder.mHandler != null) {
|
||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
if (!"".endsWith(Constants.mStream)) {
|
||||
finish();
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal));
|
||||
} else {
|
||||
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
||||
} else {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
||||
}
|
||||
});
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
|
||||
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;
|
||||
@@ -18,7 +14,6 @@ import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.interfaces.ImageResultCallback;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
@@ -30,13 +25,10 @@ import com.yunbao.main.http.MainHttpUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
public class OneLoginActivity extends AbsActivity {
|
||||
|
||||
RoundedImageView avatar;
|
||||
EditText edit_user,edit_code;
|
||||
EditText edit_user, edit_code;
|
||||
Button btn_enter;
|
||||
|
||||
public static OneLoginActivity act;
|
||||
@@ -45,6 +37,7 @@ public class OneLoginActivity extends AbsActivity {
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_one_login;
|
||||
}
|
||||
|
||||
private ProcessImageUtil mImageUtil;
|
||||
|
||||
private void updataImg() {
|
||||
@@ -66,10 +59,10 @@ public class OneLoginActivity extends AbsActivity {
|
||||
protected void main() {
|
||||
super.main();
|
||||
act = this;
|
||||
avatar = (RoundedImageView)findViewById(R.id.avatar);
|
||||
edit_user = (EditText)findViewById(R.id.edit_user);
|
||||
edit_code = (EditText)findViewById(R.id.edit_code);
|
||||
btn_enter = (Button)findViewById(R.id.btn_enter);
|
||||
avatar = (RoundedImageView) findViewById(R.id.avatar);
|
||||
edit_user = (EditText) findViewById(R.id.edit_user);
|
||||
edit_code = (EditText) findViewById(R.id.edit_code);
|
||||
btn_enter = (Button) findViewById(R.id.btn_enter);
|
||||
mImageUtil = new ProcessImageUtil(this);
|
||||
mImageUtil.setImageResultCallback(new ImageResultCallback() {
|
||||
@Override
|
||||
@@ -90,7 +83,7 @@ public class OneLoginActivity extends AbsActivity {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
bean.setAvatar(obj.getString("avatar"));
|
||||
bean.setAvatarThumb(obj.getString("avatarThumb"));
|
||||
ImgLoader.displayAvatar(mContext,CommonAppConfig.getInstance().getUserBean().getAvatar(), avatar);
|
||||
ImgLoader.displayAvatar(mContext, CommonAppConfig.getInstance().getUserBean().getAvatar(), avatar);
|
||||
V2TIMUserFullInfo v2TIMUserFullInfo = new V2TIMUserFullInfo();
|
||||
v2TIMUserFullInfo.setFaceUrl(obj.getString("avatarThumb"));
|
||||
V2TIMManager.getInstance().setSelfInfo(v2TIMUserFullInfo, new V2TIMCallback() {
|
||||
@@ -113,7 +106,7 @@ public class OneLoginActivity extends AbsActivity {
|
||||
public void onFailure() {
|
||||
}
|
||||
});
|
||||
ImgLoader.displayAvatar(mContext,CommonAppConfig.getInstance().getUserBean().getAvatar(), avatar);
|
||||
ImgLoader.displayAvatar(mContext, CommonAppConfig.getInstance().getUserBean().getAvatar(), avatar);
|
||||
|
||||
edit_user.setText(CommonAppConfig.getInstance().getUserBean().getUserNiceName());
|
||||
|
||||
@@ -128,21 +121,10 @@ public class OneLoginActivity extends AbsActivity {
|
||||
btn_enter.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
AdjustEvent adjustEvent = new AdjustEvent("xgt0h2");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
CommonHttpUtil.setAdvertisingChannels("xgt0h2", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if(code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_binding_click", null);
|
||||
logger.logEvent("FB_binding_click");
|
||||
}
|
||||
}
|
||||
});
|
||||
OneLoginDialog fragment = new OneLoginDialog();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("name", edit_user.getText().toString()+"");
|
||||
bundle.putString("code", edit_code.getText().toString()+"");
|
||||
bundle.putString("name", edit_user.getText().toString() + "");
|
||||
bundle.putString("code", edit_code.getText().toString() + "");
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(getSupportFragmentManager(), "OneLoginDialog");
|
||||
}
|
||||
|
||||
@@ -21,8 +21,6 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.binioter.guideview.Guide;
|
||||
import com.binioter.guideview.GuideBuilder;
|
||||
@@ -325,8 +323,6 @@ public class PDLiveConversationListActivity extends AbsActivity implements View.
|
||||
netHandler.post(systemNumberRunnable);
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_customer_service", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service");
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("ww5z2p");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
if (userBean.getLink() != null && !"".equals(userBean.getLink())) {
|
||||
WebViewActivity.forward(mContext, userBean.getLink());
|
||||
} else {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_cn;
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_us;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.Editable;
|
||||
@@ -19,13 +21,10 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
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.blankj.utilcode.util.DeviceUtils;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.facebook.appevents.AppEventsConstants;
|
||||
import com.fm.openinstall.OpenInstall;
|
||||
import com.fm.openinstall.listener.AppInstallAdapter;
|
||||
import com.fm.openinstall.model.AppData;
|
||||
@@ -38,8 +37,8 @@ import com.yunbao.common.HtmlConfig;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
@@ -47,10 +46,9 @@ import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.main.R;
|
||||
@@ -65,11 +63,6 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_cn;
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_us;
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/25.
|
||||
*/
|
||||
@@ -114,23 +107,6 @@ public class RegisterActivity extends AbsActivity {
|
||||
@Override
|
||||
protected void main() {
|
||||
activity = this;
|
||||
//谷歌
|
||||
mFirebaseAnalytics.logEvent("FS_complete_2nd_loading", null);
|
||||
logger.logEvent("FB_complete_2nd_loading");
|
||||
|
||||
|
||||
AdjustEvent adjustEvent = new AdjustEvent("pooqmz");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
CommonHttpUtil.setAdvertisingChannels("pooqmz", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
//谷歌
|
||||
mFirebaseAnalytics.logEvent("FS_complete_2nd_loading", null);
|
||||
logger.logEvent("FB_complete_2nd_loading");
|
||||
}
|
||||
}
|
||||
});
|
||||
mEditPhone = (EditText) findViewById(R.id.edit_phone);
|
||||
webview = (WebView) findViewById(R.id.webview);
|
||||
initView();
|
||||
@@ -158,11 +134,6 @@ public class RegisterActivity extends AbsActivity {
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if (!TextUtils.isEmpty(s) && s.length() >= mPhoneMinLength) {
|
||||
mBtnCode.setEnabled(true);
|
||||
//输入手机号
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("4mg5a9");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
mFirebaseAnalytics.logEvent("FS_phone_num", null);
|
||||
logger.logEvent("FB_phone_num");
|
||||
} else {
|
||||
mBtnCode.setEnabled(false);
|
||||
}
|
||||
@@ -301,17 +272,8 @@ public class RegisterActivity extends AbsActivity {
|
||||
webview.setVisibility(View.VISIBLE);
|
||||
//获取设备唯一标识符
|
||||
getUuidDevice();
|
||||
//获取验证码
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("rrcbdh");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
mFirebaseAnalytics.logEvent("FS_phone_getcode", null);
|
||||
logger.logEvent("FB_phone_getcode");
|
||||
} else if (i == R.id.btn_register) {
|
||||
register();
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("wrajax");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
mFirebaseAnalytics.logEvent("FS_phone_clickregister", null);
|
||||
logger.logEvent("FB_phone_clickregister");
|
||||
} else if (i == R.id.btn_tip2) {
|
||||
WebViewActivity.forward(mContext, HtmlConfig.REG_PRIVCAY1);
|
||||
} else if (i == R.id.btn_tip3) {
|
||||
@@ -400,23 +362,6 @@ public class RegisterActivity extends AbsActivity {
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
//注册成功
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("fhqx62");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
Bundle params = new Bundle();
|
||||
|
||||
CommonHttpUtil.setAdvertisingChannels("fhqx62", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_reg_phone", null);
|
||||
logger.logEvent("FB_reg_phone");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Bundle params1 = new Bundle();
|
||||
params1.putString(AppEventsConstants.EVENT_PARAM_REGISTRATION_METHOD, "Phone number");
|
||||
logger.logEvent(AppEventsConstants.EVENT_NAME_COMPLETED_REGISTRATION, params1);
|
||||
login(phoneNum, pwd, mUuidDevice);
|
||||
OpenInstall.reportRegister();
|
||||
} else {
|
||||
@@ -475,12 +420,6 @@ public class RegisterActivity extends AbsActivity {
|
||||
//融云连接服务器
|
||||
RongcloudIMManager.connectIM(activity);
|
||||
getBaseUserInfo();
|
||||
//绑定广告渠道用户
|
||||
AdjustEvent adjustEvent = new AdjustEvent("s1or0t");
|
||||
adjustEvent.addCallbackParameter("userid", CommonAppConfig.getInstance().getUid());
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
|
||||
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
@@ -512,6 +451,7 @@ public class RegisterActivity extends AbsActivity {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户自动签到
|
||||
*/
|
||||
@@ -529,7 +469,7 @@ public class RegisterActivity extends AbsActivity {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
IMLoginManager.get(activity).setisNewUserOne(true);
|
||||
IMLoginManager.get(activity).setNewUserGif(true);
|
||||
if(obj.containsKey("home_zdy_img_us")) {
|
||||
if (obj.containsKey("home_zdy_img_us")) {
|
||||
home_zdy_img_us = obj.getString("home_zdy_img_us");
|
||||
home_zdy_img_cn = obj.getString("home_zdy_img_cn");
|
||||
}
|
||||
@@ -553,7 +493,6 @@ public class RegisterActivity extends AbsActivity {
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private LiveRoomCheckLivePresenter mCheckLivePresenter;
|
||||
|
||||
private void gotoLive(final String live_id) {
|
||||
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
||||
@@ -561,20 +500,23 @@ public class RegisterActivity extends AbsActivity {
|
||||
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(RegisterActivity.this, new LiveRoomCheckLivePresenter.ActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
LiveAudienceActivity.forward(RegisterActivity.this, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
||||
NoviceInstructorManager.get(activity).setFrist(false);
|
||||
}
|
||||
});
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
NoviceInstructorManager.get(mContext).setFrist(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
MainActivity.forward(RegisterActivity.this, false);
|
||||
}
|
||||
|
||||
@@ -18,19 +18,20 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.event.CloseEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
import com.yunbao.common.manager.SearchHistoryRecordManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.utils.WordsTypeUtil;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.event.JumpUserHomeEvent;
|
||||
import com.yunbao.main.fragment.SearchRecommendFragment;
|
||||
import com.yunbao.main.fragment.SearchResultsFragment;
|
||||
import com.yunbao.common.utils.WordsTypeUtil;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
@@ -173,8 +174,18 @@ public class SearchActivity extends AbsActivity {
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
LiveAudienceActivity.forward(mContext, liveBean, 0, 0, "", 0, 0);
|
||||
} else {
|
||||
//跳转到个人资料
|
||||
if (imm != null && mEditText != null) {
|
||||
|
||||
@@ -293,18 +293,18 @@ public class SettingActivity extends AbsActivity implements OnItemClickListener<
|
||||
* 检查更新
|
||||
*/
|
||||
private void checkVersion() {
|
||||
CommonAppConfig.getInstance().getConfig(new CommonCallback<ConfigBean>() {
|
||||
@Override
|
||||
public void callback(ConfigBean configBean) {
|
||||
if (configBean != null) {
|
||||
if (VersionUtil.isLatest(configBean.getVersion())) {
|
||||
ToastUtil.show(R.string.version_latest);
|
||||
} else {
|
||||
VersionUtil.showDialog(mContext, configBean, configBean.getDownloadApkUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// CommonAppConfig.getInstance().getConfig(new CommonCallback<ConfigBean>() {
|
||||
// @Override
|
||||
// public void callback(ConfigBean configBean) {
|
||||
// if (configBean != null) {
|
||||
// if (VersionUtil.isLatest(configBean.getVersion())) {
|
||||
// ToastUtil.show(R.string.version_latest);
|
||||
// } else {
|
||||
// VersionUtil.showDialog(mContext, configBean, configBean.getDownloadApkUrl());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.live.activity.WebViewActivityMedal;
|
||||
import com.yunbao.live.dialog.LiveUserDialogFragment;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
@@ -144,29 +143,26 @@ public class WeekWebViewActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
});
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
RouteUtil.forwardUserHome(mContext, live_id, 0);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
@@ -16,17 +14,16 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebResourceResponse;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.opensource.svgaplayer.SVGACallback;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
@@ -83,9 +80,6 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
lt_title = (LinearLayout) findViewById(R.id.lt_title);
|
||||
LinearLayout rootView = (LinearLayout) findViewById(com.yunbao.live.R.id.rootView);
|
||||
if (getIntent().hasExtra("title")) {
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) rootView.getLayoutParams();
|
||||
params.topMargin = DpUtil.dp2px(34);
|
||||
rootView.setLayoutParams(params);
|
||||
if (TextUtils.isEmpty(titleString)) {
|
||||
lt_title.setVisibility(View.GONE);
|
||||
} else {
|
||||
@@ -129,7 +123,13 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
} else {
|
||||
setTitle(titleString);
|
||||
}
|
||||
int height = view.getMeasuredHeight();
|
||||
Log.e("网页高度", height + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedHttpError(WebView view, WebResourceRequest request, WebResourceResponse errorResponse) {
|
||||
super.onReceivedHttpError(view, request, errorResponse);
|
||||
}
|
||||
});
|
||||
mWebView.setWebChromeClient(new WebChromeClient() {
|
||||
@@ -270,12 +270,17 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
|
||||
public static void forward(Context context, String url, boolean addArgs) {
|
||||
if (addArgs) {
|
||||
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
||||
if (url.contains("?")) {
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
||||
} else {
|
||||
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
||||
}
|
||||
|
||||
}
|
||||
Intent intent = new Intent(context, ZhuangBanActivity.class);
|
||||
Log.i("tag1212", url);
|
||||
intent.putExtra(Constants.URL, url);
|
||||
if (url.contains("Noble/index.html")) {
|
||||
if (url.contains("Noble/index.html") || url.contains("Grade/index.html")) {
|
||||
intent.putExtra("title", "");
|
||||
}
|
||||
context.startActivity(intent);
|
||||
@@ -358,11 +363,6 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (TextUtils.equals(event.getMethod(), "AndroidAdjustConsume")) {
|
||||
mFirebaseAnalytics.logEvent("FS_event_interaction", null);
|
||||
logger.logEvent("FB_event_interaction", null);
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("rq2c5n");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.custom.MyRadioButton;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
@@ -21,8 +23,6 @@ import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.bean.SearchUserBean;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
@@ -188,7 +188,6 @@ public class SearchAdapter extends RefreshAdapter<SearchUserBean> {
|
||||
|
||||
}
|
||||
|
||||
private LiveRoomCheckLivePresenter mCheckLivePresenter;
|
||||
|
||||
private void gotoLive(final String live_id) {
|
||||
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
||||
@@ -196,21 +195,20 @@ public class SearchAdapter extends RefreshAdapter<SearchUserBean> {
|
||||
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);
|
||||
|
||||
}
|
||||
});
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
RouteUtil.forwardUserHome(mContext, live_id, 0);
|
||||
}
|
||||
|
||||
@@ -11,9 +11,6 @@ import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
@@ -91,8 +88,6 @@ public class SystemMessageAdapter extends RecyclerView.Adapter {
|
||||
if (model1.getTitle().equals("在線客服")) {
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_customer_service", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service");
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("ww5z2p");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
}
|
||||
if (!TextUtils.isEmpty(model1.getLink())) {
|
||||
mContext.startActivity(new Intent(mContext, WebViewActivity.class).putExtra("url", model1.getLink()));
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.Manifest;
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@@ -15,8 +14,6 @@ import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
@@ -24,6 +21,7 @@ import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ProcessResultUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.LiveConfig;
|
||||
@@ -142,8 +140,10 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
mRootView.findViewById(R.id.btn_video).setOnClickListener(this);
|
||||
mRootView.findViewById(R.id.btn_close).setOnClickListener(this);
|
||||
}
|
||||
|
||||
private HttpCallback mGetLiveSdkCallback;
|
||||
private ProcessResultUtil mProcessResultUtil;
|
||||
|
||||
public void setMainStartChooseCallback(boolean isCallback, AbsActivity activity) {
|
||||
mProcessResultUtil = new ProcessResultUtil(activity);
|
||||
if (isCallback) {
|
||||
@@ -154,17 +154,24 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
private MainStartChooseCallback mMainStartChooseCallback = new MainStartChooseCallback() {
|
||||
@Override
|
||||
public void onLiveClick() {
|
||||
mProcessResultUtil.requestPermissions(new String[]{
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
}, mStartLiveRunnable);
|
||||
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
|
||||
if (isAnchor) {
|
||||
mProcessResultUtil.requestPermissions(new String[]{
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
}, mStartLiveRunnable);
|
||||
} else {
|
||||
ToastUtil.show(getString(R.string.only_open_anchor));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoClick() {
|
||||
if (Constants.isAnchor) {
|
||||
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
|
||||
if (isAnchor) {
|
||||
mProcessResultUtil.requestPermissions(new String[]{
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
@@ -230,6 +237,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (!canClick()) {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.yunbao.main.dialog;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_cn;
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_us;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
@@ -10,34 +13,26 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
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.bean.LiveBean;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_cn;
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_us;
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
public class OneLoginDialog extends AbsDialogFragment {
|
||||
|
||||
|
||||
@@ -102,17 +97,6 @@ public class OneLoginDialog extends AbsDialogFragment {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
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) {
|
||||
mFirebaseAnalytics.logEvent("FS_binding_success", null);
|
||||
logger.logEvent("FB_binding_success");
|
||||
}
|
||||
}
|
||||
});
|
||||
HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
@@ -155,28 +139,38 @@ 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);
|
||||
NoviceInstructorManager.get(mContext).setFrist(false);
|
||||
}
|
||||
});
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
NoviceInstructorManager.get(mContext).setFrist(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
MainActivity.forward(mContext, false);
|
||||
}
|
||||
|
||||
@@ -1,184 +0,0 @@
|
||||
package com.yunbao.main.presenter;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.MD5Util;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.http.LiveHttpConsts;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/9/29.
|
||||
*/
|
||||
|
||||
public class CheckLivePresenter {
|
||||
|
||||
private Context mContext;
|
||||
private LiveBean mLiveBean;//选中的直播间信息
|
||||
private String mKey;
|
||||
private int mPosition;
|
||||
private int mLiveType;//直播间的类型 普通 密码 门票 计时等
|
||||
private int mLiveTypeVal;//收费价格等
|
||||
private String mLiveTypeMsg;//直播间提示信息或房间密码
|
||||
private int mLiveSdk;
|
||||
private HttpCallback mCheckLiveCallback;
|
||||
|
||||
public CheckLivePresenter(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 观众 观看直播
|
||||
*/
|
||||
public void watchLive(LiveBean bean) {
|
||||
watchLive(bean, "", 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 观众 观看直播
|
||||
*/
|
||||
public void watchLive(LiveBean bean, String key, int position) {
|
||||
mLiveBean = bean;
|
||||
mKey = key;
|
||||
mPosition = position;
|
||||
if (mCheckLiveCallback == null) {
|
||||
mCheckLiveCallback = new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
if (info.length > 0) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
mLiveType = obj.getIntValue("type");
|
||||
mLiveTypeVal = obj.getIntValue("type_val");
|
||||
mLiveTypeMsg = obj.getString("type_msg");
|
||||
if (CommonAppConfig.LIVE_SDK_CHANGED) {
|
||||
mLiveSdk = obj.getIntValue("live_sdk");
|
||||
} else {
|
||||
mLiveSdk = CommonAppConfig.LIVE_SDK_USED;
|
||||
}
|
||||
switch (mLiveType) {
|
||||
case Constants.LIVE_TYPE_NORMAL:
|
||||
forwardNormalRoom();
|
||||
break;
|
||||
case Constants.LIVE_TYPE_PWD:
|
||||
//forwardPwdRoom();
|
||||
forwardLiveAudienceActivity();
|
||||
break;
|
||||
case Constants.LIVE_TYPE_PAY:
|
||||
case Constants.LIVE_TYPE_TIME:
|
||||
forwardPayRoom();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showLoadingDialog() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog createLoadingDialog() {
|
||||
return DialogUitl.loadingDialog(mContext);
|
||||
}
|
||||
};
|
||||
}
|
||||
LiveHttpUtil.checkLive(bean.getUid(), bean.getStream(), mCheckLiveCallback);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 前往普通房间
|
||||
*/
|
||||
private void forwardNormalRoom() {
|
||||
forwardLiveAudienceActivity();
|
||||
}
|
||||
|
||||
/**
|
||||
* 前往密码房间
|
||||
*/
|
||||
private void forwardPwdRoom() {
|
||||
DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
if (TextUtils.isEmpty(content)) {
|
||||
ToastUtil.show(WordUtil.getString(R.string.live_input_password));
|
||||
return;
|
||||
}
|
||||
String password = MD5Util.getMD5(content);
|
||||
if (mLiveTypeMsg.equalsIgnoreCase(password)) {
|
||||
dialog.dismiss();
|
||||
forwardLiveAudienceActivity();
|
||||
} else {
|
||||
ToastUtil.show(WordUtil.getString(R.string.live_password_error));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 前往付费房间
|
||||
*/
|
||||
private void forwardPayRoom() {
|
||||
DialogUitl.showSimpleDialog(mContext, mLiveTypeMsg, new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
roomCharge();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void roomCharge() {
|
||||
LiveHttpUtil.roomCharge(mLiveBean.getUid(), mLiveBean.getStream(), mRoomChargeCallback);
|
||||
}
|
||||
|
||||
private HttpCallback mRoomChargeCallback = new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
forwardLiveAudienceActivity();
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showLoadingDialog() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog createLoadingDialog() {
|
||||
return DialogUitl.loadingDialog(mContext);
|
||||
}
|
||||
};
|
||||
|
||||
public void cancel() {
|
||||
LiveHttpUtil.cancel(LiveHttpConsts.CHECK_LIVE);
|
||||
LiveHttpUtil.cancel(LiveHttpConsts.ROOM_CHARGE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到直播间
|
||||
*/
|
||||
private void forwardLiveAudienceActivity() {
|
||||
LiveAudienceActivity.forward(mContext, mLiveBean, mLiveType, mLiveTypeVal, mKey, mPosition, mLiveSdk);
|
||||
}
|
||||
}
|
||||
@@ -139,7 +139,6 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
}
|
||||
}
|
||||
|
||||
private LiveRoomCheckLivePresenter mCheckLivePresenter;
|
||||
|
||||
@Override
|
||||
public void onItemClick(ListBean bean, int position) {
|
||||
@@ -149,20 +148,17 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
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);
|
||||
NoviceInstructorManager.get(mContext).setFrist(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
MainActivity.forward(mContext, false);
|
||||
}
|
||||
@@ -365,6 +361,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
if (bean.isHide()) {
|
||||
ToastUtil.show(R.string.can_not_go);
|
||||
} else {
|
||||
|
||||
if (bean.getIslive() == 1) {
|
||||
LiveHttpUtil.getLiveInfo(bean.getUid(), new HttpCallback() {
|
||||
@Override
|
||||
@@ -372,19 +369,17 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
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);
|
||||
NoviceInstructorManager.get(mContext).setFrist(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
MainActivity.forward(mContext, false);
|
||||
}
|
||||
|
||||
@@ -235,7 +235,17 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
|
||||
LiveAudienceActivity.forward(mContext, liveBean, 0, 0, "", 0, 0);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
RouteUtil.forwardUserHome(mContext, String.valueOf(live_id), 0);
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.BannerBean;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.LiveClassBean;
|
||||
import com.yunbao.common.bean.WeekListBean;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
@@ -33,11 +34,10 @@ import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.CustomViewHolder;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
@@ -312,7 +312,6 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
|
||||
}
|
||||
|
||||
private LiveRoomCheckLivePresenter mCheckLivePresenter;
|
||||
|
||||
private void gotoLive(final String live_id) {
|
||||
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
||||
@@ -320,24 +319,26 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
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;
|
||||
}
|
||||
intoIndex = 1;
|
||||
if (gotoRoomKey != null && gotoRoomKey.isEmpty()) {
|
||||
gotoRoomKey = null;
|
||||
}
|
||||
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", gotoRoomKey, 0, liveSdk);
|
||||
|
||||
}
|
||||
});
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
intoIndex = 1;
|
||||
if (gotoRoomKey != null && gotoRoomKey.isEmpty()) {
|
||||
gotoRoomKey = null;
|
||||
}
|
||||
liveBean.setParams(gotoRoomKey);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
intoIndex = 1;
|
||||
RouteUtil.forwardUserHome(mContext, live_id, 0);
|
||||
@@ -411,25 +412,33 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
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) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
|
||||
if (LiveRoomViewHolder.mHandler != null) {
|
||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
if (!"".endsWith(Constants.mStream)) {
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
if (LiveRoomViewHolder.mHandler != null) {
|
||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
if (!"".endsWith(Constants.mStream)) {
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal));
|
||||
} else {
|
||||
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
||||
} else {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
||||
}
|
||||
});
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
|
||||
@@ -154,7 +154,6 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
|
||||
findViewById(R.id.rt_kefu).setOnClickListener(this);
|
||||
findViewById(R.id.rt_setting).setOnClickListener(this);
|
||||
findViewById(R.id.v_noble).setOnClickListener(this);
|
||||
findViewById(R.id.lt_noble).setOnClickListener(this);
|
||||
findViewById(R.id.lt_name).setOnClickListener(this);
|
||||
findViewById(R.id.signature).setOnClickListener(this);
|
||||
@@ -444,7 +443,8 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
WebViewActivity.forward(mContext, url);
|
||||
} else if(bean.getId() == 3) {//我的等级
|
||||
Constants.myIntoIndex=2;
|
||||
WebViewActivity.forward(mContext, url);
|
||||
Constants.isTitle = false;
|
||||
ZhuangBanActivity.forward(mContext, url);
|
||||
}else{
|
||||
WebViewActivity.forward(mContext, url);
|
||||
}
|
||||
|
||||
@@ -15,9 +15,6 @@ import android.widget.TextView;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.binioter.guideview.Guide;
|
||||
import com.binioter.guideview.GuideBuilder;
|
||||
@@ -277,8 +274,6 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
netHandler.post(systemNumberRunnable);
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_customer_service", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service");
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("ww5z2p");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
if (userBean.getLink() != null && !"".equals(userBean.getLink())) {
|
||||
WebViewActivity.forward(mContext, userBean.getLink());
|
||||
} else {
|
||||
@@ -421,13 +416,18 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, (liveBean1, liveType, liveTypeVal, liveSdk) -> {
|
||||
if (liveBean1 == null) {
|
||||
return;
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
LiveAudienceActivity.forward(mContext, liveBean1, liveType, liveTypeVal, "", 0, liveSdk);
|
||||
});
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
|
||||
} else {
|
||||
RouteUtil.forwardUserHome(mContext, event.getLiveuid(), 0);
|
||||
}
|
||||
|
||||
@@ -15,17 +15,21 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.bean.SearchModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.WordsTypeUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.event.JumpUserHomeEvent;
|
||||
import com.yunbao.common.utils.WordsTypeUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SearchResultsViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView avatar, isLive, sex, focusOn, contribute;
|
||||
private TextView nickName;
|
||||
private TextView nickName, leave;
|
||||
private LinearLayout nickLayout;
|
||||
private RelativeLayout avatarLayout;
|
||||
private SearchModel model;
|
||||
@@ -41,6 +45,7 @@ public class SearchResultsViewHolder extends RecyclerView.ViewHolder {
|
||||
super(itemView);
|
||||
avatar = itemView.findViewById(R.id.avatar);
|
||||
isLive = itemView.findViewById(R.id.is_live);
|
||||
leave = itemView.findViewById(R.id.leave);
|
||||
sex = itemView.findViewById(R.id.sex);
|
||||
focusOn = itemView.findViewById(R.id.focus_on);
|
||||
nickName = itemView.findViewById(R.id.nick_name);
|
||||
@@ -76,9 +81,19 @@ public class SearchResultsViewHolder extends RecyclerView.ViewHolder {
|
||||
}
|
||||
isLive.setVisibility(View.GONE);
|
||||
} else {
|
||||
LevelBean anchorLevelBean = CommonAppConfig.getInstance().getAnchorLevel(Integer.parseInt(model.getLevelAnchor()));
|
||||
if (anchorLevelBean != null) {
|
||||
ImgLoader.display(isLive.getContext(), CommonAppConfig.getInstance().HOST + anchorLevelBean.getThumb(), contribute);
|
||||
List<NewLevelModel> models = new NewLevelManager(itemView.getContext()).getNewAnchorLevelModels();
|
||||
int anchorLevel = 0;
|
||||
|
||||
if (!TextUtils.isEmpty(model.getLevelAnchor())) {
|
||||
anchorLevel = Integer.parseInt(model.getLevelAnchor());
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getThumb();
|
||||
}
|
||||
}
|
||||
leave.setText(model.getLevelAnchor());
|
||||
ImgLoader.display(itemView.getContext(), imgUrl, contribute);
|
||||
}
|
||||
isLive.setVisibility(model.getIslive() == 0 ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
@@ -21,6 +19,9 @@ import android.widget.LinearLayout;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
@@ -33,6 +34,7 @@ import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.adapter.ViewPagerAdapter;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.event.FollowEvent;
|
||||
import com.yunbao.common.event.UpdateFieldEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
@@ -42,13 +44,13 @@ import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.live.activity.LiveReportActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.bean.SearchUserBean;
|
||||
import com.yunbao.live.dialog.LiveShareDialogFragment;
|
||||
import com.yunbao.live.event.LiveRoomChangeEvent;
|
||||
@@ -59,7 +61,6 @@ import com.yunbao.live.presenter.UserHomeSharePresenter;
|
||||
import com.yunbao.live.views.AbsLivePageViewHolder;
|
||||
import com.yunbao.live.views.AbsUserHomeViewHolder;
|
||||
import com.yunbao.live.views.LiveRecordViewHolder;
|
||||
import com.yunbao.live.views.LiveRoomViewHolder;
|
||||
import com.yunbao.live.views.ShowBigPhoto;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.EditProfileActivity;
|
||||
@@ -766,27 +767,30 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
|
||||
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) {
|
||||
if (mFromLiveRoom) {
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
if (LiveRoomViewHolder.mHandler != null) {
|
||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
if (mFromLiveRoom) {
|
||||
((UserHomeActivity) mContext).onBackPressed();
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal));
|
||||
} else {
|
||||
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
||||
}
|
||||
((UserHomeActivity) mContext).onBackPressed();
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
||||
} else {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
||||
}
|
||||
});
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/color_b14066"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ProgressBar
|
||||
@@ -32,6 +33,7 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rootView"
|
||||
android:background="@drawable/backgroud_custom_drawer_popup"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" />
|
||||
|
||||
@@ -477,11 +477,17 @@
|
||||
android:layout_marginRight="15dp"
|
||||
android:background="@drawable/bg_me_data"
|
||||
android:gravity="center"
|
||||
android:clickable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:focusable="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:focusable="false"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
@@ -498,6 +504,9 @@
|
||||
android:layout_weight="1"
|
||||
android:gravity="center|left"
|
||||
android:orientation="vertical"
|
||||
android:clickable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:focusable="false"
|
||||
android:paddingLeft="18dp"
|
||||
android:paddingRight="6dp">
|
||||
|
||||
@@ -525,6 +534,9 @@
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginRight="30dp"
|
||||
android:clickable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:focusable="false"
|
||||
android:background="@mipmap/icon_more_gray" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
<com.yunbao.common.views.weight.ClipPathCircleImage
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="55dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_height="55dp" />
|
||||
android:layout_height="55dp"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/is_live"
|
||||
@@ -52,11 +52,27 @@
|
||||
android:layout_height="19dp"
|
||||
android:src="@mipmap/icon_sex_female_1" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contribute"
|
||||
<FrameLayout
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="19dp" />
|
||||
android:layout_height="19dp">
|
||||
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contribute"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="19dp" />
|
||||
<TextView
|
||||
android:id="@+id/leave"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="28dp"
|
||||
android:textStyle="bold"
|
||||
android:textSize="10sp" />
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user