diff --git a/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java b/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java
index c4657ca60..4343056e3 100644
--- a/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java
+++ b/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java
@@ -19,7 +19,6 @@ import com.google.firebase.analytics.FirebaseAnalytics;
import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
-import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.SystemMessageActivity;
import com.yunbao.live.bean.ImUserBean;
diff --git a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java
index 619b6d456..be2b6a43e 100644
--- a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java
+++ b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java
@@ -115,8 +115,14 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList
} else {
changeBatchUser.setVisibility(View.GONE);
}
- //组装搜索历史数据
- adapter.showData(data.getList());
+ if (data.getList().size()>2){
+ listShow.setVisibility(View.VISIBLE);
+ }else {
+ listShow.setVisibility(View.GONE);
+ //组装搜索历史数据
+ adapter.showData(data.getList());
+ }
+
}
@@ -327,7 +333,14 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList
public void onError(String error) {
RouteUtil.forwardUserHome(mContext, String.valueOf(event.getModel().getId()), 0);
+ if (mContext instanceof LiveAnchorActivity) {
+ ((LiveAnchorActivity) mContext).superBackPressed();
+ } else if (mContext instanceof LiveAudienceActivity) {
+ ((LiveAudienceActivity) mContext).exitLiveRoom();
+ } else if (mContext instanceof LiveRyAnchorActivity) {
+ ((LiveRyAnchorActivity) mContext).superBackPressed();
+ }
}
});
diff --git a/live/src/main/res/layout/rc_conversationlist_item.xml b/live/src/main/res/layout/rc_conversationlist_item.xml
index 5ef66388e..f6afec7c4 100644
--- a/live/src/main/res/layout/rc_conversationlist_item.xml
+++ b/live/src/main/res/layout/rc_conversationlist_item.xml
@@ -21,8 +21,8 @@
{
- if (index==0){
- floatBanner.setVisibility(View.VISIBLE);
- findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
- }else {
- floatBanner.setVisibility(View.GONE);
- findViewById(R.id.banner_click).setVisibility(View.GONE);
- }
+ if (index == 0) {
+ floatBanner.setVisibility(View.VISIBLE);
+ findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
+ } else {
+ floatBanner.setVisibility(View.GONE);
+ findViewById(R.id.banner_click).setVisibility(View.GONE);
+ }
});
}
@@ -421,7 +420,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
.anchorRecommend("10", new com.yunbao.common.http.base.HttpCallback() {
@Override
public void onSuccess(AnchorRecommendModel data) {
- if (data.getListShow() == 1) {
+ if (data.getListShow() == 1 && data.getList().size() > 2) {
floatBanner.setVisibility(View.VISIBLE);
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
floatBanner.showBanner(data.getList());
@@ -1055,10 +1054,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
} else {
mViewPager.setCurrentItem(event.getPage());
mTabButtonGroup.setCurPosition(event.getPage());
- if (event.getPage()==0){
+ if (event.getPage() == 0) {
floatBanner.setVisibility(View.VISIBLE);
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
- }else {
+ } else {
floatBanner.setVisibility(View.GONE);
findViewById(R.id.banner_click).setVisibility(View.GONE);
}
@@ -1145,6 +1144,9 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) floatBanner.getLayoutParams();
lp.bottomMargin = DpUtil.dp2px(50);
floatBanner.setLayoutParams(lp);
+ RelativeLayout.LayoutParams lp2 = (RelativeLayout.LayoutParams) findViewById(R.id.banner_click).getLayoutParams();
+ lp2.bottomMargin = DpUtil.dp2px(50);
+ findViewById(R.id.banner_click).setLayoutParams(lp2);
waitingTip.setVisibility(View.VISIBLE);
//跳转消息中心
waitingTip.setOnClickListener(new View.OnClickListener() {
@@ -1161,8 +1163,21 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) floatBanner.getLayoutParams();
lp.bottomMargin = DpUtil.dp2px(10);
floatBanner.setLayoutParams(lp);
+ RelativeLayout.LayoutParams lp2 = (RelativeLayout.LayoutParams) findViewById(R.id.banner_click).getLayoutParams();
+ lp2.bottomMargin = DpUtil.dp2px(10);
+ findViewById(R.id.banner_click).setLayoutParams(lp2);
waitingTip.setVisibility(View.GONE);
}
}
+ /**
+ * 刷新首页推荐位
+ *
+ * @param event
+ */
+ @Subscribe(threadMode = ThreadMode.MAIN)
+ public void onAnchorRecommendModel(AnchorRecommendModel event) {
+ initAnchorRecommendBanner();
+ }
+
}
diff --git a/main/src/main/java/com/yunbao/main/adapter/SearchResultsAdapter.java b/main/src/main/java/com/yunbao/main/adapter/SearchResultsAdapter.java
index ecf6f1f48..e89a8ef19 100644
--- a/main/src/main/java/com/yunbao/main/adapter/SearchResultsAdapter.java
+++ b/main/src/main/java/com/yunbao/main/adapter/SearchResultsAdapter.java
@@ -56,6 +56,7 @@ public class SearchResultsAdapter extends RecyclerView.Adapter {
}
}
notifyDataSetChanged();
+ ToastUtil.show(R.string.following);
}
@Override
diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeFollLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeFollLiveViewHolder.java
index 84d20709d..718457865 100644
--- a/main/src/main/java/com/yunbao/main/views/MainHomeFollLiveViewHolder.java
+++ b/main/src/main/java/com/yunbao/main/views/MainHomeFollLiveViewHolder.java
@@ -1,14 +1,16 @@
package com.yunbao.main.views;
import android.content.Context;
-import androidx.recyclerview.widget.GridLayoutManager;
import android.util.Log;
import android.view.ViewGroup;
+import androidx.recyclerview.widget.GridLayoutManager;
+
import com.alibaba.fastjson.JSON;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.adapter.RefreshAdapter;
+import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.custom.ItemDecoration;
import com.yunbao.common.http.HttpCallback;
@@ -93,7 +95,7 @@ public class MainHomeFollLiveViewHolder extends AbsMainHomeChildViewHolder imple
@Override
public void onRefreshSuccess(List list, int count) {
-
+ EventBus.getDefault().post(new AnchorRecommendModel());
}
@Override
@@ -124,18 +126,15 @@ public class MainHomeFollLiveViewHolder extends AbsMainHomeChildViewHolder imple
}
-
-
-
@Override
public void onItemClick(LiveBean bean, int position) {
if ("1".equals(bean.getIslive())) {
watchLive(bean, Constants.LIVE_HOME, position);
- }else if(bean.getIs_week()!=null&&bean.getIs_week().equals("1")){
- String url = CommonAppConfig.HOST + bean.getUrl()+"?a=1";
+ } else if (bean.getIs_week() != null && bean.getIs_week().equals("1")) {
+ String url = CommonAppConfig.HOST + bean.getUrl() + "?a=1";
WeekWebViewActivity.forward(mContext, url, true);
} else {
- RouteUtil.forwardUserHome(mContext, bean.getUid(),0);
+ RouteUtil.forwardUserHome(mContext, bean.getUid(), 0);
}
}
diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java
index a5ede55cd..82fbed8eb 100644
--- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java
+++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java
@@ -21,6 +21,7 @@ import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.adapter.RefreshAdapter;
+import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.BannerBean;
import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.bean.LiveClassBean;
@@ -219,6 +220,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
LiveStorge.getInstance().put(Constants.LIVE_HOME, list);
}
showBanner();
+ EventBus.getDefault().post(new AnchorRecommendModel());
}
@Override
diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeRecomLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeRecomLiveViewHolder.java
index 85c643165..98ffe11b1 100644
--- a/main/src/main/java/com/yunbao/main/views/MainHomeRecomLiveViewHolder.java
+++ b/main/src/main/java/com/yunbao/main/views/MainHomeRecomLiveViewHolder.java
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.adapter.RefreshAdapter;
+import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.custom.ItemDecoration;
import com.yunbao.common.http.HttpCallback;
@@ -99,7 +100,7 @@ public class MainHomeRecomLiveViewHolder extends AbsMainHomeChildViewHolder impl
@Override
public void onRefreshSuccess(List list, int count) {
-
+ EventBus.getDefault().post(new AnchorRecommendModel());
}
@Override
diff --git a/main/src/main/java/com/yunbao/main/views/SearchResultsViewHolder.java b/main/src/main/java/com/yunbao/main/views/SearchResultsViewHolder.java
index 710f6cecc..5e7d82e09 100644
--- a/main/src/main/java/com/yunbao/main/views/SearchResultsViewHolder.java
+++ b/main/src/main/java/com/yunbao/main/views/SearchResultsViewHolder.java
@@ -12,6 +12,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
+import com.bumptech.glide.Glide;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.SearchModel;
@@ -58,6 +59,10 @@ public class SearchResultsViewHolder extends RecyclerView.ViewHolder {
public void showData(SearchModel model, int type, String searchKey) {
this.model = model;
ImgLoader.displayAvatar(itemView.getContext(), model.getAvatar(), avatar);
+ Glide.with(itemView.getContext())
+ .asGif()
+ .load(R.mipmap.icon_user_home_living).skipMemoryCache(false)
+ .into(isLive);
//用戶直接隱藏
if (type == 3) {
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(Integer.parseInt(model.getLevel()));