This commit is contained in:
18142669586 2022-07-25 16:06:39 +08:00
parent 97660b2b04
commit 708257a289
14 changed files with 592 additions and 96 deletions

View File

@ -156,7 +156,29 @@ public class AppContext extends CommonAppContext {
//初始化融云 //初始化融云
RongcloudIMManager.initRongIM(this); RongcloudIMManager.initRongIM(this);
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;
try {
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);
}
}
}
}catch (Exception e){
}
return false;
}
});
//监听im消息 //监听im消息
V2TIMManager.getInstance().addSimpleMsgListener(new V2TIMSimpleMsgListener() { V2TIMManager.getInstance().addSimpleMsgListener(new V2TIMSimpleMsgListener() {

View File

@ -261,7 +261,7 @@ public class Constants {
public static int isShowPage = -1; public static int isShowPage = -1;
public static boolean LoginKefu = true;//是否是从客服进入 public static boolean LoginKefu = true;//是否是从客服进入
public static String nowAnchorName = "";//当前主播昵称 public static String nowAnchorName = "";//当前主播昵称
public static String isSend = "0";//是否能发言enterroom接口返回1 可发言 0 不可发言 public static String isSend = "1";//是否能发言enterroom接口返回1 可发言 0 不可发言
public static String nowId = "";//当前点击了某个单聊的id public static String nowId = "";//当前点击了某个单聊的id
public static String remarks = "";//当前点击了某个单聊的备注 public static String remarks = "";//当前点击了某个单聊的备注
public static String isAdmin = "0";//当前点击了某个单聊是否是指导员 public static String isAdmin = "0";//当前点击了某个单聊是否是指导员

View File

@ -647,7 +647,7 @@ public class LiveAudienceActivity extends LiveActivity {
mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel)); mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel));
} }
} }
Constants.isSend = obj.getString("front_task"); // Constants.isSend = obj.getString("front_task");
} }
} }
}); });

View File

@ -0,0 +1,151 @@
package com.yunbao.live.dialog;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.http.LiveHttpUtil;
import java.lang.reflect.Field;
import static com.yunbao.live.activity.LiveAudienceActivity.countDownTimer;
import static com.yunbao.live.views.LiveRoomViewHolder.follow;
import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid;
public class NewUserDialog extends AbsDialogFragment {
int gif = 0;
int gif_id = 1093;
@Override
protected int getLayoutId() {
return R.layout.dialog_live_new_user;
}
/**
* 主要时这个方法上面两个方法只是获取布局用的可以不要
*
* @param manager
* @param tag
*/
@Override
public void show(FragmentManager manager, String tag) {
try {
Field dismissed = DialogFragment.class.getDeclaredField("mDismissed");
dismissed.setAccessible(true);
dismissed.set(this, false);
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
try {
Field showByMe = DialogFragment.class.getDeclaredField("mShownByMe");
showByMe.setAccessible(true);
showByMe.set(this, true);
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
FragmentTransaction ft = manager.beginTransaction();
ft.add(this, tag);
ft.commitAllowingStateLoss();
}
@Override
protected int getDialogStyle() {
return R.style.dialog2;
}
@Override
protected boolean canCancel() {
return true;
}
@Override
protected void setWindowAttributes(Window window) {
window.setWindowAnimations(R.style.bottomToTopAnim);
WindowManager.LayoutParams params = window.getAttributes();
params.width = WindowManager.LayoutParams.MATCH_PARENT;
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
params.gravity = Gravity.CENTER;
window.setAttributes(params);
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
ImageView btn_close = (ImageView) mRootView.findViewById(R.id.btn_close);
btn_close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dismiss();
}
});
RelativeLayout btn_rose = (RelativeLayout) mRootView.findViewById(R.id.btn_rose);
RelativeLayout btn_roses = (RelativeLayout) mRootView.findViewById(R.id.btn_roses);
RelativeLayout btn_lollipop = (RelativeLayout) mRootView.findViewById(R.id.btn_lollipop);
TextView btn_confirm = (TextView) mRootView.findViewById(R.id.btn_confirm);
btn_rose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
gif = 1;
gif_id = 210;
btn_rose.setBackgroundResource(R.drawable.button_ffb6c4);
btn_roses.setBackgroundResource(R.drawable.button_fff8f6f8);
btn_lollipop.setBackgroundResource(R.drawable.button_fff8f6f8);
}
});
btn_roses.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
gif = 2;
gif_id = 224;
btn_rose.setBackgroundResource(R.drawable.button_fff8f6f8);
btn_roses.setBackgroundResource(R.drawable.button_ffb6c4);
btn_lollipop.setBackgroundResource(R.drawable.button_fff8f6f8);
}
});
btn_lollipop.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
gif = 0;
gif_id = 1093;
btn_rose.setBackgroundResource(R.drawable.button_fff8f6f8);
btn_roses.setBackgroundResource(R.drawable.button_fff8f6f8);
btn_lollipop.setBackgroundResource(R.drawable.button_ffb6c4);
}
});
btn_confirm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
follow();
LiveHttpUtil.sendGift("0", mLiveUid, LiveActivity.mStream, gif_id, "1", new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
ToastUtil.show(msg);
}
});
countDownTimer.cancel();
dismiss();
}
});
}
}

View File

@ -14,6 +14,10 @@ import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.event.MessageIMEvent; import com.yunbao.common.event.MessageIMEvent;
@ -35,6 +39,9 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import java.net.MalformedURLException;
import java.net.URL;
/** /**
* Created by cxf on 2018/10/9. * Created by cxf on 2018/10/9.
* 观众直播间逻辑 * 观众直播间逻辑
@ -49,6 +56,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
private TextView tv_trickery_time; private TextView tv_trickery_time;
private View v_msg_redpoint; private View v_msg_redpoint;
private Activity context; private Activity context;
private SVGAImageView svga_new_user_gif;
public LiveAudienceViewHolder(Context context, ViewGroup parentView) { public LiveAudienceViewHolder(Context context, ViewGroup parentView) {
super(context, parentView); super(context, parentView);
@ -68,6 +76,22 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
findViewById(R.id.btn_red_pack).setOnClickListener(this); findViewById(R.id.btn_red_pack).setOnClickListener(this);
findViewById(R.id.btn_gift).setOnClickListener(this); findViewById(R.id.btn_gift).setOnClickListener(this);
findViewById(R.id.btn_zg).setOnClickListener(this); findViewById(R.id.btn_zg).setOnClickListener(this);
svga_new_user_gif = (SVGAImageView)findViewById(R.id.svga_new_user_gif);
new SVGAParser(context).decodeFromAssets("free_gift_tip.svga", new SVGAParser.ParseCompletion() {
@Override
public void onComplete(SVGAVideoEntity videoItem) {
ToastUtil.show("1212");
SVGADrawable drawable = new SVGADrawable(videoItem);
svga_new_user_gif.setImageDrawable(drawable);
svga_new_user_gif.startAnimation();
}
@Override
public void onError() {
Log.e("errqs","errl");
}
});
findViewById(R.id.btn_mic).setOnClickListener(new View.OnClickListener() { findViewById(R.id.btn_mic).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {

View File

@ -218,7 +218,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public WindowManager windowManager; public WindowManager windowManager;
public boolean isRy = false; public boolean isRy = false;
public LiveRoomViewHolder(boolean isRys, int forActivity, Context context, ViewGroup parentView, GifImageView gifImageView, SVGAImageView svgaImageView, ViewGroup liveGiftPrizePoolContainer, WindowManager windowManager) { public LiveRoomViewHolder(boolean isRys, int forActivity, Context context, ViewGroup parentView, GifImageView gifImageView, SVGAImageView svgaImageView, ViewGroup liveGiftPrizePoolContainer, WindowManager windowManager) {
super(context, parentView); super(context, parentView);
Contexts = context; Contexts = context;

View File

@ -0,0 +1,251 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="40dp"
android:paddingRight="40dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_dialog"
android:gravity="center_horizontal"
android:orientation="vertical"
android:layout_marginTop="50dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/live_blowkiss"
android:textColor="#ff161616"
android:layout_marginTop="50dp"
android:textStyle="bold"
android:textSize="14sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/live_blowkiss_reply"
android:textColor="#ffb1b1b1"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:textSize="14sp"/>
<RelativeLayout android:id="@+id/btn_rose"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:background="@drawable/button_fff8f6f8">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="16dp">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:src="@mipmap/gif_rose"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/live_blowkiss_rose"
android:gravity="center"
android:layout_marginLeft="16dp"
android:textColor="#ff565252"
android:textSize="12sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"
android:layout_alignParentRight="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="20"
android:layout_gravity="center"
android:textColor="#ff565252"
android:textSize="12sp"
/>
<ImageView
android:layout_width="30dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:src="@mipmap/icon_diamond"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout android:id="@+id/btn_roses"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_fff8f6f8">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="16dp">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:src="@mipmap/icon_rosebouquet"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/live_blowkiss_roses"
android:gravity="center"
android:layout_marginLeft="16dp"
android:textColor="#ff565252"
android:textSize="12sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"
android:layout_alignParentRight="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="500"
android:layout_gravity="center"
android:textColor="#ff565252"
android:textSize="12sp"
/>
<ImageView
android:layout_width="30dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:src="@mipmap/icon_diamond"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout android:id="@+id/btn_lollipop"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:background="@drawable/button_ffb6c4">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="16dp">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:src="@mipmap/icon_lollipop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/live_blowkiss_lollipop"
android:gravity="center"
android:layout_marginLeft="16dp"
android:textColor="#ff565252"
android:textSize="12sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"
android:layout_alignParentRight="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/live_blowkiss_time"
android:layout_gravity="center"
android:textColor="#ff565252"
android:textSize="12sp"
/>
<ImageView
android:layout_width="30dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:src="@mipmap/icon_diamond"/>
</LinearLayout>
</RelativeLayout>
<TextView android:id="@+id/btn_confirm"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:layout_marginTop="20dp"
android:text="@string/live_blowkiss_follow"
android:textColor="#ffffffff"
android:textSize="13sp"
android:gravity="center"
android:layout_marginBottom="30dp"
android:background="@drawable/button_ffffbf2f"/>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true">
<ImageView
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_centerHorizontal="true"
android:src="@mipmap/icon_love"/>
<ImageView android:id="@+id/btn_close"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:layout_marginTop="70dp"
android:src="@mipmap/icon_live_user_5"/>
</RelativeLayout>
</RelativeLayout>

View File

@ -1,9 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_alignParentBottom="true"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
@ -167,6 +177,7 @@
android:visibility="gone" /> android:visibility="gone" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/btn_link_mic2" android:id="@+id/btn_link_mic2"
android:layout_width="50dp" android:layout_width="50dp"
@ -397,6 +408,23 @@
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</LinearLayout>
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/svga_new_user_gif"
android:layout_width="116dp"
android:layout_height="40dp"
android:layout_marginBottom="50dp"
android:layout_marginRight="10dp"
android:background="@color/red"
android:layout_gravity="center_vertical"
app:autoPlay="true"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" />
</RelativeLayout>
</LinearLayout> </LinearLayout>

View File

@ -1709,10 +1709,10 @@
android:layout_width="18dp" android:layout_width="18dp"
android:layout_height="18dp" android:layout_height="18dp"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:src="@mipmap/voice"/> android:src="@mipmap/voice"/>
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

View File

@ -67,7 +67,7 @@ public class EditProfileActivity extends AbsActivity {
private String mProvinceVal; private String mProvinceVal;
private String mCityVal; private String mCityVal;
private String mZoneVal; private String mZoneVal;
private boolean isInto = false; private boolean isInto = true;
private String isBind = "0", mobile = ""; private String isBind = "0", mobile = "";
private boolean isName = false; private boolean isName = false;
@ -476,7 +476,7 @@ public class EditProfileActivity extends AbsActivity {
} }
} }
}); });
getTaskType(); // getTaskType();
if (isName) { if (isName) {
isName = false; isName = false;
MainHttpUtil.getBaseInfo(CommonAppConfig.getInstance().getUid(), CommonAppConfig.getInstance().getToken(), new CommonCallback<UserBean>() { MainHttpUtil.getBaseInfo(CommonAppConfig.getInstance().getUid(), CommonAppConfig.getInstance().getToken(), new CommonCallback<UserBean>() {

View File

@ -13,6 +13,7 @@ import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.os.Message;
import android.provider.Settings; import android.provider.Settings;
import android.util.Base64; import android.util.Base64;
import android.util.Log; import android.util.Log;
@ -74,7 +75,13 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager; import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.bean.LiveBean;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
import com.yunbao.live.socket.SocketRyClient;
import com.yunbao.main.R; import com.yunbao.main.R;
import com.yunbao.main.dialog.LoginTipsDialog; import com.yunbao.main.dialog.LoginTipsDialog;
import com.yunbao.main.http.MainHttpUtil; import com.yunbao.main.http.MainHttpUtil;
@ -83,6 +90,9 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.Arrays; import java.util.Arrays;
import io.rong.imlib.RongIMClient;
import io.rong.message.TextMessage;
import static com.yunbao.common.CommonAppContext.logger; import static com.yunbao.common.CommonAppContext.logger;
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
@ -654,75 +664,108 @@ public class EntryActivity extends AppCompatActivity {
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() { MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
@Override @Override
public void callback(UserBean bean) { public void callback(UserBean bean) {
if (mFirstLogin) {
//绑定广告渠道用户
AdjustEvent adjustEvent = new AdjustEvent("s1or0t");
adjustEvent.addCallbackParameter("userid", "bar");
Adjust.trackEvent(adjustEvent);
//完成第三方登录 gotoLive("97714");
if(mLoginType.equals("twitter")){ //
AdjustEvent adjustEvent1 = new AdjustEvent("ea6lld"); // if (mFirstLogin) {
Adjust.trackEvent(adjustEvent1); // //绑定广告渠道用户
CommonHttpUtil.setAdvertisingChannels("ea6lld", new HttpCallback() { // AdjustEvent adjustEvent = new AdjustEvent("s1or0t");
@Override // adjustEvent.addCallbackParameter("userid", "bar");
public void onSuccess(int code, String msg, String[] info) { // Adjust.trackEvent(adjustEvent);
if(code == 0) { //
mFirebaseAnalytics.logEvent("FS_reg_twitter", null); // //完成第三方登录
logger.logEvent("FB_reg_twitter"); // if(mLoginType.equals("twitter")){
} // AdjustEvent adjustEvent1 = new AdjustEvent("ea6lld");
} // Adjust.trackEvent(adjustEvent1);
}); // CommonHttpUtil.setAdvertisingChannels("ea6lld", new HttpCallback() {
// @Override
}else if(mLoginType.equals("facebook")){ // public void onSuccess(int code, String msg, String[] info) {
AdjustEvent adjustEvent1 = new AdjustEvent("5jbk95"); // if(code == 0) {
Adjust.trackEvent(adjustEvent1); // mFirebaseAnalytics.logEvent("FS_reg_twitter", null);
CommonHttpUtil.setAdvertisingChannels("5jbk95", new HttpCallback() { // logger.logEvent("FB_reg_twitter");
@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("facebook")){
} // AdjustEvent adjustEvent1 = new AdjustEvent("5jbk95");
} // Adjust.trackEvent(adjustEvent1);
}); // CommonHttpUtil.setAdvertisingChannels("5jbk95", new HttpCallback() {
// @Override
}else if(mLoginType.equals("google")){ // public void onSuccess(int code, String msg, String[] info) {
AdjustEvent adjustEvent1 = new AdjustEvent("krap47"); // if(code == 0) {
Adjust.trackEvent(adjustEvent1); // mFirebaseAnalytics.logEvent("FS_reg_fb", null);
CommonHttpUtil.setAdvertisingChannels("krap47", new HttpCallback() { // logger.logEvent("FB_reg_fb");
@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("google")){
} // AdjustEvent adjustEvent1 = new AdjustEvent("krap47");
} // Adjust.trackEvent(adjustEvent1);
}); // CommonHttpUtil.setAdvertisingChannels("krap47", new HttpCallback() {
// @Override
}else if(mLoginType.equals("line")){ // public void onSuccess(int code, String msg, String[] info) {
AdjustEvent adjustEvent1 = new AdjustEvent("uaacbn"); // if(code == 0) {
Adjust.trackEvent(adjustEvent1); // mFirebaseAnalytics.logEvent("FS_reg_google", null);
// logger.logEvent("FB_reg_google");
CommonHttpUtil.setAdvertisingChannels("uaacbn", new HttpCallback() { // }
@Override // }
public void onSuccess(int code, String msg, String[] info) { // });
if(code == 0) { //
mFirebaseAnalytics.logEvent("FS_reg_line", null); // }else if(mLoginType.equals("line")){
logger.logEvent("FB_reg_line"); // AdjustEvent adjustEvent1 = new AdjustEvent("uaacbn");
} // Adjust.trackEvent(adjustEvent1);
//
// CommonHttpUtil.setAdvertisingChannels("uaacbn", new HttpCallback() {
// @Override
// public void onSuccess(int code, String msg, String[] info) {
// if(code == 0) {
// mFirebaseAnalytics.logEvent("FS_reg_line", null);
// logger.logEvent("FB_reg_line");
// }
// }
// });
// }
// if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
// EntryActivity.this.startActivity(new Intent(EntryActivity.this, OneLoginActivity.class));
// }else{
// gotoLive("97714");
// MainActivity.forward(EntryActivity.this, false);
// }
// } else {
// MainActivity.forward(EntryActivity.this, false);
// }
// EntryActivity.activity.finish();
} }
}); });
} }
if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
EntryActivity.this.startActivity(new Intent(EntryActivity.this, OneLoginActivity.class)); private LiveRoomCheckLivePresenter mCheckLivePresenter;
}else{
MainActivity.forward(EntryActivity.this, false); 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(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);
}
});
}
mCheckLivePresenter.checkLive(liveBean);
} else { } else {
MainActivity.forward(EntryActivity.this, false); MainActivity.forward(EntryActivity.this, false);
} }
EntryActivity.activity.finish();
} }
}); });
} }

View File

@ -38,10 +38,12 @@ import com.tencent.imsdk.v2.V2TIMManager;
import com.tencent.imsdk.v2.V2TIMSDKConfig; import com.tencent.imsdk.v2.V2TIMSDKConfig;
import com.tencent.imsdk.v2.V2TIMSDKListener; import com.tencent.imsdk.v2.V2TIMSDKListener;
import com.tencent.imsdk.v2.V2TIMUserFullInfo; import com.tencent.imsdk.v2.V2TIMUserFullInfo;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.adapter.ViewPagerAdapter; import com.yunbao.common.adapter.ViewPagerAdapter;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.ChatRemarksBean; import com.yunbao.common.bean.ChatRemarksBean;
import com.yunbao.common.bean.ConfigBean; import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.bean.LiveSvgGiftBean; import com.yunbao.common.bean.LiveSvgGiftBean;
@ -55,7 +57,6 @@ import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager; import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
@ -72,6 +73,7 @@ import com.yunbao.common.views.AbsMainViewHolder;
import com.yunbao.live.LiveConfig; import com.yunbao.live.LiveConfig;
import com.yunbao.live.activity.LiveAnchorActivity; import com.yunbao.live.activity.LiveAnchorActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity; import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.activity.PDLIiveChatActivity;
import com.yunbao.live.bean.LiveBean; import com.yunbao.live.bean.LiveBean;
import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.live.bean.LiveKsyConfigBean;
import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpConsts;
@ -358,26 +360,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
mViewPager.setCurrentItem(0); mViewPager.setCurrentItem(0);
mTabButtonGroup.setCurPosition(0); mTabButtonGroup.setCurPosition(0);
isInstructor(); 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");
MessageIMManager.get(mContext).getSystemForRongcloud(message);
//融云直播间聊天
Message msg = Message.obtain();
msg.what = Constants.SOCKET_WHAT_BROADCAST;
if (message.getContent() instanceof TextMessage && !"".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;
}
});
} }
@ -1071,13 +1054,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
public void onMessageIMEvent(MessageIMEvent event) { public void onMessageIMEvent(MessageIMEvent event) {
messageNumber = event.getNumber(); messageNumber = event.getNumber();
if (event.getNumber() > 0) { if (event.getNumber() > 0) {
if (event.getNumber() > 99) {
v_table_redpoint.setText("99+");
} else {
v_table_redpoint.setText(event.getNumber() + "");
}
v_table_redpoint.setVisibility(View.VISIBLE); v_table_redpoint.setVisibility(View.VISIBLE);
v_table_redpoint.setText(event.getNumber() + "");
} else { } else {
v_table_redpoint.setVisibility(View.GONE); v_table_redpoint.setVisibility(View.GONE);
v_table_redpoint.setText(""); v_table_redpoint.setText("");

View File

@ -508,9 +508,9 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
} else if (i == R.id.rt_setting) { } else if (i == R.id.rt_setting) {
forwardSetting(); forwardSetting();
} else if (i == R.id.lt_noble) { } else if (i == R.id.lt_noble) {
Constants.isTitle = false; Constants.isTitle = true;
UserBean u = CommonAppConfig.getInstance().getUserBean(); UserBean u = CommonAppConfig.getInstance().getUserBean();
String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid(); String url = CommonAppConfig.HOST + "/h5/Nobility.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid();
ZhuangBanActivity.forward(mContext, url, false); ZhuangBanActivity.forward(mContext, url, false);
} }