Merge branch 'master' into 6.5.3

This commit is contained in:
2023-06-29 14:09:33 +08:00
11 changed files with 288 additions and 97 deletions

View File

@@ -15,6 +15,7 @@ import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import com.alibaba.fastjson.JSON;
import com.binioter.guideview.Guide;
import com.binioter.guideview.GuideBuilder;
@@ -37,7 +38,6 @@ import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.common.views.AbsMainViewHolder;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.activity.SystemMessageActivity;
import com.yunbao.live.bean.ImUserBean;
import com.yunbao.live.event.RecommendLiveRoomEvent;
@@ -67,11 +67,11 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
private ConversationListFragment conversationListFragment;
private FrameLayout container;
private SystemMessageAdapter messageAdapter;
private TextView textNewsNotice, textNewsInteraction, textNewsOnline;
private TextView textNewsNotice, textNewsInteraction, textNewsOnline, textSystemMessages;
private String type = null;
private List<ImUserBean> listUserBean = new ArrayList<>();
private LinearLayout topLayout, ltNodataMsg;
private ImageView imgNewsNotice, imgNewsInteraction, imgNewsOnline;
private ImageView imgNewsNotice, imgNewsInteraction, imgNewsOnline, imgSystemMessages;
private Handler netHandler;
private MainActivity mContext;
@@ -110,10 +110,12 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
textNewsNotice = (TextView) findViewById(R.id.text_news_notice);
textNewsInteraction = (TextView) findViewById(R.id.text_news_interaction);
textNewsOnline = (TextView) findViewById(R.id.text_news_online);
textSystemMessages = (TextView) findViewById(R.id.text_system_messages);
topLayout = (LinearLayout) findViewById(R.id.top_layout);
ltNodataMsg = (LinearLayout) findViewById(R.id.lt_nodata_msg);
imgNewsNotice = (ImageView) findViewById(R.id.img_news_notice);
imgNewsInteraction = (ImageView) findViewById(R.id.img_news_interaction);
imgSystemMessages = (ImageView) findViewById(R.id.img_system_messages);
imgNewsOnline = (ImageView) findViewById(R.id.img_news_online);
netHandler = new Handler();
@@ -286,6 +288,25 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
}
});
break;
//系统消息
case "4":
if (TextUtils.isEmpty(userBean.getNum()) || TextUtils.equals("0", userBean.getNum())) {
textSystemMessages.setVisibility(View.GONE);
} else {
textSystemMessages.setVisibility(View.VISIBLE);
textSystemMessages.setText(userBean.getNum());
}
ImgLoader.display(mContext, userBean.getNewImage(), imgSystemMessages);
ViewClicksAntiShake.clicksAntiShake(imgSystemMessages, () -> {
type = userBean.getType();
netHandler.post(systemNumberRunnable);
mContext.startActivity(new Intent(mContext, SystemMessageActivity.class)
.putExtra("type", userBean.getType())
.putExtra("uid", "")
.putExtra("title", userBean.getTitle())
.putExtra("headImg", ""));
});
break;
}
}
@@ -328,6 +349,13 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
textNewsOnline.setVisibility(View.GONE);
}
break;
//在線客服
case "4":
if (TextUtils.equals(type, userBean.getType())) {
number = null;
textSystemMessages.setVisibility(View.GONE);
}
break;
}
//未读消息不为空并且大于0
@@ -403,6 +431,17 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
textNewsOnline.setVisibility(View.VISIBLE);
textNewsOnline.setText(String.valueOf(numberInt));
}
break; //在線客服
case "4":
if (textSystemMessages.getVisibility() == View.GONE) {
textSystemMessages.setVisibility(View.GONE);
textSystemMessages.setText("");
} else {
String number = textSystemMessages.getText().toString().trim();
int numberInt = Integer.parseInt(number) + 1;
textSystemMessages.setVisibility(View.VISIBLE);
textSystemMessages.setText(String.valueOf(numberInt));
}
break;
}
systemNumber = systemNumber + 1;
@@ -420,7 +459,7 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
}
@Override

View File

@@ -2,8 +2,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="20dp"
android:orientation="vertical">
android:orientation="vertical"
android:paddingTop="20dp">
<FrameLayout
android:layout_width="match_parent"
@@ -35,91 +35,117 @@
android:id="@+id/top_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!--系统消息-->
<RelativeLayout
android:layout_width="0dp"
android:layout_height="120dp"
android:layout_height="110dp"
android:layout_weight="1">
<ImageView
android:id="@+id/img_news_notice"
android:layout_width="120dp"
android:layout_height="130dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_width="match_parent"
android:layout_height="99dp"
android:layout_centerInParent="true"
android:src="@mipmap/img_news_notice" />
<TextView
android:id="@+id/text_news_notice"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_width="17dp"
android:layout_height="17dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="20dp"
android:layout_marginEnd="9dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="17dp"
android:background="@drawable/background_system_message"
android:gravity="center"
android:text="7"
android:textColor="@color/white"
android:textSize="12sp"
android:visibility="gone" />
android:visibility="visible" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="110dp"
android:layout_weight="1">
<ImageView
android:id="@+id/img_system_messages"
android:layout_width="match_parent"
android:layout_height="99dp"
android:layout_centerInParent="true"
android:src="@mipmap/img_system_messages" />
<TextView
android:id="@+id/text_system_messages"
android:layout_width="17dp"
android:layout_height="17dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="15dp"
android:layout_marginEnd="17dp"
android:background="@drawable/background_system_message"
android:gravity="center"
android:text="7"
android:textColor="@color/white"
android:textSize="12sp"
android:visibility="visible" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="120dp"
android:layout_height="110dp"
android:layout_weight="1">
<ImageView
android:id="@+id/img_news_interaction"
android:layout_width="120dp"
android:layout_height="130dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_width="match_parent"
android:layout_height="99dp"
android:layout_centerInParent="true"
android:src="@mipmap/img_news_interaction" />
<TextView
android:id="@+id/text_news_interaction"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_width="17dp"
android:layout_height="17dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="20dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="17dp"
android:background="@drawable/background_system_message"
android:gravity="center"
android:text="7"
android:textColor="@color/white"
android:textSize="12sp"
android:visibility="gone" />
android:visibility="visible" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="120dp"
android:layout_height="110dp"
android:layout_weight="1">
<ImageView
android:id="@+id/img_news_online"
android:layout_width="120dp"
android:layout_height="130dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_width="match_parent"
android:layout_height="99dp"
android:layout_centerInParent="true"
android:src="@mipmap/img_news_online" />
<TextView
android:id="@+id/text_news_online"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_width="17dp"
android:layout_height="17dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="20dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="17dp"
android:background="@drawable/background_system_message"
android:gravity="center"
android:text="7"
android:textColor="@color/white"
android:textSize="12sp"
android:visibility="gone" />
android:visibility="visible" />
</RelativeLayout>
</LinearLayout>
<!-- 此容器用于动态放置 fragment-->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB