消息新UI老部分修改完成

This commit is contained in:
ningwenqiang 2024-10-31 20:50:38 +08:00
parent 7f9d5a5c81
commit 3712dafbed
30 changed files with 1515 additions and 10 deletions

View File

@ -576,7 +576,7 @@ public class CommonHttpUtil {
* 获取动态-发现
*/
public static void getCommunityFind(int p, HttpCallback callback) {
HttpClient.getInstance().get("ylapfabudongtaipinglun", "Pdlcommunity.getFindDynamicList")
HttpClient.getInstance().get("ylaphuoqufaxiandongtai", "Pdlcommunity.getFindDynamicList")
.params("p", p)
.execute(callback);
}

View File

@ -39,7 +39,7 @@
android:maxWidth="120dp"
android:maxLines="1"
android:textColor="@color/rc_text_main_color"
android:textSize="13dp"
android:textSize="15sp"
app:layout_constraintStart_toEndOf="@+id/rc_conversation_portrait"
app:layout_constraintTop_toTopOf="@+id/rc_conversation_portrait"
tools:text="张三11111111111111111111111" />
@ -75,7 +75,7 @@
app:layout_constraintBottom_toBottomOf="@+id/rc_conversation_title"
app:layout_constraintEnd_toEndOf="parent"
android:textColor="@color/rc_auxiliary_color"
android:textSize="@dimen/rc_font_nav_or_date_size"
android:textSize="12sp"
/>

View File

@ -138,6 +138,7 @@ import com.yunbao.main.views.MainHomeLiveViewHolder;
import com.yunbao.main.views.MainHomeViewHolder2;
import com.yunbao.main.views.MainMeViewHolder;
import com.yunbao.main.views.MainMessageHeadViewHolder;
import com.yunbao.main.views.MainMessageViewHolder;
import com.yunbao.video.utils.VideoStorge;
import com.yunbao.common.CommonAppContext;
@ -184,7 +185,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
private MainHomeViewHolder2 mainHomeViewHolder;
private MainHomeCommunityViewHolder mMainHomeCommunityViewHolder;
private MainHomeGameViewHolder mainHomeGameLiveViewHolder;
private MainMessageViewHolder mainMessageViewHolder;
private MainMessageHeadViewHolder mainMessageViewHolder;
private MainMeViewHolder mMeViewHolder;
private AbsMainViewHolder[] mViewHolders;
private View mBottom;
@ -1311,7 +1312,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
mainHomeGameLiveViewHolder = new MainHomeGameViewHolder(this, parent);
vh = mainHomeGameLiveViewHolder;
}else if (position == 3) {
mainMessageViewHolder = new MainMessageViewHolder(this, parent);
mainMessageViewHolder = new MainMessageHeadViewHolder(this,mContext, parent);
vh = mainMessageViewHolder;
} else if (position == 4) {

View File

@ -0,0 +1,205 @@
package com.yunbao.main.views;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import com.yunbao.common.event.FloatWarOrderEvent;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.MobclickAgent;
import com.yunbao.common.utils.ProcessImageUtil;
import com.yunbao.common.utils.ProcessResultUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.main.R;
import com.yunbao.main.activity.CommunitySendActivity;
import com.yunbao.main.activity.MainActivity;
import org.greenrobot.eventbus.EventBus;
/**
* Created by Martin on 2024/3/6.
* MainActivity 首页-社区m
*/
public class MainMessageHeadViewHolder extends AbsMainHomeParentComViewHolder {
private MainMessageViewHolder2 mainMessageViewHolder2;
private MainHomeNewViewHolder mainHomeLiveViewHolder;
private MainHomeRecomComViewHolder mainHomeRecomComViewHolder;
private MainHomeGameViewHolder mainHomeGameLiveViewHolder;
private final String mPageName = "home_page";
private TextView tvPlay;
private ImageView btnSend;
private boolean floatWarOrder;
private String homeZdyPop;
public boolean isFloatWarOrder() {
return floatWarOrder;
}
public void setHomeZdyPop(String homeZdyPop) {
this.homeZdyPop = homeZdyPop;
if (TextUtils.equals(homeZdyPop, "1")) {
//showGuideView();
//NoviceInstructorManager.get(mContext).setHomeZdyPop("");
}
}
public MainMessageHeadViewHolder(Context context, Activity activity, ViewGroup parentView) {
super(context, parentView);
}
@Override
protected int getLayoutId() {
return R.layout.view_main_home_com;
}
private ProcessResultUtil mProcessResultUtil;
@Override
public void init() {
super.init();
btnSend = (ImageView) findViewById(R.id.cameraImg);
btnSend.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
if (isAnchor) {
String[] permissions;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
permissions = new String[]{
Manifest.permission.READ_MEDIA_IMAGES,
Manifest.permission.CAMERA,
Manifest.permission.RECORD_AUDIO
};
} else {
permissions = new String[]{
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.CAMERA,
Manifest.permission.RECORD_AUDIO
};
}
mProcessResultUtil.requestPermissions(permissions, mStartVideoRunnable);
} else {
ToastUtil.show(mContext.getResources().getString(R.string.only_open_anchor));
}
}
});
tvPlay = (TextView) findViewById(R.id.tvPlay);
tvPlay.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RouteUtil.forwardCommunityActivity();
}
});
}
private Runnable mStartVideoRunnable = new Runnable() {
@Override
public void run() {
Intent intent = new Intent(mContext, CommunitySendActivity.class);
mContext.startActivity(intent);
}
};
public void setCurPosition(int position) {
mViewPager.setCurrentItem(position);
}
int selected = 1;
@Override
protected void loadPageData(int position) {
if (position == 3) {
RouteUtil.forwardCommunityActivity();
mIndicator.onPageSelected(selected);
setCurPosition(selected);
refreshIndex(selected);
return;
}
selected = position;
refreshIndex(position);
switch (position) {
case 0:
floatWarOrder = false;
MobclickAgent.onEvent(mContext, "home_page_follow", "首页关注列表按钮");
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
break;
case 1:
floatWarOrder = false;
MobclickAgent.onEvent(mContext, "home_page_hot", "首页热门列表按钮");
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
break;
case 2:
floatWarOrder = false;
MobclickAgent.onEvent(mContext, "home_page_recommend", "首页推荐列表按钮");
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
break;
case 3:
floatWarOrder = true;
MobclickAgent.onEvent(mContext, "home_page_redpk", "首页红包列表按钮");
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(true));
break;
}
if (mViewHolders == null) {
return;
}
AbsMainHomeChildViewHolder vh = mViewHolders[position];
if (vh == null) {
if (mViewList != null && position < mViewList.size()) {
FrameLayout parent = mViewList.get(position);
if (parent == null) {
return;
}
if (position == -1) {
} else if (position == 0) {
mainMessageViewHolder2 = new MainMessageViewHolder2((MainActivity) mContext, parent);
vh = mainMessageViewHolder2;
} else if (position == 1) {
mainHomeLiveViewHolder = new MainHomeNewViewHolder(mContext, parent);
vh = mainHomeLiveViewHolder;
}
if (vh == null) {
return;
}
mViewHolders[position] = vh;
vh.addToParent();
vh.subscribeActivityLifeCycle();
}
}
if (vh != null) {
vh.loadData();
}
}
@Override
public void onResume() {
super.onResume();
}
@Override
protected int getPageCount() {
return 2;
}
@Override
protected String[] getTitles() {
return new String[]{mContext.getString(R.string.activity_msg_title), mContext.getString(R.string.interaction_type)};
}
}

View File

@ -0,0 +1,867 @@
package com.yunbao.main.views;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Looper;
import android.text.Editable;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.text.style.ImageSpan;
import android.util.Log;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.ViewModelProvider;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
import com.alibaba.fastjson.JSON;
import com.binioter.guideview.Guide;
import com.binioter.guideview.GuideBuilder;
import com.facebook.appevents.AppEventsLogger;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.BasePopupView;
import com.lxj.xpopup.enums.PopupPosition;
import com.lxj.xpopup.interfaces.XPopupCallback;
import com.lzy.okgo.model.Response;
import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.bean.ImUserInfoModel;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.MessageChatIsAnchor;
import com.yunbao.common.fragment.AbsMainMessageChatListFragment;
import com.yunbao.common.fragment.ChatViewModel;
import com.yunbao.common.fragment.MainMessageChatListFragment;
import com.yunbao.common.fragment.MainMessageRecommendFragment;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.JsonBean;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.DebugUtils;
import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.MobclickAgent;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.ViewPageIndicatorUtils;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.AbsMainViewHolder;
import com.yunbao.common.views.MsgChatTypeSelectPoPupView;
import com.yunbao.common.views.MsgRecommendPopupView;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.activity.SystemMessageActivity;
import com.yunbao.live.bean.ImUserBean;
import com.yunbao.live.event.RecommendLiveRoomEvent;
import com.yunbao.live.http.ImHttpUtil;
import com.yunbao.main.R;
import com.yunbao.main.activity.MainActivity;
import com.yunbao.main.adapter.SystemMessageAdapter;
import com.yunbao.main.dialog.MsgMoreDialog;
import com.yunbao.main.fragment.MainMessageChatListSystemFragment;
import com.yunbao.main.fragment.MainMessageChatListUserFragment;
import com.yunbao.main.manager.imrongcloud.ConversationIMListManager;
import net.lucode.hackware.magicindicator.MagicIndicator;
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator;
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
import net.lucode.hackware.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView;
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.SimplePagerTitleView;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* 消息中心
*/
public class MainMessageViewHolder2 extends AbsMainHomeChildViewHolder {
private static final String TAG = "MainMessageViewHolder2";
private SystemMessageAdapter messageAdapter;
private TextView textNewsNotice, textSystemMessages;
private String type = null;
private List<ImUserBean> listUserBean = new ArrayList<>();
// private LinearLayout topLayout, ltNodataMsg;
private ImageView imgNewsNotice, imgSystemMessages;
private Handler netHandler;
private MainActivity mContext;
XPopup.Builder moreXPopup;
private String homeZdyPop;
private ViewPager2 viewPager;
private MagicIndicator mIndicator;
private List<AbsMainMessageChatListFragment> fragmentList;
private Group tabLayout1, tabLayout2, tabLayout3;
private TextView tab1, tab2, tab3,officialDate,officialContent,systemDate,systemContent;
private ImageView imageView1, imageView2, imageView3;
private View tab_line1, tab_line2, tab_line3;
private ImageView tab_icon;
private List<Group> relativeLayouts = new ArrayList<>();
private List<TextView> tabTexts = new ArrayList<>();
private List<View> tabLine = new ArrayList<>();
private List<ImageView> tabExpend = new ArrayList<>();
// private ConstraintLayout tabLayouts;
private int userType = 0; // (0)普通用户 (1)主播A (2)主播B
ChatViewModel chatViewModel;
public MainMessageViewHolder2 setHomeZdyPop(String homeZdyPop) {
this.homeZdyPop = homeZdyPop;
if (TextUtils.equals(homeZdyPop, "1")) {
//showGuideView();
//NoviceInstructorManager.get(mContext).setHomeZdyPop("");
}
return this;
}
public MainMessageViewHolder2(MainActivity context, ViewGroup parentView) {
super(context, parentView);
mContext = context;
chatViewModel= (new ViewModelProvider(mContext)).get(ChatViewModel.class);
}
@Override
protected int getLayoutId() {
return R.layout.view_main_message2;
}
@Override
public void onResume() {
super.onResume();
initData();
MessageIMManager.get(mContext).resetImUnReadMessageCount(mContext);
}
@Override
public void init() {
EventBus.getDefault().register(this);
officialDate=findViewById(R.id.official_date);
officialContent=findViewById(R.id.official_content);
systemDate=findViewById(R.id.system_date);
systemContent=findViewById(R.id.system_content);
//菜单
textNewsNotice = (TextView) findViewById(R.id.official_unread_count);
textSystemMessages = (TextView) findViewById(R.id.system_unread_count);
// topLayout = (LinearLayout) findViewById(R.id.top_layout);
// ltNodataMsg = (LinearLayout) findViewById(R.id.lt_nodata_msg);
imgNewsNotice = (ImageView) findViewById(R.id.official_portrait);
imgSystemMessages = (ImageView) findViewById(R.id.system_portrait);
mIndicator = (MagicIndicator) findViewById(R.id.indicator);
viewPager = findViewById(R.id.viewPager);
// tabLayouts = findViewById(R.id.tabLayouts);
tab_icon = findViewById(R.id.tab_icon);
tabLayout1 = findViewById(R.id.group_tab1);
tabLayout2 = findViewById(R.id.group_tab2);
tabLayout3 = findViewById(R.id.group_tab3);
tab1 = findViewById(R.id.tab1);
tab2 = findViewById(R.id.tab2);
tab3 = findViewById(R.id.tab3);
imageView1 = findViewById(R.id.expendImg1);
imageView2 = findViewById(R.id.expendImg2);
imageView3 = findViewById(R.id.expendImg3);
imageView1.setOnClickListener(view -> {
selectChatType(view, 0);
});
imageView2.setOnClickListener(view -> {
selectChatType(view, 1);
});
imageView3.setOnClickListener(view -> {
selectChatType(view, 2);
});
tab_line1 = findViewById(R.id.tab_line1);
tab_line2 = findViewById(R.id.tab_line2);
tab_line3 = findViewById(R.id.tab_line3);
netHandler = new Handler(Looper.getMainLooper());
initData();
}
private void selectChatType(View view, int position) {
AbsMainMessageChatListFragment fragment = fragmentList.get(position);
if (!(fragment instanceof MainMessageChatListFragment) || !(view instanceof ImageView)) {
return;
}
MainMessageChatListFragment chatFragment = (MainMessageChatListFragment) fragment;
ImageView expendImg = (ImageView) view;
expendImg.setImageResource(R.mipmap.ic_expend_up);
XPopup.Builder builder = new XPopup.Builder(mContext).atView(tabTexts.get(position));
builder.offsetY(16);
builder.dismissOnTouchOutside(true);
builder.setPopupCallback(new XPopupCallback() {
@Override
public void onCreated(BasePopupView popupView) {
}
@Override
public void beforeShow(BasePopupView popupView) {
}
@Override
public void onShow(BasePopupView popupView) {
}
@Override
public void onDismiss(BasePopupView popupView) {
expendImg.setImageResource(R.mipmap.ic_expend_down);
}
@Override
public void beforeDismiss(BasePopupView popupView) {
}
@Override
public boolean onBackPressed(BasePopupView popupView) {
return false;
}
@Override
public void onKeyBoardStateChanged(BasePopupView popupView, int height) {
}
@Override
public void onDrag(BasePopupView popupView, int value, float percent, boolean upOrLeft) {
}
@Override
public void onClickOutside(BasePopupView popupView) {
}
});
builder.asCustom(new MsgChatTypeSelectPoPupView(mContext, chatFragment.getFilter(), new MsgChatTypeSelectPoPupView.ResultCallBack() {
@Override
public void callBack(int i,String str) {
tabTexts.get(position).setText(str);
chatFragment.setFilter(i);
}
})).show();
}
private void initFragment() {
final String[] titles;
fragmentList = new ArrayList<>();
ViewGroup.LayoutParams params = mIndicator.getLayoutParams();
if (userType == 0) { //普通用户
params.width = ViewGroup.LayoutParams.WRAP_CONTENT;
mIndicator.setLayoutParams(params);
titles = new String[]{WordUtil.getNewString(R.string.message_chat_msg_all_an_a)};
fragmentList.add(new MainMessageChatListFragment(AppManager.getInstance().getMainActivity()));
} else if (userType == 1) {//主播A
params.width = ViewGroup.LayoutParams.MATCH_PARENT;
mIndicator.setLayoutParams(params);
titles = new String[]{WordUtil.getNewString(R.string.message_chat_msg_recommend), WordUtil.getNewString(R.string.message_chat_msg_all_an_a)};
fragmentList.add(new MainMessageRecommendFragment(AppManager.getInstance().getMainActivity()));
fragmentList.add(new MainMessageChatListFragment(AppManager.getInstance().getMainActivity()));
} else { //主播B
params.width = ViewGroup.LayoutParams.MATCH_PARENT;
mIndicator.setLayoutParams(params);
fragmentList.add(new MainMessageChatListFragment(AppManager.getInstance().getMainActivity()));
fragmentList.add(new MainMessageChatListSystemFragment());
fragmentList.add(new MainMessageChatListUserFragment());
titles = new String[]{WordUtil.getNewString(R.string.message_chat_msg_all), WordUtil.getNewString(R.string.message_chat_msg_system), WordUtil.getNewString(R.string.message_chat_msg_user)};
}
initTabView();
ToastUtil.showDebug("列表数量x" + fragmentList.size());
viewPager.setAdapter(new FragmentStateAdapter((FragmentActivity) AppManager.getInstance().getMainActivity()) {
@Override
public int getItemCount() {
Log.i(TAG, "viewpage 列表 getItemCount: " + fragmentList.size());
return fragmentList.size();
}
@NonNull
@Override
public Fragment createFragment(int i) {
Log.i(TAG, "createFragment: 创建fragment :" + i + " | " + fragmentList.get(i));
return fragmentList.get(i);
}
});
if (userType == 1) {
viewPager.setCurrentItem(1);
} else {
viewPager.setCurrentItem(0);
}
viewPager.setUserInputEnabled(false);
ConversationIMListManager.get(mContext).addUserInfoProvider();
CommonNavigator commonNavigator = new CommonNavigator(AppManager.getInstance().getMainActivity());
commonNavigator.setAdjustMode(true);
commonNavigator.setAdapter(new CommonNavigatorAdapter() {
@Override
public int getCount() {
return titles.length;
}
@Override
public IPagerTitleView getTitleView(Context context, final int index) {
SimplePagerTitleView simplePagerTitleView = new ColorTransitionPagerTitleView(context);
simplePagerTitleView.setNormalColor(Color.parseColor("#777777"));
simplePagerTitleView.setSelectedColor(Color.parseColor("#333333"));
if (titles.length == 2 && index == 0) {
Drawable drawable = ContextCompat.getDrawable(context, R.mipmap.icon_msg_recommend);
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); // 设置Drawable的边界
SpannableString spannableString = new SpannableString(" " + titles[index] + " ");
ImageSpan imageSpan = new ImageSpan(drawable, ImageSpan.ALIGN_BASELINE);
spannableString.setSpan(imageSpan, 0, 1, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
spannableString.setSpan(new ClickableSpan() {
@Override
public void onClick(View widget) {
// 点击事件的处理逻辑
/*XPopup.Builder builder = new XPopup.Builder(mContext).atView(simplePagerTitleView);
builder.hasShadowBg(false).isLightStatusBar(false).popupPosition(PopupPosition.Top).asCustom(new MsgRecommendPopupView(mContext).show());*/
}
@Override
public void updateDrawState(TextPaint ds) {
//super.updateDrawState(ds);
//ds.setUnderlineText(false);
}
}, 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
simplePagerTitleView.setText(spannableString);
simplePagerTitleView.setMovementMethod(LinkMovementMethod.getInstance()); // 必须调用此方法
} else {
simplePagerTitleView.setText(titles[index]);
}
simplePagerTitleView.setTextSize(15);
simplePagerTitleView.getPaint().setFakeBoldText(true);
simplePagerTitleView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (viewPager != null) {
viewPager.setCurrentItem(index);
}
}
});
return simplePagerTitleView;
}
@Override
public IPagerIndicator getIndicator(Context context) {
LinePagerIndicator linePagerIndicator = new LinePagerIndicator(context);
linePagerIndicator.setMode(LinePagerIndicator.MODE_WRAP_CONTENT);
linePagerIndicator.setXOffset(DpUtil.dp2px(5));
linePagerIndicator.setRoundRadius(DpUtil.dp2px(2));
linePagerIndicator.setColors(Color.parseColor("#EB6FFF"), Color.parseColor("#FF83C6"));
return linePagerIndicator;
}
});
mIndicator.setNavigator(commonNavigator);
ViewPageIndicatorUtils.bind(mIndicator, viewPager, new ViewPager2.OnPageChangeCallback() {
@Override
public void onPageSelected(int position) {
super.onPageSelected(position);
selectTab(position);
}
});
}
private void showChatTypeSelect() {
}
private void initTabView() {
relativeLayouts = new ArrayList<>();
tabTexts = new ArrayList<>();
tabLine = new ArrayList<>();
relativeLayouts.add(tabLayout1);
relativeLayouts.add(tabLayout2);
relativeLayouts.add(tabLayout3);
tabTexts.add(tab1);
tabTexts.add(tab2);
tabTexts.add(tab3);
tabExpend.add(imageView1);
tabExpend.add(imageView2);
tabExpend.add(imageView3);
tabLine.add(tab_line1);
tabLine.add(tab_line2);
tabLine.add(tab_line3);
if (userType == 0) { //普通用户
relativeLayouts.get(0).setVisibility(View.VISIBLE);
tabTexts.get(0).setText(WordUtil.getNewString(chatViewModel.getTitleTextId()));
// ViewGroup.LayoutParams params = tabLayouts.getLayoutParams();
// params.width = LinearLayout.LayoutParams.WRAP_CONTENT;
//tabExpend.get(0).setVisibility(View.VISIBLE);
tabLayout1.setVisibility(View.GONE);
tabLayout2.setVisibility(View.GONE);
tabLayout3.setVisibility(View.GONE);
//tabLayouts.setLayoutParams(params);
} else if (userType == 1) {//主播A
tab_icon.setVisibility(View.VISIBLE);
tab_icon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*XPopup.Builder builder = new XPopup.Builder(mContext).atView(v);
builder.hasShadowBg(false).isLightStatusBar(false).popupPosition(PopupPosition.Top).asCustom(new MsgRecommendPopupView(mContext).show());*/
XPopup.Builder builder = new XPopup.Builder(mContext).atView(v);
builder.hasShadowBg(false).isDestroyOnDismiss(true).isLightStatusBar(false).popupPosition(PopupPosition.Bottom).asCustom(new MsgRecommendPopupView(mContext, new MsgRecommendPopupView.ItemDelListener() {
@Override
public void onItemDel() {
}
})).show();
}
});
relativeLayouts.get(0).setVisibility(View.VISIBLE);
tabTexts.get(0).setText(WordUtil.getNewString(R.string.message_chat_msg_recommend));
relativeLayouts.get(1).setVisibility(View.VISIBLE);
tabTexts.get(1).setText(WordUtil.getNewString(chatViewModel.getTitleTextId()));
// tabExpend.get(1).setVisibility(View.VISIBLE);
} else { //主播B
tabExpend.get(0).setVisibility(View.VISIBLE);
relativeLayouts.get(0).setVisibility(View.VISIBLE);
tabTexts.get(0).setText(WordUtil.getNewString(chatViewModel.getTitleTextId()));
relativeLayouts.get(1).setVisibility(View.VISIBLE);
tabTexts.get(1).setText(WordUtil.getNewString(R.string.message_chat_msg_system));
relativeLayouts.get(2).setVisibility(View.VISIBLE);
tabTexts.get(2).setText(WordUtil.getNewString(R.string.message_chat_msg_user));
}
for (int i = 0; i < relativeLayouts.size(); i++) {
int finalI = i;
tabTexts.get(i).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
selectTab(finalI);
viewPager.setCurrentItem(finalI);
}
});
}
if (userType == 1) {
selectTab(1);
} else {
selectTab(0);
}
}
public void selectTab(int position) {
if (userType == 0)
return;
for (int i = 0; i < relativeLayouts.size(); i++) {
if (position == i) {
tabTexts.get(i).setTextColor(Color.parseColor("#333333"));
tabLine.get(i).setVisibility(View.VISIBLE);
} else {
tabTexts.get(i).setTextColor(Color.parseColor("#777777"));
tabLine.get(i).setVisibility(View.INVISIBLE);
}
}
}
@Override
public void release() {
super.release();
EventBus.getDefault().unregister(this);
}
/**
* 初始化数据
*/
private void initData() {
IMLoginManager.get(mContext).checkInstructor();
//netHandler.post(imUserInfoRunnable);
getSystemInfo();
//刷新列表内用户信息
Log.i(TAG, "initData: 初始化数据");
//获取一下系统通知
MessageIMManager.get(mContext).getSystemMessages();
LiveNetManager.get(mContext).getIsAnchor(new com.yunbao.common.http.base.HttpCallback<MessageChatIsAnchor>() {
@Override
public void onSuccess(MessageChatIsAnchor data) {
DebugUtils.runDebugCode(() -> {
});
if (data.getIsAnchor() == 1 && CommonAppConfig.getInstance().getUserBean().getUsers_type().equals("C")) {
userType = 2;//主播B
viewPager.setUserInputEnabled(true);
//mIndicator.setVisibility(View.VISIBLE);
} else if (CommonAppConfig.getInstance().getUserBean().getUsers_type().equals("C")) {
userType = 1;//主播A
} else {
userType = 0;
}
IMLoginManager.get(mContext).setAnchorB(data.getIsAnchor());
initFragment();
}
@Override
public void onError(String error) {
}
});
}
private void getSystemInfo(){
Log.i(TAG, "imUserInfoRunnable: 获取系统消息列表 开始");
//获取系统消息列表
ImHttpUtil.getImUserInfo("", new HttpCallback() {
@Override
public void onError(Response<JsonBean> response) {
super.onError(response);
}
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0) {
mContext.runOnUiThread(() -> {
listUserBean = JSON.parseArray(Arrays.toString(info), ImUserBean.class);
for (ImUserBean userBean : listUserBean) {
switch (userBean.getType()) {
//官方通知
case "1":
if (TextUtils.isEmpty(userBean.getNum()) || TextUtils.equals("0", userBean.getNum())) {
textNewsNotice.setVisibility(View.GONE);
} else {
textNewsNotice.setVisibility(View.VISIBLE);
officialDate.setText(userBean.getLastDate());
officialContent.setText(userBean.getContent());
// int numberInt = Integer.parseInt(userBean.getNum());
// if (numberInt > 99) {
// textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
// textNewsNotice.setText("99+");
// } else {
// textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
// textNewsNotice.setText(String.valueOf(numberInt));
// }
}
//ImgLoader.display(mContext, userBean.getNewImage(), imgNewsNotice);
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.officialClickView), () -> {
MobclickAgent.onEvent(mContext, "information_official_notice", "官方通知");
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;
//互動消息
case "2":
// if (TextUtils.isEmpty(userBean.getNum()) || TextUtils.equals("0", userBean.getNum())) {
// textNewsInteraction.setVisibility(View.GONE);
// } else {
// textNewsInteraction.setVisibility(View.VISIBLE);
// int numberInt = Integer.parseInt(userBean.getNum());
// if (numberInt > 99) {
// textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
// textNewsInteraction.setText("99+");
// } else {
// textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
// textNewsInteraction.setText(String.valueOf(numberInt));
// }
// }
// ImgLoader.display(mContext, userBean.getNewImage(), imgNewsInteraction);
break;
//在線客服
case "3":
// if (TextUtils.isEmpty(userBean.getNum()) || TextUtils.equals("0", userBean.getNum())) {
// textNewsOnline.setVisibility(View.GONE);
// } else {
// textNewsOnline.setVisibility(View.VISIBLE);
// int numberInt = Integer.parseInt(userBean.getNum());
// if (numberInt > 99) {
// textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
// textNewsOnline.setText("99+");
// } else {
// textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
// textNewsOnline.setText(String.valueOf(numberInt));
// }
// }
break;
//系统消息
case "4":
if (TextUtils.isEmpty(userBean.getNum()) || TextUtils.equals("0", userBean.getNum())) {
textSystemMessages.setVisibility(View.GONE);
} else {
textSystemMessages.setVisibility(View.VISIBLE);
systemDate.setText(userBean.getLastDate());
systemContent.setText(userBean.getContent());
// int numberInt = Integer.parseInt(userBean.getNum());
// if (numberInt > 99) {
// textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
// textSystemMessages.setText("99+");
// } else {
// textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
// textSystemMessages.setText(String.valueOf(numberInt));
// }
}
//ImgLoader.display(mContext, userBean.getNewImage(), imgSystemMessages);
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.systemClickView), () -> {
MobclickAgent.onEvent(mContext, "information_system_notice", "系统消息");
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;
}
}
});
}
}
});
}
/**
* 系統消息獲取
*/
private Runnable imUserInfoRunnable = new Runnable() {
@Override
public void run() {
getSystemInfo();
}
};
//修改小紅點
private Runnable systemNumberRunnable = new Runnable() {
@Override
public void run() {
mContext.runOnUiThread(() -> {
int systemNumber = 0;
for (ImUserBean userBean : listUserBean) {
//未读消息数
String number = userBean.getNum();
switch (userBean.getType()) {
//官方通知
case "1":
if (TextUtils.equals(type, userBean.getType())) {
number = null;
textNewsNotice.setVisibility(View.GONE);
}
break;
//互動消息
case "2":
// if (TextUtils.equals(type, userBean.getType())) {
// number = null;
// textNewsInteraction.setVisibility(View.GONE);
// }
break;
//在線客服
case "3":
// if (TextUtils.equals(type, userBean.getType())) {
// number = null;
// textNewsOnline.setVisibility(View.GONE);
// }
break;
//在線客服
case "4":
if (TextUtils.equals(type, userBean.getType())) {
number = null;
textSystemMessages.setVisibility(View.GONE);
}
break;
}
//未读消息不为空并且大于0
try {
if (!TextUtils.isEmpty(number) && Integer.parseInt(number) > 0) {
systemNumber = Integer.parseInt(number) + systemNumber;
}
} catch (NumberFormatException e) {
systemNumber = systemNumber + 0;
}
}
type = null;
MessageIMManager.get(mContext).setSystemNumber(systemNumber);
});
}
};
//更新系統消息
@Subscribe(threadMode = ThreadMode.MAIN)
public void onImUserInfoModel(ImUserInfoModel model) {
messageAdapter.upDataMessage(model);
int systemNumber = 0;
for (ImUserBean userBean : listUserBean) {
//未读消息数
String number = userBean.getNum();
//未读消息不为空并且大于0
try {
if (!TextUtils.isEmpty(number) && Integer.parseInt(number) > 0) {
systemNumber = Integer.parseInt(number) + systemNumber;
}
} catch (NumberFormatException e) {
systemNumber = systemNumber + 0;
}
}
switch (model.getType()) {
//官方通知
case "1":
if (textNewsNotice.getVisibility() == View.GONE) {
textNewsNotice.setVisibility(View.GONE);
textNewsNotice.setText("");
} else {
String number = textNewsNotice.getText().toString().trim();
textNewsNotice.setVisibility(View.VISIBLE);
int numberInt = Integer.parseInt(number) + 1;
if (numberInt > 99) {
textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
textNewsNotice.setText("99+");
} else {
textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
textNewsNotice.setText(String.valueOf(numberInt));
}
}
break;
//互動消息
case "2":
// if (textNewsInteraction.getVisibility() == View.GONE) {
// textNewsInteraction.setVisibility(View.GONE);
// textNewsInteraction.setText("");
// } else {
// String number = textNewsInteraction.getText().toString().trim();
// int numberInt = Integer.parseInt(number) + 1;
// textNewsInteraction.setVisibility(View.VISIBLE);
// if (numberInt > 99) {
// textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
// textNewsInteraction.setText("99+");
// } else {
// textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
// textNewsInteraction.setText(String.valueOf(numberInt));
// }
// }
break;
//在線客服
case "3":
// if (textNewsOnline.getVisibility() == View.GONE) {
// textNewsOnline.setVisibility(View.GONE);
// textNewsOnline.setText("");
// } else {
// String number = textNewsOnline.getText().toString().trim();
// int numberInt = Integer.parseInt(number) + 1;
// textNewsOnline.setVisibility(View.VISIBLE);
// if (numberInt > 99) {
// textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
// textNewsOnline.setText("99+");
// } else {
// textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
// 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);
if (numberInt > 99) {
textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
textSystemMessages.setText("99+");
} else {
textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
textSystemMessages.setText(String.valueOf(numberInt));
}
}
break;
}
systemNumber = systemNumber + 1;
MessageIMManager.get(mContext).setSystemNumber(systemNumber);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onRecommendLiveRoomEvent(RecommendLiveRoomEvent event) {
LiveHttpUtil.getLiveInfo(event.getLiveuid(), 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);
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk, boolean isSw) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal), isSw);
}
@Override
public void onCheckError(String contextError) {
}
});
} else {
RouteUtil.forwardUserHome(mContext, event.getLiveuid(), 0);
}
}
});
}
}

View File

@ -4,16 +4,17 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/bg_main_home_sub_game"
android:orientation="vertical">
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:src="@mipmap/bg_yola_index"
app:layout_constraintDimensionRatio="1.512"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/meTitleTv"
android:layout_width="wrap_content"
@ -118,9 +119,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:minEms="4"
android:paddingStart="8dp"
android:paddingTop="4dp"
android:minEms="4"
android:paddingBottom="4dp"
android:text="@string/unrestricted_players"
android:textColor="#777777"
@ -155,11 +156,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:minEms="4"
android:paddingStart="8dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:text="@string/unlimited_threshold"
android:minEms="4"
android:textColor="#777777"
android:textSize="11sp"
app:layout_constraintBottom_toBottomOf="@id/hall"

View File

@ -21,8 +21,9 @@
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:src="@mipmap/bg_yola_index"
app:layout_constraintDimensionRatio="1.512"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@ -0,0 +1,416 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:background="@color/white"
android:orientation="vertical">
<!-- 官方息部分 -->
<View
android:id="@+id/officialClickView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="-6dp"
android:layout_marginBottom="-6dp"
app:layout_constraintBottom_toBottomOf="@+id/official_portrait"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/official_portrait" />
<com.yunbao.common.views.weight.ClipPathCircleImage
android:id="@+id/official_portrait"
android:layout_width="54dp"
android:layout_height="54dp"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:scaleType="centerCrop"
android:src="@mipmap/ic_yola_official_msg"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/official_title"
style="@style/TextStyle.Alignment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:maxWidth="120dp"
android:maxLines="1"
android:text="@string/activity_msg_news_notice"
android:textColor="@color/rc_text_main_color"
android:textSize="15sp"
app:layout_constraintStart_toEndOf="@+id/official_portrait"
app:layout_constraintTop_toTopOf="@+id/official_portrait" />
<TextView
android:id="@+id/official_date"
style="@style/TextStyle.Alignment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="18dp"
android:textColor="@color/rc_auxiliary_color"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/official_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/official_title"
tools:text="3 月 22 日" />
<TextView
android:id="@+id/official_content"
style="@style/TextStyle.Alignment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:ellipsize="end"
android:maxLines="1"
android:paddingEnd="6dp"
android:textColor="@color/rc_secondary_color"
android:textSize="12dp"
app:layout_constraintBottom_toBottomOf="@+id/official_portrait"
app:layout_constraintEnd_toStartOf="@+id/official_unread_count"
app:layout_constraintStart_toStartOf="@+id/official_title"
tools:text="你好朋友111111111111111111111" />
<TextView
android:id="@+id/official_unread_count"
style="@style/TextStyle.Alignment"
android:layout_width="8dp"
android:layout_height="8dp"
android:background="@drawable/red_dot"
android:gravity="center"
android:visibility="gone"
tools:visibility="visible"
android:textColor="@color/rc_white_color"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="@+id/official_content"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="@+id/official_date"
app:layout_constraintTop_toTopOf="@+id/official_content" />
<!-- 系统消息部分 -->
<View
android:id="@+id/systemClickView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="-6dp"
android:layout_marginBottom="-6dp"
app:layout_constraintBottom_toBottomOf="@+id/system_portrait"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/system_portrait" />
<com.yunbao.common.views.weight.ClipPathCircleImage
android:id="@+id/system_portrait"
android:layout_width="54dp"
android:layout_height="54dp"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:scaleType="centerCrop"
android:src="@mipmap/ic_yola_system_msg"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/officialClickView" />
<TextView
android:id="@+id/system_title"
style="@style/TextStyle.Alignment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:maxWidth="120dp"
android:maxLines="1"
android:text="@string/system_msg"
android:textColor="@color/rc_text_main_color"
android:textSize="15sp"
app:layout_constraintStart_toEndOf="@+id/system_portrait"
app:layout_constraintTop_toTopOf="@+id/system_portrait" />
<TextView
android:id="@+id/system_date"
style="@style/TextStyle.Alignment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="18dp"
android:textColor="@color/rc_auxiliary_color"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/system_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/system_title"
tools:text="3 月 22 日" />
<TextView
android:id="@+id/system_content"
style="@style/TextStyle.Alignment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:ellipsize="end"
android:maxLines="1"
android:paddingEnd="6dp"
android:textColor="@color/rc_secondary_color"
android:textSize="12dp"
app:layout_constraintBottom_toBottomOf="@+id/system_portrait"
app:layout_constraintEnd_toStartOf="@+id/system_unread_count"
app:layout_constraintStart_toStartOf="@+id/system_title"
tools:text="你好朋友111111111111111111111" />
<TextView
android:id="@+id/system_unread_count"
style="@style/TextStyle.Alignment"
android:layout_width="8dp"
android:layout_height="8dp"
android:background="@drawable/red_dot"
android:gravity="center"
android:visibility="gone"
tools:visibility="visible"
android:textColor="@color/rc_white_color"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="@+id/system_content"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="@+id/system_date"
app:layout_constraintTop_toTopOf="@+id/system_content" />
<!-- 切换选择消息类型的-->
<TextView
android:id="@+id/tab1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center"
android:maxWidth="100dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:textColor="@color/color_111111"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/view2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/systemClickView"
tools:text="仅显示已读" />
<ImageView
android:id="@+id/tab_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:src="@mipmap/icon_msg_recommend"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/tab1"
app:layout_constraintEnd_toStartOf="@+id/tab1"
app:layout_constraintTop_toTopOf="@+id/tab1"
tools:visibility="visible" />
<View
android:id="@+id/tab_line1"
android:layout_width="24dp"
android:layout_height="4dp"
android:layout_centerHorizontal="true"
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
android:background="@mipmap/ic_yola_msg_type_line"
app:layout_constraintEnd_toEndOf="@+id/tab1"
app:layout_constraintStart_toStartOf="@+id/tab1"
app:layout_constraintTop_toBottomOf="@+id/tab1" />
<ImageView
android:id="@+id/expendImg1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:src="@mipmap/ic_expend_down"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/tab1"
app:layout_constraintStart_toEndOf="@+id/tab1"
app:layout_constraintTop_toTopOf="@+id/tab1"
tools:visibility="gone" />
<androidx.constraintlayout.widget.Group
android:id="@+id/group_tab1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="tab1,tab_line1"
tools:visibility="visible" />
<View
android:id="@+id/view2"
android:layout_width="1dp"
android:layout_height="1dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/tab2"
app:layout_constraintStart_toEndOf="@+id/tab1"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tab2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center"
android:maxWidth="100dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:textColor="@color/color_8a8a8a"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/view3"
app:layout_constraintStart_toEndOf="@+id/view2"
app:layout_constraintTop_toBottomOf="@+id/systemClickView"
tools:text="系统匹配"
tools:visibility="visible" />
<ImageView
android:id="@+id/tab_line2"
android:layout_width="24dp"
android:layout_height="4dp"
android:layout_centerHorizontal="true"
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
android:background="@mipmap/ic_yola_msg_type_line"
app:layout_constraintEnd_toEndOf="@+id/tab2"
app:layout_constraintStart_toStartOf="@+id/tab2"
app:layout_constraintTop_toBottomOf="@+id/tab2" />
<ImageView
android:id="@+id/expendImg2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:src="@mipmap/ic_expend_down"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/tab2"
app:layout_constraintStart_toEndOf="@+id/tab2"
app:layout_constraintTop_toTopOf="@+id/tab2"
tools:visibility="gone" />
<androidx.constraintlayout.widget.Group
android:id="@+id/group_tab2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="view2,tab2,tab_line2"
tools:visibility="visible" />
<View
android:id="@+id/view3"
android:layout_width="1dp"
android:layout_height="1dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/tab3"
app:layout_constraintStart_toEndOf="@+id/tab2"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tab3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center"
android:maxWidth="100dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:textColor="@color/color_8a8a8a"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/view3"
app:layout_constraintTop_toBottomOf="@+id/systemClickView"
tools:text="对方主动"
tools:visibility="visible" />
<View
android:id="@+id/tab_line3"
android:layout_width="24dp"
android:layout_height="4dp"
android:layout_centerHorizontal="true"
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
android:background="@mipmap/ic_yola_msg_type_line"
app:layout_constraintEnd_toEndOf="@+id/tab3"
app:layout_constraintStart_toStartOf="@+id/tab3"
app:layout_constraintTop_toBottomOf="@+id/tab3"
tools:visibility="visible" />
<ImageView
android:id="@+id/expendImg3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:src="@mipmap/ic_expend_down"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/tab3"
app:layout_constraintStart_toEndOf="@+id/tab3"
app:layout_constraintTop_toTopOf="@+id/tab3"
tools:visibility="gone" />
<androidx.constraintlayout.widget.Group
android:id="@+id/group_tab3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="view3,tab3,tab_line3"
tools:visibility="visible" />
<View
android:layout_marginTop="18dp"
app:layout_constraintTop_toBottomOf="@+id/tab1"
android:layout_width="0dp"
android:layout_height="1dp"
app:layout_constraintStart_toStartOf="parent"
android:background="#EFEFEF"
app:layout_constraintEnd_toEndOf="parent"/>
<!-- 摆放控件 -->
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewPager"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="19dp"
android:layout_marginBottom="50dp"
android:overScrollMode="never"
app:layout_constraintTop_toBottomOf="@+id/tab1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toBottomOf="parent" />
<!-- 此容器用于动态放置 隐藏的-->
<LinearLayout
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:id="@+id/lt_nodata_msg"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center"
android:visibility="gone">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/img_no_new" />
</LinearLayout>
<net.lucode.hackware.magicindicator.MagicIndicator
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:id="@+id/indicator"
android:layout_width="match_parent"
android:layout_height="37dp"
android:visibility="gone" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,12 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:background="@color/white"
android:orientation="vertical">
</androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 915 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

@ -108,5 +108,7 @@
<string name="live_room_sud_hint_join">Join</string>
<string name="live_dialog_top_guardian_tasks">Guard tasks</string>
<string name="game">game</string>
<string name="interaction_type">互動</string>
<string name="system_msg">系統消息</string>
</resources>