111
This commit is contained in:
parent
cbf43a3aa3
commit
701f1c6dc1
@ -30,11 +30,17 @@ import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.live.socket.SocketRyClient;
|
||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import io.rong.imlib.IRongCoreListener;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
import static com.yunbao.live.socket.SocketClient.mSocketHandler;
|
||||
|
||||
//import cn.tillusory.sdk.TiSDK;
|
||||
@ -134,7 +140,7 @@ public class AppContext extends CommonAppContext {
|
||||
CommonHttpUtil.setAdvertisingChannels("p7igfz", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if(code == 0) {
|
||||
if (code == 0) {
|
||||
//谷歌激活
|
||||
mFirebaseAnalytics.logEvent("FS_complete_1st_loading", null);
|
||||
//FB激活
|
||||
@ -146,8 +152,7 @@ public class AppContext extends CommonAppContext {
|
||||
//初始化 AndroidUtilCode
|
||||
Utils.init(this);
|
||||
liveImDeletUtil = new LiveImDeletUtil();
|
||||
//
|
||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener();
|
||||
|
||||
//初始化融云
|
||||
RongcloudIMManager.initRongIM(this);
|
||||
|
||||
|
@ -36,6 +36,7 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
public static String lang = "chinese";
|
||||
public static FirebaseAnalytics mFirebaseAnalytics;
|
||||
public static AppEventsLogger logger;
|
||||
public static boolean isReady = false;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
|
@ -10,6 +10,7 @@ import androidx.annotation.NonNull;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
@ -26,6 +27,10 @@ import io.rong.imlib.RongCoreClient;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.Ingroup;
|
||||
import static com.yunbao.common.CommonAppContext.isReady;
|
||||
|
||||
/**
|
||||
* 会话列表
|
||||
@ -33,7 +38,7 @@ import io.rong.imlib.model.Message;
|
||||
*/
|
||||
public class RongcloudIMManager {
|
||||
//融云开发者平台注册app唯一识别符
|
||||
private static final String RONG_IM_KEY = "uwd1c0sxu1p71";
|
||||
public static final String RONG_IM_KEY = "uwd1c0sxu1p71";
|
||||
private static final String CLASSNAME = "RongcloudIMManager";
|
||||
|
||||
/**
|
||||
@ -48,17 +53,13 @@ public class RongcloudIMManager {
|
||||
initPhotoGlide();
|
||||
}
|
||||
|
||||
private static RongIMClient.OnReceiveMessageWrapperListener listener = new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||
@Override
|
||||
public boolean onReceived(Message message, int left, boolean hasPackage, boolean offline) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
private static RongIMClient.OnReceiveMessageWrapperListener mListener ;
|
||||
|
||||
/**
|
||||
* 设置消息接受监听器
|
||||
*/
|
||||
public static void addRongcloudIMOnReceiveMessageListener() {
|
||||
public static void addRongcloudIMOnReceiveMessageListener(RongIMClient.OnReceiveMessageWrapperListener listener) {
|
||||
mListener = listener;
|
||||
IMCenter.getInstance().addOnReceiveMessageListener(listener);
|
||||
}
|
||||
|
||||
@ -66,7 +67,8 @@ public class RongcloudIMManager {
|
||||
* 移除消息接受监听器
|
||||
*/
|
||||
public static void removeRongcloudIMOnReceiveMessageListener() {
|
||||
IMCenter.getInstance().removeOnReceiveMessageListener(listener);
|
||||
if (null!=mListener)
|
||||
IMCenter.getInstance().removeOnReceiveMessageListener(mListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -113,6 +115,7 @@ public class RongcloudIMManager {
|
||||
public void onSuccess(String s) {
|
||||
//连接成功,如果 onDatabaseOpened() 时没有页面跳转,也可在此时进行跳转。
|
||||
Log.e(CLASSNAME, "onSuccess:" + s);
|
||||
isReady = true;
|
||||
//添加融云连接状态监听
|
||||
RongcloudIMManager.setIMStatusListener();
|
||||
}
|
||||
|
@ -9,9 +9,9 @@ ext {
|
||||
]
|
||||
manifestPlaceholders = [
|
||||
//正式
|
||||
// serverHost : "https://napi.yaoulive.com",
|
||||
serverHost : "https://napi.yaoulive.com",
|
||||
//測試
|
||||
serverHost : "https://ceshi.yaoulive.com",
|
||||
// serverHost : "https://ceshi.yaoulive.com",
|
||||
|
||||
//腾讯地图
|
||||
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",
|
||||
|
@ -67,7 +67,7 @@
|
||||
android:name=".activity.MedalQuestionWebViewActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".views.ZhuangBanActivity"
|
||||
android:name=".activity.ZhuangBanActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:screenOrientation="portrait" /> <!-- Android 9.0移除了apache的HttpClient,而金山sdk中用到了这个,不加这个的话在Android 9.0会崩溃 -->
|
||||
<activity
|
||||
|
@ -657,16 +657,20 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
* 打开礼物窗口
|
||||
*/
|
||||
public void openGiftWindow() {
|
||||
if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) {
|
||||
return;
|
||||
}
|
||||
LiveGiftDialogFragment fragment = new LiveGiftDialogFragment();
|
||||
fragment.setLiveGuardInfo(mLiveGuardInfo);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putString(Constants.LIVE_STREAM, mStream);
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
public void run() {
|
||||
if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) {
|
||||
return;
|
||||
}
|
||||
LiveGiftDialogFragment fragment = new LiveGiftDialogFragment();
|
||||
fragment.setLiveGuardInfo(mLiveGuardInfo);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putString(Constants.LIVE_STREAM, mStream);
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void openGiftWindow(String giftId) {
|
||||
@ -687,17 +691,22 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) {
|
||||
return;
|
||||
}
|
||||
LiveGiftDialogFragment fragment = new LiveGiftDialogFragment();
|
||||
fragment.setLiveGuardInfo(mLiveGuardInfo);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putString(Constants.LIVE_STREAM, mStream);
|
||||
bundle.putString(Constants.LIVE_WISH_GIFTID, giftId);
|
||||
if (for_by.equals("1")) {
|
||||
bundle.putString("by", "1");
|
||||
}
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
public void run() {
|
||||
LiveGiftDialogFragment fragment = new LiveGiftDialogFragment();
|
||||
fragment.setLiveGuardInfo(mLiveGuardInfo);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putString(Constants.LIVE_STREAM, mStream);
|
||||
bundle.putString(Constants.LIVE_WISH_GIFTID, giftId);
|
||||
if (for_by.equals("1")) {
|
||||
bundle.putString("by", "1");
|
||||
}
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -147,6 +147,12 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
||||
onTrickerySendGiftInto(new JsWishBean(id));
|
||||
}
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void openWrap() {
|
||||
dismiss();
|
||||
((LiveAudienceActivity) mContext).openGiftWindow();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -166,9 +172,11 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
||||
|
||||
public void onTrickerySendGiftInto(JsWishBean id) {
|
||||
Log.i("tvs", "來了" + id);
|
||||
if (id != null) {
|
||||
if (id!=null){
|
||||
dismiss();
|
||||
if (mContext instanceof LiveAudienceActivity) {
|
||||
Log.i("tvs","來了111"+id);
|
||||
if (mContext instanceof LiveAudienceActivity){
|
||||
Log.i("tvs","來了333"+id);
|
||||
((LiveAudienceActivity) mContext).openGiftWindow(id.getGiftId(), "1");
|
||||
}
|
||||
}
|
||||
|
@ -143,72 +143,7 @@ public class EntryActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
// public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
// super.onActivityResult(requestCode, resultCode, data);
|
||||
// if (requestCode != 1) {
|
||||
// Log.e("ERROR", "Unsupported Request");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// LineLoginResult result = LineLoginApi.getLoginResultFromIntent(data);
|
||||
//
|
||||
// Log.i("ttts",result.getResponseCode()+"");
|
||||
// switch (result.getResponseCode()) {
|
||||
//
|
||||
// case SUCCESS:
|
||||
// // Login successful
|
||||
// String accessToken = result.getLineCredential().getAccessToken().getTokenString();
|
||||
// LoginData re_data = new LoginData();
|
||||
// re_data.setOpenID(result.getLineProfile().getUserId());
|
||||
// if(result.getLineProfile().getPictureUrl()!=null) {
|
||||
// re_data.setAvatar("" + result.getLineProfile().getPictureUrl().toString());
|
||||
// }
|
||||
// re_data.setNickName(result.getLineProfile().getDisplayName());
|
||||
// re_data.setType("LINE");
|
||||
// loginBuyThird(re_data);
|
||||
// break;
|
||||
//
|
||||
// case CANCEL:
|
||||
// // Login canceled by user
|
||||
// Log.e("ERROR", "LINE Login Canceled by user.");
|
||||
// break;
|
||||
//
|
||||
// default:
|
||||
// // Login canceled due to other error
|
||||
// Log.e("ERROR", "Login FAILED!");
|
||||
// Log.e("ERROR", result.getErrorData().toString());
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
//谷歌登录回调
|
||||
|
||||
/**
|
||||
* 登录回调
|
||||
*
|
||||
* @params requestCode 对应onActivityResult的 requestCode
|
||||
* @params data 对应onActivityResult的 data
|
||||
* @params selfRequestCode 对应上面初始化请求的自定义请求码
|
||||
* @params mListener 登录结果回调
|
||||
*/
|
||||
// public static void onActivityResult(int requestCode, Intent data, int selfRequestCode) {
|
||||
// if (requestCode == selfRequestCode) {
|
||||
// Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
|
||||
// handleSignInResult( task);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// private static void handleSignInResult(@NonNull Task<GoogleSignInAccount> completedTask) {
|
||||
// try {
|
||||
// GoogleSignInAccount account = completedTask.getResult(ApiException.class);
|
||||
// String idToken = account.getIdToken();
|
||||
// Log.e("tag111", idToken+"token"+account.getPhotoUrl());
|
||||
//
|
||||
// } catch (ApiException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
public void Get_hash_key() {
|
||||
PackageInfo info;
|
||||
try {
|
||||
@ -283,25 +218,6 @@ public class EntryActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// MobSDK.submitPolicyGrantResult(true, new OperationCallback<Void>() {
|
||||
// @Override
|
||||
// public void onComplete(Void aVoid) {
|
||||
//// ToastUtil.show("onComplete: c成功");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(Throwable throwable) {
|
||||
//// ToastUtil.show("隐私协议授权结果提交:失败");
|
||||
// }
|
||||
// });
|
||||
|
||||
//gpp模式判断
|
||||
// boolean gppVer = MobSDK.isGppVer();
|
||||
// Log.i("tag", "onCreate: gppVer: " + gppVer);
|
||||
// Boolean gpAvailable = MobSDK.isGpAvailable();
|
||||
// Log.i("tag", "onCreate: gpAvailable: " + gpAvailable);
|
||||
|
||||
getPromoCode();
|
||||
getUuidDevice();
|
||||
AdjustEvent adjustEvent2 = new AdjustEvent("tyqsyf");
|
||||
@ -340,33 +256,17 @@ public class EntryActivity extends AppCompatActivity {
|
||||
lt_btn_facebook.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
// final Dialog dialog = DialogUitl.loginAuthDialog(activity);
|
||||
// dialog.show();
|
||||
// mLoginUtil.execute("facebook", new MobCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(Object data) {
|
||||
// if (data != null) {
|
||||
// loginBuyThird((LoginData) data);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onCancel() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFinish() {
|
||||
// if (dialog != null) {
|
||||
// dialog.dismiss();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
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");
|
||||
}
|
||||
}
|
||||
});
|
||||
LoginManager.getInstance().logInWithReadPermissions(EntryActivity.this, Arrays.asList("public_profile"));
|
||||
}
|
||||
});
|
||||
@ -395,6 +295,17 @@ public class EntryActivity extends AppCompatActivity {
|
||||
btn_google.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View 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);
|
||||
}
|
||||
@ -403,6 +314,17 @@ public class EntryActivity extends AppCompatActivity {
|
||||
lt_btn_twitter.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View 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();
|
||||
}
|
||||
});
|
||||
@ -428,22 +350,7 @@ public class EntryActivity extends AppCompatActivity {
|
||||
|
||||
loginBuyThird(data);
|
||||
|
||||
// Call<User> user = TwitterCore.getInstance().getApiClient().getAccountService().verifyCredentials(false, true, false);
|
||||
// user.enqueue(new Callback<User>() {
|
||||
// @Override
|
||||
// public void success(Result<User> result) {
|
||||
// User userInfo = result.data;
|
||||
// String email = userInfo.email;
|
||||
// String description = userInfo.description;
|
||||
// String imageProfileUrl = userInfo.profileImageUrl;
|
||||
// String profileUrl = imageProfileUrl.replace("_normal", "");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void failure(TwitterException exception) {
|
||||
// Log.i("Log", "TwitterException = " + exception);
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -456,6 +363,17 @@ public class EntryActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onClick(View 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(),
|
||||
@ -737,6 +655,11 @@ public class EntryActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void callback(UserBean bean) {
|
||||
if (mFirstLogin) {
|
||||
//绑定广告渠道用户
|
||||
AdjustEvent adjustEvent = new AdjustEvent("s1or0t");
|
||||
adjustEvent.addCallbackParameter("userid", "bar");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
|
||||
//完成第三方登录
|
||||
if(mLoginType.equals("twitter")){
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("ea6lld");
|
||||
@ -790,7 +713,6 @@ public class EntryActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
|
||||
EntryActivity.this.startActivity(new Intent(EntryActivity.this, OneLoginActivity.class));
|
||||
|
@ -12,6 +12,7 @@ import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Display;
|
||||
@ -53,7 +54,7 @@ import com.yunbao.common.event.UpdateTablePointMe;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.GifCacheUtil;
|
||||
@ -74,6 +75,7 @@ import com.yunbao.live.bean.LiveBean;
|
||||
import com.yunbao.live.bean.LiveKsyConfigBean;
|
||||
import com.yunbao.live.http.LiveHttpConsts;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.socket.SocketRyClient;
|
||||
import com.yunbao.live.utils.LiveStorge;
|
||||
import com.yunbao.live.views.ChatListViewHolder;
|
||||
import com.yunbao.main.R;
|
||||
@ -107,6 +109,15 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.rongcloud.rtc.api.RCRTCConfig;
|
||||
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.Ingroup;
|
||||
import static com.yunbao.common.CommonAppContext.isReady;
|
||||
|
||||
public class MainActivity extends AbsActivity implements MainAppBarLayoutListener {
|
||||
|
||||
public static RelativeLayout rt_main_tab;
|
||||
@ -136,7 +147,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
private long mLastClickBackTime;//上次点击back键的时间
|
||||
private HttpCallback mGetLiveSdkCallback;
|
||||
private String mUrlCsd;
|
||||
private boolean isReady = false;
|
||||
private TextView v_table_redpoint;
|
||||
private View v_table_redpoint_me;
|
||||
|
||||
@ -247,6 +257,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
|
||||
Display mDisplay = getWindowManager().getDefaultDisplay();
|
||||
Height = mDisplay.getHeight();
|
||||
// IMLib 初始化
|
||||
RongIMClient.init(this, RongcloudIMManager.RONG_IM_KEY);
|
||||
// RTCLib 初始化
|
||||
RCRTCConfig.Builder config = RCRTCConfig.Builder.create();
|
||||
RCRTCEngine.getInstance().init(MainActivity.this, config.build());
|
||||
|
||||
boolean showInvite = getIntent().getBooleanExtra(Constants.SHOW_INVITE, false);
|
||||
mRootView = (ViewGroup) findViewById(R.id.rootView);
|
||||
@ -342,6 +357,26 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
initTXIM();
|
||||
mViewPager.setCurrentItem(0);
|
||||
mTabButtonGroup.setCurPosition(0);
|
||||
isInstructor();
|
||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||
@Override
|
||||
public boolean onReceived(io.rong.imlib.model.Message message, int i, boolean b, boolean b1) {
|
||||
Log.e("wewe",message.getConversationType() +"112121");
|
||||
//融云直播间聊天
|
||||
Message msg = Message.obtain();
|
||||
msg.what = Constants.SOCKET_WHAT_BROADCAST;
|
||||
if (!"".equals(message.getContent()) && message.getContent() != null) {
|
||||
TextMessage content = (TextMessage) message.getContent();
|
||||
if(content.getContent().contains("_method_")) {
|
||||
msg.obj = content.getContent();
|
||||
if (SocketRyClient.mSocketHandler != null) {
|
||||
SocketRyClient.mSocketHandler.sendMessage(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@ -383,7 +418,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
@Override
|
||||
public void onKickedOffline() {
|
||||
super.onKickedOffline();
|
||||
IMLoginManager.get(mContext).logout();
|
||||
CommonAppConfig.getInstance().clearLoginInfo();
|
||||
LoginActivity.forward();
|
||||
|
||||
@ -1033,7 +1067,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
}
|
||||
|
||||
//消息中心
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
|
||||
public void onMessageIMEvent(MessageIMEvent event) {
|
||||
messageNumber = event.getNumber();
|
||||
if (event.getNumber() > 0) {
|
||||
|
@ -7,6 +7,7 @@ import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.provider.MediaStore;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
@ -251,9 +252,11 @@ public class MyWebViewActivity extends AbsActivity {
|
||||
@JavascriptInterface
|
||||
public void androidCommunityGift(String postsId) {
|
||||
Constants.nowPostsId = postsId;
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
public void run() {
|
||||
EncourageDialog fragment = new EncourageDialog();
|
||||
fragment.show(((MyWebViewActivity) mContext).getSupportFragmentManager(), "EncourageDialog");
|
||||
}
|
||||
}});}
|
||||
|
||||
@JavascriptInterface
|
||||
public void reportCommunity(String info) {
|
||||
|
@ -6,6 +6,8 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.provider.MediaStore;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import android.text.TextUtils;
|
||||
@ -222,8 +224,11 @@ public class MyWebViewActivity2 extends AbsActivity {
|
||||
@JavascriptInterface
|
||||
public void androidCommunityGift(String postsId) {
|
||||
Constants.nowPostsId = postsId;
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
public void run() {
|
||||
EncourageDialog fragment = new EncourageDialog();
|
||||
fragment.show(((MyWebViewActivity2) mContext).getSupportFragmentManager(), "EncourageDialog");
|
||||
}});
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
|
@ -6,6 +6,8 @@ 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;
|
||||
@ -16,6 +18,7 @@ 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;
|
||||
@ -27,6 +30,9 @@ 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;
|
||||
@ -121,6 +127,17 @@ 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()+"");
|
||||
|
@ -10,10 +10,13 @@ import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
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.utils.ToastUtil;
|
||||
@ -21,6 +24,9 @@ import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
public class OneLoginDialog extends AbsDialogFragment {
|
||||
|
||||
|
||||
@ -87,6 +93,17 @@ 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");
|
||||
}
|
||||
}
|
||||
});
|
||||
MainActivity.forward(getContext(), false);
|
||||
}else{
|
||||
if(msg.contains("暱稱重複,請重新輸入")){
|
||||
|
@ -6,6 +6,8 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.provider.MediaStore;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import android.text.TextUtils;
|
||||
@ -220,10 +222,14 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
||||
@JavascriptInterface
|
||||
public void androidCommunityGift(String postsId) {
|
||||
Constants.nowPostsId = postsId;
|
||||
EncourageDialog fragment = new EncourageDialog();
|
||||
if (mContext instanceof MainActivity) {
|
||||
fragment.show(((MainActivity) mContext).getSupportFragmentManager(), "EncourageDialog");
|
||||
}
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
public void run() {
|
||||
EncourageDialog fragment = new EncourageDialog();
|
||||
if (mContext instanceof MainActivity) {
|
||||
fragment.show(((MainActivity) mContext).getSupportFragmentManager(), "EncourageDialog");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
|
@ -508,9 +508,9 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
} else if (i == R.id.rt_setting) {
|
||||
forwardSetting();
|
||||
} else if (i == R.id.lt_noble) {
|
||||
Constants.isTitle = true;
|
||||
Constants.isTitle = false;
|
||||
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||
String url = CommonAppConfig.HOST + "/h5/Nobility.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid();
|
||||
String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid();
|
||||
ZhuangBanActivity.forward(mContext, url, false);
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
<View
|
||||
android:id="@+id/v_spacing"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="24dp"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
|
Loading…
Reference in New Issue
Block a user