Merge branch 'master' into dev_hour_rank
92
app/agconnect-services.json
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
{
|
||||||
|
"agcgw":{
|
||||||
|
"backurl":"connect-drcn.hispace.hicloud.com",
|
||||||
|
"url":"connect-drcn.dbankcloud.cn",
|
||||||
|
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
|
||||||
|
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
|
||||||
|
},
|
||||||
|
"agcgw_all":{
|
||||||
|
"CN":"connect-drcn.dbankcloud.cn",
|
||||||
|
"CN_back":"connect-drcn.hispace.hicloud.com",
|
||||||
|
"DE":"connect-dre.dbankcloud.cn",
|
||||||
|
"DE_back":"connect-dre.hispace.hicloud.com",
|
||||||
|
"RU":"connect-drru.hispace.dbankcloud.ru",
|
||||||
|
"RU_back":"connect-drru.hispace.dbankcloud.cn",
|
||||||
|
"SG":"connect-dra.dbankcloud.cn",
|
||||||
|
"SG_back":"connect-dra.hispace.hicloud.com"
|
||||||
|
},
|
||||||
|
"websocketgw_all":{
|
||||||
|
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
|
||||||
|
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
|
||||||
|
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
|
||||||
|
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
|
||||||
|
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
|
||||||
|
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
|
||||||
|
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
|
||||||
|
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
|
||||||
|
},
|
||||||
|
"client":{
|
||||||
|
"cp_id":"30086000612391734",
|
||||||
|
"product_id":"99536292102564216",
|
||||||
|
"client_id":"964994320723627840",
|
||||||
|
"client_secret":"6D5FE29D85B967D3A66BDCD473641E4C7B5524F7F4935CA0EF4A842730C3402D",
|
||||||
|
"project_id":"99536292102564216",
|
||||||
|
"app_id":"106936673",
|
||||||
|
"api_key":"DAEDADYGta/0O4ZSdrnug52NgC67/w/RIyTq9A8LyAY0+mp6g6XeJDbxugpluFPLAhaqjaMs5c0PLnRx14UzWbPPADgi1EqihbWLoA==",
|
||||||
|
"package_name":"com.pdlive.shayu"
|
||||||
|
},
|
||||||
|
"oauth_client":{
|
||||||
|
"client_id":"106936673",
|
||||||
|
"client_type":1
|
||||||
|
},
|
||||||
|
"app_info":{
|
||||||
|
"app_id":"106936673",
|
||||||
|
"package_name":"com.pdlive.shayu"
|
||||||
|
},
|
||||||
|
"service":{
|
||||||
|
"analytics":{
|
||||||
|
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||||
|
"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
|
||||||
|
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
|
||||||
|
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
|
||||||
|
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||||
|
"resource_id":"p1",
|
||||||
|
"channel_id":""
|
||||||
|
},
|
||||||
|
"search":{
|
||||||
|
"url":"https://search-drcn.cloud.huawei.com"
|
||||||
|
},
|
||||||
|
"cloudstorage":{
|
||||||
|
"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
|
||||||
|
"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
|
||||||
|
"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
|
||||||
|
"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
|
||||||
|
"storage_url_de":"https://ops-dre.agcstorage.link",
|
||||||
|
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
|
||||||
|
"storage_url_sg":"https://ops-dra.agcstorage.link",
|
||||||
|
"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
|
||||||
|
"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
|
||||||
|
},
|
||||||
|
"ml":{
|
||||||
|
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"region":"CN",
|
||||||
|
"configuration_version":"3.0",
|
||||||
|
"appInfos":[
|
||||||
|
{
|
||||||
|
"package_name":"com.pdlive.shayu",
|
||||||
|
"client":{
|
||||||
|
"app_id":"106936673"
|
||||||
|
},
|
||||||
|
"app_info":{
|
||||||
|
"package_name":"com.pdlive.shayu",
|
||||||
|
"app_id":"106936673"
|
||||||
|
},
|
||||||
|
"oauth_client":{
|
||||||
|
"client_type":1,
|
||||||
|
"client_id":"106936673"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -110,4 +110,6 @@ dependencies {
|
|||||||
//短视频
|
//短视频
|
||||||
api project(':video')
|
api project(':video')
|
||||||
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -91,20 +91,20 @@
|
|||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
tools:replace="theme,label,icon,allowBackup">
|
tools:replace="theme,label,icon,allowBackup">
|
||||||
<service
|
|
||||||
android:name="com.shayu.phonelive.utils.MyNotificationService">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
|
||||||
</intent-filter>
|
|
||||||
</service>
|
|
||||||
<!-- <service-->
|
<!-- <service-->
|
||||||
<!-- android:name="io.rong.push.platform.google.RongFirebaseMessagingService"-->
|
<!-- android:name="com.shayu.phonelive.utils.MyNotificationService">-->
|
||||||
<!-- android:stopWithTask="false"-->
|
|
||||||
<!-- android:exported="false">-->
|
|
||||||
<!-- <intent-filter>-->
|
<!-- <intent-filter>-->
|
||||||
<!-- <action android:name="com.google.firebase.MESSAGING_EVENT" />-->
|
<!-- <action android:name="com.google.firebase.MESSAGING_EVENT" />-->
|
||||||
<!-- </intent-filter>-->
|
<!-- </intent-filter>-->
|
||||||
<!-- </service>-->
|
<!-- </service>-->
|
||||||
|
<service
|
||||||
|
android:name="io.rong.push.platform.google.RongFirebaseMessagingService"
|
||||||
|
android:stopWithTask="false"
|
||||||
|
android:exported="false">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
|
||||||
|
</intent-filter>
|
||||||
|
</service>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.shayu.phonelive.activity.LauncherActivity"
|
android:name="com.shayu.phonelive.activity.LauncherActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
@ -164,7 +164,29 @@
|
|||||||
<meta-data
|
<meta-data
|
||||||
android:name="firebase_analytics_collection_enabled"
|
android:name="firebase_analytics_collection_enabled"
|
||||||
android:value="false" />
|
android:value="false" />
|
||||||
|
<receiver
|
||||||
|
android:name="com.shayu.phonelive.utils.CustomMessageReceiver"
|
||||||
|
android:exported="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="io.rong.push.intent.MESSAGE_ARRIVED" />
|
||||||
|
<action android:name="io.rong.push.intent.MESSAGE_CLICKED" />
|
||||||
|
<action android:name="io.rong.push.intent.THIRD_PARTY_PUSH_STATE" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name="io.rong.push.platform.hms.HMSPushService"
|
||||||
|
android:exported="false">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
|
||||||
|
</intent-filter>
|
||||||
|
</service>
|
||||||
|
<meta-data
|
||||||
|
android:name="com.huawei.hms.client.appid"
|
||||||
|
android:value="106936673"/>
|
||||||
|
<meta-data
|
||||||
|
android:name="com.huawei.hms.client.cpid"
|
||||||
|
android:value="30086000612391734"/>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@ -101,6 +101,8 @@ public class AppContext extends CommonAppContext {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
//注册全局异常捕获
|
||||||
|
//registerError();
|
||||||
sInstance = this;
|
sInstance = this;
|
||||||
L.setDeBug(BuildConfig.DEBUG);
|
L.setDeBug(BuildConfig.DEBUG);
|
||||||
AppEventsLogger.activateApp(this);
|
AppEventsLogger.activateApp(this);
|
||||||
@ -118,11 +120,6 @@ public class AppContext extends CommonAppContext {
|
|||||||
}
|
}
|
||||||
ARouter.init(this);
|
ARouter.init(this);
|
||||||
|
|
||||||
//谷歌推送
|
|
||||||
PushConfig gconfig = new PushConfig.Builder()
|
|
||||||
.enableFCM(true)
|
|
||||||
.build();
|
|
||||||
RongPushClient.setPushConfig(gconfig);
|
|
||||||
|
|
||||||
//初始化 邀请码库
|
//初始化 邀请码库
|
||||||
if (isMainProcess()) {
|
if (isMainProcess()) {
|
||||||
@ -180,7 +177,7 @@ public class AppContext extends CommonAppContext {
|
|||||||
msg.obj = content.getContent();
|
msg.obj = content.getContent();
|
||||||
if (SocketRyClient.mSocketHandler != null
|
if (SocketRyClient.mSocketHandler != null
|
||||||
&& (TextUtils.equals("__system__", message.getTargetId())
|
&& (TextUtils.equals("__system__", message.getTargetId())
|
||||||
|| (TextUtils.equals("g" + PortraitLiveManager.liveID, message.getTargetId())))) {
|
|| ("g" + PortraitLiveManager.liveID).contains(message.getTargetId()))) {
|
||||||
SocketRyClient.mSocketHandler.sendMessage(msg);
|
SocketRyClient.mSocketHandler.sendMessage(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -192,6 +189,7 @@ public class AppContext extends CommonAppContext {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//监听im消息
|
//监听im消息
|
||||||
V2TIMManager.getInstance().addSimpleMsgListener(new V2TIMSimpleMsgListener() {
|
V2TIMManager.getInstance().addSimpleMsgListener(new V2TIMSimpleMsgListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -238,4 +236,21 @@ public class AppContext extends CommonAppContext {
|
|||||||
RongcloudIMManager.removeRongcloudIMOnReceiveMessageListener();
|
RongcloudIMManager.removeRongcloudIMOnReceiveMessageListener();
|
||||||
super.onTerminate();
|
super.onTerminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册全局异常捕获,有需要时可以在onCreate调用
|
||||||
|
*/
|
||||||
|
private void registerError() {
|
||||||
|
NeverCrashUtils.getInstance()
|
||||||
|
.setDebugMode(BuildConfig.DEBUG)
|
||||||
|
.setMainCrashHandler((t, e) -> {
|
||||||
|
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||||
|
e.printStackTrace();
|
||||||
|
})
|
||||||
|
.setUncaughtCrashHandler((t, e) -> {
|
||||||
|
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||||
|
e.printStackTrace();
|
||||||
|
})
|
||||||
|
.register(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
110
app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
package com.shayu.phonelive;
|
||||||
|
import android.app.Application;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName NeverCrashUtils
|
||||||
|
* @Description 全局捕获异常
|
||||||
|
*/
|
||||||
|
public class NeverCrashUtils {
|
||||||
|
|
||||||
|
private final static String TAG = NeverCrashUtils.class.getSimpleName();
|
||||||
|
private final static NeverCrashUtils INSTANCE = new NeverCrashUtils();
|
||||||
|
|
||||||
|
private boolean debugMode;
|
||||||
|
private MainCrashHandler mainCrashHandler;
|
||||||
|
private UncaughtCrashHandler uncaughtCrashHandler;
|
||||||
|
|
||||||
|
private NeverCrashUtils() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static NeverCrashUtils getInstance() {
|
||||||
|
return INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized MainCrashHandler getMainCrashHandler() {
|
||||||
|
if (null == mainCrashHandler) {
|
||||||
|
mainCrashHandler = (t, e) -> {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return mainCrashHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主线程发生异常时的回调,可用于打印日志文件
|
||||||
|
* <p>
|
||||||
|
* 注意跨线程操作的可能
|
||||||
|
*/
|
||||||
|
public NeverCrashUtils setMainCrashHandler(MainCrashHandler mainCrashHandler) {
|
||||||
|
mainCrashHandler = mainCrashHandler;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized UncaughtCrashHandler getUncaughtCrashHandler() {
|
||||||
|
if (null == uncaughtCrashHandler) {
|
||||||
|
uncaughtCrashHandler = (t, e) -> {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return uncaughtCrashHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 子线程发生异常时的回调,可用于打印日志文件
|
||||||
|
* <p>
|
||||||
|
* 注意跨线程操作的可能
|
||||||
|
*/
|
||||||
|
public NeverCrashUtils setUncaughtCrashHandler(UncaughtCrashHandler uncaughtCrashHandler) {
|
||||||
|
this.uncaughtCrashHandler = uncaughtCrashHandler;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isDebugMode() {
|
||||||
|
return debugMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* debug模式,会打印log日志,且toast提醒发生异常,反之则都没有
|
||||||
|
*/
|
||||||
|
public NeverCrashUtils setDebugMode(boolean debugMode) {
|
||||||
|
this.debugMode = debugMode;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成监听异常的注册
|
||||||
|
* @param application application
|
||||||
|
*/
|
||||||
|
public void register(Application application) {
|
||||||
|
//主线程异常拦截
|
||||||
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
|
while (true) {
|
||||||
|
try {
|
||||||
|
Looper.loop();
|
||||||
|
} catch (Throwable e) {
|
||||||
|
if (isDebugMode()) {
|
||||||
|
Log.e(TAG, "未捕获的主线程异常行为", e);
|
||||||
|
}
|
||||||
|
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//子线程异常拦截
|
||||||
|
Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
|
||||||
|
if (isDebugMode()) {
|
||||||
|
Log.e(TAG, "未捕获的子线程异常行为", e);
|
||||||
|
}
|
||||||
|
getUncaughtCrashHandler().uncaughtException(t, e);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface MainCrashHandler {
|
||||||
|
void mainException(Thread t, Throwable e);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface UncaughtCrashHandler {
|
||||||
|
void uncaughtException(Thread t, Throwable e);
|
||||||
|
}
|
||||||
|
}
|
@ -31,6 +31,8 @@ import com.tencent.rtmp.TXLivePlayer;
|
|||||||
import com.tencent.rtmp.ui.TXCloudVideoView;
|
import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||||
import com.tencent.ugc.TXUGCBase;
|
import com.tencent.ugc.TXUGCBase;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.Constants;
|
||||||
|
import com.yunbao.common.activity.WebViewActivity;
|
||||||
import com.yunbao.common.bean.AdBean;
|
import com.yunbao.common.bean.AdBean;
|
||||||
import com.yunbao.common.bean.ConfigBean;
|
import com.yunbao.common.bean.ConfigBean;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
@ -40,6 +42,7 @@ import com.yunbao.common.event.DataUserInfoEvent;
|
|||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.CommonHttpConsts;
|
import com.yunbao.common.http.CommonHttpConsts;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
|
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;
|
||||||
@ -50,11 +53,17 @@ import com.yunbao.common.utils.RouteUtil;
|
|||||||
import com.yunbao.common.utils.SpUtil;
|
import com.yunbao.common.utils.SpUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||||
|
import com.yunbao.live.bean.LiveBean;
|
||||||
|
import com.yunbao.live.http.LiveHttpUtil;
|
||||||
|
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||||
import com.yunbao.live.views.LauncherAdViewHolder;
|
import com.yunbao.live.views.LauncherAdViewHolder;
|
||||||
import com.yunbao.main.activity.EntryActivity;
|
import com.yunbao.main.activity.EntryActivity;
|
||||||
import com.yunbao.main.activity.MainActivity;
|
import com.yunbao.main.activity.MainActivity;
|
||||||
|
import com.yunbao.main.activity.PDLiveConversationListActivity;
|
||||||
import com.yunbao.main.http.MainHttpConsts;
|
import com.yunbao.main.http.MainHttpConsts;
|
||||||
import com.yunbao.main.http.MainHttpUtil;
|
import com.yunbao.main.http.MainHttpUtil;
|
||||||
|
import com.yunbao.main.manager.imrongcloud.ConversationIMListManager;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
@ -78,8 +87,8 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
|||||||
private static final String TAG = "LauncherActivity";
|
private static final String TAG = "LauncherActivity";
|
||||||
private static final int WHAT_GET_CONFIG = 0;
|
private static final int WHAT_GET_CONFIG = 0;
|
||||||
private static final int WHAT_COUNT_DOWN = 1;
|
private static final int WHAT_COUNT_DOWN = 1;
|
||||||
private Handler mHandler;
|
|
||||||
protected Context mContext;
|
protected Context mContext;
|
||||||
|
private Handler mHandler;
|
||||||
private ViewGroup mRoot;
|
private ViewGroup mRoot;
|
||||||
private ImageView mCover;
|
private ImageView mCover;
|
||||||
private ViewGroup mContainer;
|
private ViewGroup mContainer;
|
||||||
@ -261,10 +270,24 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
|||||||
*/
|
*/
|
||||||
private void forwardMainActivity() {
|
private void forwardMainActivity() {
|
||||||
releaseVideo();
|
releaseVideo();
|
||||||
MainActivity.forward(mContext);
|
Intent intent = new Intent(
|
||||||
finish();
|
LauncherActivity.this, MainActivity.class);
|
||||||
|
intent.putExtra(Constants.SHOW_INVITE, false);
|
||||||
|
|
||||||
|
if (getIntent().getStringExtra("liveid") != null) {
|
||||||
|
intent.putExtra("liveid", getIntent().getStringExtra("liveid"));
|
||||||
|
}
|
||||||
|
if (getIntent().getStringExtra("type") != null) {
|
||||||
|
intent.putExtra("type", getIntent().getStringExtra("type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getIntent().getStringExtra("activityUrl") != null) {
|
||||||
|
intent.putExtra("activityUrl", getIntent().getStringExtra("activityUrl"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LauncherActivity.this.startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
|
@ -0,0 +1,282 @@
|
|||||||
|
package com.shayu.phonelive.utils;
|
||||||
|
|
||||||
|
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.Notification;
|
||||||
|
import android.app.NotificationChannel;
|
||||||
|
import android.app.NotificationManager;
|
||||||
|
import android.app.PendingIntent;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.PorterDuffXfermode;
|
||||||
|
import android.graphics.Rect;
|
||||||
|
import android.graphics.RectF;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.RemoteViews;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.core.app.NotificationCompat;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.request.target.SimpleTarget;
|
||||||
|
import com.bumptech.glide.request.target.Target;
|
||||||
|
import com.bumptech.glide.request.transition.Transition;
|
||||||
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
|
import com.shayu.phonelive.activity.LauncherActivity;
|
||||||
|
import com.yunbao.common.bean.NotificationMsgBean;
|
||||||
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.main.activity.MainActivity;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import io.rong.imlib.ConnectChangeReceiver;
|
||||||
|
import io.rong.push.PushType;
|
||||||
|
import io.rong.push.notification.PushMessageReceiver;
|
||||||
|
import io.rong.push.notification.PushNotificationMessage;
|
||||||
|
import myname.pdlive.shayu.R;
|
||||||
|
|
||||||
|
public class CustomMessageReceiver extends PushMessageReceiver {
|
||||||
|
|
||||||
|
|
||||||
|
private String createNotificationChannel(Context context, String channelID, String channelNAME, int level) {
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||||
|
NotificationManager manager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);
|
||||||
|
NotificationChannel channel = new NotificationChannel(channelID, channelNAME, level);
|
||||||
|
channel.setSound(Uri.parse("android.resource://" + context.getPackageName() + "/raw/pdlive_sound"),null);
|
||||||
|
manager.createNotificationChannel(channel);
|
||||||
|
return channelID;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onNotificationMessageClicked(
|
||||||
|
Context context, PushType pushType, PushNotificationMessage message) {
|
||||||
|
if (pushType.equals(PushType.GOOGLE_FCM)) {
|
||||||
|
|
||||||
|
Log.i("gmc", "gmc");
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
} else {
|
||||||
|
Log.i("gmc", "gmc1111");
|
||||||
|
}
|
||||||
|
// 返回 true 表示拦截,false 为不拦截
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NotificationMsgBean msg = new NotificationMsgBean();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage notificationMessage) {
|
||||||
|
Log.i("gmc", notificationMessage.getPushContent() + "VVV" + notificationMessage.getPushTitle() + "gmc11112222" + notificationMessage.getExtra());
|
||||||
|
if (notificationMessage.getExtra() == null) {
|
||||||
|
msg.setImg("" + notificationMessage.getSenderPortrait());
|
||||||
|
msg.setTitle(notificationMessage.getPushTitle());
|
||||||
|
msg.setContent(notificationMessage.getPushContent());
|
||||||
|
msg.setType("-1");
|
||||||
|
sendNotification(context, msg);
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
JSONObject obj = new JSONObject(notificationMessage.getExtra());
|
||||||
|
Log.i("gmc", "1111222");
|
||||||
|
//开播
|
||||||
|
if (obj.getString("type").equals("1") || obj.getString("type").equals("9")) {
|
||||||
|
Log.i("gmc", "1111");
|
||||||
|
msg.setImg("" + obj.getString("avatar"));
|
||||||
|
msg.setTitle(notificationMessage.getPushTitle());
|
||||||
|
msg.setContent(notificationMessage.getPushContent());
|
||||||
|
msg.setLiveuid(obj.getString("liveuid"));
|
||||||
|
msg.setType("1");
|
||||||
|
liveNotification(context, msg);
|
||||||
|
//发布动态 2
|
||||||
|
//点赞 3
|
||||||
|
//评论 4
|
||||||
|
//鼓励 5
|
||||||
|
} else if (obj.getString("type").equals("2") || obj.getString("type").equals("3") || obj.getString("type").equals("4") || obj.getString("type").equals("5")) {
|
||||||
|
msg.setImg("" + obj.getString("avatar"));
|
||||||
|
msg.setTitle(notificationMessage.getPushTitle());
|
||||||
|
msg.setContent(notificationMessage.getPushContent());
|
||||||
|
msg.setType("2");
|
||||||
|
dynamicNotification(context, msg);
|
||||||
|
} else if (obj.getString("type").equals("8") || obj.getString("type").equals("7")) {
|
||||||
|
msg.setImg("" + obj.getString("avatar"));
|
||||||
|
msg.setTitle(notificationMessage.getPushTitle());
|
||||||
|
msg.setContent(notificationMessage.getPushContent());
|
||||||
|
msg.setType(obj.getString("type"));
|
||||||
|
msg.setActivityurl(obj.getString("activityUrl"));
|
||||||
|
serviceNotification(context, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (JSONException e) {
|
||||||
|
Log.i("gmc", "1111" + e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Bitmap makeRoundCorner(Bitmap bitmap, float roundPx) {
|
||||||
|
try {
|
||||||
|
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
|
||||||
|
bitmap.getHeight(), Bitmap.Config.ARGB_8888);
|
||||||
|
Canvas canvas = new Canvas(output);
|
||||||
|
final int color = 0xff424242;// 颜色值(0xff---alpha)
|
||||||
|
final Paint paint = new Paint();
|
||||||
|
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
|
||||||
|
final RectF rectF = new RectF(rect);// Rect是使用int类型作为数值,RectF是使用float类型作为数值
|
||||||
|
// --------抗锯齿-------//
|
||||||
|
paint.setAntiAlias(true);
|
||||||
|
canvas.drawARGB(0, 0, 0, 0);
|
||||||
|
paint.setColor(color);
|
||||||
|
canvas.drawRoundRect(rectF, roundPx, roundPx, paint);
|
||||||
|
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
||||||
|
final Rect src = new Rect(0, 0, bitmap.getWidth(),
|
||||||
|
bitmap.getHeight());
|
||||||
|
canvas.drawBitmap(bitmap, null, rect, paint);
|
||||||
|
return output;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//私聊
|
||||||
|
private void sendNotification(Context context, NotificationMsgBean message) {
|
||||||
|
// 设置通知的点击行为:这里启动一个 Activity
|
||||||
|
Intent intent = new Intent(context, MainActivity.class);
|
||||||
|
intent.setFlags(FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
|
||||||
|
String channelId = createNotificationChannel(context, "my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
||||||
|
// 构建 remoteView
|
||||||
|
RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.notification_message);
|
||||||
|
remoteView.setTextViewText(R.id.title, message.getTitle());
|
||||||
|
remoteView.setTextViewText(R.id.content, message.getContent());
|
||||||
|
Glide.with(context).asBitmap().load(message.getImg()).into(new SimpleTarget<Bitmap>() {
|
||||||
|
@Override
|
||||||
|
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
|
||||||
|
remoteView.setImageViewBitmap(R.id.img, makeRoundCorner(resource, 50));
|
||||||
|
|
||||||
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channelId);
|
||||||
|
// 设置自定义 RemoteViews
|
||||||
|
builder.setContent(remoteView).setSmallIcon(R.drawable.small_icons);
|
||||||
|
// 设置通知的优先级(悬浮通知)
|
||||||
|
builder.setPriority(NotificationCompat.PRIORITY_MAX);
|
||||||
|
builder.setContentIntent(pendingIntent);
|
||||||
|
builder.setAutoCancel(true);
|
||||||
|
Notification notification = builder.build();
|
||||||
|
NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
manager.notify(0, notification);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int id = 1;
|
||||||
|
|
||||||
|
//动态
|
||||||
|
private void dynamicNotification(Context context, NotificationMsgBean message) {
|
||||||
|
// 设置通知的点击行为:这里启动一个 Activity
|
||||||
|
Intent intent = new Intent(context, MainActivity.class);
|
||||||
|
intent.putExtra("type", "2");
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
String channelId = createNotificationChannel(context, "my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
||||||
|
// 构建 remoteView
|
||||||
|
RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.notification_message);
|
||||||
|
remoteView.setTextViewText(R.id.title, message.getTitle());
|
||||||
|
remoteView.setTextViewText(R.id.content, message.getContent());
|
||||||
|
remoteView.setImageViewResource(R.id.img, R.mipmap.ic_launcher);
|
||||||
|
|
||||||
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channelId);
|
||||||
|
// 设置自定义 RemoteViews
|
||||||
|
builder.setContent(remoteView).setSmallIcon(R.drawable.small_icons);
|
||||||
|
// 设置通知的优先级(悬浮通知)
|
||||||
|
builder.setPriority(NotificationCompat.PRIORITY_MAX);
|
||||||
|
builder.setContentIntent(pendingIntent);
|
||||||
|
builder.setAutoCancel(true);
|
||||||
|
Notification notification = builder.build();
|
||||||
|
NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
id = (int) (id + System.currentTimeMillis());
|
||||||
|
manager.notify(id, notification);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//开播
|
||||||
|
private void liveNotification(Context context, NotificationMsgBean message) {
|
||||||
|
// 设置通知的点击行为:这里启动一个 Activity
|
||||||
|
Intent intent = new Intent(context, LauncherActivity.class);
|
||||||
|
intent.setFlags(FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
|
intent.putExtra("liveid", message.getLiveuid());
|
||||||
|
Log.e("gmc", message.getLiveuid() + "21121");
|
||||||
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
String channelId = createNotificationChannel(context, "my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
||||||
|
// 构建 remoteView
|
||||||
|
RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.notification_message);
|
||||||
|
remoteView.setTextViewText(R.id.title, message.getTitle());
|
||||||
|
remoteView.setTextViewText(R.id.content, message.getContent());
|
||||||
|
Glide.with(context).asBitmap().load(message.getImg()).into(new SimpleTarget<Bitmap>() {
|
||||||
|
@Override
|
||||||
|
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
|
||||||
|
remoteView.setImageViewBitmap(R.id.img, makeRoundCorner(resource, 50));
|
||||||
|
|
||||||
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channelId);
|
||||||
|
// 设置自定义 RemoteViews
|
||||||
|
builder.setContent(remoteView).setSmallIcon(R.drawable.small_icons);
|
||||||
|
// 设置通知的优先级(悬浮通知)
|
||||||
|
builder.setPriority(NotificationCompat.PRIORITY_MAX);
|
||||||
|
builder.setContentIntent(pendingIntent);
|
||||||
|
builder.setAutoCancel(true);
|
||||||
|
Notification notification = builder.build();
|
||||||
|
NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
id = (int) (id + System.currentTimeMillis());
|
||||||
|
manager.notify(id, notification);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Log.i("gmc", "11123231");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//后台
|
||||||
|
private void serviceNotification(Context context, NotificationMsgBean message) {
|
||||||
|
// 设置通知的点击行为:这里启动一个 Activity
|
||||||
|
Intent intent = new Intent(context, MainActivity.class);
|
||||||
|
intent.putExtra("type", message.getType());
|
||||||
|
if (message.getType().equals("8")) {
|
||||||
|
intent.putExtra("activityUrl", message.getActivityurl());
|
||||||
|
}
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
String channelId = createNotificationChannel(context, "my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
||||||
|
// 构建 remoteView
|
||||||
|
RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.notification_message);
|
||||||
|
remoteView.setTextViewText(R.id.title, message.getTitle());
|
||||||
|
remoteView.setTextViewText(R.id.content, message.getContent());
|
||||||
|
remoteView.setImageViewResource(R.id.img, R.mipmap.ic_launcher);
|
||||||
|
|
||||||
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channelId);
|
||||||
|
// 设置自定义 RemoteViews
|
||||||
|
builder.setContent(remoteView).setSmallIcon(R.drawable.small_icons);
|
||||||
|
// 设置通知的优先级(悬浮通知)
|
||||||
|
builder.setPriority(NotificationCompat.PRIORITY_MAX);
|
||||||
|
builder.setContentIntent(pendingIntent);
|
||||||
|
builder.setAutoCancel(true);
|
||||||
|
Notification notification = builder.build();
|
||||||
|
NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
id = (int) (id + System.currentTimeMillis());
|
||||||
|
manager.notify(id, notification);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -22,9 +22,15 @@ import com.google.firebase.messaging.RemoteMessage;
|
|||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.main.activity.MainActivity;
|
import com.yunbao.main.activity.MainActivity;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import myname.pdlive.shayu.R;
|
import myname.pdlive.shayu.R;
|
||||||
|
|
||||||
public class MyNotificationService extends FirebaseMessagingService {
|
public class MyNotificationService extends FirebaseMessagingService {
|
||||||
|
|
||||||
private String createNotificationChannel(String channelID, String channelNAME, int level) {
|
private String createNotificationChannel(String channelID, String channelNAME, int level) {
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||||
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||||
@ -35,36 +41,70 @@ public class MyNotificationService extends FirebaseMessagingService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void onMessageReceived(RemoteMessage remoteMessage) {
|
|
||||||
Log.e("gmc","remoteMessage");
|
public void onMessageReceived(RemoteMessage message) {
|
||||||
// do nothing
|
// do nothing
|
||||||
sendNotification("remoteMessage");
|
Map<String, String> params = message.getData();
|
||||||
|
JSONObject object = new JSONObject(params);
|
||||||
|
Log.e("JSON_OBJECT", object.toString());
|
||||||
|
JSONObject remoteMessage = null;
|
||||||
|
try {
|
||||||
|
remoteMessage = new JSONObject(object.getString("message"));
|
||||||
|
Log.e("gmc","remoteMessage1"+remoteMessage.toString());
|
||||||
|
Log.e("gmc","remoteMessage"+remoteMessage.getString("fromUserName"));
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
// if(remoteMessage!=null && remoteMessage.isNull("fcm_token")) {
|
||||||
|
// String title = remoteMessage.getData().get("title");
|
||||||
|
// String message = remoteMessage.getData().get("text");
|
||||||
|
// String username = remoteMessage.getData().get("username");
|
||||||
|
// String uid = remoteMessage.getData().get("uid");
|
||||||
|
// String fcmToken = remoteMessage.getData().get("fcm_token");
|
||||||
|
// Log.e("gmc","remoteMessage"+remoteMessage.getData().get("username"));
|
||||||
|
//
|
||||||
|
// //Muestro la notifiación
|
||||||
|
//// sendNotification(title, message, username, uid, fcmToken);
|
||||||
|
// }else {
|
||||||
|
// /// Si es de tipo inserción la muestro sino no.
|
||||||
|
// //Es una nueva notificación de que alguien ha creado algo
|
||||||
|
// if(remoteMessage.getData().get("accion")!=null &&
|
||||||
|
// remoteMessage.getData().get("accion").compareTo("insert")==0)
|
||||||
|
//// displayNotification(remoteMessage.getNotification(), remoteMessage.getData());
|
||||||
|
//// //Envío los datos al RecyclerView correspondiente para que se actualice
|
||||||
|
//// addNotificacion(remoteMessage);
|
||||||
|
// Log.e("gmc","remoteMessage"+remoteMessage.getData().get("username"));
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
// sendNotification("remoteMessage");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void sendNotification(String messageBody) {
|
// private void sendNotification(String messageBody) {
|
||||||
|
//
|
||||||
// 设置通知的点击行为:这里启动一个 Activity
|
// // 设置通知的点击行为:这里启动一个 Activity
|
||||||
Intent intent = new Intent(this, MainActivity.class);
|
// Intent intent = new Intent(this, MainActivity.class);
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
|
// PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
|
||||||
String channelId = createNotificationChannel("my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
// String channelId = createNotificationChannel("my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
||||||
// 构建 remoteView
|
// // 构建 remoteView
|
||||||
RemoteViews remoteView = new RemoteViews(getPackageName(), R.layout.notification_message);
|
//// RemoteViews remoteView = new RemoteViews(getPackageName(), R.layout.notification_message);
|
||||||
// remoteView.setTextViewText(R.id.tvMsg, "RemoteViews");
|
//
|
||||||
// remoteView.setImageViewResource(R.id.ivIcon, R.mipmap.ic_launcher_round);
|
//// remoteView.setTextViewText(R.id.tvMsg, "RemoteViews");
|
||||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(this,channelId);
|
//// remoteView.setImageViewResource(R.id.ivIcon, R.mipmap.ic_launcher_round);
|
||||||
// 设置自定义 RemoteViews
|
// NotificationCompat.Builder builder = new NotificationCompat.Builder(this,channelId);
|
||||||
builder.setContent(remoteView).setSmallIcon(R.mipmap.ic_launcher);
|
// // 设置自定义 RemoteViews
|
||||||
// 设置通知的优先级(悬浮通知)
|
// builder.setContent(remoteView).setSmallIcon(R.mipmap.ic_launcher);
|
||||||
builder.setPriority(NotificationCompat.PRIORITY_MAX);
|
// // 设置通知的优先级(悬浮通知)
|
||||||
builder.setContentIntent(pendingIntent);
|
// builder.setPriority(NotificationCompat.PRIORITY_MAX);
|
||||||
builder.setAutoCancel(true);
|
// builder.setContentIntent(pendingIntent);
|
||||||
Notification notification = builder.build();
|
// builder.setAutoCancel(true);
|
||||||
NotificationManager manager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
|
// Notification notification = builder.build();
|
||||||
manager.notify(0, notification);
|
// NotificationManager manager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
// manager.notify(0, notification);
|
||||||
}
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
BIN
app/src/main/res/drawable/small_icons.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/raw/pdlive_sound.mp3
Normal file
@ -178,5 +178,5 @@ dependencies {
|
|||||||
api 'com.wang.avi:library:2.1.3'
|
api 'com.wang.avi:library:2.1.3'
|
||||||
api 'com.google.firebase:firebase-messaging:23.0.6'
|
api 'com.google.firebase:firebase-messaging:23.0.6'
|
||||||
api 'com.google.firebase:firebase-analytics:21.1.0'
|
api 'com.google.firebase:firebase-analytics:21.1.0'
|
||||||
|
// api 'com.huawei.hms:push:4.0.2.300'
|
||||||
}
|
}
|
||||||
|
@ -6,16 +6,21 @@ import android.os.Build;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import androidx.multidex.MultiDex;
|
import androidx.multidex.MultiDex;
|
||||||
import androidx.multidex.MultiDexApplication;
|
import androidx.multidex.MultiDexApplication;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.facebook.FacebookSdk;
|
import com.facebook.FacebookSdk;
|
||||||
import com.facebook.appevents.AppEventsLogger;
|
import com.facebook.appevents.AppEventsLogger;
|
||||||
|
import com.google.android.gms.common.api.ApiException;
|
||||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import io.rong.push.RongPushClient;
|
||||||
|
import io.rong.push.pushconfig.PushConfig;
|
||||||
import me.leolin.shortcutbadger.ShortcutBadger;
|
import me.leolin.shortcutbadger.ShortcutBadger;
|
||||||
|
|
||||||
import static com.facebook.FacebookSdk.setAdvertiserIDCollectionEnabled;
|
import static com.facebook.FacebookSdk.setAdvertiserIDCollectionEnabled;
|
||||||
@ -46,6 +51,16 @@ public class CommonAppContext extends MultiDexApplication {
|
|||||||
sInstance = this;
|
sInstance = this;
|
||||||
//初始化Http
|
//初始化Http
|
||||||
CommonHttpUtil.init();
|
CommonHttpUtil.init();
|
||||||
|
// //华为推送
|
||||||
|
// PushConfig config = new PushConfig.Builder()
|
||||||
|
// .enableHWPush(true)
|
||||||
|
// .build();
|
||||||
|
// RongPushClient.setPushConfig(config); //将推送相关配置设置到 SDK
|
||||||
|
//谷歌推送
|
||||||
|
PushConfig gconfig = new PushConfig.Builder()
|
||||||
|
.enableFCM(true)
|
||||||
|
.build();
|
||||||
|
RongPushClient.setPushConfig(gconfig);
|
||||||
//初始化友盟统计
|
//初始化友盟统计
|
||||||
// UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
|
// UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
|
||||||
FacebookSdk.sdkInitialize(getApplicationContext());
|
FacebookSdk.sdkInitialize(getApplicationContext());
|
||||||
@ -54,6 +69,7 @@ public class CommonAppContext extends MultiDexApplication {
|
|||||||
mFirebaseAnalytics.setUserProperty("ALLOW_AD_PERSONALIZATION_SIGNALS", "true" );
|
mFirebaseAnalytics.setUserProperty("ALLOW_AD_PERSONALIZATION_SIGNALS", "true" );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
logger = AppEventsLogger.newLogger(this);
|
logger = AppEventsLogger.newLogger(this);
|
||||||
setAutoLogAppEventsEnabled(true);
|
setAutoLogAppEventsEnabled(true);
|
||||||
FacebookSdk.fullyInitialize();
|
FacebookSdk.fullyInitialize();
|
||||||
@ -75,6 +91,7 @@ public class CommonAppContext extends MultiDexApplication {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void attachBaseContext(Context base) {
|
protected void attachBaseContext(Context base) {
|
||||||
MultiDex.install(this);
|
MultiDex.install(this);
|
||||||
|
@ -46,6 +46,7 @@ public class Constants {
|
|||||||
public static final String LIVE_NEAR = "liveNear";
|
public static final String LIVE_NEAR = "liveNear";
|
||||||
public static final String LIVE_CLASS_PREFIX = "liveClass_";
|
public static final String LIVE_CLASS_PREFIX = "liveClass_";
|
||||||
public static final String LIVE_ADMIN_ROOM = "liveAdminRoom";
|
public static final String LIVE_ADMIN_ROOM = "liveAdminRoom";
|
||||||
|
public static final String LIVE_ANCHER_NAME = "ancherName";//主播名
|
||||||
public static final String HAS_GAME = "hasGame";
|
public static final String HAS_GAME = "hasGame";
|
||||||
public static final String OPEN_FLASH = "openFlash";
|
public static final String OPEN_FLASH = "openFlash";
|
||||||
public static final String SHARE_QR_CODE_FILE = "shareQrCodeFile.png";
|
public static final String SHARE_QR_CODE_FILE = "shareQrCodeFile.png";
|
||||||
|
@ -22,6 +22,17 @@ public class AnchorRecommendModel extends BaseModel {
|
|||||||
private int upShow = 0;
|
private int upShow = 0;
|
||||||
@SerializedName("list")
|
@SerializedName("list")
|
||||||
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||||
|
@SerializedName("slide")
|
||||||
|
private List<SlideInfoModel> slide = new ArrayList<>();
|
||||||
|
|
||||||
|
public List<SlideInfoModel> getSlide() {
|
||||||
|
return slide;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AnchorRecommendModel setSlide(List<SlideInfoModel> slide) {
|
||||||
|
this.slide = slide;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public int getListShow() {
|
public int getListShow() {
|
||||||
return listShow;
|
return listShow;
|
||||||
|
@ -0,0 +1,60 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MsgSwitchDetailModel extends BaseModel {
|
||||||
|
@SerializedName("dynamic_msg_switch")
|
||||||
|
String dynamic_msg_switch;
|
||||||
|
@SerializedName("interaction_show_msg_switch")
|
||||||
|
String interaction_show_msg_switch;
|
||||||
|
@SerializedName("chat_msg_switch")
|
||||||
|
String chat_msg_switch;
|
||||||
|
@SerializedName("system_msg_switch")
|
||||||
|
String system_msg_switch;
|
||||||
|
|
||||||
|
@SerializedName("followList")
|
||||||
|
private List<MsgSwitchFollowlModel> followList = new ArrayList<>();
|
||||||
|
|
||||||
|
public String getDynamic_msg_switch() {
|
||||||
|
return dynamic_msg_switch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDynamic_msg_switch(String dynamic_msg_switch) {
|
||||||
|
this.dynamic_msg_switch = dynamic_msg_switch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInteraction_show_msg_switch() {
|
||||||
|
return interaction_show_msg_switch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInteraction_show_msg_switch(String interaction_show_msg_switch) {
|
||||||
|
this.interaction_show_msg_switch = interaction_show_msg_switch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getChat_msg_switch() {
|
||||||
|
return chat_msg_switch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChat_msg_switch(String chat_msg_switch) {
|
||||||
|
this.chat_msg_switch = chat_msg_switch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSystem_msg_switch() {
|
||||||
|
return system_msg_switch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSystem_msg_switch(String system_msg_switch) {
|
||||||
|
this.system_msg_switch = system_msg_switch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MsgSwitchFollowlModel> getFollowList() {
|
||||||
|
return followList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFollowList(List<MsgSwitchFollowlModel> followList) {
|
||||||
|
this.followList = followList;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class MsgSwitchFollowlModel extends BaseModel{
|
||||||
|
@SerializedName("status")
|
||||||
|
String status;
|
||||||
|
@SerializedName("user_nicename")
|
||||||
|
String user_nicename;
|
||||||
|
@SerializedName("avatar")
|
||||||
|
String avatar;
|
||||||
|
@SerializedName("liveuid")
|
||||||
|
String liveuid;
|
||||||
|
|
||||||
|
public String getLiveuid() {
|
||||||
|
return liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLiveuid(String liveuid) {
|
||||||
|
this.liveuid = liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUser_nicename() {
|
||||||
|
return user_nicename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser_nicename(String user_nicename) {
|
||||||
|
this.user_nicename = user_nicename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAvatar() {
|
||||||
|
return avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvatar(String avatar) {
|
||||||
|
this.avatar = avatar;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
public class NotificationMsgBean {
|
||||||
|
String img;
|
||||||
|
String title;
|
||||||
|
String content;
|
||||||
|
String type;
|
||||||
|
String liveuid;
|
||||||
|
String activityurl;
|
||||||
|
|
||||||
|
public String getActivityurl() {
|
||||||
|
return activityurl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivityurl(String activityurl) {
|
||||||
|
this.activityurl = activityurl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveuid() {
|
||||||
|
return liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLiveuid(String liveuid) {
|
||||||
|
this.liveuid = liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImg() {
|
||||||
|
return img;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImg(String img) {
|
||||||
|
this.img = img;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
}
|
@ -7,6 +7,7 @@ import com.yunbao.common.bean.ContributeModel;
|
|||||||
import com.yunbao.common.bean.FaceBookUpModel;
|
import com.yunbao.common.bean.FaceBookUpModel;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
import com.yunbao.common.bean.LiveInfoModel;
|
import com.yunbao.common.bean.LiveInfoModel;
|
||||||
|
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
||||||
import com.yunbao.common.bean.NewPeopleInfo;
|
import com.yunbao.common.bean.NewPeopleInfo;
|
||||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||||
import com.yunbao.common.bean.SearchModel;
|
import com.yunbao.common.bean.SearchModel;
|
||||||
@ -115,6 +116,17 @@ public interface PDLiveApi {
|
|||||||
@Query("num") String num
|
@Query("num") String num
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直播间上下滚动列表
|
||||||
|
*
|
||||||
|
* @param num 请求数量
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Home.anchorRecommend ")
|
||||||
|
Observable<ResponseModel<AnchorRecommendModel>> anchorRecommend(
|
||||||
|
@Query("num") String num, @Query("type") String type
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取直播间信息
|
* 获取直播间信息
|
||||||
*
|
*
|
||||||
@ -132,7 +144,7 @@ public interface PDLiveApi {
|
|||||||
* @param liveuid
|
* @param liveuid
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=User.setAttents")
|
@GET("/api/public/?service=User.slketAttents")
|
||||||
Observable<ResponseModel<List<SetAttentsModel>>> setAttents(
|
Observable<ResponseModel<List<SetAttentsModel>>> setAttents(
|
||||||
@Query("touid") String liveuid
|
@Query("touid") String liveuid
|
||||||
);
|
);
|
||||||
@ -150,6 +162,7 @@ public interface PDLiveApi {
|
|||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Active.getActiveList")
|
@GET("/api/public/?service=Active.getActiveList")
|
||||||
Observable<ResponseModel<List<ActiveModel>>> getActiveList();
|
Observable<ResponseModel<List<ActiveModel>>> getActiveList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取活动
|
* 获取活动
|
||||||
*/
|
*/
|
||||||
@ -158,6 +171,7 @@ public interface PDLiveApi {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取日榜、周榜数据
|
* 获取日榜、周榜数据
|
||||||
|
*
|
||||||
* @param uid 直播间id,并非用户uid
|
* @param uid 直播间id,并非用户uid
|
||||||
* @return 榜单结构
|
* @return 榜单结构
|
||||||
*/
|
*/
|
||||||
@ -166,8 +180,29 @@ public interface PDLiveApi {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 直播间新人特惠信息
|
* 直播间新人特惠信息
|
||||||
|
*
|
||||||
* @return 新人特惠数据
|
* @return 新人特惠数据
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Live.newUserPreferential")
|
@GET("/api/public/?service=Live.newUserPreferential")
|
||||||
Observable<ResponseModel<NewPeopleInfo>> getNewPeopleInfo();
|
Observable<ResponseModel<NewPeopleInfo>> getNewPeopleInfo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取推送关注的开关和关注列表
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Tx.offlineMsgSwitchDetail")
|
||||||
|
Observable<ResponseModel<MsgSwitchDetailModel>> getMsgSwitchDetail();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送关注的开关设置
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Tx.setMsgMasterSwitch")
|
||||||
|
Observable<ResponseModel<BaseModel>> setMsgMasterSwitch(@Query("status") String status,@Query("type") String type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*开播推送设置开关
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Tx.setBeginShowMsgSwitch")
|
||||||
|
Observable<ResponseModel<List<BaseModel>>> setBeginShowMsgSwitch(@Query("status") String status,@Query("isAll") String isAll,@Query("liveuid") String liveuid);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,13 +3,17 @@ package com.yunbao.common.http.main;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
|
||||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
import com.yunbao.common.bean.FaceBookUpModel;
|
import com.yunbao.common.bean.FaceBookUpModel;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
|
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
||||||
import com.yunbao.common.bean.SearchModel;
|
import com.yunbao.common.bean.SearchModel;
|
||||||
import com.yunbao.common.bean.SlideInfoModel;
|
import com.yunbao.common.bean.SlideInfoModel;
|
||||||
import com.yunbao.common.http.API;
|
import com.yunbao.common.http.API;
|
||||||
|
import com.yunbao.common.http.ResponseData;
|
||||||
import com.yunbao.common.http.ResponseModel;
|
import com.yunbao.common.http.ResponseModel;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -112,6 +116,28 @@ public class MainNetManager {
|
|||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 猜你喜欢
|
||||||
|
*
|
||||||
|
* @param num 请求数量
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public void anchorRecommendType(String num, HttpCallback<AnchorRecommendModel> httpCallback) {
|
||||||
|
API.get().pdLiveApi(mContext).anchorRecommend(num, "1")
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(anchorRecommendModelResponseModel -> {
|
||||||
|
if (httpCallback != null) {
|
||||||
|
AnchorRecommendModel model = anchorRecommendModelResponseModel.getData().getInfo();
|
||||||
|
httpCallback.onSuccess(model);
|
||||||
|
}
|
||||||
|
}, throwable -> {
|
||||||
|
if (httpCallback != null) {
|
||||||
|
httpCallback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 搜索
|
* 搜索
|
||||||
*
|
*
|
||||||
@ -168,12 +194,72 @@ public class MainNetManager {
|
|||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(slideInBannerModelResponseModel -> {
|
.subscribe(slideInBannerModelResponseModel -> {
|
||||||
if (!mContext.isFinishing() && callback != null) {
|
if (callback != null) {
|
||||||
List<SlideInfoModel> slideInfoModels = slideInBannerModelResponseModel.getData().getInfo().get(0).getSlide();
|
List<SlideInfoModel> slideInfoModels = slideInBannerModelResponseModel.getData().getInfo().get(0).getSlide();
|
||||||
callback.onSuccess(slideInfoModels);
|
callback.onSuccess(slideInfoModels);
|
||||||
}
|
}
|
||||||
}, throwable -> {
|
}, throwable -> {
|
||||||
if (!mContext.isFinishing() && callback != null) {
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取推送关注的设置和关注列表
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
public void getMsgSwitchDetail(HttpCallback<MsgSwitchDetailModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext).getMsgSwitchDetail()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(msgSwitchDetailModelResponseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
MsgSwitchDetailModel msgSwitchDetailModel = msgSwitchDetailModelResponseModel.getData().getInfo();
|
||||||
|
callback.onSuccess(msgSwitchDetailModel);
|
||||||
|
}
|
||||||
|
}, throwable -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送开关设置
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
public void setMsgMasterSwitch(String status,String type,HttpCallback<ResponseData> callback) {
|
||||||
|
API.get().pdLiveApi(mContext).setMsgMasterSwitch(status,type)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
ResponseData responseData = BaseModel.getData();
|
||||||
|
callback.onSuccess(responseData);
|
||||||
|
}
|
||||||
|
}, throwable -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主播开播推送开关设置
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
public void setBeginShowMsgSwitch(String status,String isAll,String liveuid,HttpCallback<ResponseData> callback) {
|
||||||
|
API.get().pdLiveApi(mContext).setBeginShowMsgSwitch(status,isAll,liveuid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
ResponseData responseData = BaseModel.getData();
|
||||||
|
callback.onSuccess(responseData);
|
||||||
|
}
|
||||||
|
}, throwable -> {
|
||||||
|
if (callback != null) {
|
||||||
callback.onError(throwable.getMessage());
|
callback.onError(throwable.getMessage());
|
||||||
}
|
}
|
||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
|
@ -53,6 +53,7 @@ public class RongcloudIMManager {
|
|||||||
private static RongIMClient.OnReceiveMessageWrapperListener mListener;
|
private static RongIMClient.OnReceiveMessageWrapperListener mListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* 设置消息接受监听器
|
* 设置消息接受监听器
|
||||||
*/
|
*/
|
||||||
public static void addRongcloudIMOnReceiveMessageListener(RongIMClient.OnReceiveMessageWrapperListener listener) {
|
public static void addRongcloudIMOnReceiveMessageListener(RongIMClient.OnReceiveMessageWrapperListener listener) {
|
||||||
|
@ -97,7 +97,7 @@ public class DialogUitl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void showSimpleDialog(Context context, String content, SimpleCallback callback) {
|
public static void showSimpleDialog(Context context, String content, SimpleCallback callback) {
|
||||||
showSimpleDialog(context, content, true, callback);
|
showSimpleDialog(context, content, false, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showSimpleDialog(Context context, String content, boolean cancelable, SimpleCallback callback) {
|
public static void showSimpleDialog(Context context, String content, boolean cancelable, SimpleCallback callback) {
|
||||||
@ -114,6 +114,15 @@ public class DialogUitl {
|
|||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void showSimpleDialog(Context context, String title, String content, boolean cancelable, SimpleCallback3 callback) {
|
||||||
|
new Builder(context)
|
||||||
|
.setTitle(title)
|
||||||
|
.setContent(content)
|
||||||
|
.setCancelable(cancelable)
|
||||||
|
.setClickCallback3(callback)
|
||||||
|
.build()
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
public static void showSimpleInputDialog(Context context, String title, String hint, int inputType, int length, SimpleCallback callback) {
|
public static void showSimpleInputDialog(Context context, String title, String hint, int inputType, int length, SimpleCallback callback) {
|
||||||
new Builder(context).setTitle(title)
|
new Builder(context).setTitle(title)
|
||||||
@ -290,6 +299,7 @@ public class DialogUitl {
|
|||||||
private int mInputType;
|
private int mInputType;
|
||||||
private int mLength;
|
private int mLength;
|
||||||
private SimpleCallback mClickCallback;
|
private SimpleCallback mClickCallback;
|
||||||
|
private SimpleCallback3 mClickCallback3;
|
||||||
|
|
||||||
public Builder(Context context) {
|
public Builder(Context context) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
@ -350,6 +360,11 @@ public class DialogUitl {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Builder setClickCallback3(SimpleCallback3 clickCallback) {
|
||||||
|
mClickCallback3 = clickCallback;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Dialog build() {
|
public Dialog build() {
|
||||||
final Dialog dialog = new Dialog(mContext, mBackgroundDimEnabled ? R.style.dialog : R.style.dialog2);
|
final Dialog dialog = new Dialog(mContext, mBackgroundDimEnabled ? R.style.dialog : R.style.dialog2);
|
||||||
dialog.setContentView(mInput ? R.layout.dialog_input : R.layout.dialog_simple);
|
dialog.setContentView(mInput ? R.layout.dialog_input : R.layout.dialog_simple);
|
||||||
@ -397,13 +412,25 @@ public class DialogUitl {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
|
if (mClickCallback3 != null) {
|
||||||
|
mClickCallback3.onConfirmClick(dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
|
if (mClickCallback3 != null) {
|
||||||
|
mClickCallback3.onCancel();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
if (mClickCallback instanceof SimpleCallback2) {
|
if (mClickCallback instanceof SimpleCallback2) {
|
||||||
((SimpleCallback2) mClickCallback).onCancelClick();
|
((SimpleCallback2) mClickCallback).onCancelClick();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
btnConfirm.setOnClickListener(listener);
|
btnConfirm.setOnClickListener(listener);
|
||||||
@ -429,6 +456,12 @@ public class DialogUitl {
|
|||||||
void onCancelClick();
|
void onCancelClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface SimpleCallback3 {
|
||||||
|
void onConfirmClick(Dialog dialog);
|
||||||
|
|
||||||
|
void onCancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 城市选择
|
* 城市选择
|
||||||
|
@ -75,6 +75,10 @@ public class VerticalViewPager extends ViewGroup {
|
|||||||
|
|
||||||
private boolean mEnableScroll = true;
|
private boolean mEnableScroll = true;
|
||||||
|
|
||||||
|
public boolean ismEnableScroll() {
|
||||||
|
return mEnableScroll;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to track what the expected number of items in the adapter should be.
|
* Used to track what the expected number of items in the adapter should be.
|
||||||
* If the app changes this when we don't expect it, we'll throw a big obnoxious exception.
|
* If the app changes this when we don't expect it, we'll throw a big obnoxious exception.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<corners android:topLeftRadius="12dp" android:topRightRadius="12dp" />
|
<corners android:topLeftRadius="12dp" android:topRightRadius="12dp" />
|
||||||
<solid android:color="#98000000" />
|
<solid android:color="#333333" />
|
||||||
</shape>
|
</shape>
|
@ -21,9 +21,10 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/live_type"
|
android:id="@+id/live_type"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="46dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="18dp"
|
||||||
android:layout_margin="4dp"
|
android:layout_margin="4dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
android:gravity="center" />
|
android:gravity="center" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="80dp"
|
android:layout_height="80dp"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -11,27 +12,31 @@
|
|||||||
android:layout_marginRight="60dp"
|
android:layout_marginRight="60dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/img"
|
||||||
|
app:riv_oval="true"
|
||||||
android:src="@mipmap/ic_launcher"
|
android:src="@mipmap/ic_launcher"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="60dp"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="60dp"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="25dp"
|
android:layout_marginLeft="25dp"
|
||||||
|
android:gravity="center|left"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView android:id="@+id/title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
android:textColor="@color/yellow4"
|
android:textColor="@color/yellow4"
|
||||||
android:text="我开播了!"/>
|
android:text="我开播了!"/>
|
||||||
|
|
||||||
<TextView
|
<TextView android:id="@+id/content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
@ -43,6 +48,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -50,4 +56,5 @@
|
|||||||
android:textColor="@color/gray3"
|
android:textColor="@color/gray3"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:text="PD LIVE"/>
|
android:text="PD LIVE"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 29 KiB |
@ -6,9 +6,6 @@ import android.content.ClipboardManager;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
|
||||||
import androidx.fragment.app.DialogFragment;
|
|
||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -16,9 +13,10 @@ import android.view.ViewGroup;
|
|||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.fragment.app.DialogFragment;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.tencent.imsdk.conversation.ConversationManager;
|
|
||||||
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;
|
||||||
@ -49,15 +47,15 @@ import com.yunbao.live.bean.LivePKUserListBean;
|
|||||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||||
import com.yunbao.live.bean.LiveUserGiftBean;
|
import com.yunbao.live.bean.LiveUserGiftBean;
|
||||||
import com.yunbao.live.dialog.GiftPrizePoolFragment;
|
import com.yunbao.live.dialog.GiftPrizePoolFragment;
|
||||||
import com.yunbao.live.dialog.LiveChatListDialogFragment;
|
|
||||||
import com.yunbao.live.dialog.LiveChatRoomDialogFragment;
|
import com.yunbao.live.dialog.LiveChatRoomDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveFansFragment;
|
import com.yunbao.live.dialog.LiveFansFragment;
|
||||||
import com.yunbao.live.dialog.LiveFansMedalOkDialogFragment;
|
import com.yunbao.live.dialog.LiveFansMedalOkDialogFragment;
|
||||||
|
import com.yunbao.live.dialog.LiveGiveHotDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveGuardBuyDialogFragment;
|
import com.yunbao.live.dialog.LiveGuardBuyDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveGuardDialogFragment;
|
import com.yunbao.live.dialog.LiveGuardDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveGiveHotDialogFragment;
|
|
||||||
import com.yunbao.live.dialog.LiveInputDialogFragment;
|
import com.yunbao.live.dialog.LiveInputDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveMoreDialogFragment;
|
import com.yunbao.live.dialog.LiveMoreDialogFragment;
|
||||||
|
import com.yunbao.live.dialog.LiveNewGuardBuyDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveRedPackListDialogFragment;
|
import com.yunbao.live.dialog.LiveRedPackListDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveRedPackSendDialogFragment;
|
import com.yunbao.live.dialog.LiveRedPackSendDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveShareDialogFragment;
|
import com.yunbao.live.dialog.LiveShareDialogFragment;
|
||||||
@ -69,7 +67,6 @@ import com.yunbao.live.presenter.LiveLinkMicAnchorPresenter;
|
|||||||
import com.yunbao.live.presenter.LiveLinkMicPkPresenter;
|
import com.yunbao.live.presenter.LiveLinkMicPkPresenter;
|
||||||
import com.yunbao.live.presenter.LiveLinkMicPresenter;
|
import com.yunbao.live.presenter.LiveLinkMicPresenter;
|
||||||
import com.yunbao.live.presenter.LiveRyLinkMicPkPresenter;
|
import com.yunbao.live.presenter.LiveRyLinkMicPkPresenter;
|
||||||
import com.yunbao.live.socket.SocketChatUtil;
|
|
||||||
import com.yunbao.live.socket.SocketClient;
|
import com.yunbao.live.socket.SocketClient;
|
||||||
import com.yunbao.live.socket.SocketMessageListener;
|
import com.yunbao.live.socket.SocketMessageListener;
|
||||||
import com.yunbao.live.socket.SocketRyChatUtil;
|
import com.yunbao.live.socket.SocketRyChatUtil;
|
||||||
@ -91,8 +88,6 @@ import org.greenrobot.eventbus.ThreadMode;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.rong.imkit.utils.RouteUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/10/7.
|
* Created by cxf on 2018/10/7.
|
||||||
*/
|
*/
|
||||||
@ -138,7 +133,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
private LiveChatRoomDialogFragment mLiveChatRoomDialogFragment;//私信聊天窗口
|
private LiveChatRoomDialogFragment mLiveChatRoomDialogFragment;//私信聊天窗口
|
||||||
protected LiveGuardInfo mLiveGuardInfo;
|
protected LiveGuardInfo mLiveGuardInfo;
|
||||||
private HashSet<DialogFragment> mDialogFragmentSet;
|
private HashSet<DialogFragment> mDialogFragmentSet;
|
||||||
public boolean isRy = false;
|
// public static boolean isRy = true;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void main() {
|
protected void main() {
|
||||||
@ -149,7 +144,6 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
mImageUtil = new ProcessImageUtil(this);
|
mImageUtil = new ProcessImageUtil(this);
|
||||||
mDialogFragmentSet = new HashSet<>();
|
mDialogFragmentSet = new HashSet<>();
|
||||||
|
|
||||||
//解压 美颜模型
|
//解压 美颜模型
|
||||||
try {
|
try {
|
||||||
CommonAppConfig.VIDEO_TIE_MODEl_PATH = getFilesDir().getAbsolutePath() + "/model";//app安装路径
|
CommonAppConfig.VIDEO_TIE_MODEl_PATH = getFilesDir().getAbsolutePath() + "/model";//app安装路径
|
||||||
@ -205,17 +199,17 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
if (!mFirstConnectSocket) {
|
if (!mFirstConnectSocket) {
|
||||||
mFirstConnectSocket = true;
|
mFirstConnectSocket = true;
|
||||||
if (mLiveType == Constants.LIVE_TYPE_PAY || mLiveType == Constants.LIVE_TYPE_TIME) {
|
if (mLiveType == Constants.LIVE_TYPE_PAY || mLiveType == Constants.LIVE_TYPE_TIME) {
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
SocketChatUtil.sendUpdateVotesMessage(mLiveUid, mLiveTypeVal, 1);
|
// SocketChatUtil.sendUpdateVotesMessage(mLiveUid, mLiveTypeVal, 1);
|
||||||
} else {
|
// } else {
|
||||||
SocketRyChatUtil.sendUpdateVotesMessage(mLiveUid, mLiveTypeVal, 1);
|
SocketRyChatUtil.sendUpdateVotesMessage(mLiveUid, mLiveTypeVal, 1);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
// if (isRy == false) {
|
||||||
if (isRy == false) {
|
// SocketChatUtil.getFakeFans(mLiveUid);
|
||||||
SocketChatUtil.getFakeFans(mLiveUid);
|
// } else {
|
||||||
} else {
|
|
||||||
SocketRyChatUtil.getFakeFans(mLiveUid);
|
SocketRyChatUtil.getFakeFans(mLiveUid);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -333,6 +327,8 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBuyLiangName(LiveReceiveGiftBean bean) {
|
public void onBuyLiangName(LiveReceiveGiftBean bean) {
|
||||||
if (mLiveRoomViewHolder != null) {
|
if (mLiveRoomViewHolder != null) {
|
||||||
@ -364,15 +360,15 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onSendGiftPk(long leftGift, long rightGift, LivePKUserListBean bean) {
|
public void onSendGiftPk(long leftGift, long rightGift, LivePKUserListBean bean) {
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
if (mLiveLinkMicPkPresenter != null) {
|
// if (mLiveLinkMicPkPresenter != null) {
|
||||||
mLiveLinkMicPkPresenter.onPkProgressChanged(leftGift, rightGift, bean);
|
// mLiveLinkMicPkPresenter.onPkProgressChanged(leftGift, rightGift, bean);
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
if (mLiveRyLinkMicPkPresenter != null) {
|
if (mLiveRyLinkMicPkPresenter != null) {
|
||||||
mLiveRyLinkMicPkPresenter.onPkProgressChanged(leftGift, rightGift, bean);
|
mLiveRyLinkMicPkPresenter.onPkProgressChanged(leftGift, rightGift, bean);
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -615,21 +611,21 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onLinkMicAnchorClose() {
|
public void onLinkMicAnchorClose() {
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
if (mLiveLinkMicAnchorPresenter != null) {
|
// if (mLiveLinkMicAnchorPresenter != null) {
|
||||||
mLiveLinkMicAnchorPresenter.onLinkMicAnchorClose();
|
// mLiveLinkMicAnchorPresenter.onLinkMicAnchorClose();
|
||||||
}
|
// }
|
||||||
if (mLiveLinkMicPkPresenter != null) {
|
// if (mLiveLinkMicPkPresenter != null) {
|
||||||
mLiveLinkMicPkPresenter.onLinkMicPkClose(1);
|
// mLiveLinkMicPkPresenter.onLinkMicPkClose(1);
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
if (mLiveLinkMicAnchorPresenter != null) {
|
if (mLiveLinkMicAnchorPresenter != null) {
|
||||||
mLiveLinkMicAnchorPresenter.onLinkMicAnchorClose();
|
mLiveLinkMicAnchorPresenter.onLinkMicAnchorClose();
|
||||||
}
|
}
|
||||||
if (mLiveRyLinkMicPkPresenter != null) {
|
if (mLiveRyLinkMicPkPresenter != null) {
|
||||||
mLiveRyLinkMicPkPresenter.onLinkMicPkClose(1);
|
mLiveRyLinkMicPkPresenter.onLinkMicPkClose(1);
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
if (this instanceof LiveAudienceActivity) {
|
if (this instanceof LiveAudienceActivity) {
|
||||||
@ -688,23 +684,23 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
@Override
|
@Override
|
||||||
public void onLinkMicPkStart(final String pkUid, final String pkhead, final String pkname) {
|
public void onLinkMicPkStart(final String pkUid, final String pkhead, final String pkname) {
|
||||||
Log.e("ry", "pkUid" + pkUid + "pkhead" + pkhead + "pkname" + pkname);
|
Log.e("ry", "pkUid" + pkUid + "pkhead" + pkhead + "pkname" + pkname);
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
if (mLiveLinkMicPkPresenter != null && mLiveRoomViewHolder != null) {
|
// if (mLiveLinkMicPkPresenter != null && mLiveRoomViewHolder != null) {
|
||||||
mLiveLinkMicPkPresenter.onLinkMicPkStart(pkUid, pkhead, pkname);
|
// mLiveLinkMicPkPresenter.onLinkMicPkStart(pkUid, pkhead, pkname);
|
||||||
Handler handler = new Handler();
|
// Handler handler = new Handler();
|
||||||
handler.postDelayed(new Runnable() {
|
// handler.postDelayed(new Runnable() {
|
||||||
@Override
|
// @Override
|
||||||
public void run() {
|
// public void run() {
|
||||||
if (mLiveRoomViewHolder != null) {
|
// if (mLiveRoomViewHolder != null) {
|
||||||
if (mIsAnchor == false) {
|
// if (mIsAnchor == false) {
|
||||||
mLiveRoomViewHolder.setOtherInfo(pkUid, pkhead, pkname);
|
// mLiveRoomViewHolder.setOtherInfo(pkUid, pkhead, pkname);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}, 4000);//3秒后执行Runnable中的run方法
|
// }, 4000);//3秒后执行Runnable中的run方法
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
if (mLiveRyLinkMicPkPresenter != null && mLiveRoomViewHolder != null) {
|
if (mLiveRyLinkMicPkPresenter != null && mLiveRoomViewHolder != null) {
|
||||||
mLiveRyLinkMicPkPresenter.onLinkMicPkStart(pkUid, 1);
|
mLiveRyLinkMicPkPresenter.onLinkMicPkStart(pkUid, 1);
|
||||||
Handler handler = new Handler();
|
Handler handler = new Handler();
|
||||||
@ -721,7 +717,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
}, 4000);//3秒后执行Runnable中的run方法
|
}, 4000);//3秒后执行Runnable中的run方法
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -730,16 +726,16 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onLinkMicPkClose(int i) {
|
public void onLinkMicPkClose(int i) {
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
if (mLiveLinkMicPkPresenter != null) {
|
// if (mLiveLinkMicPkPresenter != null) {
|
||||||
mLiveLinkMicPkPresenter.onLinkMicPkClose(i);
|
// mLiveLinkMicPkPresenter.onLinkMicPkClose(i);
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
if (mLiveRyLinkMicPkPresenter != null) {
|
if (mLiveRyLinkMicPkPresenter != null) {
|
||||||
mLiveRyLinkMicPkPresenter.onLinkMicPkClose(i);
|
mLiveRyLinkMicPkPresenter.onLinkMicPkClose(i);
|
||||||
} else if (mLiveLinkMicPkPresenter != null) {
|
} else if (mLiveLinkMicPkPresenter != null) {
|
||||||
mLiveLinkMicPkPresenter.onLinkMicPkClose(i);
|
mLiveLinkMicPkPresenter.onLinkMicPkClose(i);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -772,12 +768,12 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onLinkMicPkEnd(String winUid) {
|
public void onLinkMicPkEnd(String winUid) {
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
if (mLiveLinkMicPkPresenter != null) {
|
// if (mLiveLinkMicPkPresenter != null) {
|
||||||
mLiveLinkMicPkPresenter.onLinkMicPkEnd(winUid);
|
// mLiveLinkMicPkPresenter.onLinkMicPkEnd(winUid);
|
||||||
mLiveRoomViewHolder.setDelOtherInfo();
|
// mLiveRoomViewHolder.setDelOtherInfo();
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
if (mLiveRyLinkMicPkPresenter != null) {
|
if (mLiveRyLinkMicPkPresenter != null) {
|
||||||
mLiveRyLinkMicPkPresenter.onLinkMicPkEnd(winUid);
|
mLiveRyLinkMicPkPresenter.onLinkMicPkEnd(winUid);
|
||||||
mLiveRoomViewHolder.setDelOtherInfo();
|
mLiveRoomViewHolder.setDelOtherInfo();
|
||||||
@ -785,7 +781,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
mLiveLinkMicPkPresenter.onLinkMicPkEnd(winUid);
|
mLiveLinkMicPkPresenter.onLinkMicPkEnd(winUid);
|
||||||
mLiveRoomViewHolder.setDelOtherInfo();
|
mLiveRoomViewHolder.setDelOtherInfo();
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -908,7 +904,6 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发 弹幕 消息
|
* 发 弹幕 消息
|
||||||
*/
|
*/
|
||||||
@ -939,11 +934,11 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
onCoinChanged(coin);
|
onCoinChanged(coin);
|
||||||
}
|
}
|
||||||
String[] data = new String[]{obj.getString("barragetoken")};
|
String[] data = new String[]{obj.getString("barragetoken")};
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
SocketChatUtil.sendDanmuMessage(mLiveUid, contents);
|
// SocketChatUtil.sendDanmuMessage(mLiveUid, contents);
|
||||||
} else {
|
// } else {
|
||||||
SocketRyChatUtil.sendDanmuMessage(mLiveUid, contents);
|
SocketRyChatUtil.sendDanmuMessage(mLiveUid, contents);
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
ToastUtil.show(msg);
|
ToastUtil.show(msg);
|
||||||
}
|
}
|
||||||
@ -963,11 +958,11 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
int guardType = mLiveGuardInfo != null ? mLiveGuardInfo.getMyGuardType() : Constants.GUARD_TYPE_NONE;
|
int guardType = mLiveGuardInfo != null ? mLiveGuardInfo.getMyGuardType() : Constants.GUARD_TYPE_NONE;
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
SocketChatUtil.sendChatMessage(mLiveUid, content, mIsAnchor, mSocketUserType, guardType);
|
// SocketChatUtil.sendChatMessage(mLiveUid, content, mIsAnchor, mSocketUserType, guardType);
|
||||||
} else {
|
// } else {
|
||||||
SocketRyChatUtil.sendChatMessage(mLiveUid, content, mIsAnchor, mSocketUserType, guardType);
|
SocketRyChatUtil.sendChatMessage(mLiveUid, content, mIsAnchor, mSocketUserType, guardType);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -975,7 +970,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
*/
|
*/
|
||||||
public static void sendSystemMessage(String content) {
|
public static void sendSystemMessage(String content) {
|
||||||
// if (isRy == false) {
|
// if (isRy == false) {
|
||||||
SocketChatUtil.sendSystemMessage(mLiveUid, content);
|
// SocketChatUtil.sendSystemMessage(mLiveUid, content);
|
||||||
// } else {
|
// } else {
|
||||||
SocketRyChatUtil.sendSystemMessage(mLiveUid, content);
|
SocketRyChatUtil.sendSystemMessage(mLiveUid, content);
|
||||||
// }
|
// }
|
||||||
@ -988,11 +983,11 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
public void sendGiftMessage(LiveGiftBean giftBean, String giftToken, String ancherName, String by) {
|
public void sendGiftMessage(LiveGiftBean giftBean, String giftToken, String ancherName, String by) {
|
||||||
int guardType = mLiveGuardInfo != null ? mLiveGuardInfo.getMyGuardType() : Constants.GUARD_TYPE_NONE;
|
int guardType = mLiveGuardInfo != null ? mLiveGuardInfo.getMyGuardType() : Constants.GUARD_TYPE_NONE;
|
||||||
|
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
SocketChatUtil.sendGiftMessage(giftBean.getType(), giftToken, mLiveUid, ancherName, guardType, by);
|
// SocketChatUtil.sendGiftMessage(giftBean.getType(), giftToken, mLiveUid, ancherName, guardType, by);
|
||||||
} else {
|
// } else {
|
||||||
SocketRyChatUtil.sendGiftMessage(giftBean.getType(), giftToken, mLiveUid, ancherName, guardType, by);
|
SocketRyChatUtil.sendGiftMessage(giftBean.getType(), giftToken, mLiveUid, ancherName, guardType, by);
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1000,33 +995,33 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
* 主播或管理员踢人
|
* 主播或管理员踢人
|
||||||
*/
|
*/
|
||||||
public void kickUser(String toUid, String toName) {
|
public void kickUser(String toUid, String toName) {
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
SocketChatUtil.sendKickMessage(mLiveUid, toUid, toName);
|
// SocketChatUtil.sendKickMessage(mLiveUid, toUid, toName);
|
||||||
} else {
|
// } else {
|
||||||
SocketRyChatUtil.sendKickMessage(mLiveUid, toUid, toName);
|
SocketRyChatUtil.sendKickMessage(mLiveUid, toUid, toName);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 禁言
|
* 禁言
|
||||||
*/
|
*/
|
||||||
public void setShutUp(String toUid, String toName, int type) {
|
public void setShutUp(String toUid, String toName, int type) {
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
SocketChatUtil.sendShutUpMessage(mLiveUid, toUid, toName, type);
|
// SocketChatUtil.sendShutUpMessage(mLiveUid, toUid, toName, type);
|
||||||
} else {
|
// } else {
|
||||||
SocketRyChatUtil.sendShutUpMessage(mLiveUid, toUid, toName, type);
|
SocketRyChatUtil.sendShutUpMessage(mLiveUid, toUid, toName, type);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置或取消管理员消息
|
* 设置或取消管理员消息
|
||||||
*/
|
*/
|
||||||
public void sendSetAdminMessage(int action, String toUid, String toName) {
|
public void sendSetAdminMessage(int action, String toUid, String toName) {
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
SocketChatUtil.sendSetAdminMessage(mLiveUid, action, toUid, toName);
|
// SocketChatUtil.sendSetAdminMessage(mLiveUid, action, toUid, toName);
|
||||||
} else {
|
// } else {
|
||||||
SocketRyChatUtil.sendSetAdminMessage(mLiveUid, action, toUid, toName);
|
SocketRyChatUtil.sendSetAdminMessage(mLiveUid, action, toUid, toName);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1034,22 +1029,22 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
* 超管关闭直播间
|
* 超管关闭直播间
|
||||||
*/
|
*/
|
||||||
public void superCloseRoom() {
|
public void superCloseRoom() {
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
SocketChatUtil.superCloseRoom(mLiveUid);
|
// SocketChatUtil.superCloseRoom(mLiveUid);
|
||||||
} else {
|
// } else {
|
||||||
SocketRyChatUtil.superCloseRoom(mLiveUid);
|
SocketRyChatUtil.superCloseRoom(mLiveUid);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新主播映票数
|
* 更新主播映票数
|
||||||
*/
|
*/
|
||||||
public void sendUpdateVotesMessage(int deltaVal) {
|
public void sendUpdateVotesMessage(int deltaVal) {
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
SocketChatUtil.sendUpdateVotesMessage(mLiveUid, deltaVal);
|
// SocketChatUtil.sendUpdateVotesMessage(mLiveUid, deltaVal);
|
||||||
} else {
|
// } else {
|
||||||
SocketRyChatUtil.sendUpdateVotesMessage(mLiveUid, deltaVal);
|
SocketRyChatUtil.sendUpdateVotesMessage(mLiveUid, deltaVal);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1057,20 +1052,20 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
* 发送购买守护成功消息
|
* 发送购买守护成功消息
|
||||||
*/
|
*/
|
||||||
public void sendBuyGuardMessage(String votes, int guardNum, int guardType) {
|
public void sendBuyGuardMessage(String votes, int guardNum, int guardType) {
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
SocketChatUtil.sendBuyGuardMessage(mLiveUid, votes, guardNum, guardType);
|
// SocketChatUtil.sendBuyGuardMessage(mLiveUid, votes, guardNum, guardType);
|
||||||
} else {
|
// } else {
|
||||||
SocketRyChatUtil.sendBuyGuardMessage(mLiveUid, votes, guardNum, guardType);
|
SocketRyChatUtil.sendBuyGuardMessage(mLiveUid, votes, guardNum, guardType);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendBuyGuardMessage2(String votes, int guardNum, int guardType, String ancherName, String liveId) {
|
public void sendBuyGuardMessage2(String votes, int guardNum, int guardType, String ancherName, String liveId) {
|
||||||
if (guardType != 1) {
|
if (guardType != 1) {
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
SocketChatUtil.sendBuyGuardMessage2(mLiveUid, votes, guardNum, guardType, ancherName, liveId);
|
// SocketChatUtil.sendBuyGuardMessage2(mLiveUid, votes, guardNum, guardType, ancherName, liveId);
|
||||||
} else {
|
// } else {
|
||||||
SocketRyChatUtil.sendBuyGuardMessage2(mLiveUid, votes, guardNum, guardType, ancherName, liveId);
|
SocketRyChatUtil.sendBuyGuardMessage2(mLiveUid, votes, guardNum, guardType, ancherName, liveId);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1078,11 +1073,11 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
* 发送发红包成功消息
|
* 发送发红包成功消息
|
||||||
*/
|
*/
|
||||||
public void sendRedPackMessage() {
|
public void sendRedPackMessage() {
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
SocketChatUtil.sendRedPackMessage(mLiveUid);
|
// SocketChatUtil.sendRedPackMessage(mLiveUid);
|
||||||
} else {
|
// } else {
|
||||||
SocketRyChatUtil.sendRedPackMessage(mLiveUid);
|
SocketRyChatUtil.sendRedPackMessage(mLiveUid);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1214,7 +1209,6 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监听关注变化事件
|
* 监听关注变化事件
|
||||||
*/
|
*/
|
||||||
@ -1225,6 +1219,9 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
mLiveRoomViewHolder.setAttention(e.getIsAttention());
|
mLiveRoomViewHolder.setAttention(e.getIsAttention());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this instanceof LiveAudienceActivity) {
|
||||||
|
((LiveAudienceActivity) this).onFollowEvent(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1304,6 +1301,23 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
fragment.show(getSupportFragmentManager(), "LiveHotDialogFragment");
|
fragment.show(getSupportFragmentManager(), "LiveHotDialogFragment");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开购买新版守护的弹窗
|
||||||
|
*/
|
||||||
|
public void openNewBuyGuardWindow() {
|
||||||
|
if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream) || mLiveGuardInfo == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
LiveNewGuardBuyDialogFragment fragment = new LiveNewGuardBuyDialogFragment();
|
||||||
|
fragment.setLiveGuardInfo(mLiveGuardInfo);
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putString(Constants.COIN_NAME, mCoinName);
|
||||||
|
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||||
|
bundle.putString(Constants.LIVE_ANCHER_NAME, mAncherName);
|
||||||
|
bundle.putString(Constants.STREAM, mStream);
|
||||||
|
fragment.setArguments(bundle);
|
||||||
|
fragment.show(getSupportFragmentManager(), "LiveGuardBuyDialogFragment");
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 打开购买守护的弹窗
|
* 打开购买守护的弹窗
|
||||||
*/
|
*/
|
||||||
|
@ -4,11 +4,12 @@ import android.app.Dialog;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import androidx.fragment.app.DialogFragment;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.fragment.app.DialogFragment;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.lzy.okgo.callback.Callback;
|
import com.lzy.okgo.callback.Callback;
|
||||||
@ -122,7 +123,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
|
|||||||
@Override
|
@Override
|
||||||
protected void main() {
|
protected void main() {
|
||||||
super.main();
|
super.main();
|
||||||
isRy = false;
|
// isRy = false;
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
mLiveSDK = intent.getIntExtra(Constants.LIVE_SDK, Constants.LIVE_SDK_KSY);
|
mLiveSDK = intent.getIntExtra(Constants.LIVE_SDK, Constants.LIVE_SDK_KSY);
|
||||||
mLiveKsyConfigBean = intent.getParcelableExtra(Constants.LIVE_KSY_CONFIG);
|
mLiveKsyConfigBean = intent.getParcelableExtra(Constants.LIVE_KSY_CONFIG);
|
||||||
@ -170,7 +171,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
|
|||||||
mLiveReadyViewHolder.addToParent();
|
mLiveReadyViewHolder.addToParent();
|
||||||
mLiveReadyViewHolder.subscribeActivityLifeCycle();
|
mLiveReadyViewHolder.subscribeActivityLifeCycle();
|
||||||
mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePushViewHolder, true, mLiveSDK, mContainer);
|
mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePushViewHolder, true, mLiveSDK, mContainer);
|
||||||
mLiveLinkMicPresenter.setLiveUid(mLiveUid);
|
// mLiveLinkMicPresenter.setLiveUid(mLiveUid);
|
||||||
mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePushViewHolder, true, mLiveSDK, mContainer);
|
mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePushViewHolder, true, mLiveSDK, mContainer);
|
||||||
mLiveLinkMicPkPresenter = new LiveLinkMicPkPresenter(mContext, mLivePushViewHolder, true, mContainer);
|
mLiveLinkMicPkPresenter = new LiveLinkMicPkPresenter(mContext, mLivePushViewHolder, true, mContainer);
|
||||||
}
|
}
|
||||||
@ -413,7 +414,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
|
|||||||
hasGame = mGameList.size() > 0;
|
hasGame = mGameList.size() > 0;
|
||||||
}
|
}
|
||||||
bundle.putBoolean(Constants.HAS_GAME, hasGame);
|
bundle.putBoolean(Constants.HAS_GAME, hasGame);
|
||||||
bundle.putBoolean("isRy", false);
|
// bundle.putBoolean("isRy", true);
|
||||||
bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen());
|
bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen());
|
||||||
fragment.setArguments(bundle);
|
fragment.setArguments(bundle);
|
||||||
fragment.setFunctionClickListener(this);
|
fragment.setFunctionClickListener(this);
|
||||||
@ -597,30 +598,30 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
if (isRy == false) {
|
// if (isRy == false) {
|
||||||
SocketChatUtil.closeLive(mLiveUid, mSocketClient);
|
// SocketChatUtil.closeLive(mLiveUid, mSocketClient);
|
||||||
|
//
|
||||||
//断开socket
|
// //断开socket
|
||||||
if (mSocketClient != null) {
|
// if (mSocketClient != null) {
|
||||||
mSocketClient.disConnect();
|
// mSocketClient.disConnect();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (LivePushTxViewHolder.mTRTCCloud != null) {
|
// if (LivePushTxViewHolder.mTRTCCloud != null) {
|
||||||
|
//
|
||||||
LivePushTxViewHolder.mTRTCCloud.exitRoom();
|
// LivePushTxViewHolder.mTRTCCloud.exitRoom();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (LiveLinkMicPkPresenter.mTRTCCloud1 != null) {
|
// if (LiveLinkMicPkPresenter.mTRTCCloud1 != null) {
|
||||||
LiveLinkMicPkPresenter.mTRTCCloud1.exitRoom();
|
// LiveLinkMicPkPresenter.mTRTCCloud1.exitRoom();
|
||||||
LiveLinkMicPkPresenter.mTRTCCloud1.stopLocalPreview();
|
// LiveLinkMicPkPresenter.mTRTCCloud1.stopLocalPreview();
|
||||||
}
|
// }
|
||||||
if (LivePushTxViewHolder.mTRTCCloud != null) {
|
// if (LivePushTxViewHolder.mTRTCCloud != null) {
|
||||||
|
//
|
||||||
LivePushTxViewHolder.mTRTCCloud.exitRoom();
|
// LivePushTxViewHolder.mTRTCCloud.exitRoom();
|
||||||
LivePushTxViewHolder.mTRTCCloud.stopLocalPreview();
|
// LivePushTxViewHolder.mTRTCCloud.stopLocalPreview();
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
// SocketRyChatUtil.closeLive(mLiveUid, mSocketRyClient);
|
// SocketRyChatUtil.closeLive(mLiveUid, mSocketRyClient);
|
||||||
//断开socket
|
//断开socket
|
||||||
if (mSocketRyClient != null) {
|
if (mSocketRyClient != null) {
|
||||||
@ -644,7 +645,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
|
|||||||
}
|
}
|
||||||
mLivePushViewHolder = null;
|
mLivePushViewHolder = null;
|
||||||
mLiveLinkMicPresenter = null;
|
mLiveLinkMicPresenter = null;
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
ToastUtil.show(msg);
|
ToastUtil.show(msg);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.yunbao.live.activity;
|
package com.yunbao.live.activity;
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
@ -30,6 +29,7 @@ import com.yunbao.common.bean.SlideInfoModel;
|
|||||||
import com.yunbao.common.bean.UserBean;
|
import com.yunbao.common.bean.UserBean;
|
||||||
import com.yunbao.common.dialog.EffectsSettingsDialog;
|
import com.yunbao.common.dialog.EffectsSettingsDialog;
|
||||||
import com.yunbao.common.dialog.LiveChargeDialogFragment;
|
import com.yunbao.common.dialog.LiveChargeDialogFragment;
|
||||||
|
import com.yunbao.common.event.FollowEvent;
|
||||||
import com.yunbao.common.http.CommonHttpConsts;
|
import com.yunbao.common.http.CommonHttpConsts;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
@ -61,28 +61,15 @@ import com.yunbao.live.event.LiveRoomChangeEvent;
|
|||||||
import com.yunbao.live.http.LiveHttpConsts;
|
import com.yunbao.live.http.LiveHttpConsts;
|
||||||
import com.yunbao.live.http.LiveHttpUtil;
|
import com.yunbao.live.http.LiveHttpUtil;
|
||||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||||
import com.yunbao.live.socket.SocketSendBean;
|
|
||||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
|
||||||
import com.yunbao.live.views.LiveRoomPlayViewHolder;
|
import com.yunbao.live.views.LiveRoomPlayViewHolder;
|
||||||
import com.yunbao.live.views.LoadingView;
|
|
||||||
import com.yunbao.live.views.PortraitLiveManager;
|
import com.yunbao.live.views.PortraitLiveManager;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cn.rongcloud.rtc.api.RCRTCEngine;
|
|
||||||
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
|
|
||||||
import cn.rongcloud.rtc.api.callback.IRCRTCSwitchRoleCallback;
|
|
||||||
import cn.rongcloud.rtc.base.RTCErrorCode;
|
|
||||||
import io.rong.imlib.IRongCallback;
|
|
||||||
import io.rong.imlib.RongIMClient;
|
|
||||||
import io.rong.imlib.model.Conversation;
|
|
||||||
import io.rong.message.TextMessage;
|
|
||||||
|
|
||||||
import static com.yunbao.live.views.LivePlayRyViewHolder.Micing;
|
import static com.yunbao.live.views.LivePlayRyViewHolder.Micing;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,7 +98,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
public static int fansNum;
|
public static int fansNum;
|
||||||
|
|
||||||
public static ProcessResultUtil mProcessResultUtil;
|
public static ProcessResultUtil mProcessResultUtil;
|
||||||
private LiveImDeletUtil liveImDeletUtil;
|
|
||||||
public static int isattention;
|
public static int isattention;
|
||||||
|
|
||||||
private LiveBean mLiveBean;
|
private LiveBean mLiveBean;
|
||||||
@ -121,7 +108,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
private int mLastPosition = -1;
|
private int mLastPosition = -1;
|
||||||
|
|
||||||
private ViewGroup mViewGroup;
|
private ViewGroup mViewGroup;
|
||||||
private LoadingView loadingView;
|
private int liveBg = 0;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -140,7 +127,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
Bus.getOn(this);
|
Bus.getOn(this);
|
||||||
super.main();
|
super.main();
|
||||||
liveAudienceActivity = this;
|
liveAudienceActivity = this;
|
||||||
liveImDeletUtil = new LiveImDeletUtil();
|
|
||||||
mProcessResultUtil = new ProcessResultUtil(this);
|
mProcessResultUtil = new ProcessResultUtil(this);
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
mLiveSDK = intent.getIntExtra(Constants.LIVE_SDK, Constants.LIVE_SDK_KSY);
|
mLiveSDK = intent.getIntExtra(Constants.LIVE_SDK, Constants.LIVE_SDK_KSY);
|
||||||
@ -150,11 +137,6 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
mLiveBean = intent.getParcelableExtra(Constants.LIVE_BEAN);
|
mLiveBean = intent.getParcelableExtra(Constants.LIVE_BEAN);
|
||||||
mLiveUid = mLiveBean.getUid();
|
mLiveUid = mLiveBean.getUid();
|
||||||
mStream = mLiveBean.getStream();
|
mStream = mLiveBean.getStream();
|
||||||
if (getIntent().getIntExtra("isry", 0) == 1) {
|
|
||||||
isRy = true;
|
|
||||||
} else {
|
|
||||||
isRy = false;
|
|
||||||
}
|
|
||||||
setVolumeControlStream(AudioManager.STREAM_MUSIC);
|
setVolumeControlStream(AudioManager.STREAM_MUSIC);
|
||||||
manager = new PortraitLiveManager(this, intent);
|
manager = new PortraitLiveManager(this, intent);
|
||||||
initView();
|
initView();
|
||||||
@ -167,8 +149,6 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
private void initView() {
|
private void initView() {
|
||||||
// 竖直滑动 ViewPager
|
// 竖直滑动 ViewPager
|
||||||
verticalViewPager = findViewById(R.id.view_pager);
|
verticalViewPager = findViewById(R.id.view_pager);
|
||||||
loadingView = findViewById(R.id.loading);
|
|
||||||
loadingView.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBackIndex(int backIndex) {
|
public void setBackIndex(int backIndex) {
|
||||||
@ -187,49 +167,35 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
* 初始化数据
|
* 初始化数据
|
||||||
*/
|
*/
|
||||||
private void initData() {
|
private void initData() {
|
||||||
//直播间列表
|
|
||||||
MainNetManager.get(mContext)
|
|
||||||
.anchorRecommend("30", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(AnchorRecommendModel data) {
|
|
||||||
itemModelList = data.getList();
|
|
||||||
//查询直播间状态
|
|
||||||
int index = -1;
|
|
||||||
for (int i = 0; i < itemModelList.size(); i++) {
|
|
||||||
AnchorRecommendItemModel model = itemModelList.get(i);
|
|
||||||
if (TextUtils.equals(mLiveBean.getUid(), model.getUid())) {
|
|
||||||
index = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (index > -1) {
|
|
||||||
Collections.swap(itemModelList, index, 0);
|
|
||||||
} else {
|
|
||||||
String json = GsonUtils.toJson(mLiveBean);
|
String json = GsonUtils.toJson(mLiveBean);
|
||||||
AnchorRecommendItemModel model = GsonUtils.fromJson(json, AnchorRecommendItemModel.class);
|
AnchorRecommendItemModel model = GsonUtils.fromJson(json, AnchorRecommendItemModel.class);
|
||||||
itemModelList.add(0, model);
|
itemModelList.add(0, model);
|
||||||
}
|
|
||||||
mPagerAdapter = new VerticalPagerAdapter(itemModelList, mContext);
|
mPagerAdapter = new VerticalPagerAdapter(itemModelList, mContext);
|
||||||
verticalViewPager.setAdapter(mPagerAdapter);
|
verticalViewPager.setAdapter(mPagerAdapter);
|
||||||
loadingView.hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(String error) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
verticalViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
|
verticalViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||||
|
|
||||||
|
if (Micing == 1) {
|
||||||
|
|
||||||
|
manager.micIngTypeOne(mLiveBean, mLiveType, mLiveTypeVal);
|
||||||
|
verticalViewPager.setEnableScroll(false);
|
||||||
|
} else if (Micing == 2) {
|
||||||
|
verticalViewPager.setEnableScroll(false);
|
||||||
|
manager.micIngTypeTwo(mLiveBean, mLiveType, mLiveTypeVal);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
verticalViewPager.setEnableScroll(true);
|
||||||
mCurrentItem = position;
|
mCurrentItem = position;
|
||||||
Log.e(TAG, "mCurrentItem:" + mCurrentItem);
|
Log.e(TAG, "mCurrentItem:" + mCurrentItem);
|
||||||
if (mCurrentItem == itemModelList.size() - 1) {
|
if (mCurrentItem == itemModelList.size() - 1) {
|
||||||
MainNetManager.get(mContext)
|
MainNetManager.get(mContext)
|
||||||
.anchorRecommend("30", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
.anchorRecommendType("30", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(AnchorRecommendModel data) {
|
public void onSuccess(AnchorRecommendModel data) {
|
||||||
|
if (TextUtils.equals(data.getList().get(0).getUid(), mLiveBean.getUid())) {
|
||||||
|
data.getList().remove(0);
|
||||||
|
}
|
||||||
itemModelList.addAll(data.getList());
|
itemModelList.addAll(data.getList());
|
||||||
mPagerAdapter.notifyDataSetChanged();
|
mPagerAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
@ -241,6 +207,9 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageSelected(int position) {
|
public void onPageSelected(int position) {
|
||||||
super.onPageSelected(position);
|
super.onPageSelected(position);
|
||||||
@ -266,7 +235,6 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
|
|
||||||
// 满足此种条件,表明需要加载直播视频,以及聊天室了
|
// 满足此种条件,表明需要加载直播视频,以及聊天室了
|
||||||
if (viewGroup.getId() == mCurrentItem && (position == 0) && mCurrentItem != mLastPosition) {
|
if (viewGroup.getId() == mCurrentItem && (position == 0) && mCurrentItem != mLastPosition) {
|
||||||
|
|
||||||
loadData(viewGroup, mCurrentItem);
|
loadData(viewGroup, mCurrentItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -443,115 +411,15 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
|
manager.onBackPressed();
|
||||||
if (Micing == 1) {
|
if (Micing == 1) {
|
||||||
DialogUitl.showSimpleDialog(mContext, "您已申請,退出將取消語音連麥申請!", new DialogUitl.SimpleCallback() {
|
manager.micIngTypeOne(mLiveBean, mLiveType, mLiveTypeVal);
|
||||||
@Override
|
|
||||||
public void onConfirmClick(Dialog dialog, String content) {
|
|
||||||
Micing = 0;
|
|
||||||
//用户申请联麦
|
|
||||||
final SocketSendBean msg = new SocketSendBean()
|
|
||||||
.param("_method_", Constants.LIAN_MAI)
|
|
||||||
.param("action", 7)
|
|
||||||
.param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName())
|
|
||||||
.param("avatar", CommonAppConfig.getInstance().getUserBean().getAvatar())
|
|
||||||
.param("uid", CommonAppConfig.getInstance().getUid());
|
|
||||||
msg.create();
|
|
||||||
|
|
||||||
String targetId = mLiveUid;
|
|
||||||
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
|
|
||||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
|
||||||
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent);
|
|
||||||
|
|
||||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
|
||||||
@Override
|
|
||||||
public void onAttached(io.rong.imlib.model.Message message) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(io.rong.imlib.model.Message message) {
|
|
||||||
Log.e("ry", "发送成功");
|
|
||||||
liveImDeletUtil.deleteMessages(message.getTargetId(), message.getMessageId());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(io.rong.imlib.model.Message message, RongIMClient.ErrorCode errorCode) {
|
|
||||||
Log.e("ry", "发送失敗" + errorCode.toString());
|
|
||||||
liveImDeletUtil.deleteMessages(message.getTargetId(), message.getMessageId());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
end();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
} else if (Micing == 2) {
|
} else if (Micing == 2) {
|
||||||
DialogUitl.showSimpleDialog(mContext, "連麥中,退出將斷開語音連麥!", new DialogUitl.SimpleCallback() {
|
manager.micIngTypeTwo(mLiveBean, mLiveType, mLiveTypeVal);
|
||||||
@Override
|
} else {
|
||||||
public void onConfirmClick(Dialog dialog, String content) {
|
super.onBackPressed();
|
||||||
ToastUtil.show("下麥中,稍等.....");
|
|
||||||
RCRTCEngine.getInstance().getRoom().getLocalUser().switchToAudience(new IRCRTCSwitchRoleCallback() {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当切换失败且SDK处于无法回退状态时回调,该角色已经无法使用当前角色继续进行音视频。
|
|
||||||
* SDK内部会退出房间并清理所有资源,该用户只能重新加入房间才能继续音视频。
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onKicked() {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess() {
|
|
||||||
Log.e("ry", "下麦成功");
|
|
||||||
// 该用户切换为观众成功,可以以观众身份进行音视频
|
|
||||||
//退出多人房间
|
|
||||||
HttpClient.getInstance().get("live.leaveDrLm", "live.leaveDrLm")
|
|
||||||
.params("roomid", LiveActivity.mLiveUid)
|
|
||||||
.execute(new HttpCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
Log.e("ry", code + "退出多人");
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//退出rtc播放
|
|
||||||
RCRTCEngine.getInstance().leaveRoom(new IRCRTCResultCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess() {
|
|
||||||
Log.e("ry", "退出多人房间成功");
|
|
||||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
Micing = 0;
|
|
||||||
end();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(RTCErrorCode errorCode) {
|
|
||||||
Log.e("ry", errorCode + "退出多人房间失敗");
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当切换失败且不影响当前角色继续音视频时回调
|
|
||||||
* @param errorCode 失败错误码
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onFailed(RTCErrorCode errorCode) {
|
|
||||||
Log.e("ry", "下麦失败" + errorCode);
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
end();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void end() {
|
public void end() {
|
||||||
@ -664,20 +532,34 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
fragment.show(getSupportFragmentManager(), "ChatChargeDialogFragment");
|
fragment.show(getSupportFragmentManager(), "ChatChargeDialogFragment");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setEnableScroll(boolean enableScroll) {
|
||||||
|
verticalViewPager.setEnableScroll(enableScroll);
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onLiveRoomChangeEvent(LiveRoomChangeEvent e) {
|
public void onLiveRoomChangeEvent(LiveRoomChangeEvent e) {
|
||||||
|
if (verticalViewPager.ismEnableScroll()) {
|
||||||
LiveBean liveBean = e.getLiveBean();
|
LiveBean liveBean = e.getLiveBean();
|
||||||
if (liveBean != null) {
|
if (liveBean != null) {
|
||||||
|
|
||||||
LiveHttpUtil.cancel(LiveHttpConsts.CHECK_LIVE);
|
LiveHttpUtil.cancel(LiveHttpConsts.CHECK_LIVE);
|
||||||
LiveHttpUtil.cancel(LiveHttpConsts.ENTER_ROOM);
|
LiveHttpUtil.cancel(LiveHttpConsts.ENTER_ROOM);
|
||||||
LiveHttpUtil.cancel(LiveHttpConsts.ROOM_CHARGE);
|
LiveHttpUtil.cancel(LiveHttpConsts.ROOM_CHARGE);
|
||||||
manager.onRemove();
|
manager.onRemove();
|
||||||
mLiveType = e.getLiveType();
|
mLiveType = e.getLiveType();
|
||||||
mLiveTypeVal = e.getLiveTypeVal();
|
mLiveTypeVal = e.getLiveTypeVal();
|
||||||
|
mLiveBean = liveBean;
|
||||||
|
mLiveUid = liveBean.getUid();
|
||||||
|
mStream = liveBean.getStream();
|
||||||
|
mAncherName = liveBean.getUserNiceName();
|
||||||
manager.onAdd(liveBean, mLiveType, mLiveTypeVal, mLiveSDK);
|
manager.onAdd(liveBean, mLiveType, mLiveTypeVal, mLiveSDK);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
verticalViewPager.setEnableScroll(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -698,11 +580,21 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case SIDEBAR:
|
case SIDEBAR:
|
||||||
|
int userIndex = -1;
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
if (TextUtils.equals(list.get(i).getUid(), PortraitLiveManager.liveID)) {
|
||||||
|
userIndex = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (userIndex != -1) {
|
||||||
|
list.remove(userIndex);
|
||||||
|
}
|
||||||
//从右边打开侧边栏
|
//从右边打开侧边栏
|
||||||
SidebarLiveAudience sidebarLiveAudience = new SidebarLiveAudience();
|
SidebarLiveAudience sidebarLiveAudience = new SidebarLiveAudience();
|
||||||
bundle.putString("Avatar", mLiveBean.getAvatar());
|
bundle.putString("Avatar", mLiveBean.getAvatar());
|
||||||
bundle.putString("banner", GsonUtils.toJson(slideInfoModels));
|
bundle.putString("banner", GsonUtils.toJson(slideInfoModels));
|
||||||
bundle.putString("list", GsonUtils.toJson(list));
|
bundle.putString("list", GsonUtils.toJson(list));
|
||||||
|
bundle.putInt("LiveBg", liveBg);
|
||||||
sidebarLiveAudience.setArguments(bundle);
|
sidebarLiveAudience.setArguments(bundle);
|
||||||
sidebarLiveAudience.show(getSupportFragmentManager(), "SidebarLiveAudience");
|
sidebarLiveAudience.show(getSupportFragmentManager(), "SidebarLiveAudience");
|
||||||
// manager.openDrawer();
|
// manager.openDrawer();
|
||||||
@ -773,6 +665,11 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
ZhuangBanActivity.forward(mContext, nobleUrl, false);
|
ZhuangBanActivity.forward(mContext, nobleUrl, false);
|
||||||
break;
|
break;
|
||||||
case LIAN_MAI:
|
case LIAN_MAI:
|
||||||
|
if (event.getMicIng() == 1) {
|
||||||
|
manager.micIngTypeOne(event.getBean(), event.getLiveType(), event.getLiveTypeVal());
|
||||||
|
} else if (event.getMicIng() == 2) {
|
||||||
|
manager.micIngTypeTwo(event.getBean(), event.getLiveType(), event.getLiveTypeVal());
|
||||||
|
} else {
|
||||||
//获取房间连麦状态
|
//获取房间连麦状态
|
||||||
HttpClient.getInstance().get("live.getDrLm", "live.getDrLm")
|
HttpClient.getInstance().get("live.getDrLm", "live.getDrLm")
|
||||||
.params("uid", mLiveUid, true)
|
.params("uid", mLiveUid, true)
|
||||||
@ -793,6 +690,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case EFFECTS_SETTINGS:
|
case EFFECTS_SETTINGS:
|
||||||
EffectsSettingsDialog effectsSettingsDialog = new EffectsSettingsDialog();
|
EffectsSettingsDialog effectsSettingsDialog = new EffectsSettingsDialog();
|
||||||
@ -821,6 +719,8 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
mLiveTypeVal : event.getParametersModel().getmLiveTypeVal();
|
mLiveTypeVal : event.getParametersModel().getmLiveTypeVal();
|
||||||
mLiveGuardInfo = event.getParametersModel().getmLiveGuardInfo() == null ?
|
mLiveGuardInfo = event.getParametersModel().getmLiveGuardInfo() == null ?
|
||||||
mLiveGuardInfo : event.getParametersModel().getmLiveGuardInfo();
|
mLiveGuardInfo : event.getParametersModel().getmLiveGuardInfo();
|
||||||
|
liveBg = TextUtils.equals(String.valueOf(liveBg), String.valueOf(event.getParametersModel().getLiveBg())) ?
|
||||||
|
liveBg : event.getParametersModel().getLiveBg();
|
||||||
break;
|
break;
|
||||||
case ACTIVITY_CENTER://活动中心
|
case ACTIVITY_CENTER://活动中心
|
||||||
String url = CommonAppConfig.HOST + "/h5/live/hallOfFame/index.html?g=Appapi&m=Turntable&a=tricky";
|
String url = CommonAppConfig.HOST + "/h5/live/hallOfFame/index.html?g=Appapi&m=Turntable&a=tricky";
|
||||||
@ -832,6 +732,20 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
intent.putExtra("isFull", true);
|
intent.putExtra("isFull", true);
|
||||||
mContext.startActivity(intent);
|
mContext.startActivity(intent);
|
||||||
break;
|
break;
|
||||||
|
case LIVE_ROOM_EXCEPTION:
|
||||||
|
//主播未直播时自动下滑至下一个直播间
|
||||||
|
itemModelList.remove(mCurrentPage);
|
||||||
|
mPagerAdapter.notifyDataSetChanged();
|
||||||
|
verticalViewPager.setCurrentItem(mCurrentPage + 1);
|
||||||
|
break;
|
||||||
|
case REFRESH_THE_LIVEl_PAGE:
|
||||||
|
// loadingView.show();
|
||||||
|
// AnchorRecommendItemModel model = event.getAnchorRecommendItemModel();
|
||||||
|
// itemModelList.add(0, model);
|
||||||
|
// mPagerAdapter.notifyDataSetChanged();
|
||||||
|
// verticalViewPager.setCurrentItem(0);
|
||||||
|
getDrawer();
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -855,7 +769,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
intent.putExtra(Constants.LIVE_SDK, liveSdk);
|
intent.putExtra(Constants.LIVE_SDK, liveSdk);
|
||||||
intent.putExtra(Constants.LIVE_SDK, liveSdk);
|
intent.putExtra(Constants.LIVE_SDK, liveSdk);
|
||||||
intent.putExtra("landscape", liveBean.getLandscape());
|
intent.putExtra("landscape", liveBean.getLandscape());
|
||||||
intent.putExtra("isry", liveBean.getIs_rong());
|
// intent.putExtra("isry", true);
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -866,26 +780,19 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||||
|
|
||||||
private void getDrawer() {
|
private void getDrawer() {
|
||||||
//侧边栏轮播
|
|
||||||
MainNetManager.get(mContext)
|
|
||||||
.getHot(1, new com.yunbao.common.http.base.HttpCallback<List<SlideInfoModel>>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<SlideInfoModel> data) {
|
|
||||||
slideInfoModels = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(String error) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//推荐位
|
//推荐位
|
||||||
MainNetManager.get(mContext)
|
MainNetManager.get(mContext)
|
||||||
.anchorRecommend("10", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
.anchorRecommend("12", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(AnchorRecommendModel anchorRecommendModel) {
|
public void onSuccess(AnchorRecommendModel anchorRecommendModel) {
|
||||||
list = anchorRecommendModel.getList();
|
list.clear();
|
||||||
|
slideInfoModels.clear();
|
||||||
|
List<AnchorRecommendItemModel> models = anchorRecommendModel.getList();
|
||||||
|
|
||||||
|
models.add(0, new AnchorRecommendItemModel());
|
||||||
|
list.addAll(models);
|
||||||
|
slideInfoModels = anchorRecommendModel.getSlide();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -894,4 +801,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onFollowEvent(FollowEvent e) {
|
||||||
|
manager.onFollowEvent(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
@Override
|
@Override
|
||||||
protected void main() {
|
protected void main() {
|
||||||
super.main();
|
super.main();
|
||||||
isRy = true;
|
// isRy = true;
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
mLiveSDK = intent.getIntExtra(Constants.LIVE_SDK, Constants.LIVE_SDK_KSY);
|
mLiveSDK = intent.getIntExtra(Constants.LIVE_SDK, Constants.LIVE_SDK_KSY);
|
||||||
mLiveKsyConfigBean = intent.getParcelableExtra(Constants.LIVE_KSY_CONFIG);
|
mLiveKsyConfigBean = intent.getParcelableExtra(Constants.LIVE_KSY_CONFIG);
|
||||||
@ -190,7 +190,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
mLiveReadyViewHolder.addToParent();
|
mLiveReadyViewHolder.addToParent();
|
||||||
mLiveReadyViewHolder.subscribeActivityLifeCycle();
|
mLiveReadyViewHolder.subscribeActivityLifeCycle();
|
||||||
mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePushViewHolder, true, mLiveSDK, mContainer);
|
mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePushViewHolder, true, mLiveSDK, mContainer);
|
||||||
mLiveLinkMicPresenter.setLiveUid(mLiveUid);
|
// mLiveLinkMicPresenter.setLiveUid(mLiveUid);
|
||||||
mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePushViewHolder, true, mLiveSDK, mContainer);
|
mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePushViewHolder, true, mLiveSDK, mContainer);
|
||||||
mLivePushViewHolder.setLivePushListener(new LivePushListener() {
|
mLivePushViewHolder.setLivePushListener(new LivePushListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -590,7 +590,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
hasGame = mGameList.size() > 0;
|
hasGame = mGameList.size() > 0;
|
||||||
}
|
}
|
||||||
bundle.putBoolean(Constants.HAS_GAME, hasGame);
|
bundle.putBoolean(Constants.HAS_GAME, hasGame);
|
||||||
bundle.putBoolean("isRy", true);
|
// bundle.putBoolean("isRy", true);
|
||||||
bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen());
|
bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen());
|
||||||
fragment.setArguments(bundle);
|
fragment.setArguments(bundle);
|
||||||
fragment.setFunctionClickListener(this);
|
fragment.setFunctionClickListener(this);
|
||||||
|
@ -36,6 +36,9 @@ public class GuardRightAdapter extends RecyclerView.Adapter<GuardRightAdapter.Vh
|
|||||||
// mColor2 = ContextCompat.getColor(context, R.color.gray3);
|
// mColor2 = ContextCompat.getColor(context, R.color.gray3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setList(List<GuardRightBean> mList) {
|
||||||
|
this.mList = mList;
|
||||||
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
|
@ -0,0 +1,109 @@
|
|||||||
|
package com.yunbao.live.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
import com.yunbao.live.R;
|
||||||
|
import com.yunbao.live.bean.GuardBuyBean;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 守护购买列表适配器
|
||||||
|
*/
|
||||||
|
public class LiveNewGuardBuyItemsAdapter extends RecyclerView.Adapter<LiveNewGuardBuyItemsAdapter.Vh> {
|
||||||
|
|
||||||
|
List<GuardBuyBean> items = new ArrayList<>();
|
||||||
|
private final Context context;
|
||||||
|
private int selectId = 1;
|
||||||
|
private OnItemSelectListener itemSelect;
|
||||||
|
|
||||||
|
public LiveNewGuardBuyItemsAdapter(Context context) {
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItems(List<GuardBuyBean> items) {
|
||||||
|
this.items = items;
|
||||||
|
}
|
||||||
|
public void setOnItemSelectListener(OnItemSelectListener listener){
|
||||||
|
this.itemSelect=listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
return new Vh(LayoutInflater.from(context).inflate(R.layout.item_dialog_guard_buy, parent, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull Vh holder, int position) {
|
||||||
|
GuardBuyBean bean = items.get(position);
|
||||||
|
holder.setData(bean, bean.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void changeItem(int id) {
|
||||||
|
this.selectId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return items.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected class Vh extends RecyclerView.ViewHolder {
|
||||||
|
private LinearLayout buyButton;
|
||||||
|
private TextView title;
|
||||||
|
private TextView msg;
|
||||||
|
private TextView coin;
|
||||||
|
|
||||||
|
public Vh(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
buyButton = itemView.findViewById(R.id.guard_buy_button);
|
||||||
|
title = itemView.findViewById(R.id.guard_buy_title);
|
||||||
|
msg = itemView.findViewById(R.id.guard_buy_goback);
|
||||||
|
coin = itemView.findViewById(R.id.guard_buy_money);
|
||||||
|
|
||||||
|
buyButton.setOnClickListener(view -> {
|
||||||
|
buyButton.setBackgroundResource(R.drawable.img_k_selected);
|
||||||
|
changeItem((int)title.getTag());
|
||||||
|
notifyDataSetChanged();
|
||||||
|
if(itemSelect!=null){
|
||||||
|
itemSelect.onSelectId((int)title.getTag());
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setData(GuardBuyBean bean, int id) {
|
||||||
|
String coin = bean.getCoin() + "";
|
||||||
|
title.setText(bean.getName());
|
||||||
|
title.setTag(id);
|
||||||
|
String msgText = WordUtil.getString(R.string.buy_guard_back_coin);
|
||||||
|
msg.setText(msgText + coin);
|
||||||
|
this.coin.setText(coin);
|
||||||
|
if(id==selectId){
|
||||||
|
buyButton.setBackgroundResource(R.drawable.img_k_selected);
|
||||||
|
}else {
|
||||||
|
buyButton.setBackgroundResource(R.drawable.img_k_uncheck);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于回调通知当前选择id
|
||||||
|
*/
|
||||||
|
public interface OnItemSelectListener {
|
||||||
|
void onSelectId(int id);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,109 @@
|
|||||||
|
package com.yunbao.live.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.yunbao.live.R;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直播间打招呼适配器
|
||||||
|
*/
|
||||||
|
public class LiveRoomFastMessageRecyclerViewAdapter extends RecyclerView.Adapter<LiveRoomFastMessageRecyclerViewAdapter.Vh> {
|
||||||
|
private Context context;
|
||||||
|
private List<String> items;
|
||||||
|
private OnSendMessageListener messageListener;
|
||||||
|
public LiveRoomFastMessageRecyclerViewAdapter(Context context) {
|
||||||
|
this.context = context;
|
||||||
|
this.items=new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置点击消息回调
|
||||||
|
* @param messageListener 消息回调
|
||||||
|
*/
|
||||||
|
public void setMessageListener(OnSendMessageListener messageListener) {
|
||||||
|
this.messageListener = messageListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加消息
|
||||||
|
* @param msg 消息
|
||||||
|
*/
|
||||||
|
public void addMessage(String msg){
|
||||||
|
items.add(msg);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加消息
|
||||||
|
* @param items 消息组
|
||||||
|
*/
|
||||||
|
public void setMessage(List<String> items){
|
||||||
|
this.items=items;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
return new Vh(LayoutInflater.from(context).inflate(R.layout.item_fast_msg,parent,false));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull Vh holder, int position) {
|
||||||
|
holder.setData(items.get(position));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return items.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected class Vh extends RecyclerView.ViewHolder{
|
||||||
|
private final TextView message;
|
||||||
|
|
||||||
|
public Vh(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
message=itemView.findViewById(R.id.room_fast_message_text_view);
|
||||||
|
ConstraintLayout layout = itemView.findViewById(R.id.room_fast_layout);
|
||||||
|
layout.setOnClickListener(view -> {
|
||||||
|
int position= getPosition((String) message.getTag());
|
||||||
|
if(position==-1){{
|
||||||
|
return;
|
||||||
|
}}
|
||||||
|
if(messageListener!=null){
|
||||||
|
messageListener.onMessage((String) message.getTag());
|
||||||
|
}
|
||||||
|
items.remove(position);
|
||||||
|
notifyItemRemoved(position);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
private int getPosition(String msg){
|
||||||
|
for (int i = 0; i < items.size(); i++) {
|
||||||
|
if(items.get(i).equals(msg)){
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
public void setData(String msg){
|
||||||
|
message.setTag(msg);
|
||||||
|
message.setText(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public interface OnSendMessageListener{
|
||||||
|
void onMessage(String msg);
|
||||||
|
}
|
||||||
|
}
|
@ -50,7 +50,7 @@ public class VerticalPagerAdapter extends androidx.viewpager.widget.PagerAdapter
|
|||||||
ImageView ivLoading = view.findViewById(R.id.iv_loading);
|
ImageView ivLoading = view.findViewById(R.id.iv_loading);
|
||||||
AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground();
|
AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground();
|
||||||
frameAnimation.start();
|
frameAnimation.start();
|
||||||
|
// ImgLoader.displayGif(mContext, R.drawable.live_loading, ivLoading);
|
||||||
view.setId(position);
|
view.setId(position);
|
||||||
container.addView(view);
|
container.addView(view);
|
||||||
return view;
|
return view;
|
||||||
|
@ -3,6 +3,8 @@ package com.yunbao.live.bean;
|
|||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/11/6.
|
* Created by cxf on 2018/11/6.
|
||||||
* 守护商品类型
|
* 守护商品类型
|
||||||
@ -67,4 +69,15 @@ public class GuardBuyBean {
|
|||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "GuardBuyBean{" +
|
||||||
|
"id=" + id +
|
||||||
|
", name='" + name + '\'' +
|
||||||
|
", type=" + type +
|
||||||
|
", coin=" + coin +
|
||||||
|
", privilege=" + Arrays.toString(privilege) +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,16 @@ public class OpenParametersModel extends BaseModel {
|
|||||||
//收费价格,计时收费每次扣费的值
|
//收费价格,计时收费每次扣费的值
|
||||||
private int mLiveTypeVal = 0;
|
private int mLiveTypeVal = 0;
|
||||||
private LiveGuardInfo mLiveGuardInfo = null;
|
private LiveGuardInfo mLiveGuardInfo = null;
|
||||||
|
private int liveBg = 0;
|
||||||
|
|
||||||
|
public int getLiveBg() {
|
||||||
|
return liveBg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OpenParametersModel setLiveBg(int liveBg) {
|
||||||
|
this.liveBg = liveBg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public int getmLiveType() {
|
public int getmLiveType() {
|
||||||
return mLiveType;
|
return mLiveType;
|
||||||
|
@ -24,7 +24,7 @@ import com.yunbao.live.interfaces.LiveFunctionClickListener;
|
|||||||
public class LiveFunctionDialogFragment extends AbsDialogFragment implements OnItemClickListener<Integer> {
|
public class LiveFunctionDialogFragment extends AbsDialogFragment implements OnItemClickListener<Integer> {
|
||||||
|
|
||||||
private LiveFunctionClickListener mFunctionClickListener;
|
private LiveFunctionClickListener mFunctionClickListener;
|
||||||
boolean isRy = false;
|
// boolean isRy = false;
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
return R.layout.dialog_live_function;
|
return R.layout.dialog_live_function;
|
||||||
@ -60,7 +60,7 @@ public class LiveFunctionDialogFragment extends AbsDialogFragment implements OnI
|
|||||||
if (bundle != null) {
|
if (bundle != null) {
|
||||||
hasGame = bundle.getBoolean(Constants.HAS_GAME, false);
|
hasGame = bundle.getBoolean(Constants.HAS_GAME, false);
|
||||||
openFlash = bundle.getBoolean(Constants.OPEN_FLASH, false);
|
openFlash = bundle.getBoolean(Constants.OPEN_FLASH, false);
|
||||||
isRy = bundle.getBoolean("isRy", false);
|
// isRy = bundle.getBoolean("isRy", false);
|
||||||
}
|
}
|
||||||
RecyclerView recyclerView = (RecyclerView) mRootView.findViewById(R.id.recyclerView);
|
RecyclerView recyclerView = (RecyclerView) mRootView.findViewById(R.id.recyclerView);
|
||||||
recyclerView.setHasFixedSize(true);
|
recyclerView.setHasFixedSize(true);
|
||||||
@ -85,11 +85,11 @@ public class LiveFunctionDialogFragment extends AbsDialogFragment implements OnI
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
mFunctionClickListener = null;
|
mFunctionClickListener = null;
|
||||||
if(isRy == false) {
|
// if(isRy == false) {
|
||||||
((LiveAnchorActivity) mContext).setBtnFunctionDark();
|
// ((LiveAnchorActivity) mContext).setBtnFunctionDark();
|
||||||
}else{
|
// }else{
|
||||||
((LiveRyAnchorActivity) mContext).setBtnFunctionDark();
|
((LiveRyAnchorActivity) mContext).setBtnFunctionDark();
|
||||||
}
|
// }
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,6 +93,12 @@ public class LiveGuardDialogFragment extends AbsDialogFragment implements View.O
|
|||||||
mTip = (TextView) mRootView.findViewById(R.id.tip);
|
mTip = (TextView) mRootView.findViewById(R.id.tip);
|
||||||
mBtnBuy = (TextView) mRootView.findViewById(R.id.btn_buy);
|
mBtnBuy = (TextView) mRootView.findViewById(R.id.btn_buy);
|
||||||
mBtnBuy.setOnClickListener(this);
|
mBtnBuy.setOnClickListener(this);
|
||||||
|
/* mBtnBuy.setOnLongClickListener(view -> {
|
||||||
|
//长按调用老版购买守护页面,调试用
|
||||||
|
dismiss();
|
||||||
|
((LiveActivity) mContext).openBuyGuardWindow();
|
||||||
|
return false;
|
||||||
|
});*/
|
||||||
if (mLiveGuardInfo != null) {
|
if (mLiveGuardInfo != null) {
|
||||||
mGuardNum.setText(WordUtil.getString(R.string.guard_guard) + "(" + mLiveGuardInfo.getGuardNum() + ")");
|
mGuardNum.setText(WordUtil.getString(R.string.guard_guard) + "(" + mLiveGuardInfo.getGuardNum() + ")");
|
||||||
int guardType = mLiveGuardInfo.getMyGuardType();
|
int guardType = mLiveGuardInfo.getMyGuardType();
|
||||||
@ -158,7 +164,7 @@ public class LiveGuardDialogFragment extends AbsDialogFragment implements View.O
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
dismiss();
|
dismiss();
|
||||||
((LiveActivity) mContext).openBuyGuardWindow();
|
((LiveActivity) mContext).openNewBuyGuardWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -212,7 +212,7 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
|
|||||||
public void onError(io.rong.imlib.model.Message message, RongIMClient.ErrorCode errorCode) {
|
public void onError(io.rong.imlib.model.Message message, RongIMClient.ErrorCode errorCode) {
|
||||||
Log.e("ry", "发送失敗" + errorCode.toString());
|
Log.e("ry", "发送失敗" + errorCode.toString());
|
||||||
liveImDeletUtil.deleteMessages(message.getTargetId(), message.getMessageId());
|
liveImDeletUtil.deleteMessages(message.getTargetId(), message.getMessageId());
|
||||||
}
|
}//BIZ_ERROR_DATABASE_ERROR
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ToastUtil.show(msg);
|
ToastUtil.show(msg);
|
||||||
|
@ -0,0 +1,316 @@
|
|||||||
|
package com.yunbao.live.dialog;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.Constants;
|
||||||
|
import com.yunbao.common.bean.UserBean;
|
||||||
|
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||||
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
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.R;
|
||||||
|
import com.yunbao.live.activity.LiveActivity;
|
||||||
|
import com.yunbao.live.adapter.GuardRightAdapter;
|
||||||
|
import com.yunbao.live.adapter.LiveNewGuardBuyItemsAdapter;
|
||||||
|
import com.yunbao.live.bean.GuardBuyBean;
|
||||||
|
import com.yunbao.live.bean.GuardRightBean;
|
||||||
|
import com.yunbao.live.bean.LiveGuardInfo;
|
||||||
|
import com.yunbao.live.http.LiveHttpConsts;
|
||||||
|
import com.yunbao.live.http.LiveHttpUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cxf on 2018/11/6.
|
||||||
|
* 直播间购买守护弹窗
|
||||||
|
* 改版后效果
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements View.OnClickListener {
|
||||||
|
|
||||||
|
private RecyclerView mRights;//权益列表
|
||||||
|
private RecyclerView mBuys;//购买列表
|
||||||
|
private TextView anchorName;
|
||||||
|
private TextView mCoin;
|
||||||
|
private String mCoinName;
|
||||||
|
private TextView mCoinNameTextView;
|
||||||
|
private View mBtnBuy;
|
||||||
|
private List<GuardRightBean> mRightList=new ArrayList<>();//权限列表
|
||||||
|
private List<GuardBuyBean> mBuyList;//商品列表
|
||||||
|
private long mCoinVal;//余额
|
||||||
|
private String mLiveUid;
|
||||||
|
private String mStream;
|
||||||
|
private String mAncherName;
|
||||||
|
private LiveGuardInfo mLiveGuardInfo;
|
||||||
|
private GuardBuyBean mTargetBuyBean;
|
||||||
|
|
||||||
|
private LiveNewGuardBuyItemsAdapter buyItemsAdapter;
|
||||||
|
private GuardRightAdapter mGuardRightAdapter;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.dialog_new_guard_buy;
|
||||||
|
}
|
||||||
|
|
||||||
|
@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.BOTTOM;
|
||||||
|
window.setAttributes(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLiveGuardInfo(LiveGuardInfo info) {
|
||||||
|
mLiveGuardInfo = info;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onActivityCreated(savedInstanceState);
|
||||||
|
|
||||||
|
mCoinNameTextView = mRootView.findViewById(R.id.guard_coin_name);
|
||||||
|
mCoin = mRootView.findViewById(R.id.guard_coin);
|
||||||
|
mBtnBuy = mRootView.findViewById(R.id.guard_btn_buy);
|
||||||
|
mRights = mRootView.findViewById(R.id.guard_rights);
|
||||||
|
mBuys = mRootView.findViewById(R.id.guard_buys);
|
||||||
|
anchorName = mRootView.findViewById(R.id.guard_anchor_name);
|
||||||
|
mBtnBuy.setOnClickListener(this);
|
||||||
|
mRights.setHasFixedSize(true);
|
||||||
|
mRights.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||||
|
mBuys.setHasFixedSize(true);
|
||||||
|
mBuys.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false){
|
||||||
|
@Override
|
||||||
|
public boolean canScrollHorizontally() {//购买列表禁止滑动
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mBuys.setItemViewCacheSize(3);
|
||||||
|
|
||||||
|
buyItemsAdapter = new LiveNewGuardBuyItemsAdapter(mContext);
|
||||||
|
mGuardRightAdapter = new GuardRightAdapter(mContext, mRightList);
|
||||||
|
mRights.setAdapter(mGuardRightAdapter);
|
||||||
|
mBuys.setAdapter(buyItemsAdapter);
|
||||||
|
buyItemsAdapter.setOnItemSelectListener(this::refreshList);
|
||||||
|
|
||||||
|
Bundle bundle = getArguments();
|
||||||
|
if (bundle != null) {
|
||||||
|
mLiveUid = bundle.getString(Constants.LIVE_UID);
|
||||||
|
mStream = bundle.getString(Constants.STREAM);
|
||||||
|
mAncherName=bundle.getString(Constants.LIVE_ANCHER_NAME);
|
||||||
|
String coinName = WordUtil.getString(R.string.diamond);
|
||||||
|
mCoinName = coinName;
|
||||||
|
mCoinNameTextView.setText(WordUtil.getString(R.string.guard_my) + coinName + ":");
|
||||||
|
anchorName.setText(String.format("成爲%s的守護", mAncherName));
|
||||||
|
}
|
||||||
|
LiveHttpUtil.getGuardBuyList(new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0 && info.length > 0) {
|
||||||
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
|
mRightList = JSON.parseArray(obj.getString("privilege"), GuardRightBean.class);
|
||||||
|
mBuyList = JSON.parseArray(obj.getString("list"), GuardBuyBean.class);
|
||||||
|
try {
|
||||||
|
mCoinVal = obj.getLongValue("coin");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
mCoin.setText(String.valueOf(mCoinVal));
|
||||||
|
buyItemsAdapter.setItems(mBuyList);
|
||||||
|
mGuardRightAdapter.setList(mRightList);
|
||||||
|
buyItemsAdapter.notifyDataSetChanged();
|
||||||
|
|
||||||
|
refreshList(1);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
ToastUtil.show(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void refreshList(int index) {
|
||||||
|
if (!mRightList.isEmpty()) {
|
||||||
|
GuardBuyBean guardBuyBean = mBuyList.get(index - 1);
|
||||||
|
mTargetBuyBean=guardBuyBean;
|
||||||
|
for (GuardRightBean bean : mRightList) {
|
||||||
|
bean.setChecked(false);
|
||||||
|
}
|
||||||
|
for (int i : guardBuyBean.getPrivilege()) {
|
||||||
|
mRightList.get(i).setChecked(true);
|
||||||
|
}
|
||||||
|
mGuardRightAdapter.notifyDataSetChanged();
|
||||||
|
mBtnBuy.setEnabled(mCoinVal >= guardBuyBean.getCoin());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
int i = view.getId();
|
||||||
|
if (i == R.id.guard_btn_buy) {
|
||||||
|
clickBuyGuard();
|
||||||
|
|
||||||
|
}
|
||||||
|
// else if (i == R.id.coin) {
|
||||||
|
// forwardMyCoin();
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跳转到我的钻石
|
||||||
|
*/
|
||||||
|
private void forwardMyCoin() {
|
||||||
|
dismiss();
|
||||||
|
RouteUtil.forwardMyCoin(mContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击购买守护按钮
|
||||||
|
*/
|
||||||
|
private void clickBuyGuard() {
|
||||||
|
if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream) || mLiveGuardInfo == null || mTargetBuyBean == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Log.d("ffffff", "" + mLiveGuardInfo.getMyGuardType() + " " + mTargetBuyBean.getType());
|
||||||
|
if (mLiveGuardInfo.getMyGuardType() == Constants.GUARD_TYPE_MONTH && mTargetBuyBean.getType() == Constants.GUARD_TYPE_DAY) {
|
||||||
|
DialogUitl.showSimpleTipDialog(mContext, WordUtil.getString(R.string.guard_buy_tip));
|
||||||
|
return;
|
||||||
|
} else if (mLiveGuardInfo.getMyGuardType() == Constants.GUARD_TYPE_YEAR && mTargetBuyBean.getType() == Constants.GUARD_TYPE_DAY) {
|
||||||
|
DialogUitl.showSimpleTipDialog(mContext, "您為當前主播的年守護無法開通周守護");
|
||||||
|
return;
|
||||||
|
} else if (mLiveGuardInfo.getMyGuardType() == Constants.GUARD_TYPE_YEAR && mTargetBuyBean.getType() == Constants.GUARD_TYPE_MONTH) {
|
||||||
|
DialogUitl.showSimpleTipDialog(mContext, "您為當前主播的年守護無法開通月守護");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
if (mLiveGuardInfo.getMyGuardType() == Constants.GUARD_TYPE_MONTH
|
||||||
|
&& mTargetBuyBean.getType() == Constants.GUARD_TYPE_YEAR) {
|
||||||
|
DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.guard_buy_tip_2), new DialogUitl.SimpleCallback() {
|
||||||
|
@Override
|
||||||
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
|
doBuyGuard();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
} else if (mLiveGuardInfo.getMyGuardType() == Constants.GUARD_TYPE_DAY
|
||||||
|
&& mTargetBuyBean.getType() == Constants.GUARD_TYPE_MONTH) {
|
||||||
|
DialogUitl.showSimpleDialog(mContext, "您為當前主播的周守護,開通月守護將覆蓋您的周守護時長,是否開通?", new DialogUitl.SimpleCallback() {
|
||||||
|
@Override
|
||||||
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
|
doBuyGuard();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
} else if (mLiveGuardInfo.getMyGuardType() == Constants.GUARD_TYPE_DAY
|
||||||
|
&& mTargetBuyBean.getType() == Constants.GUARD_TYPE_YEAR) {
|
||||||
|
DialogUitl.showSimpleDialog(mContext, "您為當前主播的周守護,開通年守護將覆蓋您的周守護時長,是否開通?", new DialogUitl.SimpleCallback() {
|
||||||
|
@Override
|
||||||
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
|
doBuyGuard();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
buyGuard();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购买守护
|
||||||
|
*/
|
||||||
|
private void buyGuard() {
|
||||||
|
if (mTargetBuyBean == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
DialogUitl.showSimpleDialog(mContext,
|
||||||
|
String.format(WordUtil.getString(R.string.guard_buy_tip_3), mTargetBuyBean.getCoin(), mCoinName, mTargetBuyBean.getShopName()),
|
||||||
|
new DialogUitl.SimpleCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
|
doBuyGuard();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购买守护
|
||||||
|
*/
|
||||||
|
private void doBuyGuard() {
|
||||||
|
if (mTargetBuyBean == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
LiveHttpUtil.buyGuard(mLiveUid, mStream, mTargetBuyBean.getId(), new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0 && info.length > 0) {
|
||||||
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
|
String votes = obj.getString("votestotal");//主播当前的映票数
|
||||||
|
int guardNum = obj.getIntValue("guard_nums");//主播当前的守护人数
|
||||||
|
int guardType = obj.getIntValue("type");
|
||||||
|
String ancherName = obj.getString("ancherName");
|
||||||
|
String liveuid = obj.getString("liveuid");
|
||||||
|
if (mLiveGuardInfo != null) {
|
||||||
|
mLiveGuardInfo.setMyGuardType(guardType);
|
||||||
|
mLiveGuardInfo.setMyGuardEndTime(obj.getString("endtime"));
|
||||||
|
mLiveGuardInfo.setGuardNum(guardNum);
|
||||||
|
}
|
||||||
|
mCoinVal = obj.getLongValue("coin");
|
||||||
|
String coinString = String.valueOf(mCoinVal);
|
||||||
|
mCoin.setText(coinString);
|
||||||
|
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||||
|
if (u != null) {
|
||||||
|
u.setCoin(coinString);
|
||||||
|
u.setLevel(obj.getIntValue("level"));
|
||||||
|
}
|
||||||
|
((LiveActivity) mContext).sendBuyGuardMessage2(votes, guardNum, guardType, ancherName, liveuid);
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
ToastUtil.show(msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
mLiveGuardInfo = null;
|
||||||
|
LiveHttpUtil.cancel(LiveHttpConsts.GET_GUARD_BUY_LIST);
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
}
|
@ -272,6 +272,9 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
|
|||||||
}
|
}
|
||||||
private List<LiveUserGiftBean> processUserData(JSONObject json){
|
private List<LiveUserGiftBean> processUserData(JSONObject json){
|
||||||
List<LiveUserGiftBean> data = JSON.parseArray(json.getString("userlist"), LiveUserGiftBean.class);
|
List<LiveUserGiftBean> data = JSON.parseArray(json.getString("userlist"), LiveUserGiftBean.class);
|
||||||
|
if(data==null){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
Log.i("tag222", "ssss");
|
Log.i("tag222", "ssss");
|
||||||
if (data.size() > 0 && pg == 1) {
|
if (data.size() > 0 && pg == 1) {
|
||||||
nums = 0;
|
nums = 0;
|
||||||
@ -297,6 +300,9 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
|
|||||||
/**
|
/**
|
||||||
* 由于在线观众和粉丝列表实体结构与榜单结构不一致,做个兼容操作
|
* 由于在线观众和粉丝列表实体结构与榜单结构不一致,做个兼容操作
|
||||||
*/
|
*/
|
||||||
|
if(rank==null){
|
||||||
|
return data;
|
||||||
|
}
|
||||||
for (Object o : rank) {
|
for (Object o : rank) {
|
||||||
JSONObject item= (JSONObject) o;
|
JSONObject item= (JSONObject) o;
|
||||||
LiveUserRankBean bean=JSON.parseObject(item.getString("userinfo"),LiveUserRankBean.class);
|
LiveUserRankBean bean=JSON.parseObject(item.getString("userinfo"),LiveUserRankBean.class);
|
||||||
@ -332,8 +338,11 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Up() {
|
void Up() {
|
||||||
|
userMoreInfoAdapter.clearData();
|
||||||
bottom_msg.setVisibility(View.VISIBLE);
|
bottom_msg.setVisibility(View.VISIBLE);
|
||||||
title.setVisibility(View.GONE);
|
title.setVisibility(View.GONE);
|
||||||
|
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) mRefreshView.getLayoutParams();
|
||||||
|
params.bottomMargin=DpUtil.dp2px(65);
|
||||||
if (Tips.equals("1")) {
|
if (Tips.equals("1")) {
|
||||||
tags.setText("開通貴族,尊享超多特權!");
|
tags.setText("開通貴族,尊享超多特權!");
|
||||||
btn.setBackgroundResource(R.mipmap.btn_openvip);
|
btn.setBackgroundResource(R.mipmap.btn_openvip);
|
||||||
@ -361,6 +370,7 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
|
|||||||
type = "fans";
|
type = "fans";
|
||||||
no_more.setImageResource(R.mipmap.bixin);
|
no_more.setImageResource(R.mipmap.bixin);
|
||||||
}else if(Tips.equals("4")){
|
}else if(Tips.equals("4")){
|
||||||
|
params.bottomMargin=DpUtil.dp2px(0);
|
||||||
userMoreInfoAdapter.type = "4";
|
userMoreInfoAdapter.type = "4";
|
||||||
bottom_msg.setVisibility(View.GONE);
|
bottom_msg.setVisibility(View.GONE);
|
||||||
type="dayRank";
|
type="dayRank";
|
||||||
@ -368,6 +378,7 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
|
|||||||
gz_view.setVisibility(View.GONE);
|
gz_view.setVisibility(View.GONE);
|
||||||
no_more.setImageResource(R.drawable.img_rank_empty);
|
no_more.setImageResource(R.drawable.img_rank_empty);
|
||||||
}else if (Tips.equals("5")){
|
}else if (Tips.equals("5")){
|
||||||
|
params.bottomMargin=DpUtil.dp2px(0);
|
||||||
userMoreInfoAdapter.type = "5";
|
userMoreInfoAdapter.type = "5";
|
||||||
bottom_msg.setVisibility(View.GONE);
|
bottom_msg.setVisibility(View.GONE);
|
||||||
type="weekRank";
|
type="weekRank";
|
||||||
@ -375,6 +386,7 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
|
|||||||
no_more.setImageResource(R.drawable.img_rank_empty);
|
no_more.setImageResource(R.drawable.img_rank_empty);
|
||||||
setTextColor(weekRank,audience_btn,guard_btn,fans_btn,gz_view,dayRank);
|
setTextColor(weekRank,audience_btn,guard_btn,fans_btn,gz_view,dayRank);
|
||||||
}
|
}
|
||||||
|
mRefreshView.setLayoutParams(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package com.yunbao.live.dialog;
|
package com.yunbao.live.dialog;
|
||||||
|
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -22,14 +24,20 @@ import com.yunbao.common.dialog.AbsDialogFragment;
|
|||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.http.main.MainNetManager;
|
import com.yunbao.common.http.main.MainNetManager;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
import com.yunbao.common.utils.DeviceUtils;
|
import com.yunbao.common.utils.DeviceUtils;
|
||||||
import com.yunbao.common.utils.RouteUtil;
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
|
||||||
import com.yunbao.live.adapter.SidebarAdapter;
|
import com.yunbao.live.adapter.SidebarAdapter;
|
||||||
import com.yunbao.live.bean.LiveBean;
|
import com.yunbao.live.bean.LiveBean;
|
||||||
|
import com.yunbao.live.event.LiveAudienceEvent;
|
||||||
|
import com.yunbao.live.event.LiveRoomChangeEvent;
|
||||||
import com.yunbao.live.http.LiveHttpUtil;
|
import com.yunbao.live.http.LiveHttpUtil;
|
||||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||||
|
import com.yunbao.live.views.LivePlayRyViewHolder;
|
||||||
|
import com.yunbao.live.views.PortraitLiveManager;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -40,6 +48,7 @@ import java.util.List;
|
|||||||
public class SidebarLiveAudience extends AbsDialogFragment {
|
public class SidebarLiveAudience extends AbsDialogFragment {
|
||||||
//侧边栏背景
|
//侧边栏背景
|
||||||
private ImageView sidebarBack;
|
private ImageView sidebarBack;
|
||||||
|
private View mask;
|
||||||
//侧边栏刷新列表
|
//侧边栏刷新列表
|
||||||
public CommonRefreshView sidebarList;
|
public CommonRefreshView sidebarList;
|
||||||
|
|
||||||
@ -48,6 +57,8 @@ public class SidebarLiveAudience extends AbsDialogFragment {
|
|||||||
private List<SlideInfoModel> slideInfoModels = new ArrayList<>();
|
private List<SlideInfoModel> slideInfoModels = new ArrayList<>();
|
||||||
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||||
|
|
||||||
|
private int index = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
return R.layout.view_sidebar_live_audience;
|
return R.layout.view_sidebar_live_audience;
|
||||||
@ -63,14 +74,23 @@ public class SidebarLiveAudience extends AbsDialogFragment {
|
|||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
Bundle bundle = getArguments();
|
Bundle bundle = getArguments();
|
||||||
sidebarBack = (ImageView) findViewById(R.id.sidebar_back);
|
sidebarBack = (ImageView) findViewById(R.id.sidebar_back);
|
||||||
|
mask = findViewById(R.id.mask);
|
||||||
if (bundle != null) {
|
if (bundle != null) {
|
||||||
String avatar = bundle.getString("Avatar");
|
String avatar = bundle.getString("Avatar");
|
||||||
|
int liveBg = bundle.getInt("LiveBg");
|
||||||
slideInfoModels = GsonUtils.fromJson(bundle.getString("banner"), new TypeToken<List<SlideInfoModel>>() {
|
slideInfoModels = GsonUtils.fromJson(bundle.getString("banner"), new TypeToken<List<SlideInfoModel>>() {
|
||||||
}.getType());
|
}.getType());
|
||||||
list = GsonUtils.fromJson(bundle.getString("list"), new TypeToken<List<AnchorRecommendItemModel>>() {
|
list = GsonUtils.fromJson(bundle.getString("list"), new TypeToken<List<AnchorRecommendItemModel>>() {
|
||||||
}.getType());
|
}.getType());
|
||||||
//侧边栏背景
|
//侧边栏背景
|
||||||
|
if (liveBg == 1) {
|
||||||
ImgLoader.displayBlurLive(mContext, avatar, sidebarBack);
|
ImgLoader.displayBlurLive(mContext, avatar, sidebarBack);
|
||||||
|
mask.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
ImgLoader.display(mContext, R.mipmap.live_bg, sidebarBack);
|
||||||
|
mask.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
sidebarList = (CommonRefreshView) findViewById(R.id.sidebarList);
|
sidebarList = (CommonRefreshView) findViewById(R.id.sidebarList);
|
||||||
@ -106,39 +126,46 @@ public class SidebarLiveAudience extends AbsDialogFragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void refresh() {
|
public void refresh() {
|
||||||
|
if (index > 0) {
|
||||||
//推荐位
|
//推荐位
|
||||||
MainNetManager.get(getActivity())
|
MainNetManager.get(getActivity())
|
||||||
.anchorRecommend("10", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
.anchorRecommend("12", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(AnchorRecommendModel anchorRecommendModel) {
|
public void onSuccess(AnchorRecommendModel anchorRecommendModel) {
|
||||||
//侧边栏
|
|
||||||
MainNetManager.get(getActivity())
|
|
||||||
.getHot(1, new com.yunbao.common.http.base.HttpCallback<List<SlideInfoModel>>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<SlideInfoModel> data) {
|
|
||||||
List<AnchorRecommendItemModel> list = anchorRecommendModel.getList();
|
List<AnchorRecommendItemModel> list = anchorRecommendModel.getList();
|
||||||
|
int userIndex = -1;
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
if (TextUtils.equals(list.get(i).getUid(), PortraitLiveManager.liveID)) {
|
||||||
|
userIndex = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (userIndex != -1) {
|
||||||
|
list.remove(userIndex);
|
||||||
|
}
|
||||||
|
|
||||||
list.add(0, new AnchorRecommendItemModel());
|
list.add(0, new AnchorRecommendItemModel());
|
||||||
|
|
||||||
sidebarAdapter.addData(list);
|
sidebarAdapter.addData(list);
|
||||||
|
sidebarAdapter.setData(anchorRecommendModel.getSlide());
|
||||||
sidebarList.onFinish();
|
sidebarList.onFinish();
|
||||||
sidebarAdapter.setData(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(String error) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
index = index + 1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
sidebarList.initData();
|
sidebarList.initData();
|
||||||
sidebarAdapter.setOnItemClickListener((bean, position) -> gotoLive(bean.getUid()));
|
sidebarAdapter.setOnItemClickListener((bean, position) -> {
|
||||||
|
|
||||||
|
gotoLive(bean.getUid());
|
||||||
|
dismiss();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -176,16 +203,35 @@ public class SidebarLiveAudience extends AbsDialogFragment {
|
|||||||
if (liveBean1 == null) {
|
if (liveBean1 == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LiveAudienceActivity.forward(getActivity(), liveBean1, liveType, liveTypeVal, "", 0, liveSdk);
|
if (LivePlayRyViewHolder.Micing == 1) {
|
||||||
(getActivity()).finish();
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.LIAN_MAI)
|
||||||
|
.setMicIng(1)
|
||||||
|
.setBean(liveBean).setLiveType(liveType).setLiveTypeVal(liveTypeVal));
|
||||||
|
} else if (LivePlayRyViewHolder.Micing == 2) {
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.LIAN_MAI)
|
||||||
|
.setMicIng(2)
|
||||||
|
.setBean(liveBean).setLiveType(liveType).setLiveTypeVal(liveTypeVal));
|
||||||
|
} else {
|
||||||
|
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal));
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
mCheckLivePresenter.checkLive(liveBean);
|
mCheckLivePresenter.checkLive(liveBean);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
RouteUtil.forwardUserHome(getActivity(), liveId, 0);
|
RouteUtil.forwardUserHome(getActivity(), liveId, 0);
|
||||||
getActivity().finish();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(DialogInterface dialog) {
|
||||||
|
super.onDismiss(dialog);
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.REFRESH_THE_LIVEl_PAGE)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package com.yunbao.live.event;
|
package com.yunbao.live.event;
|
||||||
|
|
||||||
import com.yunbao.common.bean.ActiveModel;
|
import com.yunbao.common.bean.ActiveModel;
|
||||||
|
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
import com.yunbao.live.bean.LiveBean;
|
||||||
import com.yunbao.live.bean.OpenParametersModel;
|
import com.yunbao.live.bean.OpenParametersModel;
|
||||||
|
|
||||||
public class LiveAudienceEvent extends BaseModel {
|
public class LiveAudienceEvent extends BaseModel {
|
||||||
@ -9,6 +11,56 @@ public class LiveAudienceEvent extends BaseModel {
|
|||||||
private ActiveModel model = new ActiveModel();
|
private ActiveModel model = new ActiveModel();
|
||||||
private String avatar = "";
|
private String avatar = "";
|
||||||
private OpenParametersModel parametersModel = new OpenParametersModel();
|
private OpenParametersModel parametersModel = new OpenParametersModel();
|
||||||
|
private AnchorRecommendItemModel anchorRecommendItemModel = new AnchorRecommendItemModel();
|
||||||
|
private int micIng = 0;//连麦状态
|
||||||
|
private LiveBean bean;
|
||||||
|
private int liveType;
|
||||||
|
private int liveTypeVal;
|
||||||
|
|
||||||
|
public int getLiveType() {
|
||||||
|
return liveType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveAudienceEvent setLiveType(int liveType) {
|
||||||
|
this.liveType = liveType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLiveTypeVal() {
|
||||||
|
return liveTypeVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveAudienceEvent setLiveTypeVal(int liveTypeVal) {
|
||||||
|
this.liveTypeVal = liveTypeVal;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveBean getBean() {
|
||||||
|
return bean;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveAudienceEvent setBean(LiveBean bean) {
|
||||||
|
this.bean = bean;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMicIng() {
|
||||||
|
return micIng;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveAudienceEvent setMicIng(int micIng) {
|
||||||
|
this.micIng = micIng;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AnchorRecommendItemModel getAnchorRecommendItemModel() {
|
||||||
|
return anchorRecommendItemModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveAudienceEvent setAnchorRecommendItemModel(AnchorRecommendItemModel anchorRecommendItemModel) {
|
||||||
|
this.anchorRecommendItemModel = anchorRecommendItemModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public OpenParametersModel getParametersModel() {
|
public OpenParametersModel getParametersModel() {
|
||||||
return parametersModel;
|
return parametersModel;
|
||||||
@ -59,7 +111,9 @@ public class LiveAudienceEvent extends BaseModel {
|
|||||||
EFFECTS_SETTINGS(10, "特效設置"),
|
EFFECTS_SETTINGS(10, "特效設置"),
|
||||||
WISH_LIST(11, "心愿单"),
|
WISH_LIST(11, "心愿单"),
|
||||||
OPEN_PARAMETERS(12, "开放参数"),
|
OPEN_PARAMETERS(12, "开放参数"),
|
||||||
ACTIVITY_CENTER(13, "活動中心");
|
ACTIVITY_CENTER(13, "活動中心"),
|
||||||
|
LIVE_ROOM_EXCEPTION(14, "直播间异常"),
|
||||||
|
REFRESH_THE_LIVEl_PAGE(15, "刷新直播页面");
|
||||||
|
|
||||||
private int type;
|
private int type;
|
||||||
private String name;
|
private String name;
|
||||||
|
@ -3,7 +3,6 @@ package com.yunbao.live.presenter;
|
|||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.graphics.Outline;
|
import android.graphics.Outline;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -17,7 +16,6 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.ViewOutlineProvider;
|
import android.view.ViewOutlineProvider;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.PopupWindow;
|
import android.widget.PopupWindow;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
@ -55,9 +53,6 @@ import com.yunbao.live.R;
|
|||||||
import com.yunbao.live.activity.LiveActivity;
|
import com.yunbao.live.activity.LiveActivity;
|
||||||
import com.yunbao.live.activity.LiveAnchorActivity;
|
import com.yunbao.live.activity.LiveAnchorActivity;
|
||||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||||
import com.yunbao.live.activity.ZhuangBanActivity;
|
|
||||||
import com.yunbao.live.bean.LiveWishlistBean;
|
|
||||||
import com.yunbao.live.dialog.LiveHDDialogFragment;
|
|
||||||
import com.yunbao.live.dialog.LiveOneDialogFragment;
|
import com.yunbao.live.dialog.LiveOneDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveTurnTableDialogFragment4Audience;
|
import com.yunbao.live.dialog.LiveTurnTableDialogFragment4Audience;
|
||||||
import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience;
|
import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience;
|
||||||
@ -72,7 +67,6 @@ import com.yunbao.live.socket.SocketLinkMicUtil;
|
|||||||
import com.yunbao.live.utils.CountDownView;
|
import com.yunbao.live.utils.CountDownView;
|
||||||
import com.yunbao.live.views.AbsLiveLinkMicPlayViewHolder;
|
import com.yunbao.live.views.AbsLiveLinkMicPlayViewHolder;
|
||||||
import com.yunbao.live.views.AbsLiveLinkMicPushViewHolder;
|
import com.yunbao.live.views.AbsLiveLinkMicPushViewHolder;
|
||||||
import com.yunbao.live.views.CustomViewHolder;
|
|
||||||
import com.yunbao.live.views.LiveLinkMicPlayTxViewHolder;
|
import com.yunbao.live.views.LiveLinkMicPlayTxViewHolder;
|
||||||
import com.yunbao.live.views.LiveLinkMicPushTxViewHolder;
|
import com.yunbao.live.views.LiveLinkMicPushTxViewHolder;
|
||||||
|
|
||||||
@ -83,8 +77,6 @@ import org.greenrobot.eventbus.ThreadMode;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.blankj.utilcode.util.ActivityUtils.startActivity;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/10/25.
|
* Created by cxf on 2018/10/25.
|
||||||
* 观众和主播连麦的逻辑
|
* 观众和主播连麦的逻辑
|
||||||
@ -118,21 +110,21 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
|||||||
private int mLiveSdk;
|
private int mLiveSdk;
|
||||||
private View btnWishList;
|
private View btnWishList;
|
||||||
private View btnTurnTable;
|
private View btnTurnTable;
|
||||||
private View btnEvent;
|
|
||||||
private View btnEvent3;
|
private View btnEvent3;
|
||||||
private View btn_onecz_event;
|
private View btn_onecz_event;
|
||||||
private ImageView imgEvent;
|
|
||||||
private String eventUrl;
|
private String eventUrl;
|
||||||
private Banner mBanner1;
|
//
|
||||||
public static Banner mBanner2, mBanner3;
|
public Banner mBanner3;
|
||||||
private List<BannerBean> mBannerList1 = new ArrayList<>();
|
private List<BannerBean> mBannerList1 = new ArrayList<>();
|
||||||
private List<BannerBean> mBannerList3 = new ArrayList<>();
|
private List<BannerBean> mBannerList3 = new ArrayList<>();
|
||||||
|
|
||||||
public static List<BannerBean> mBannerList2 = new ArrayList<>();
|
|
||||||
public static CountDownView date;
|
public static CountDownView date;
|
||||||
|
|
||||||
public static String link = "";
|
public static String link = "";
|
||||||
LinearLayout btn_event2;
|
//
|
||||||
public static LiveGiftBean bean1 = new LiveGiftBean();
|
public static LiveGiftBean bean1 = new LiveGiftBean();
|
||||||
String gold, experience;
|
String gold, experience;
|
||||||
|
|
||||||
@ -298,26 +290,13 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
|||||||
btnLinkMic.setOnClickListener(this);
|
btnLinkMic.setOnClickListener(this);
|
||||||
btnWishList.setOnClickListener(this);
|
btnWishList.setOnClickListener(this);
|
||||||
btnTurnTable.setOnClickListener(this);
|
btnTurnTable.setOnClickListener(this);
|
||||||
btnEvent = root.findViewById(R.id.btn_event);
|
|
||||||
btnEvent3 = root.findViewById(R.id.btn_event3);
|
btnEvent3 = root.findViewById(R.id.btn_event3);
|
||||||
mBanner1 = (Banner) root.findViewById(R.id.banner1);
|
|
||||||
mBanner2 = (Banner) root.findViewById(R.id.banner2);
|
|
||||||
mBanner3 = (Banner) root.findViewById(R.id.banner3);
|
mBanner3 = (Banner) root.findViewById(R.id.banner3);
|
||||||
|
|
||||||
|
|
||||||
btn_event2 = root.findViewById(R.id.btn_event2);
|
|
||||||
mBanner1.setOutlineProvider(new ViewOutlineProvider() {
|
|
||||||
@Override
|
|
||||||
public void getOutline(View view, Outline outline) {
|
|
||||||
outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mBanner2.setOutlineProvider(new ViewOutlineProvider() {
|
|
||||||
@Override
|
|
||||||
public void getOutline(View view, Outline outline) {
|
|
||||||
outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mBanner3.setOutlineProvider(new ViewOutlineProvider() {
|
mBanner3.setOutlineProvider(new ViewOutlineProvider() {
|
||||||
@Override
|
@Override
|
||||||
public void getOutline(View view, Outline outline) {
|
public void getOutline(View view, Outline outline) {
|
||||||
@ -397,8 +376,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
|||||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveOneDialogFragment");
|
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveOneDialogFragment");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
imgEvent = root.findViewById(R.id.img_event);
|
|
||||||
btnEvent.setOnClickListener(this);
|
|
||||||
mLinkMicTip = btnLinkMic.findViewById(R.id.link_mic_tip);
|
mLinkMicTip = btnLinkMic.findViewById(R.id.link_mic_tip);
|
||||||
}
|
}
|
||||||
mLinkMicWaitString = WordUtil.getString(R.string.link_mic_wait);
|
mLinkMicWaitString = WordUtil.getString(R.string.link_mic_wait);
|
||||||
@ -420,12 +398,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
mHandler.postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
loadWishlistData();
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
|
|
||||||
String turntableEnable = CommonAppConfig.getInstance().getTurnTableEnable();
|
String turntableEnable = CommonAppConfig.getInstance().getTurnTableEnable();
|
||||||
getEvent();
|
getEvent();
|
||||||
@ -444,35 +417,6 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
|||||||
mSocketClient = socketClient;
|
mSocketClient = socketClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLiveUid(String liveUid) {
|
|
||||||
mLiveUid = liveUid;
|
|
||||||
LiveHttpUtil.geteEvent(mLiveUid, new HttpCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
if (code == 0 && imgEvent != null) {
|
|
||||||
for (int i = 0; i < info.length; i++) {
|
|
||||||
JSONObject obj = JSONObject.parseObject(info[i]);
|
|
||||||
if (obj.getString("is_hidden").equals("0")) {
|
|
||||||
BannerBean bannerBean = new BannerBean();
|
|
||||||
bannerBean.setImageUrl(obj.getString("img"));
|
|
||||||
bannerBean.setLink(obj.getString("link"));
|
|
||||||
bannerBean.setShow_type(obj.getString("show_type"));
|
|
||||||
mBannerList2.add(bannerBean);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mBannerList2.size() <= 0) {
|
|
||||||
btn_event2.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
showBanner2();
|
|
||||||
} else {
|
|
||||||
if (btn_event2 != null) {
|
|
||||||
btn_event2.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主播收到观众申请连麦的回调
|
* 主播收到观众申请连麦的回调
|
||||||
@ -764,11 +708,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
|||||||
anchorCloseLinkMic();
|
anchorCloseLinkMic();
|
||||||
|
|
||||||
}
|
}
|
||||||
//打开活动窗口
|
|
||||||
else if (i == R.id.btn_event) {
|
|
||||||
Log.i("tag", eventUrl);
|
|
||||||
startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url", eventUrl));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -799,43 +739,6 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//获取心愿单列表
|
|
||||||
private void loadWishlistData() {
|
|
||||||
LiveHttpUtil.getWishList(mLiveUid, new HttpCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
if (code == 0 && info.length > 0) {
|
|
||||||
try {
|
|
||||||
JSONObject obj = JSON.parseObject(info[0]);
|
|
||||||
String giftJson = obj.getString("wishlist");
|
|
||||||
List<LiveWishlistBean> mWishlist = JSON.parseArray(giftJson, LiveWishlistBean.class);
|
|
||||||
if (btnWishList != null) {
|
|
||||||
if (mWishlist.size() > 0) {
|
|
||||||
btnWishList.setVisibility(View.GONE);
|
|
||||||
//心单
|
|
||||||
BannerBean bannerBean2 = new BannerBean();
|
|
||||||
bannerBean2.setImageUrl(obj.getString("img"));
|
|
||||||
bannerBean2.setLink("xyd");
|
|
||||||
mBannerList1.add(bannerBean2);
|
|
||||||
} else {
|
|
||||||
btnWishList.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
showBanner();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFinish() {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onLinkMicBtnClick() {
|
private void onLinkMicBtnClick() {
|
||||||
if (((LiveActivity) mContext).isGamePlaying()) {
|
if (((LiveActivity) mContext).isGamePlaying()) {
|
||||||
ToastUtil.show(R.string.live_game_cannot_link_mic);
|
ToastUtil.show(R.string.live_game_cannot_link_mic);
|
||||||
@ -868,109 +771,6 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showBanner() {
|
|
||||||
if (mBannerList1 == null || mBannerList1.size() == 0 || mBanner1 == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mBanner1.setAutoPlay(true)
|
|
||||||
.setPages(mBannerList1, new CustomViewHolder())
|
|
||||||
.setDelayTime(3000)
|
|
||||||
.setBannerStyle(BannerConfig.NOT_INDICATOR)
|
|
||||||
.setOnBannerClickListener(new OnBannerClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onBannerClick(List datas, int p) {
|
|
||||||
if (mBannerList1 != null) {
|
|
||||||
if (p >= 0 && p < mBannerList1.size()) {
|
|
||||||
BannerBean bean = mBannerList1.get(p);
|
|
||||||
if (bean != null) {
|
|
||||||
String link = bean.getLink();
|
|
||||||
if (link.equals("sc")) {
|
|
||||||
String url;
|
|
||||||
if (!"".equals(bean.getmIntoUrl()) && bean.getmIntoUrl() != null) {
|
|
||||||
url = CommonAppConfig.HOST + bean.getmIntoUrl() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
|
||||||
} else {
|
|
||||||
url = CommonAppConfig.HOST + "/h5/activity/firstTopUp/newUp.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
|
||||||
}
|
|
||||||
// Bundle bundle = new Bundle();
|
|
||||||
// bundle.putString("url", url);
|
|
||||||
// LiveOneDialogFragment fragment = new LiveOneDialogFragment();
|
|
||||||
// fragment.setArguments(bundle);
|
|
||||||
// fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveOneDialogFragment");
|
|
||||||
ZhuangBanActivity.forward(mContext, url, false);
|
|
||||||
} else if (link.equals("zxb")) {
|
|
||||||
String url = CommonAppConfig.HOST + "/h5/activity/weekStar/index.html?&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
|
|
||||||
ZhuangBanActivity.forward(mContext, url, false);
|
|
||||||
} else if (link.equals("xyd")) {
|
|
||||||
openWishListWindow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showBanner2() {
|
|
||||||
if (mBannerList2 == null || mBannerList2.size() == 0 || mBanner2 == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (mBannerList2.size() == 1) {
|
|
||||||
mBanner2.setAutoPlay(false)
|
|
||||||
.setPages(mBannerList2, new CustomViewHolder())
|
|
||||||
.setDelayTime(3000)
|
|
||||||
.setBannerStyle(BannerConfig.NOT_INDICATOR)
|
|
||||||
.setOnBannerClickListener(new OnBannerClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onBannerClick(List datas, int p) {
|
|
||||||
if (mBannerList2 != null) {
|
|
||||||
if (p >= 0 && p < mBannerList2.size()) {
|
|
||||||
BannerBean bean = mBannerList2.get(p);
|
|
||||||
if (bean.getShow_type().equals("1")) {
|
|
||||||
String url = bean.getLink() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid + "&t=" + System.currentTimeMillis();
|
|
||||||
ZhuangBanActivity.forward(mContext, url, false);
|
|
||||||
} else {
|
|
||||||
String url = bean.getLink() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid + "&t=" + System.currentTimeMillis();
|
|
||||||
Bundle bundle = new Bundle();
|
|
||||||
bundle.putString("url", url);
|
|
||||||
LiveHDDialogFragment fragment = new LiveHDDialogFragment();
|
|
||||||
fragment.setArguments(bundle);
|
|
||||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.start();
|
|
||||||
} else {
|
|
||||||
mBanner2.setAutoPlay(true)
|
|
||||||
.setPages(mBannerList2, new CustomViewHolder())
|
|
||||||
.setDelayTime(3000)
|
|
||||||
.setBannerStyle(BannerConfig.NOT_INDICATOR)
|
|
||||||
.setOnBannerClickListener(new OnBannerClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onBannerClick(List datas, int p) {
|
|
||||||
if (mBannerList2 != null) {
|
|
||||||
if (p >= 0 && p < mBannerList2.size()) {
|
|
||||||
BannerBean bean = mBannerList2.get(p);
|
|
||||||
if (bean.getShow_type().equals("1")) {
|
|
||||||
String url = bean.getLink() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
|
|
||||||
ZhuangBanActivity.forward(mContext, url, false);
|
|
||||||
} else {
|
|
||||||
String url = bean.getLink() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
|
|
||||||
Bundle bundle = new Bundle();
|
|
||||||
bundle.putString("url", url);
|
|
||||||
LiveHDDialogFragment fragment = new LiveHDDialogFragment();
|
|
||||||
fragment.setArguments(bundle);
|
|
||||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showBanner3() {
|
private void showBanner3() {
|
||||||
btnEvent3.setVisibility(View.VISIBLE);
|
btnEvent3.setVisibility(View.VISIBLE);
|
||||||
|
@ -9,12 +9,14 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
import com.yunbao.common.utils.DialogUitl;
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
import com.yunbao.common.utils.MD5Util;
|
import com.yunbao.common.utils.MD5Util;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
import com.yunbao.live.bean.LiveBean;
|
import com.yunbao.live.bean.LiveBean;
|
||||||
|
import com.yunbao.live.event.LiveAudienceEvent;
|
||||||
import com.yunbao.live.http.LiveHttpConsts;
|
import com.yunbao.live.http.LiveHttpConsts;
|
||||||
import com.yunbao.live.http.LiveHttpUtil;
|
import com.yunbao.live.http.LiveHttpUtil;
|
||||||
|
|
||||||
@ -76,6 +78,8 @@ public class LiveRoomCheckLivePresenter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_ROOM_EXCEPTION));
|
||||||
ToastUtil.show(msg);
|
ToastUtil.show(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ public class SocketChatUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String desc) {
|
public void onError(int code, String desc) {
|
||||||
Log.i("tx", code + "发送失败" + desc);
|
Log.i("tx", code + "发送失败1" + desc);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -114,7 +114,7 @@ public class SocketChatUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String desc) {
|
public void onError(int code, String desc) {
|
||||||
Log.i("tx", code + "发送失败" + desc);
|
Log.i("tx", code + "发送失败2" + desc);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -170,7 +170,7 @@ public class SocketChatUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String desc) {
|
public void onError(int code, String desc) {
|
||||||
Log.i("tx", code + "发送失败" + desc);
|
Log.i("tx", code + "发送失败3" + desc);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -210,7 +210,7 @@ public class SocketChatUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String desc) {
|
public void onError(int code, String desc) {
|
||||||
Log.i("tx", code + "发送失败" + desc);
|
Log.i("tx", code + "发送失败4" + desc);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -339,7 +339,7 @@ public class SocketChatUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String desc) {
|
public void onError(int code, String desc) {
|
||||||
Log.i("tx", code + "发送失败" + desc);
|
Log.i("tx", code + "发送失败5" + desc);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -381,7 +381,7 @@ public class SocketChatUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String desc) {
|
public void onError(int code, String desc) {
|
||||||
Log.i("tx", code + "发送失败" + desc);
|
Log.i("tx", code + "发送失败6" + desc);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -423,7 +423,7 @@ public class SocketChatUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String desc) {
|
public void onError(int code, String desc) {
|
||||||
Log.i("tx", code + "发送失败" + desc);
|
Log.i("tx", code + "发送失败7" + desc);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -456,7 +456,7 @@ public class SocketChatUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String desc) {
|
public void onError(int code, String desc) {
|
||||||
Log.i("tx", code + "发送失败" + desc);
|
Log.i("tx", code + "发送失败7" + desc);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -493,7 +493,7 @@ public class SocketChatUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String desc) {
|
public void onError(int code, String desc) {
|
||||||
Log.i("tx", code + "发送失败" + desc);
|
Log.i("tx", code + "发送失败9" + desc);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -528,7 +528,7 @@ public class SocketChatUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String desc) {
|
public void onError(int code, String desc) {
|
||||||
Log.i("tx", code + "发送失败" + desc);
|
Log.i("tx", code + "发送失败10" + desc);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -118,7 +118,7 @@ public class SocketRyChatUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Message message) {
|
public void onSuccess(Message message) {
|
||||||
Log.i("tx", "发送成功" + mLiveUid);
|
Log.i("tx", "ssss"+"发送成功" + mLiveUid);
|
||||||
//首发言成功
|
//首发言成功
|
||||||
AdjustEvent adjustEvent1 = new AdjustEvent("j7isvr");
|
AdjustEvent adjustEvent1 = new AdjustEvent("j7isvr");
|
||||||
Adjust.trackEvent(adjustEvent1);
|
Adjust.trackEvent(adjustEvent1);
|
||||||
@ -141,7 +141,7 @@ public class SocketRyChatUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Message message, RongIMClient.ErrorCode errorCode) {
|
public void onError(Message message, RongIMClient.ErrorCode errorCode) {
|
||||||
|
Log.e("tx","aaa"+errorCode.toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -543,7 +543,7 @@ public class SocketRyChatUtil {
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(Message message) {
|
public void onSuccess(Message message) {
|
||||||
Log.i("tx", "发送成功");
|
Log.i("tx", "发送成功");
|
||||||
// SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString() + "");
|
SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString() + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -61,7 +61,6 @@ import org.greenrobot.eventbus.ThreadMode;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.functions.Consumer;
|
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -377,7 +376,14 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
|||||||
NewPeopleInfo peopleInfo = stringResponseModel.getData().getInfo();
|
NewPeopleInfo peopleInfo = stringResponseModel.getData().getInfo();
|
||||||
if (peopleInfo.getIsShow()) {
|
if (peopleInfo.getIsShow()) {
|
||||||
liveNewPeople.setVisibility(View.VISIBLE);
|
liveNewPeople.setVisibility(View.VISIBLE);
|
||||||
|
if(peopleInfo.getLink().startsWith("http")){
|
||||||
newPeopleUrl = peopleInfo.getLink();
|
newPeopleUrl = peopleInfo.getLink();
|
||||||
|
if(!newPeopleUrl.contains("?")){
|
||||||
|
newPeopleUrl+="?";
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
newPeopleUrl = CommonAppConfig.HOST + peopleInfo.getLink();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, Throwable::printStackTrace).isDisposed();
|
}, Throwable::printStackTrace).isDisposed();
|
||||||
}
|
}
|
||||||
@ -410,7 +416,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
|||||||
showTrickeryDialog();
|
showTrickeryDialog();
|
||||||
}else if (i==R.id.live_new_people){
|
}else if (i==R.id.live_new_people){
|
||||||
Bundle bundle=new Bundle();
|
Bundle bundle=new Bundle();
|
||||||
String url= newPeopleUrl+"?g=Appapi&m=Turntable&a=tricky";
|
String url= newPeopleUrl+"&g=Appapi&m=Turntable&a=tricky";
|
||||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||||
+ CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
|
+ CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
|
||||||
bundle.putString("url", url);
|
bundle.putString("url", url);
|
||||||
|
@ -226,6 +226,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setViewUP(int i) {
|
public static void setViewUP(int i) {
|
||||||
|
if (mVideoView == null) return;
|
||||||
Log.i("收", "整理" + i);
|
Log.i("收", "整理" + i);
|
||||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
|
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
|
||||||
params.height = vHeight;
|
params.height = vHeight;
|
||||||
|
@ -3,6 +3,8 @@ package com.yunbao.live.views;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Outline;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
@ -12,6 +14,7 @@ import android.util.Log;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.ViewOutlineProvider;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
@ -21,6 +24,7 @@ import android.widget.TextView;
|
|||||||
import android.widget.ViewFlipper;
|
import android.widget.ViewFlipper;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.recyclerview.widget.DefaultItemAnimator;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
@ -37,12 +41,16 @@ import com.bumptech.glide.request.RequestListener;
|
|||||||
import com.bumptech.glide.request.RequestOptions;
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
import com.bumptech.glide.request.target.Target;
|
import com.bumptech.glide.request.target.Target;
|
||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
|
import com.ms.banner.Banner;
|
||||||
|
import com.ms.banner.BannerConfig;
|
||||||
|
import com.ms.banner.listener.OnBannerClickListener;
|
||||||
import com.opensource.svgaplayer.SVGADrawable;
|
import com.opensource.svgaplayer.SVGADrawable;
|
||||||
import com.opensource.svgaplayer.SVGAImageView;
|
import com.opensource.svgaplayer.SVGAImageView;
|
||||||
import com.opensource.svgaplayer.SVGAParser;
|
import com.opensource.svgaplayer.SVGAParser;
|
||||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
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.bean.BannerBean;
|
||||||
import com.yunbao.common.bean.LevelBean;
|
import com.yunbao.common.bean.LevelBean;
|
||||||
import com.yunbao.common.bean.UserBean;
|
import com.yunbao.common.bean.UserBean;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
@ -66,7 +74,9 @@ import com.yunbao.live.activity.LiveActivity;
|
|||||||
import com.yunbao.live.activity.LiveAnchorActivity;
|
import com.yunbao.live.activity.LiveAnchorActivity;
|
||||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||||
|
import com.yunbao.live.activity.ZhuangBanActivity;
|
||||||
import com.yunbao.live.adapter.LiveChatAdapter;
|
import com.yunbao.live.adapter.LiveChatAdapter;
|
||||||
|
import com.yunbao.live.adapter.LiveRoomFastMessageRecyclerViewAdapter;
|
||||||
import com.yunbao.live.adapter.LiveUserAdapter;
|
import com.yunbao.live.adapter.LiveUserAdapter;
|
||||||
import com.yunbao.live.bean.DrPkbean;
|
import com.yunbao.live.bean.DrPkbean;
|
||||||
import com.yunbao.live.bean.LiveBuyGuardMsgBean;
|
import com.yunbao.live.bean.LiveBuyGuardMsgBean;
|
||||||
@ -78,6 +88,7 @@ import com.yunbao.live.bean.LiveLuckGiftWinBean;
|
|||||||
import com.yunbao.live.bean.LivePKUserListBean;
|
import com.yunbao.live.bean.LivePKUserListBean;
|
||||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||||
import com.yunbao.live.bean.LiveUserGiftBean;
|
import com.yunbao.live.bean.LiveUserGiftBean;
|
||||||
|
import com.yunbao.live.bean.LiveWishlistBean;
|
||||||
import com.yunbao.live.bean.WishlistItemModel;
|
import com.yunbao.live.bean.WishlistItemModel;
|
||||||
import com.yunbao.live.custom.LiveLightView;
|
import com.yunbao.live.custom.LiveLightView;
|
||||||
import com.yunbao.live.custom.RightGradual;
|
import com.yunbao.live.custom.RightGradual;
|
||||||
@ -85,6 +96,7 @@ import com.yunbao.live.custom.TopGradual;
|
|||||||
import com.yunbao.live.dialog.LiveFansMedalDialogFragment;
|
import com.yunbao.live.dialog.LiveFansMedalDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveHDDialogFragment;
|
import com.yunbao.live.dialog.LiveHDDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveUserDialogFragment;
|
import com.yunbao.live.dialog.LiveUserDialogFragment;
|
||||||
|
import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience;
|
||||||
import com.yunbao.live.event.LiveAudienceEvent;
|
import com.yunbao.live.event.LiveAudienceEvent;
|
||||||
import com.yunbao.live.http.LiveHttpConsts;
|
import com.yunbao.live.http.LiveHttpConsts;
|
||||||
import com.yunbao.live.http.LiveHttpUtil;
|
import com.yunbao.live.http.LiveHttpUtil;
|
||||||
@ -92,7 +104,6 @@ import com.yunbao.live.presenter.LiveDanmuPresenter;
|
|||||||
import com.yunbao.live.presenter.LiveEnterRoomAnimPresenter;
|
import com.yunbao.live.presenter.LiveEnterRoomAnimPresenter;
|
||||||
import com.yunbao.live.presenter.LiveGiftAnimPresenter;
|
import com.yunbao.live.presenter.LiveGiftAnimPresenter;
|
||||||
import com.yunbao.live.presenter.LiveLightAnimPresenter;
|
import com.yunbao.live.presenter.LiveLightAnimPresenter;
|
||||||
import com.yunbao.live.socket.SocketChatUtil;
|
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
@ -100,12 +111,12 @@ import java.lang.ref.WeakReference;
|
|||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import pl.droidsonroids.gif.GifImageView;
|
import pl.droidsonroids.gif.GifImageView;
|
||||||
|
|
||||||
|
import static com.blankj.utilcode.util.ActivityUtils.startActivity;
|
||||||
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;
|
||||||
|
|
||||||
@ -231,13 +242,23 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
public static RelativeLayout lt_pk_line;
|
public static RelativeLayout lt_pk_line;
|
||||||
|
|
||||||
public WindowManager windowManager;
|
public WindowManager windowManager;
|
||||||
public boolean isRy = false;
|
// public boolean isRy = false;
|
||||||
|
private Banner mBanner1, mBanner2;
|
||||||
|
private List<BannerBean> mBannerList1 = new ArrayList<>();
|
||||||
|
private List<BannerBean> mBannerList2 = new ArrayList<>();
|
||||||
|
private LinearLayout btn_event2;
|
||||||
|
private ImageView imgEvent;
|
||||||
|
private View btnEvent;
|
||||||
|
private RecyclerView fastMsgRecyclerView;
|
||||||
|
private LiveRoomFastMessageRecyclerViewAdapter fastMessageRecyclerViewAdapter;
|
||||||
|
|
||||||
|
private LiveUserGiftBean nowGuardUser;
|
||||||
|
|
||||||
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;
|
||||||
this.forAct = forActivity;
|
this.forAct = forActivity;
|
||||||
this.isRy = isRys;
|
// this.isRy = isRys;
|
||||||
mGifImageView = gifImageView;
|
mGifImageView = gifImageView;
|
||||||
mSVGAImageView = svgaImageView;
|
mSVGAImageView = svgaImageView;
|
||||||
mLiveGiftPrizePoolContainer = liveGiftPrizePoolContainer;
|
mLiveGiftPrizePoolContainer = liveGiftPrizePoolContainer;
|
||||||
@ -245,6 +266,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearList() {
|
||||||
|
mBannerList2.clear();
|
||||||
|
}
|
||||||
|
|
||||||
//更新连麦人
|
//更新连麦人
|
||||||
public static List<String> mic_ids = new ArrayList<>();
|
public static List<String> mic_ids = new ArrayList<>();
|
||||||
@ -550,8 +574,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
|
btnEvent = findViewById(R.id.btn_event);
|
||||||
|
imgEvent = (ImageView) findViewById(R.id.img_event);
|
||||||
|
btn_event2 = (LinearLayout) findViewById(R.id.btn_event2);
|
||||||
|
mBanner1 = (Banner) findViewById(R.id.banner1);
|
||||||
time = (TextView) findViewById(R.id.time);
|
time = (TextView) findViewById(R.id.time);
|
||||||
|
mBanner2 = (Banner) findViewById(R.id.banner2);
|
||||||
pkText1 = (TextView) findViewById(R.id.pk_text1);
|
pkText1 = (TextView) findViewById(R.id.pk_text1);
|
||||||
pkText2 = (TextView) findViewById(R.id.pk_text2);
|
pkText2 = (TextView) findViewById(R.id.pk_text2);
|
||||||
pkText3 = (TextView) findViewById(R.id.pk_text3);
|
pkText3 = (TextView) findViewById(R.id.pk_text3);
|
||||||
@ -811,7 +839,204 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
ViewClicksAntiShake.clicksAntiShake(wishListLayout, () -> Bus.get().post(new LiveAudienceEvent()
|
ViewClicksAntiShake.clicksAntiShake(wishListLayout, () -> Bus.get().post(new LiveAudienceEvent()
|
||||||
.setType(LiveAudienceEvent.LiveAudienceType.WISH_LIST)));
|
.setType(LiveAudienceEvent.LiveAudienceType.WISH_LIST)));
|
||||||
|
|
||||||
|
mBanner1.setOutlineProvider(new ViewOutlineProvider() {
|
||||||
|
@Override
|
||||||
|
public void getOutline(View view, Outline outline) {
|
||||||
|
outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mBanner2.setOutlineProvider(new ViewOutlineProvider() {
|
||||||
|
@Override
|
||||||
|
public void getOutline(View view, Outline outline) {
|
||||||
|
outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadWishlistData();
|
||||||
|
//打开活动窗口
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(wishListLayout, () -> startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url", "")));
|
||||||
|
//打招呼消息
|
||||||
|
fastMsgRecyclerView = (RecyclerView) findViewById(R.id.room_fast_msg);
|
||||||
|
fastMsgRecyclerView.setLayoutManager(new LinearLayoutManager(mContext,LinearLayoutManager.HORIZONTAL,false));
|
||||||
|
fastMessageRecyclerViewAdapter=new LiveRoomFastMessageRecyclerViewAdapter(mContext);
|
||||||
|
fastMsgRecyclerView.setAdapter(fastMessageRecyclerViewAdapter);
|
||||||
|
fastMessageRecyclerViewAdapter.setMessageListener(msg -> {
|
||||||
|
//点击的消息发送出去
|
||||||
|
((LiveActivity) mContext).sendChatMessage(msg);
|
||||||
|
fastMsgRecyclerView.setVisibility(View.GONE);
|
||||||
|
});
|
||||||
|
// fastMsgRecyclerView.setItemAnimator(new DefaultItemAnimator());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showBanner2() {
|
||||||
|
if (mBannerList2 == null || mBannerList2.size() == 0 || mBanner2 == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (mBannerList2.size() == 1) {
|
||||||
|
mBanner2.setAutoPlay(false)
|
||||||
|
.setPages(mBannerList2, new CustomViewHolder())
|
||||||
|
.setDelayTime(3000)
|
||||||
|
.setBannerStyle(BannerConfig.NOT_INDICATOR)
|
||||||
|
.setOnBannerClickListener(new OnBannerClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onBannerClick(List datas, int p) {
|
||||||
|
if (mBannerList2 != null) {
|
||||||
|
if (p >= 0 && p < mBannerList2.size()) {
|
||||||
|
BannerBean bean = mBannerList2.get(p);
|
||||||
|
if (bean.getShow_type().equals("1")) {
|
||||||
|
String url = bean.getLink() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid + "&t=" + System.currentTimeMillis();
|
||||||
|
ZhuangBanActivity.forward(mContext, url, false);
|
||||||
|
} else {
|
||||||
|
String url = bean.getLink() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid + "&t=" + System.currentTimeMillis();
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putString("url", url);
|
||||||
|
LiveHDDialogFragment fragment = new LiveHDDialogFragment();
|
||||||
|
fragment.setArguments(bundle);
|
||||||
|
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.start();
|
||||||
|
} else {
|
||||||
|
mBanner2.setAutoPlay(true)
|
||||||
|
.setPages(mBannerList2, new CustomViewHolder())
|
||||||
|
.setDelayTime(3000)
|
||||||
|
.setBannerStyle(BannerConfig.NOT_INDICATOR)
|
||||||
|
.setOnBannerClickListener(new OnBannerClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onBannerClick(List datas, int p) {
|
||||||
|
if (mBannerList2 != null) {
|
||||||
|
if (p >= 0 && p < mBannerList2.size()) {
|
||||||
|
BannerBean bean = mBannerList2.get(p);
|
||||||
|
if (bean.getShow_type().equals("1")) {
|
||||||
|
String url = bean.getLink() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
|
||||||
|
ZhuangBanActivity.forward(mContext, url, false);
|
||||||
|
} else {
|
||||||
|
String url = bean.getLink() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putString("url", url);
|
||||||
|
LiveHDDialogFragment fragment = new LiveHDDialogFragment();
|
||||||
|
fragment.setArguments(bundle);
|
||||||
|
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLiveUid(String liveUid) {
|
||||||
|
mLiveUid = liveUid;
|
||||||
|
LiveHttpUtil.geteEvent(mLiveUid, new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0 && imgEvent != null) {
|
||||||
|
for (int i = 0; i < info.length; i++) {
|
||||||
|
JSONObject obj = JSONObject.parseObject(info[i]);
|
||||||
|
if (obj.getString("is_hidden").equals("0")) {
|
||||||
|
BannerBean bannerBean = new BannerBean();
|
||||||
|
bannerBean.setImageUrl(obj.getString("img"));
|
||||||
|
bannerBean.setLink(obj.getString("link"));
|
||||||
|
bannerBean.setShow_type(obj.getString("show_type"));
|
||||||
|
mBannerList2.add(bannerBean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mBannerList2.size() <= 0) {
|
||||||
|
btn_event2.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
showBanner2();
|
||||||
|
} else {
|
||||||
|
if (btn_event2 != null) {
|
||||||
|
btn_event2.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取心愿单列表
|
||||||
|
private void loadWishlistData() {
|
||||||
|
LiveHttpUtil.getWishList(mLiveUid, new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0 && info.length > 0) {
|
||||||
|
try {
|
||||||
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
|
String giftJson = obj.getString("wishlist");
|
||||||
|
List<LiveWishlistBean> mWishlist = JSON.parseArray(giftJson, LiveWishlistBean.class);
|
||||||
|
if (mWishlist.size() > 0) {
|
||||||
|
//心单
|
||||||
|
BannerBean bannerBean2 = new BannerBean();
|
||||||
|
bannerBean2.setImageUrl(obj.getString("img"));
|
||||||
|
bannerBean2.setLink("xyd");
|
||||||
|
mBannerList1.add(bannerBean2);
|
||||||
|
}
|
||||||
|
|
||||||
|
showBanner();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinish() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showBanner() {
|
||||||
|
if (mBannerList1 == null || mBannerList1.size() == 0 || mBanner1 == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mBanner1.setAutoPlay(true)
|
||||||
|
.setPages(mBannerList1, new CustomViewHolder())
|
||||||
|
.setDelayTime(3000)
|
||||||
|
.setBannerStyle(BannerConfig.NOT_INDICATOR)
|
||||||
|
.setOnBannerClickListener(new OnBannerClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onBannerClick(List datas, int p) {
|
||||||
|
if (mBannerList1 != null) {
|
||||||
|
if (p >= 0 && p < mBannerList1.size()) {
|
||||||
|
BannerBean bean = mBannerList1.get(p);
|
||||||
|
if (bean != null) {
|
||||||
|
String link = bean.getLink();
|
||||||
|
if (link.equals("sc")) {
|
||||||
|
String url;
|
||||||
|
if (!"".equals(bean.getmIntoUrl()) && bean.getmIntoUrl() != null) {
|
||||||
|
url = CommonAppConfig.HOST + bean.getmIntoUrl() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
||||||
|
} else {
|
||||||
|
url = CommonAppConfig.HOST + "/h5/activity/firstTopUp/newUp.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
||||||
|
}
|
||||||
|
ZhuangBanActivity.forward(mContext, url, false);
|
||||||
|
} else if (link.equals("zxb")) {
|
||||||
|
String url = CommonAppConfig.HOST + "/h5/activity/weekStar/index.html?&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
|
||||||
|
ZhuangBanActivity.forward(mContext, url, false);
|
||||||
|
} else if (link.equals("xyd")) {
|
||||||
|
openWishListWindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 观众打开主播的心愿单窗口
|
||||||
|
*/
|
||||||
|
public void openWishListWindow() {
|
||||||
|
LiveWishListDialogFragment4Audience fragment = new LiveWishListDialogFragment4Audience();
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||||
|
fragment.setArguments(bundle);
|
||||||
|
if (mContext instanceof LiveAudienceActivity) {
|
||||||
|
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveWishListDialogFragmentAudience");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1196,6 +1421,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
getIsHot();
|
getIsHot();
|
||||||
getGuardInfo();
|
getGuardInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getGuardInfo() {
|
private void getGuardInfo() {
|
||||||
LiveHttpUtil.getUserList(mLiveUid, mStream, "guard", 1, new HttpCallback() {
|
LiveHttpUtil.getUserList(mLiveUid, mStream, "guard", 1, new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
@ -1208,8 +1434,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setGuardIcon(LiveUserGiftBean guard) {
|
private void setGuardIcon(LiveUserGiftBean guard) {
|
||||||
if (guard != null) {
|
if (guard != null) {
|
||||||
|
nowGuardUser=guard;
|
||||||
ImgLoader.displayAvatar(mContext, guard.getAvatar(), userGuard);
|
ImgLoader.displayAvatar(mContext, guard.getAvatar(), userGuard);
|
||||||
gift_svga.setVisibility(View.VISIBLE);
|
gift_svga.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
@ -1288,7 +1516,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
} else if (i == R.id.ft_hot_add) {
|
} else if (i == R.id.ft_hot_add) {
|
||||||
((LiveActivity) mContext).openHotListWindow(1);
|
((LiveActivity) mContext).openHotListWindow(1);
|
||||||
} else if (i == R.id.user_guard) {
|
} else if (i == R.id.user_guard) {
|
||||||
((LiveActivity) mContext).openUserMoreListWindow(2,true);
|
// ((LiveActivity) mContext).openUserMoreListWindow(2, true);
|
||||||
|
((LiveActivity) mContext).openGuardListWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1322,7 +1551,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
logger.logEvent("FB_Follow", null);
|
logger.logEvent("FB_Follow", null);
|
||||||
AdjustEvent adjustEvent1 = new AdjustEvent("oess6a");
|
AdjustEvent adjustEvent1 = new AdjustEvent("oess6a");
|
||||||
Adjust.trackEvent(adjustEvent1);
|
Adjust.trackEvent(adjustEvent1);
|
||||||
SocketChatUtil.sendSystemMessage(mLiveUid, CommonAppConfig.getInstance().getUserBean().getUserNiceName() + WordUtil.getString(R.string.live_follow_anchor));
|
// SocketChatUtil.sendSystemMessage(mLiveUid, CommonAppConfig.getInstance().getUserBean().getUserNiceName() + WordUtil.getString(R.string.live_follow_anchor));
|
||||||
LiveActivity.sendSystemMessage(
|
LiveActivity.sendSystemMessage(
|
||||||
CommonAppConfig.getInstance().getUserBean().getUserNiceName() + WordUtil.getString(R.string.live_follow_anchor));
|
CommonAppConfig.getInstance().getUserBean().getUserNiceName() + WordUtil.getString(R.string.live_follow_anchor));
|
||||||
}
|
}
|
||||||
@ -1367,7 +1596,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
* 退出直播间
|
* 退出直播间
|
||||||
*/
|
*/
|
||||||
private void close() {
|
private void close() {
|
||||||
if (isRy == false) {
|
if (mContext instanceof LiveAudienceActivity) {
|
||||||
if (forAct == 1) {
|
if (forAct == 1) {
|
||||||
//是否关注0==没关注
|
//是否关注0==没关注
|
||||||
if (isAttention == 0) {
|
if (isAttention == 0) {
|
||||||
@ -1385,7 +1614,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
((LiveAudienceActivity) mContext).setBackIndex(1);
|
((LiveAudienceActivity) mContext).setBackIndex(1);
|
||||||
((LiveAnchorActivity) mContext).onBackPressed();
|
((LiveAnchorActivity) mContext).onBackPressed();
|
||||||
}
|
}
|
||||||
} else {
|
} else if (mContext instanceof LiveRyAnchorActivity) {
|
||||||
if (forAct == 1) {
|
if (forAct == 1) {
|
||||||
//是否关注0==没关注
|
//是否关注0==没关注
|
||||||
if (isAttention == 0) {
|
if (isAttention == 0) {
|
||||||
@ -1404,6 +1633,43 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
((LiveRyAnchorActivity) mContext).onBackPressed();
|
((LiveRyAnchorActivity) mContext).onBackPressed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// if (isRy == false) {
|
||||||
|
// if (forAct == 1) {
|
||||||
|
// //是否关注0==没关注
|
||||||
|
// if (isAttention == 0) {
|
||||||
|
// if (isStayRoomfive) {
|
||||||
|
// showFollowDialog(mNameText, mAvatarUrl, mContext);
|
||||||
|
// } else {
|
||||||
|
// ((LiveAudienceActivity) mContext).setBackIndex(1);
|
||||||
|
// ((LiveAudienceActivity) mContext).onBackPressed();
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// ((LiveAudienceActivity) mContext).setBackIndex(1);
|
||||||
|
// ((LiveAudienceActivity) mContext).onBackPressed();
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// ((LiveAudienceActivity) mContext).setBackIndex(1);
|
||||||
|
// ((LiveAnchorActivity) mContext).onBackPressed();
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// if (forAct == 1) {
|
||||||
|
// //是否关注0==没关注
|
||||||
|
// if (isAttention == 0) {
|
||||||
|
// if (isStayRoomfive) {
|
||||||
|
// showFollowDialog(mNameText, mAvatarUrl, mContext);
|
||||||
|
// } else {
|
||||||
|
// LiveRyAnchorActivity.backIndex = 1;
|
||||||
|
// ((LiveRyAnchorActivity) mContext).onBackPressed();
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// LiveRyAnchorActivity.backIndex = 1;
|
||||||
|
// ((LiveRyAnchorActivity) mContext).onBackPressed();
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// LiveRyAnchorActivity.backIndex = 1;
|
||||||
|
// ((LiveRyAnchorActivity) mContext).onBackPressed();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1422,7 +1688,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
public void refreshUserList(JSONObject obj) {
|
public void refreshUserList(JSONObject obj) {
|
||||||
List<LiveUserGiftBean> list = JSON.parseArray(obj.getString("userlist"), LiveUserGiftBean.class);
|
List<LiveUserGiftBean> list = JSON.parseArray(obj.getString("userlist"), LiveUserGiftBean.class);
|
||||||
mLiveUserAdapter.refreshList(list);
|
mLiveUserAdapter.refreshList(list);
|
||||||
getGuardInfo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1531,6 +1796,24 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
mLiveEnterRoomAnimPresenter.enterRoom(bean);
|
mLiveEnterRoomAnimPresenter.enterRoom(bean);
|
||||||
}
|
}
|
||||||
room_hot.setText(formatBigNum.formatBigNum(bean.getLiveChatBean().getHot_num()));
|
room_hot.setText(formatBigNum.formatBigNum(bean.getLiveChatBean().getHot_num()));
|
||||||
|
LiveUserGiftBean chatBean = bean.getUserBean();
|
||||||
|
if(chatBean!=null&&nowGuardUser!=null) {
|
||||||
|
LiveUserGiftBean tmp = null;
|
||||||
|
if (chatBean.getGuardType() != 0 && chatBean.getGuardType() > nowGuardUser.getGuardType()) {
|
||||||
|
tmp = chatBean;
|
||||||
|
} else if (chatBean.getGuardType() != 0 && chatBean.getGuardType() == nowGuardUser.getGuardType() && chatBean.getLevel() > nowGuardUser.getLevel()) {
|
||||||
|
tmp = chatBean;
|
||||||
|
}
|
||||||
|
setGuardIcon(tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户离开房间
|
||||||
|
* @param bean 用户
|
||||||
|
*/
|
||||||
|
public void onExitRoom(UserBean bean){
|
||||||
|
// getGuardInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1844,6 +2127,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetUserListWidth(int width) {
|
public void resetUserListWidth(int width) {
|
||||||
ViewGroup.LayoutParams params = mUserRecyclerView.getLayoutParams();
|
ViewGroup.LayoutParams params = mUserRecyclerView.getLayoutParams();
|
||||||
params.width = width;
|
params.width = width;
|
||||||
@ -1919,6 +2203,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
mLiveRoomHandler.removeCallbacksAndMessages(null);
|
mLiveRoomHandler.removeCallbacksAndMessages(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setFastMessage(List<String> greetings) {
|
||||||
|
fastMessageRecyclerViewAdapter.setMessage(greetings);
|
||||||
|
}
|
||||||
|
|
||||||
private static class LiveRoomHandler extends Handler {
|
private static class LiveRoomHandler extends Handler {
|
||||||
|
|
||||||
private LiveRoomViewHolder mLiveRoomViewHolder;
|
private LiveRoomViewHolder mLiveRoomViewHolder;
|
||||||
|
@ -36,7 +36,7 @@ public class LoadingView extends FrameLayout {
|
|||||||
|
|
||||||
private void init(Context context) {
|
private void init(Context context) {
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
View view = LayoutInflater.from(mContext).inflate(R.layout.layout_portrait_live_item, this, true);
|
View view = LayoutInflater.from(mContext).inflate(R.layout.layout_portrait_comm_item, this, true);
|
||||||
mIvLoading = view.findViewById(R.id.iv_loading);
|
mIvLoading = view.findViewById(R.id.iv_loading);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,7 +46,6 @@ public class LoadingView extends FrameLayout {
|
|||||||
ImageView ivLoading = mIvLoading.findViewById(R.id.iv_loading);
|
ImageView ivLoading = mIvLoading.findViewById(R.id.iv_loading);
|
||||||
AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground();
|
AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground();
|
||||||
frameAnimation.start();
|
frameAnimation.start();
|
||||||
|
|
||||||
setVisibility(VISIBLE);
|
setVisibility(VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@ import android.app.Dialog;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.os.CountDownTimer;
|
import android.os.CountDownTimer;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@ -20,6 +22,7 @@ import androidx.viewpager.widget.PagerAdapter;
|
|||||||
import com.adjust.sdk.Adjust;
|
import com.adjust.sdk.Adjust;
|
||||||
import com.adjust.sdk.AdjustEvent;
|
import com.adjust.sdk.AdjustEvent;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.blankj.utilcode.util.GsonUtils;
|
import com.blankj.utilcode.util.GsonUtils;
|
||||||
import com.tencent.imsdk.v2.V2TIMCallback;
|
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||||
@ -29,14 +32,15 @@ import com.yunbao.common.CommonAppContext;
|
|||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.bean.UserBean;
|
import com.yunbao.common.bean.UserBean;
|
||||||
import com.yunbao.common.custom.MyViewPager;
|
import com.yunbao.common.custom.MyViewPager;
|
||||||
|
import com.yunbao.common.event.FollowEvent;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.CommonHttpConsts;
|
import com.yunbao.common.http.CommonHttpConsts;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
import com.yunbao.common.http.HttpClient;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
import com.yunbao.common.utils.DialogUitl;
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
import com.yunbao.common.utils.DpUtil;
|
|
||||||
import com.yunbao.common.utils.RandomUtil;
|
import com.yunbao.common.utils.RandomUtil;
|
||||||
import com.yunbao.common.utils.RouteUtil;
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
@ -62,30 +66,39 @@ import com.yunbao.live.dialog.BlowkissDialog;
|
|||||||
import com.yunbao.live.dialog.NewUserDialog;
|
import com.yunbao.live.dialog.NewUserDialog;
|
||||||
import com.yunbao.live.event.LinkMicTxAccEvent;
|
import com.yunbao.live.event.LinkMicTxAccEvent;
|
||||||
import com.yunbao.live.event.LiveAudienceEvent;
|
import com.yunbao.live.event.LiveAudienceEvent;
|
||||||
|
import com.yunbao.live.event.LiveRoomChangeEvent;
|
||||||
import com.yunbao.live.http.LiveHttpConsts;
|
import com.yunbao.live.http.LiveHttpConsts;
|
||||||
import com.yunbao.live.http.LiveHttpUtil;
|
import com.yunbao.live.http.LiveHttpUtil;
|
||||||
import com.yunbao.live.presenter.LiveLinkMicAnchorPresenter;
|
import com.yunbao.live.presenter.LiveLinkMicAnchorPresenter;
|
||||||
import com.yunbao.live.presenter.LiveLinkMicPkPresenter;
|
|
||||||
import com.yunbao.live.presenter.LiveLinkMicPresenter;
|
import com.yunbao.live.presenter.LiveLinkMicPresenter;
|
||||||
import com.yunbao.live.presenter.LiveRyLinkMicPkPresenter;
|
import com.yunbao.live.presenter.LiveRyLinkMicPkPresenter;
|
||||||
import com.yunbao.live.socket.SocketChatUtil;
|
|
||||||
import com.yunbao.live.socket.SocketClient;
|
import com.yunbao.live.socket.SocketClient;
|
||||||
import com.yunbao.live.socket.SocketMessageListener;
|
import com.yunbao.live.socket.SocketMessageListener;
|
||||||
import com.yunbao.live.socket.SocketRyChatUtil;
|
import com.yunbao.live.socket.SocketRyChatUtil;
|
||||||
import com.yunbao.live.socket.SocketRyClient;
|
import com.yunbao.live.socket.SocketRyClient;
|
||||||
|
import com.yunbao.live.socket.SocketSendBean;
|
||||||
|
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||||
|
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
|
||||||
|
import cn.rongcloud.rtc.api.callback.IRCRTCSwitchRoleCallback;
|
||||||
|
import cn.rongcloud.rtc.base.RTCErrorCode;
|
||||||
|
import io.rong.imlib.IRongCallback;
|
||||||
import io.rong.imlib.IRongCoreCallback;
|
import io.rong.imlib.IRongCoreCallback;
|
||||||
import io.rong.imlib.IRongCoreEnum;
|
import io.rong.imlib.IRongCoreEnum;
|
||||||
|
import io.rong.imlib.RongIMClient;
|
||||||
import io.rong.imlib.chatroom.base.RongChatRoomClient;
|
import io.rong.imlib.chatroom.base.RongChatRoomClient;
|
||||||
|
import io.rong.imlib.model.Conversation;
|
||||||
|
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;
|
||||||
import static com.yunbao.live.presenter.LiveLinkMicPresenter.mBannerList2;
|
import static com.yunbao.live.views.LivePlayRyViewHolder.Micing;
|
||||||
import static com.yunbao.live.views.LivePlayKsyViewHolder.setViewUP;
|
|
||||||
import static com.yunbao.live.views.LiveRoomViewHolder.isStayRoomfive;
|
import static com.yunbao.live.views.LiveRoomViewHolder.isStayRoomfive;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -108,7 +121,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
//直播间背景
|
//直播间背景
|
||||||
private ImageView liveBack;
|
private ImageView liveBack;
|
||||||
|
|
||||||
|
private View mask;
|
||||||
//侧滑布局
|
//侧滑布局
|
||||||
// private DrawerLayout drawerLayout;
|
// private DrawerLayout drawerLayout;
|
||||||
//直播间拆分布局
|
//直播间拆分布局
|
||||||
@ -125,8 +138,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
//主播与主播连麦逻辑
|
//主播与主播连麦逻辑
|
||||||
private LiveLinkMicAnchorPresenter mLiveLinkMicAnchorPresenter;
|
private LiveLinkMicAnchorPresenter mLiveLinkMicAnchorPresenter;
|
||||||
//主播与主播PK逻辑
|
//主播与主播PK逻辑
|
||||||
private LiveLinkMicPkPresenter mLiveLinkMicPkPresenter;
|
|
||||||
//主播与主播PK逻辑
|
|
||||||
private LiveRyLinkMicPkPresenter mLiveRyLinkMicPkPresenter;
|
private LiveRyLinkMicPkPresenter mLiveRyLinkMicPkPresenter;
|
||||||
//直播间的类型 普通 密码 门票 计时等
|
//直播间的类型 普通 密码 门票 计时等
|
||||||
private int mLiveType;
|
private int mLiveType;
|
||||||
@ -151,10 +162,14 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
private boolean mLighted;
|
private boolean mLighted;
|
||||||
private boolean mCoinNotEnough;//余额不足
|
private boolean mCoinNotEnough;//余额不足
|
||||||
private boolean mFirstConnectSocket;//是否是第一次连接成功socket
|
private boolean mFirstConnectSocket;//是否是第一次连接成功socket
|
||||||
|
private int liveBg;
|
||||||
|
private LiveImDeletUtil liveImDeletUtil;
|
||||||
|
private List<String> greetings = new ArrayList<>();
|
||||||
|
|
||||||
public PortraitLiveManager(Activity context, Intent intent) {
|
public PortraitLiveManager(Activity context, Intent intent) {
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
this.mIntent = intent;
|
this.mIntent = intent;
|
||||||
|
liveImDeletUtil = new LiveImDeletUtil();
|
||||||
ininView();
|
ininView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,6 +201,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
|
|
||||||
//直播页面背景
|
//直播页面背景
|
||||||
liveBack = mRootContainer.findViewById(R.id.live_back);
|
liveBack = mRootContainer.findViewById(R.id.live_back);
|
||||||
|
mask = mRootContainer.findViewById(R.id.mask);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -202,11 +218,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
.setParametersModel(new OpenParametersModel()
|
.setParametersModel(new OpenParametersModel()
|
||||||
.setmLiveType(mLiveType)
|
.setmLiveType(mLiveType)
|
||||||
.setmLiveTypeVal(mLiveTypeVal)));
|
.setmLiveTypeVal(mLiveTypeVal)));
|
||||||
if (mIntent.getIntExtra("isry", 0) == 1) {
|
|
||||||
mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, mIntent.getIntExtra("landscape", 0));
|
mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, mIntent.getIntExtra("landscape", 0));
|
||||||
} else {
|
|
||||||
mLivePlayViewHolder = new LivePlayKsyViewHolder(mContext, playContainer, mIntent.getIntExtra("landscape", 0));
|
|
||||||
}
|
|
||||||
mLivePlayViewHolder.addToParent();
|
mLivePlayViewHolder.addToParent();
|
||||||
mLivePlayViewHolder.subscribeActivityLifeCycle();
|
mLivePlayViewHolder.subscribeActivityLifeCycle();
|
||||||
mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager());
|
mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager());
|
||||||
@ -218,15 +231,13 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
mLiveAudienceViewHolder.subscribeActivityLifeCycle();
|
mLiveAudienceViewHolder.subscribeActivityLifeCycle();
|
||||||
mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, mLiveAudienceViewHolder.getContentView());
|
mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, mLiveAudienceViewHolder.getContentView());
|
||||||
mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, null);
|
mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, null);
|
||||||
if (!(mIntent.getIntExtra("isry", 0) == 1)) {
|
|
||||||
mLiveLinkMicPkPresenter = new LiveLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
|
|
||||||
} else {
|
|
||||||
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
|
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
|
||||||
}
|
|
||||||
|
|
||||||
//直播间背景
|
//直播间背景
|
||||||
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack);
|
ImgLoader.display(mContext, R.mipmap.live_bg, liveBack);
|
||||||
|
mask.setVisibility(View.GONE);
|
||||||
mLivePlayViewHolder.setCover(data.getThumb());
|
mLivePlayViewHolder.setCover(data.getThumb());
|
||||||
mLivePlayViewHolder.play(data.getPull());
|
mLivePlayViewHolder.play(data.getPull());
|
||||||
mLiveRoomViewHolder.setAvatar(data.getAvatar());
|
mLiveRoomViewHolder.setAvatar(data.getAvatar());
|
||||||
@ -234,12 +245,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
mLiveRoomViewHolder.setName(data.getUserNiceName());
|
mLiveRoomViewHolder.setName(data.getUserNiceName());
|
||||||
mLiveRoomViewHolder.setRoomNum(data.getLiangNameTip());
|
mLiveRoomViewHolder.setRoomNum(data.getLiangNameTip());
|
||||||
mLiveRoomViewHolder.setTitle(data.getTitle());
|
mLiveRoomViewHolder.setTitle(data.getTitle());
|
||||||
if (!(mIntent.getIntExtra("isry", 0) == 1)) {
|
|
||||||
mLiveLinkMicPkPresenter.setLiveUid(data.getUid(), "");
|
|
||||||
} else {
|
|
||||||
mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), "");
|
mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), "");
|
||||||
}
|
|
||||||
mLiveLinkMicPresenter.setLiveUid(data.getUid());
|
mLiveRoomViewHolder.setLiveUid(data.getUid());
|
||||||
//心愿单
|
//心愿单
|
||||||
LiveHttpUtil.getWishList(mLiveBean.getUid(), new HttpCallback() {
|
LiveHttpUtil.getWishList(mLiveBean.getUid(), new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
@ -263,19 +272,19 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRemove() {
|
public void onRemove() {
|
||||||
|
if (mLiveAudienceViewHolder != null) {
|
||||||
|
mLiveAudienceViewHolder.removeFromParent();
|
||||||
|
mLiveAudienceViewHolder.countDownTimerTrickery = null;
|
||||||
mLiveAudienceViewHolder.removeCallbacks();
|
mLiveAudienceViewHolder.removeCallbacks();
|
||||||
//断开socket
|
|
||||||
if (!(mIntent.getIntExtra("isry", 0) == 1)) {
|
|
||||||
if (mSocketClient != null) {
|
|
||||||
mSocketClient.disConnect();
|
|
||||||
}
|
}
|
||||||
mSocketClient = null;
|
mLiveAudienceViewHolder = null;
|
||||||
} else {
|
//断开socket
|
||||||
|
|
||||||
if (mSocketRyClient != null) {
|
if (mSocketRyClient != null) {
|
||||||
mSocketRyClient.disConnect();
|
mSocketRyClient.disConnect();
|
||||||
}
|
}
|
||||||
mSocketRyClient = null;
|
mSocketRyClient = null;
|
||||||
}
|
|
||||||
|
|
||||||
//结束播放
|
//结束播放
|
||||||
if (mLivePlayViewHolder != null) {
|
if (mLivePlayViewHolder != null) {
|
||||||
@ -314,17 +323,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
if (mLiveLinkMicAnchorPresenter != null) {
|
if (mLiveLinkMicAnchorPresenter != null) {
|
||||||
mLiveLinkMicAnchorPresenter.clearData();
|
mLiveLinkMicAnchorPresenter.clearData();
|
||||||
}
|
}
|
||||||
if (mLiveLinkMicPkPresenter != null) {
|
|
||||||
mLiveLinkMicPkPresenter.clearData();
|
|
||||||
}
|
|
||||||
if (mLiveRyLinkMicPkPresenter != null) {
|
if (mLiveRyLinkMicPkPresenter != null) {
|
||||||
mLiveRyLinkMicPkPresenter.clearData();
|
mLiveRyLinkMicPkPresenter.clearData();
|
||||||
}
|
}
|
||||||
if (mLiveAudienceViewHolder != null) {
|
|
||||||
mLiveAudienceViewHolder.removeFromParent();
|
|
||||||
mLiveAudienceViewHolder.countDownTimerTrickery = null;
|
|
||||||
mLiveAudienceViewHolder = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -377,9 +379,146 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请连麦但是主播还未同意的状态
|
||||||
|
*/
|
||||||
|
public void micIngTypeOne(LiveBean bean, int liveType, int liveTypeVal) {
|
||||||
|
DialogUitl.showSimpleDialog(mContext, null, "您已申請,退出將取消語音連麥申請!", false, new DialogUitl.SimpleCallback3() {
|
||||||
|
@Override
|
||||||
|
public void onConfirmClick(Dialog dialog) {
|
||||||
|
Micing = 0;
|
||||||
|
//用户申请联麦
|
||||||
|
final SocketSendBean msg = new SocketSendBean()
|
||||||
|
.param("_method_", Constants.LIAN_MAI)
|
||||||
|
.param("action", 7)
|
||||||
|
.param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName())
|
||||||
|
.param("avatar", CommonAppConfig.getInstance().getUserBean().getAvatar())
|
||||||
|
.param("uid", CommonAppConfig.getInstance().getUid());
|
||||||
|
msg.create();
|
||||||
|
|
||||||
|
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
|
||||||
|
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||||
|
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(liveID, conversationType, messageContent);
|
||||||
|
|
||||||
|
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||||
|
@Override
|
||||||
|
public void onAttached(io.rong.imlib.model.Message message) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(io.rong.imlib.model.Message message) {
|
||||||
|
Log.e("ry", "发送成功");
|
||||||
|
liveImDeletUtil.deleteMessages(message.getTargetId(), message.getMessageId());
|
||||||
|
if (isBackPressed) {
|
||||||
|
((LiveAudienceActivity) mContext).onBackPressed();
|
||||||
|
} else {
|
||||||
|
EventBus.getDefault().post(new LiveRoomChangeEvent(bean, liveType, liveTypeVal));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(io.rong.imlib.model.Message message, RongIMClient.ErrorCode errorCode) {
|
||||||
|
Log.e("ry", "发送失敗" + errorCode.toString());
|
||||||
|
liveImDeletUtil.deleteMessages(message.getTargetId(), message.getMessageId());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCancel() {
|
||||||
|
((LiveAudienceActivity) mContext).setEnableScroll(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正处于连麦中
|
||||||
|
*/
|
||||||
|
public void micIngTypeTwo(LiveBean bean, int liveType, int liveTypeVal) {
|
||||||
|
DialogUitl.showSimpleDialog(mContext, null, "連麥中,退出將斷開語音連麥!", false, new DialogUitl.SimpleCallback3() {
|
||||||
|
@Override
|
||||||
|
public void onConfirmClick(Dialog dialog) {
|
||||||
|
ToastUtil.show("下麥中,稍等.....");
|
||||||
|
RCRTCEngine.getInstance().getRoom().getLocalUser().switchToAudience(new IRCRTCSwitchRoleCallback() {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当切换失败且SDK处于无法回退状态时回调,该角色已经无法使用当前角色继续进行音视频。
|
||||||
|
* SDK内部会退出房间并清理所有资源,该用户只能重新加入房间才能继续音视频。
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onKicked() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("ry", "下麦成功");
|
||||||
|
// 该用户切换为观众成功,可以以观众身份进行音视频
|
||||||
|
//退出多人房间
|
||||||
|
HttpClient.getInstance().get("live.leaveDrLm", "live.leaveDrLm")
|
||||||
|
.params("roomid", liveID)
|
||||||
|
.execute(new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
Log.e("ry", code + "退出多人");
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//退出rtc播放
|
||||||
|
RCRTCEngine.getInstance().leaveRoom(new IRCRTCResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("ry", "退出多人房间成功");
|
||||||
|
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
Micing = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (isBackPressed) {
|
||||||
|
((LiveAudienceActivity) mContext).onBackPressed();
|
||||||
|
} else {
|
||||||
|
EventBus.getDefault().post(new LiveRoomChangeEvent(bean, liveType, liveTypeVal));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode errorCode) {
|
||||||
|
Log.e("ry", errorCode + "退出多人房间失敗");
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当切换失败且不影响当前角色继续音视频时回调
|
||||||
|
* @param errorCode 失败错误码
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode errorCode) {
|
||||||
|
Log.e("ry", "下麦失败" + errorCode);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCancel() {
|
||||||
|
((LiveAudienceActivity) mContext).setEnableScroll(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//是否处于返回键
|
||||||
|
private boolean isBackPressed = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
|
isBackPressed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -388,20 +527,14 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
if (!mFirstConnectSocket) {
|
if (!mFirstConnectSocket) {
|
||||||
mFirstConnectSocket = true;
|
mFirstConnectSocket = true;
|
||||||
if (mLiveType == Constants.LIVE_TYPE_PAY || mLiveType == Constants.LIVE_TYPE_TIME) {
|
if (mLiveType == Constants.LIVE_TYPE_PAY || mLiveType == Constants.LIVE_TYPE_TIME) {
|
||||||
if (!(mIntent.getIntExtra("isry", 0) == 1)) {
|
|
||||||
SocketChatUtil.sendUpdateVotesMessage(mLiveBean.getUid(), mLiveTypeVal, 1);
|
|
||||||
} else {
|
|
||||||
SocketRyChatUtil.sendUpdateVotesMessage(mLiveBean.getUid(), mLiveTypeVal, 1);
|
SocketRyChatUtil.sendUpdateVotesMessage(mLiveBean.getUid(), mLiveTypeVal, 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!(mIntent.getIntExtra("isry", 0) == 1)) {
|
|
||||||
SocketChatUtil.getFakeFans(mLiveBean.getUid());
|
|
||||||
} else {
|
|
||||||
SocketRyChatUtil.getFakeFans(mLiveBean.getUid());
|
SocketRyChatUtil.getFakeFans(mLiveBean.getUid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisConnect() {
|
public void onDisConnect() {
|
||||||
@ -443,11 +576,14 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
mLiveLinkMicPresenter.onAudienceLeaveRoom(bean);
|
mLiveLinkMicPresenter.onAudienceLeaveRoom(bean);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
if(mLiveRoomViewHolder!=null){
|
||||||
|
mLiveRoomViewHolder.onExitRoom(bean);
|
||||||
if (mLiveRoomViewHolder.room_hot != null) {
|
if (mLiveRoomViewHolder.room_hot != null) {
|
||||||
if (!"".equals(bean.getHot_num()) && !"0".equals(bean.getHot_num())) {
|
if (!"".equals(bean.getHot_num()) && !"0".equals(bean.getHot_num())) {
|
||||||
mLiveRoomViewHolder.room_hot.setText(formatBigNum.formatBigNum(bean.getHot_num()));
|
mLiveRoomViewHolder.room_hot.setText(formatBigNum.formatBigNum(bean.getHot_num()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -499,14 +635,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSendGiftPk(long leftGift, long rightGift, LivePKUserListBean bean) {
|
public void onSendGiftPk(long leftGift, long rightGift, LivePKUserListBean bean) {
|
||||||
if (!(mIntent.getIntExtra("isry", 0) == 1)) {
|
|
||||||
if (mLiveLinkMicPkPresenter != null) {
|
|
||||||
mLiveLinkMicPkPresenter.onPkProgressChanged(leftGift, rightGift, bean);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (mLiveRyLinkMicPkPresenter != null) {
|
if (mLiveRyLinkMicPkPresenter != null) {
|
||||||
mLiveRyLinkMicPkPresenter.onPkProgressChanged(leftGift, rightGift, bean);
|
mLiveRyLinkMicPkPresenter.onPkProgressChanged(leftGift, rightGift, bean);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -814,34 +946,41 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
|
|
||||||
private void enterRoom() {
|
private void enterRoom() {
|
||||||
//进入直播间IM
|
//进入直播间IM
|
||||||
if (!(mIntent.getIntExtra("isry", 0) == 1)) {
|
|
||||||
mSocketClient = new SocketClient(mLiveBean.getUid(), this);
|
|
||||||
if (mLiveLinkMicPresenter != null) {
|
|
||||||
mLiveLinkMicPresenter.setSocketClient(mSocketClient);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
mSocketRyClient = new SocketRyClient(mLiveBean.getUid(), this);
|
mSocketRyClient = new SocketRyClient(mLiveBean.getUid(), this);
|
||||||
if (mLiveLinkMicPresenter != null) {
|
if (mLiveLinkMicPresenter != null) {
|
||||||
mLiveLinkMicPresenter.setSocketClient(mSocketClient);
|
mLiveLinkMicPresenter.setSocketClient(mSocketClient);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
timeIndex = 0;
|
timeIndex = 0;
|
||||||
LiveHttpUtil.enterRoom(mLiveBean.getUid(), mLiveBean.getStream(), new HttpCallback() {
|
LiveHttpUtil.enterRoom(mLiveBean.getUid(), mLiveBean.getStream(), new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
|
||||||
if (code == 0 && info.length > 0) {
|
if (code == 0 && info.length > 0) {
|
||||||
JSONObject obj = JSON.parseObject(info[0]);
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
mDanmuPrice = obj.getString("barrage_fee");
|
mDanmuPrice = obj.getString("barrage_fee");
|
||||||
mSocketUserType = obj.getIntValue("usertype");
|
mSocketUserType = obj.getIntValue("usertype");
|
||||||
mChatLevel = obj.getIntValue("speak_limit");
|
mChatLevel = obj.getIntValue("speak_limit");
|
||||||
mDanMuLevel = obj.getIntValue("barrage_limit");
|
mDanMuLevel = obj.getIntValue("barrage_limit");
|
||||||
|
liveBg = obj.getIntValue("live_bg");
|
||||||
|
if (obj.containsKey("greetings")) {
|
||||||
|
greetings = JSONArray.parseArray(obj.getJSONArray("greetings").toJSONString(), String.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (liveBg == 1) {
|
||||||
|
//直播间背景
|
||||||
|
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack);
|
||||||
|
mask.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
//回传参数
|
//回传参数
|
||||||
Bus.get().post(new LiveAudienceEvent()
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
|
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
|
||||||
.setParametersModel(new OpenParametersModel().setmDanmuPrice(mDanmuPrice)
|
.setParametersModel(new OpenParametersModel().setmDanmuPrice(mDanmuPrice)
|
||||||
.setmSocketUserType(mSocketUserType)
|
.setmSocketUserType(mSocketUserType)
|
||||||
.setmChatLevel(mChatLevel)
|
.setmChatLevel(mChatLevel)
|
||||||
.setmDanMuLevel(mDanMuLevel)));
|
.setmDanMuLevel(mDanMuLevel)
|
||||||
|
.setLiveBg(liveBg)));
|
||||||
EventBus.getDefault().post("close_login");
|
EventBus.getDefault().post("close_login");
|
||||||
EventBus.getDefault().post("oneUesrOver");
|
EventBus.getDefault().post("oneUesrOver");
|
||||||
|
|
||||||
@ -903,6 +1042,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
LivePlayKsyViewHolder.setLandscape(obj.getIntValue("landscape"));
|
LivePlayKsyViewHolder.setLandscape(obj.getIntValue("landscape"));
|
||||||
|
|
||||||
mLiveRoomViewHolder.setLiveInfo(mLiveBean.getUid(), mLiveBean.getStream(), obj.getIntValue("userlist_time") * 4000);
|
mLiveRoomViewHolder.setLiveInfo(mLiveBean.getUid(), mLiveBean.getStream(), obj.getIntValue("userlist_time") * 4000);
|
||||||
|
mLiveRoomViewHolder.setFastMessage(greetings);
|
||||||
mLiveRoomViewHolder.setVotes(obj.getString("votestotal"));
|
mLiveRoomViewHolder.setVotes(obj.getString("votestotal"));
|
||||||
//真爱排行 数量
|
//真爱排行 数量
|
||||||
mLiveRoomViewHolder.setMedaRankNum(obj.getString("medalRankNum"));
|
mLiveRoomViewHolder.setMedaRankNum(obj.getString("medalRankNum"));
|
||||||
@ -971,50 +1111,33 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (obj.getString("isconnection") != null && obj.getString("isconnection").equals("1")) {
|
if (obj.getString("isconnection") != null && obj.getString("isconnection").equals("1")) {
|
||||||
if (!(mIntent.getIntExtra("isry", 0) == 1)) {
|
|
||||||
setViewUP();
|
|
||||||
} else {
|
|
||||||
LivePlayRyViewHolder.setViewUP(1);
|
LivePlayRyViewHolder.setViewUP(1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (pkInfo.getIntValue("ifpk") == 1 && pkInfo.getString("end_pk_time").equals("0")) {//pk开始了
|
if (pkInfo.getIntValue("ifpk") == 1 && pkInfo.getString("end_pk_time").equals("0")) {//pk开始了
|
||||||
if (!(mIntent.getIntExtra("isry", 0) == 1)) {
|
|
||||||
setViewUP();
|
|
||||||
} else {
|
|
||||||
LivePlayRyViewHolder.setViewUP(2);
|
LivePlayRyViewHolder.setViewUP(2);
|
||||||
}
|
|
||||||
//pk排名数据
|
//pk排名数据
|
||||||
LivePKUserListBean livePKUserListBean = JSON.parseObject(pkInfo.getString("pk_top_users"), LivePKUserListBean.class);
|
LivePKUserListBean livePKUserListBean = JSON.parseObject(pkInfo.getString("pk_top_users"), LivePKUserListBean.class);
|
||||||
if (mLiveRoomViewHolder != null) {
|
if (mLiveRoomViewHolder != null) {
|
||||||
mLiveRoomViewHolder.setOtherInfo(pkInfo.getString("pkuid"), pkInfo.getString("pkuimg"), pkInfo.getString("pkuname"));
|
mLiveRoomViewHolder.setOtherInfo(pkInfo.getString("pkuid"), pkInfo.getString("pkuimg"), pkInfo.getString("pkuname"));
|
||||||
}
|
}
|
||||||
if (mLiveLinkMicPkPresenter != null) {
|
|
||||||
mLiveLinkMicPkPresenter.onEnterRoomPkStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("pk_time"), livePKUserListBean);
|
|
||||||
} else {
|
|
||||||
mLiveRyLinkMicPkPresenter.onEnterRoomPkStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("pk_time"), livePKUserListBean);
|
mLiveRyLinkMicPkPresenter.onEnterRoomPkStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("pk_time"), livePKUserListBean);
|
||||||
}
|
|
||||||
} else if (!pkInfo.getString("end_pk_time").equals("0")) {
|
} else if (!pkInfo.getString("end_pk_time").equals("0")) {
|
||||||
if (!(mIntent.getIntExtra("isry", 0) == 1)) {
|
|
||||||
setViewUP();
|
|
||||||
} else {
|
|
||||||
LivePlayRyViewHolder.setViewUP(3);
|
LivePlayRyViewHolder.setViewUP(3);
|
||||||
}
|
|
||||||
//pk排名数据
|
//pk排名数据
|
||||||
LivePKUserListBean livePKUserListBean = JSON.parseObject(pkInfo.getString("pk_top_users"), LivePKUserListBean.class);
|
LivePKUserListBean livePKUserListBean = JSON.parseObject(pkInfo.getString("pk_top_users"), LivePKUserListBean.class);
|
||||||
if (mLiveLinkMicPkPresenter != null) {
|
|
||||||
mLiveLinkMicPkPresenter.onEnterRoomCFStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("end_pk_time"), livePKUserListBean);
|
|
||||||
} else {
|
|
||||||
mLiveRyLinkMicPkPresenter.onEnterRoomCFStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("end_pk_time"), livePKUserListBean);
|
mLiveRyLinkMicPkPresenter.onEnterRoomCFStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("end_pk_time"), livePKUserListBean);
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//多人PK
|
//多人PK
|
||||||
} else if (pkInfo != null && pkInfo.getIntValue("drpk_status") == 1) {
|
} else if (pkInfo != null && pkInfo.getIntValue("drpk_status") == 1) {
|
||||||
if (!(mIntent.getIntExtra("isry", 0) == 1)) {
|
|
||||||
setViewUP();
|
|
||||||
} else {
|
|
||||||
LivePlayRyViewHolder.setViewUP(4);
|
LivePlayRyViewHolder.setViewUP(4);
|
||||||
}
|
|
||||||
mLiveRoomViewHolder.UpPkBar(pkInfo.getJSONArray("userlist"), mLiveBean.getUid(), pkInfo.getIntValue("drpk_time"));
|
mLiveRoomViewHolder.UpPkBar(pkInfo.getJSONArray("userlist"), mLiveBean.getUid(), pkInfo.getIntValue("drpk_time"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1136,17 +1259,12 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
}
|
}
|
||||||
mEnd = true;
|
mEnd = true;
|
||||||
//断开socket
|
//断开socket
|
||||||
if (!(mIntent.getIntExtra("isry", 0) == 1)) {
|
|
||||||
if (mSocketClient != null) {
|
|
||||||
mSocketClient.disConnect();
|
|
||||||
}
|
|
||||||
mSocketClient = null;
|
|
||||||
} else {
|
|
||||||
if (mSocketRyClient != null) {
|
if (mSocketRyClient != null) {
|
||||||
mSocketRyClient.disConnect();
|
mSocketRyClient.disConnect();
|
||||||
}
|
}
|
||||||
mSocketRyClient = null;
|
mSocketRyClient = null;
|
||||||
}
|
|
||||||
|
|
||||||
//结束播放
|
//结束播放
|
||||||
if (mLivePlayViewHolder != null) {
|
if (mLivePlayViewHolder != null) {
|
||||||
@ -1157,6 +1275,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void end() {
|
public void end() {
|
||||||
|
if (mLiveRoomViewHolder != null)
|
||||||
|
mLiveRoomViewHolder.clearList();
|
||||||
boolean canBackPressed = true;
|
boolean canBackPressed = true;
|
||||||
if (mContext instanceof LiveAudienceActivity) {
|
if (mContext instanceof LiveAudienceActivity) {
|
||||||
canBackPressed = ((LiveAudienceActivity) mContext).canBackPressed();
|
canBackPressed = ((LiveAudienceActivity) mContext).canBackPressed();
|
||||||
@ -1185,7 +1305,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
} else {
|
} else {
|
||||||
exitLiveRoom();
|
exitLiveRoom();
|
||||||
}
|
}
|
||||||
mBannerList2.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1266,11 +1386,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
if (!mLighted) {
|
if (!mLighted) {
|
||||||
mLighted = true;
|
mLighted = true;
|
||||||
int guardType = mLiveGuardInfo != null ? mLiveGuardInfo.getMyGuardType() : Constants.GUARD_TYPE_NONE;
|
int guardType = mLiveGuardInfo != null ? mLiveGuardInfo.getMyGuardType() : Constants.GUARD_TYPE_NONE;
|
||||||
if (!(mIntent.getIntExtra("isry", 0) == 1)) {
|
|
||||||
SocketChatUtil.sendLightMessage(mLiveBean.getUid(), 1 + RandomUtil.nextInt(6), guardType);
|
|
||||||
} else {
|
|
||||||
SocketRyChatUtil.sendLightMessage(mLiveBean.getUid(), 1 + RandomUtil.nextInt(6), guardType);
|
SocketRyChatUtil.sendLightMessage(mLiveBean.getUid(), 1 + RandomUtil.nextInt(6), guardType);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (mLiveRoomViewHolder != null) {
|
if (mLiveRoomViewHolder != null) {
|
||||||
mLiveRoomViewHolder.playLightAnim();
|
mLiveRoomViewHolder.playLightAnim();
|
||||||
@ -1324,10 +1441,17 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
* 更新主播映票数
|
* 更新主播映票数
|
||||||
*/
|
*/
|
||||||
public void sendUpdateVotesMessage() {
|
public void sendUpdateVotesMessage() {
|
||||||
if (!(mIntent.getIntExtra("isry", 0) == 1)) {
|
|
||||||
SocketChatUtil.sendUpdateVotesMessage(mLiveBean.getUid(), mLiveTypeVal);
|
|
||||||
} else {
|
|
||||||
SocketRyChatUtil.sendUpdateVotesMessage(mLiveBean.getUid(), mLiveTypeVal);
|
SocketRyChatUtil.sendUpdateVotesMessage(mLiveBean.getUid(), mLiveTypeVal);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onFollowEvent(FollowEvent e) {
|
||||||
|
if (!TextUtils.isEmpty(liveID) && liveID.equals(e.getToUid())) {
|
||||||
|
if (mLiveRoomViewHolder != null) {
|
||||||
|
mLiveRoomViewHolder.setAttention(e.getIsAttention());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
9
live/src/main/res/drawable/bg_fast_meg.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:width="112dp" android:height="25dp">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#33000000" />
|
||||||
|
<corners android:radius="12dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
9
live/src/main/res/drawable/bg_guard_info.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:width="365dp" android:height="333dp">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#ffffffff" />
|
||||||
|
<corners android:radius="16dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
9
live/src/main/res/drawable/bg_guard_up_title.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:width="182dp" android:height="32dp">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#ff9e7afd" />
|
||||||
|
<corners android:radius="16dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
BIN
live/src/main/res/drawable/guardian_img_bg.png
Normal file
After Width: | Height: | Size: 656 KiB |
BIN
live/src/main/res/drawable/guardian_img_wings.png
Normal file
After Width: | Height: | Size: 251 KiB |
BIN
live/src/main/res/drawable/img_diamond.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
live/src/main/res/drawable/img_guard_bottom.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
live/src/main/res/drawable/img_k_selected.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
live/src/main/res/drawable/img_k_uncheck.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
live/src/main/res/drawable/img_venosa.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
live/src/main/res/drawable/live_loading.gif
Normal file
After Width: | Height: | Size: 482 KiB |
BIN
live/src/main/res/drawable/loading_00000.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
live/src/main/res/drawable/loading_00001.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
live/src/main/res/drawable/loading_00002.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
live/src/main/res/drawable/loading_00003.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
live/src/main/res/drawable/loading_00004.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
live/src/main/res/drawable/loading_00005.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
live/src/main/res/drawable/loading_00006.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
live/src/main/res/drawable/loading_00007.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
live/src/main/res/drawable/loading_00008.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
live/src/main/res/drawable/loading_00009.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
live/src/main/res/drawable/loading_00010.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
live/src/main/res/drawable/loading_00011.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
live/src/main/res/drawable/loading_00012.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
live/src/main/res/drawable/loading_00013.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
live/src/main/res/drawable/loading_00014.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
live/src/main/res/drawable/loading_00015.png
Normal file
After Width: | Height: | Size: 32 KiB |
@ -2,13 +2,53 @@
|
|||||||
<animation-list xmlns:android="http://schemas.android.com/apk/res/android">
|
<animation-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:drawable="@drawable/img_loading_01"
|
android:drawable="@drawable/loading_00000"
|
||||||
android:duration="350" />
|
android:duration="100" />
|
||||||
<item
|
<item
|
||||||
android:drawable="@drawable/img_loading_02"
|
android:drawable="@drawable/loading_00001"
|
||||||
android:duration="350" />
|
android:duration="100" />
|
||||||
<item
|
<item
|
||||||
android:drawable="@drawable/img_loading_03"
|
android:drawable="@drawable/loading_00002"
|
||||||
android:duration="350" />
|
android:duration="100" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/loading_00003"
|
||||||
|
android:duration="100" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/loading_00004"
|
||||||
|
android:duration="100" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/loading_00005"
|
||||||
|
android:duration="100" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/loading_00006"
|
||||||
|
android:duration="100" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/loading_00007"
|
||||||
|
android:duration="100" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/loading_00008"
|
||||||
|
android:duration="100" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/loading_00009"
|
||||||
|
android:duration="100" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/loading_00010"
|
||||||
|
android:duration="100" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/loading_00011"
|
||||||
|
android:duration="100" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/loading_00012"
|
||||||
|
android:duration="100" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/loading_00013"
|
||||||
|
android:duration="100" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/loading_00014"
|
||||||
|
android:duration="100" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/loading_00015"
|
||||||
|
android:duration="100" />
|
||||||
|
|
||||||
|
|
||||||
</animation-list>
|
</animation-list>
|
BIN
live/src/main/res/drawable/sh_img_title.png
Normal file
After Width: | Height: | Size: 17 KiB |
@ -18,6 +18,7 @@
|
|||||||
android:src="@mipmap/live_bg" />
|
android:src="@mipmap/live_bg" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
android:id="@+id/mask"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#70000000" />
|
android:background="#70000000" />
|
||||||
|
@ -9,10 +9,6 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:overScrollMode="never" />
|
android:overScrollMode="never" />
|
||||||
|
|
||||||
<com.yunbao.live.views.LoadingView
|
|
||||||
android:id="@+id/loading"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:visibility="visible" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -48,8 +48,7 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/guard_buy_2"
|
android:text="@string/guard_buy_2"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp" />
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tip"
|
android:id="@+id/tip"
|
||||||
|
184
live/src/main/res/layout/dialog_new_guard_buy.xml
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/transparent"
|
||||||
|
android:clipChildren="false">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/guard_rootView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="52dp"
|
||||||
|
android:background="@drawable/guardian_img_bg"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/guard_linearLayout"
|
||||||
|
android:layout_width="182dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_marginTop="52dp"
|
||||||
|
android:layout_marginBottom="21dp"
|
||||||
|
android:background="@drawable/bg_guard_up_title"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guard_constraintLayout"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/guard_anchor_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#F6F7FB"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/guard_constraintLayout"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:layout_marginTop="11dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:background="@drawable/bg_guard_info"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/guard_linearLayout">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/guard_textView2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/buy_guard_info"
|
||||||
|
android:textColor="#020202"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/guard_buys_layout"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="110dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="6dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/guard_textView2">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/guard_buys"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="center">
|
||||||
|
|
||||||
|
</androidx.recyclerview.widget.RecyclerView>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/guard_imageView2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/guard_buys_layout"
|
||||||
|
app:srcCompat="@drawable/sh_img_title" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/guard_rights"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/guard_imageView2">
|
||||||
|
|
||||||
|
</androidx.recyclerview.widget.RecyclerView>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/guard_relativeLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="77dp"
|
||||||
|
android:layout_marginTop="-20dp"
|
||||||
|
android:background="@drawable/img_guard_bottom"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/guard_constraintLayout">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/guard_coin_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:textColor="@color/textColor2"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/guard_coin"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_toRightOf="@id/guard_coin_name"
|
||||||
|
android:drawablePadding="4dp"
|
||||||
|
android:textColor="@color/global"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/guard_btn_buy"
|
||||||
|
android:layout_width="90dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:background="@drawable/bg_guard_btn_buy"
|
||||||
|
android:enabled="false"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/guard_buy"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/guard_imageView"
|
||||||
|
android:layout_width="243dp"
|
||||||
|
android:layout_height="117dp"
|
||||||
|
android:layout_above="@id/guard_rootView"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginBottom="-102dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:srcCompat="@drawable/guardian_img_wings" />
|
||||||
|
</RelativeLayout>
|
@ -73,7 +73,7 @@
|
|||||||
android:text="@string/live_guard"
|
android:text="@string/live_guard"
|
||||||
android:textColor="#ff646464"
|
android:textColor="#ff646464"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:visibility="gone" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/fans_btn"
|
android:id="@+id/fans_btn"
|
||||||
|
71
live/src/main/res/layout/item_dialog_guard_buy.xml
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="112dp"
|
||||||
|
android:layout_height="114dp"
|
||||||
|
android:id="@+id/guard_buy_button"
|
||||||
|
android:background="@drawable/img_k_selected"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/guard_buy_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:text="TextView"
|
||||||
|
android:textColor="#020202"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/guard_buy_goback"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="right"
|
||||||
|
android:text="TextView"
|
||||||
|
android:textColor="#979797"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="10dp"
|
||||||
|
android:layout_height="11dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/img_venosa" />
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/guard_buy_money"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="right"
|
||||||
|
android:text="TextView"
|
||||||
|
android:textColor="#7C4FF9"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="13dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/img_diamond" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
24
live/src/main/res/layout/item_fast_msg.xml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/room_fast_layout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_fast_meg">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/room_fast_message_text_view"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:text="TextView"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
19
live/src/main/res/layout/layout_portrait_comm_item.xml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_bg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_loading"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="188dp"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:background="@drawable/loading_animation" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_loading"
|
android:id="@+id/iv_loading"
|
||||||
android:layout_width="50dp"
|
android:layout_width="150dp"
|
||||||
android:layout_height="10dp"
|
android:layout_height="188dp"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:background="@drawable/loading_animation" />
|
android:background="@drawable/loading_animation" />
|
||||||
|
|
||||||
|
@ -85,47 +85,6 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/btn_event1"
|
|
||||||
android:layout_width="68dp"
|
|
||||||
android:layout_height="68dp"
|
|
||||||
android:layout_gravity="right"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:layout_marginBottom="18dp"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<com.ms.banner.Banner
|
|
||||||
android:id="@+id/banner1"
|
|
||||||
android:layout_width="68dp"
|
|
||||||
android:layout_height="68dp"
|
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
app:delay_time="5000"
|
|
||||||
app:indicator_height="8dp"
|
|
||||||
app:indicator_width="8dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/btn_event2"
|
|
||||||
android:layout_width="58dp"
|
|
||||||
android:layout_height="80dp"
|
|
||||||
android:layout_gravity="right"
|
|
||||||
android:layout_marginRight="15dp"
|
|
||||||
android:layout_marginBottom="45dp"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<com.ms.banner.Banner
|
|
||||||
android:id="@+id/banner2"
|
|
||||||
android:layout_width="58dp"
|
|
||||||
android:layout_height="80dp"
|
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
app:delay_time="5000"
|
|
||||||
app:indicator_height="8dp"
|
|
||||||
app:indicator_width="8dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/btn_onecz_event"
|
android:id="@+id/btn_onecz_event"
|
||||||
@ -147,24 +106,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/btn_event"
|
|
||||||
android:layout_width="68dp"
|
|
||||||
android:layout_height="68dp"
|
|
||||||
android:layout_gravity="right"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:layout_marginBottom="20dp"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/img_event"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:src="@drawable/live_turntable" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -9,6 +9,76 @@
|
|||||||
|
|
||||||
android:paddingTop="15dp">
|
android:paddingTop="15dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btn_event1"
|
||||||
|
android:layout_width="68dp"
|
||||||
|
android:layout_height="68dp"
|
||||||
|
android:layout_gravity="right"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginBottom="18dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.ms.banner.Banner
|
||||||
|
android:id="@+id/banner1"
|
||||||
|
android:layout_width="68dp"
|
||||||
|
android:layout_height="68dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
app:delay_time="5000"
|
||||||
|
app:indicator_height="8dp"
|
||||||
|
app:indicator_width="8dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btn_event2"
|
||||||
|
android:layout_width="58dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:layout_gravity="right"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:layout_marginBottom="45dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.ms.banner.Banner
|
||||||
|
android:id="@+id/banner2"
|
||||||
|
android:layout_width="58dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
app:delay_time="5000"
|
||||||
|
app:indicator_height="8dp"
|
||||||
|
app:indicator_width="8dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btn_event"
|
||||||
|
android:layout_width="68dp"
|
||||||
|
|
||||||
|
android:layout_height="68dp"
|
||||||
|
android:layout_gravity="right"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_event"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:src="@drawable/live_turntable" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/lin"
|
android:id="@+id/lin"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -127,12 +197,12 @@
|
|||||||
android:id="@+id/user_guard"
|
android:id="@+id/user_guard"
|
||||||
android:layout_width="27dp"
|
android:layout_width="27dp"
|
||||||
android:layout_height="27dp"
|
android:layout_height="27dp"
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
app:riv_oval="true"
|
android:src="@mipmap/img_guardian_empty"
|
||||||
android:src="@mipmap/img_guardian_empty"/>
|
app:riv_oval="true" />
|
||||||
|
|
||||||
|
|
||||||
<com.opensource.svgaplayer.SVGAImageView
|
<com.opensource.svgaplayer.SVGAImageView
|
||||||
@ -146,13 +216,13 @@
|
|||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/user_recyclerView"
|
android:id="@+id/user_recyclerView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginRight="-3dp"
|
android:layout_marginRight="-3dp"
|
||||||
android:overScrollMode="never" />
|
android:overScrollMode="never" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/user_more"
|
android:id="@+id/user_more"
|
||||||
android:layout_width="33dp"
|
android:layout_width="33dp"
|
||||||
@ -352,8 +422,8 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_marginStart="6dp"
|
android:layout_marginStart="6dp"
|
||||||
android:flipInterval="5000"
|
|
||||||
android:layout_marginEnd="6dp"
|
android:layout_marginEnd="6dp"
|
||||||
|
android:flipInterval="5000"
|
||||||
android:inAnimation="@anim/anim_marquee_in"
|
android:inAnimation="@anim/anim_marquee_in"
|
||||||
android:outAnimation="@anim/anim_marquee_out" />
|
android:outAnimation="@anim/anim_marquee_out" />
|
||||||
|
|
||||||
@ -1796,7 +1866,11 @@
|
|||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_centerVertical="true" />
|
android:layout_centerVertical="true" />
|
||||||
<!-- SVG 座骑-->
|
<!-- SVG 座骑-->
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/room_fast_msg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_alignParentBottom="true" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
android:scaleType="centerCrop" />
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
android:id="@+id/mask"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#90000000" />
|
android:background="#90000000" />
|
||||||
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 29 KiB |
@ -1 +1,4 @@
|
|||||||
<resources></resources>
|
<resources>
|
||||||
|
<string name="buy_guard_info" translatable="false">成爲TA的守護,爲TA保駕護航!</string>
|
||||||
|
<string name="buy_guard_back_coin" translatable="false">返還</string>
|
||||||
|
</resources>
|
||||||
|
@ -62,7 +62,7 @@ public class GoogleFragment extends Fragment {
|
|||||||
|
|
||||||
|
|
||||||
private View view;
|
private View view;
|
||||||
private static String mOrderid,mProductId,MoneyUsds;
|
private String mOrderid,mProductId,MoneyUsds;
|
||||||
|
|
||||||
private WebView rlWebview;
|
private WebView rlWebview;
|
||||||
private String url;
|
private String url;
|
||||||
@ -84,9 +84,6 @@ public class GoogleFragment extends Fragment {
|
|||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
adid = AdvertisingIdClient.getAdvertisingIdInfo(getActivity()).getId();
|
adid = AdvertisingIdClient.getAdvertisingIdInfo(getActivity()).getId();
|
||||||
Log.e("vssss",adid);
|
Log.e("vssss",adid);
|
||||||
|
@ -46,8 +46,10 @@ 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.CommonAppContext;
|
||||||
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.activity.WebViewActivity;
|
||||||
import com.yunbao.common.adapter.ViewPagerAdapter;
|
import com.yunbao.common.adapter.ViewPagerAdapter;
|
||||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||||
import com.yunbao.common.bean.ChatRemarksBean;
|
import com.yunbao.common.bean.ChatRemarksBean;
|
||||||
@ -133,6 +135,7 @@ import io.rong.imlib.RongIMClient;
|
|||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
|
|
||||||
import static com.yunbao.common.CommonAppContext.isReady;
|
import static com.yunbao.common.CommonAppContext.isReady;
|
||||||
|
import static com.yunbao.live.activity.SystemMessageActivity.type;
|
||||||
|
|
||||||
import io.rong.imlib.model.Message;
|
import io.rong.imlib.model.Message;
|
||||||
import io.rong.push.PushManager;
|
import io.rong.push.PushManager;
|
||||||
@ -267,6 +270,37 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// private void getToken() {
|
||||||
|
// // 创建一个新线程
|
||||||
|
// new Thread() {
|
||||||
|
// @Override
|
||||||
|
// public void run() {
|
||||||
|
// try {
|
||||||
|
// // 从agconnect-service.json文件中读取appId
|
||||||
|
// String appId = "106936673";
|
||||||
|
//
|
||||||
|
// // 输入token标识"HCM"
|
||||||
|
// String tokenScope = "HCM";
|
||||||
|
// String token = HmsInstanceId.getInstance(MainActivity.this).getToken(appId, tokenScope);
|
||||||
|
// Log.i("hw", "get token: " + token);
|
||||||
|
//
|
||||||
|
// // 判断token是否为空
|
||||||
|
// if(!TextUtils.isEmpty(token)) {
|
||||||
|
// sendRegTokenToServer(token);
|
||||||
|
// }
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// Log.e("hw","get token failed, " + e);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }.start();
|
||||||
|
// }
|
||||||
|
// private void sendRegTokenToServer(String token) {
|
||||||
|
// PushManager.getInstance()
|
||||||
|
// .onReceiveToken(MainActivity.this, PushType.HUAWEI, token);
|
||||||
|
// Log.i("hw", "sending token to server. token:" + token);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void main() {
|
protected void main() {
|
||||||
ConversationIMListManager.get(this);
|
ConversationIMListManager.get(this);
|
||||||
@ -287,6 +321,40 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
// RTCLib 初始化
|
// RTCLib 初始化
|
||||||
RCRTCConfig.Builder config = RCRTCConfig.Builder.create();
|
RCRTCConfig.Builder config = RCRTCConfig.Builder.create();
|
||||||
RCRTCEngine.getInstance().init(MainActivity.this, config.build());
|
RCRTCEngine.getInstance().init(MainActivity.this, config.build());
|
||||||
|
//推送跳直播间
|
||||||
|
if(getIntent().getStringExtra("liveid")!=null){
|
||||||
|
LiveHttpUtil.getLiveInfo(getIntent().getStringExtra("liveid") + "", 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);
|
||||||
|
|
||||||
|
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
||||||
|
if (liveBean == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mCheckLivePresenter.checkLive(liveBean);
|
||||||
|
} else {
|
||||||
|
ToastUtil.show("直播已结束");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else if(getIntent().getStringExtra("type")!=null&&getIntent().getStringExtra("type").equals("2")){
|
||||||
|
//跳转消息列表
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putInt(PDLiveConversationListActivity.MESSAGENUMBER, messageNumber);
|
||||||
|
bundle.putInt(PDLiveConversationListActivity.NUMBERME, numberMe);
|
||||||
|
ConversationIMListManager.get(this).jumpConversationList(bundle);
|
||||||
|
}else if(getIntent().getStringExtra("type")!=null&&getIntent().getStringExtra("type").equals("8")){
|
||||||
|
WebViewActivity.forward(mContext, getIntent().getStringExtra("activityUrl"), true);
|
||||||
|
}
|
||||||
FirebaseMessaging.getInstance().getToken()
|
FirebaseMessaging.getInstance().getToken()
|
||||||
.addOnCompleteListener(new OnCompleteListener<String>() {
|
.addOnCompleteListener(new OnCompleteListener<String>() {
|
||||||
@Override
|
@Override
|
||||||
@ -306,6 +374,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
// Toast.makeText(MainActivity.this, token, Toast.LENGTH_SHORT).show();
|
// Toast.makeText(MainActivity.this, token, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//华为推送
|
||||||
|
// getToken();
|
||||||
|
|
||||||
boolean showInvite = getIntent().getBooleanExtra(Constants.SHOW_INVITE, false);
|
boolean showInvite = getIntent().getBooleanExtra(Constants.SHOW_INVITE, false);
|
||||||
mRootView = (ViewGroup) findViewById(R.id.rootView);
|
mRootView = (ViewGroup) findViewById(R.id.rootView);
|
||||||
floatBanner = findViewById(R.id.float_banner_home);
|
floatBanner = findViewById(R.id.float_banner_home);
|
||||||
|
@ -1,15 +1,34 @@
|
|||||||
package com.yunbao.main.activity;
|
package com.yunbao.main.activity;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
|
||||||
import com.yunbao.common.activity.AbsActivity;
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
||||||
|
import com.yunbao.common.bean.SlideInfoModel;
|
||||||
|
import com.yunbao.common.http.ResponseData;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.main.MainNetManager;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
import com.yunbao.live.views.LoadingView;
|
||||||
import com.yunbao.main.R;
|
import com.yunbao.main.R;
|
||||||
|
import com.yunbao.main.adapter.MainHomeLivesClassAdapter;
|
||||||
|
import com.yunbao.main.adapter.MsgFollowAdapter;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class MsgSettActivity extends AbsActivity {
|
public class MsgSettActivity extends AbsActivity {
|
||||||
|
|
||||||
|
ImageView dt_switch,hdd_switch,lt_switch,xt_switch,kb_switch;
|
||||||
|
|
||||||
|
RecyclerView follow_list;
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
return R.layout.activity_msg_sett;
|
return R.layout.activity_msg_sett;
|
||||||
@ -19,5 +38,201 @@ public class MsgSettActivity extends AbsActivity {
|
|||||||
protected void main() {
|
protected void main() {
|
||||||
super.main();
|
super.main();
|
||||||
setTitle("消息通知");
|
setTitle("消息通知");
|
||||||
|
follow_list = (RecyclerView) findViewById(R.id.follow_list);
|
||||||
|
dt_switch = (ImageView) findViewById(R.id.dt_switch);
|
||||||
|
hdd_switch= (ImageView) findViewById(R.id.hdd_switch);
|
||||||
|
lt_switch = (ImageView) findViewById(R.id.lt_switch);
|
||||||
|
xt_switch= (ImageView) findViewById(R.id.xt_switch);
|
||||||
|
kb_switch= (ImageView) findViewById(R.id.kb_switch);
|
||||||
|
getData();
|
||||||
|
dt_switch.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
//打开的
|
||||||
|
if (dt_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())){
|
||||||
|
if(setMsgMasterSwitch("2","1")){
|
||||||
|
dt_switch.setImageResource(R.mipmap.special_icon_off);
|
||||||
|
};
|
||||||
|
}else{
|
||||||
|
if(setMsgMasterSwitch("1","1")){
|
||||||
|
dt_switch.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hdd_switch.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
//打开的
|
||||||
|
if (hdd_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())){
|
||||||
|
if(setMsgMasterSwitch("2","2")){
|
||||||
|
hdd_switch.setImageResource(R.mipmap.special_icon_off);
|
||||||
|
};
|
||||||
|
}else{
|
||||||
|
if(setMsgMasterSwitch("1","2")){
|
||||||
|
hdd_switch.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
lt_switch.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
//打开的
|
||||||
|
if (lt_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())){
|
||||||
|
if(setMsgMasterSwitch("2","3")){
|
||||||
|
lt_switch.setImageResource(R.mipmap.special_icon_off);
|
||||||
|
};
|
||||||
|
}else{
|
||||||
|
if(setMsgMasterSwitch("1","3")){
|
||||||
|
lt_switch.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
xt_switch.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
//打开的
|
||||||
|
if (xt_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())){
|
||||||
|
if(setMsgMasterSwitch("2","4")){
|
||||||
|
xt_switch.setImageResource(R.mipmap.special_icon_off);
|
||||||
|
};
|
||||||
|
}else{
|
||||||
|
if(setMsgMasterSwitch("1","4")){
|
||||||
|
xt_switch.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
follow_list.setVisibility(View.GONE);
|
||||||
|
kb_switch.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
int is =1;
|
||||||
|
//打开的
|
||||||
|
if (kb_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())){
|
||||||
|
is = 2;
|
||||||
|
}else{
|
||||||
|
is = 1;
|
||||||
|
}
|
||||||
|
MainNetManager.get(mContext).setBeginShowMsgSwitch(is+"", "1","", new HttpCallback<ResponseData>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(ResponseData data) {
|
||||||
|
|
||||||
|
Log.e("ds",data.getCode()+"");
|
||||||
|
if(data.getCode() == 200 ){
|
||||||
|
Log.e("ds",kb_switch.getDrawable().getCurrent().getConstantState()+"");
|
||||||
|
if (kb_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())){
|
||||||
|
kb_switch.setImageResource(R.mipmap.special_icon_off);
|
||||||
|
follow_list.setVisibility(View.GONE);
|
||||||
|
}else{
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
Log.e("ds",kb_switch.getDrawable().getCurrent().getConstantState()+"11"+error);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
follow_list.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||||
|
follow_list.setHasFixedSize(true);
|
||||||
|
follow_list.setNestedScrollingEnabled(true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getData(){
|
||||||
|
MainNetManager.get(mContext)
|
||||||
|
.getMsgSwitchDetail(new HttpCallback<MsgSwitchDetailModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(MsgSwitchDetailModel data) {
|
||||||
|
|
||||||
|
if(data.getDynamic_msg_switch().equals("2")){
|
||||||
|
dt_switch.setImageResource(R.mipmap.special_icon_off);
|
||||||
|
}else{
|
||||||
|
dt_switch.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(data.getInteraction_show_msg_switch().equals("2")){
|
||||||
|
hdd_switch.setImageResource(R.mipmap.special_icon_off);
|
||||||
|
}else{
|
||||||
|
hdd_switch.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(data.getChat_msg_switch().equals("2")){
|
||||||
|
lt_switch.setImageResource(R.mipmap.special_icon_off);
|
||||||
|
}else{
|
||||||
|
lt_switch.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(data.getChat_msg_switch().equals("2")){
|
||||||
|
lt_switch.setImageResource(R.mipmap.special_icon_off);
|
||||||
|
}else{
|
||||||
|
lt_switch.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(data.getSystem_msg_switch().equals("2")){
|
||||||
|
xt_switch.setImageResource(R.mipmap.special_icon_off);
|
||||||
|
}else{
|
||||||
|
xt_switch.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(data.getSystem_msg_switch().equals("2")){
|
||||||
|
xt_switch.setImageResource(R.mipmap.special_icon_off);
|
||||||
|
}else{
|
||||||
|
xt_switch.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < data.getFollowList().size();i++) {
|
||||||
|
if(!data.getFollowList().get(i).getStatus().equals("2")){
|
||||||
|
kb_switch.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
follow_list.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
MsgFollowAdapter topAdapter = new MsgFollowAdapter(MsgSettActivity.this, data.getFollowList());
|
||||||
|
follow_list.setAdapter(topAdapter);
|
||||||
|
follow_list.setVisibility(View.VISIBLE);
|
||||||
|
kb_switch.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
boolean ret = false;
|
||||||
|
public boolean setMsgMasterSwitch(String status,String type){
|
||||||
|
ret =false;
|
||||||
|
MainNetManager.get(mContext).setMsgMasterSwitch(status, type, new HttpCallback<ResponseData>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(ResponseData data) {
|
||||||
|
|
||||||
|
if(data.getCode() == 200 ){
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
124
main/src/main/java/com/yunbao/main/adapter/MsgFollowAdapter.java
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
package com.yunbao.main.adapter;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
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.makeramen.roundedimageview.RoundedImageView;
|
||||||
|
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
||||||
|
import com.yunbao.common.bean.MsgSwitchFollowlModel;
|
||||||
|
import com.yunbao.common.bean.UserItemBean;
|
||||||
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.http.ResponseData;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.main.MainNetManager;
|
||||||
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
import com.yunbao.main.R;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MsgFollowAdapter extends RecyclerView.Adapter<MsgFollowAdapter.Vh> {
|
||||||
|
|
||||||
|
private Activity mContext;
|
||||||
|
private List<MsgSwitchFollowlModel> mList;
|
||||||
|
private LayoutInflater mInflater;
|
||||||
|
private OnItemClickListener<MsgSwitchFollowlModel> mOnItemClickListener;
|
||||||
|
public MsgFollowAdapter(Activity context, List<MsgSwitchFollowlModel> list) {
|
||||||
|
mContext = context;
|
||||||
|
mList = list;
|
||||||
|
mInflater = LayoutInflater.from(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnItemClickListener(OnItemClickListener<MsgSwitchFollowlModel> onItemClickListener) {
|
||||||
|
mOnItemClickListener = onItemClickListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
|
||||||
|
return new Vh(mInflater.inflate( R.layout.item_msg_follow, parent, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull Vh holder, int position) {
|
||||||
|
holder.setData(mList.get(position),position);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return mList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
class Vh extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
RoundedImageView avatar;
|
||||||
|
TextView anchor_name;
|
||||||
|
ImageView sb_switch;
|
||||||
|
|
||||||
|
public Vh(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
avatar = (RoundedImageView) itemView.findViewById(R.id.avatar);
|
||||||
|
anchor_name = (TextView) itemView.findViewById(R.id.anchor_name);
|
||||||
|
sb_switch = (ImageView) itemView.findViewById(R.id.sb_switch);
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(itemView, () -> {
|
||||||
|
Object tag = itemView.getTag();
|
||||||
|
if (tag != null) {
|
||||||
|
MsgSwitchFollowlModel bean = (MsgSwitchFollowlModel) tag;
|
||||||
|
if (mOnItemClickListener != null) {
|
||||||
|
mOnItemClickListener.onItemClick(bean, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
String is = "1";
|
||||||
|
void setData(MsgSwitchFollowlModel bean,int position) {
|
||||||
|
itemView.setTag(bean);
|
||||||
|
ImgLoader.display(mContext, bean.getAvatar(), avatar);
|
||||||
|
anchor_name.setText(bean.getUser_nicename());
|
||||||
|
if(bean.getStatus().equals("2")) {
|
||||||
|
is = "1";
|
||||||
|
sb_switch.setImageResource(R.mipmap.special_icon_off);
|
||||||
|
}else{
|
||||||
|
is = "2";
|
||||||
|
sb_switch.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
}
|
||||||
|
sb_switch.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
MainNetManager.get(mContext).setBeginShowMsgSwitch(is + "", "", bean.getLiveuid(), new HttpCallback<ResponseData>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(ResponseData data) {
|
||||||
|
if(data.getCode() == 200){
|
||||||
|
mList.get(position).setStatus(is);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ import android.content.ClipData;
|
|||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.drawable.AnimationDrawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
@ -22,6 +23,7 @@ import android.webkit.WebChromeClient;
|
|||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@ -47,6 +49,7 @@ import com.yunbao.live.bean.LiveBean;
|
|||||||
import com.yunbao.live.bean.ReportCommunityBean;
|
import com.yunbao.live.bean.ReportCommunityBean;
|
||||||
import com.yunbao.live.http.LiveHttpUtil;
|
import com.yunbao.live.http.LiveHttpUtil;
|
||||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||||
|
import com.yunbao.live.views.LoadingView;
|
||||||
import com.yunbao.main.R;
|
import com.yunbao.main.R;
|
||||||
import com.yunbao.main.activity.FansActivity;
|
import com.yunbao.main.activity.FansActivity;
|
||||||
import com.yunbao.main.activity.MainActivity;
|
import com.yunbao.main.activity.MainActivity;
|
||||||
@ -106,6 +109,11 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
|||||||
mWebView.setLayoutParams(params);
|
mWebView.setLayoutParams(params);
|
||||||
mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||||
|
|
||||||
|
LoadingView loadingView = new LoadingView(mContext);
|
||||||
|
loadingView.show();
|
||||||
|
|
||||||
|
rootView.addView(loadingView);
|
||||||
|
|
||||||
mWebView.getSettings().setJavaScriptEnabled(true);
|
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||||
mWebView.getSettings().setDomStorageEnabled(true);
|
mWebView.getSettings().setDomStorageEnabled(true);
|
||||||
String appCachePath = mContext.getCacheDir().getAbsolutePath();
|
String appCachePath = mContext.getCacheDir().getAbsolutePath();
|
||||||
@ -158,8 +166,10 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
|||||||
@Override
|
@Override
|
||||||
public void onProgressChanged(WebView view, int newProgress) {
|
public void onProgressChanged(WebView view, int newProgress) {
|
||||||
if (newProgress == 100) {
|
if (newProgress == 100) {
|
||||||
|
loadingView.hide();
|
||||||
mProgressBar.setVisibility(View.GONE);
|
mProgressBar.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
|
loadingView.show();
|
||||||
mProgressBar.setProgress(newProgress);
|
mProgressBar.setProgress(newProgress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|