diff --git a/common/build.gradle b/common/build.gradle index abf5d8c..7d7702a 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -225,9 +225,8 @@ dependencies { api 'com.wuxiaolong.pullloadmorerecyclerview:library:1.1.2' //时间选择器 api 'com.contrarywind:Android-PickerView:4.1.9' - //播放器-https://github.com/yangchong211/YCVideoPlayer - api 'cn.yc:VideoPlayer:3.1.0' - api 'cn.yc:VideoCache:3.0.5' - api 'cn.yc:VideoKernel:3.0.6' + //UI框架 + api 'com.github.xuexiangjys:XUI:1.1.6' + api 'com.github.xuexiangjys.XUtil:xutil-core:2.0.0' } diff --git a/common/src/main/java/com/yunbao/common/activity/CommunityDetailsActivity.java b/common/src/main/java/com/yunbao/common/activity/CommunityDetailsActivity.java index 9a8db92..47db79f 100644 --- a/common/src/main/java/com/yunbao/common/activity/CommunityDetailsActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/CommunityDetailsActivity.java @@ -24,6 +24,7 @@ import com.yunbao.common.R; import com.yunbao.common.adapter.CommentAdapter; import com.yunbao.common.bean.ActiveBean; import com.yunbao.common.bean.CommentBean; +import com.yunbao.common.dialog.ImagePreviewDialog; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; @@ -108,7 +109,19 @@ public class CommunityDetailsActivity extends AbsActivity { mNineGridLayout.setActionListener(new NineGridLayout.ActionListener() { @Override public void onItemClick(List dataList, int position) { + ImagePreviewDialog dialog = new ImagePreviewDialog(); + dialog.setImageInfo(dataList.size(), position, false, new ImagePreviewDialog.ActionListener() { + @Override + public void loadImage(ImageView imageView, int position) { + ImgLoader.display(mContext, (String) (dataList.get(position)), imageView); + } + @Override + public void onDeleteClick(int position) { + + } + }); + dialog.show(((AbsActivity) mContext).getSupportFragmentManager(), "ImagePreviewDialog"); } @Override @@ -160,6 +173,7 @@ public class CommunityDetailsActivity extends AbsActivity { }); } }); + findViewById(R.id.setting).setVisibility(View.VISIBLE); findViewById(R.id.setting).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -172,7 +186,12 @@ public class CommunityDetailsActivity extends AbsActivity { if (tag == 0) { RouteUtil.forwardCommentReportActivity(activeBean.getId(), activeBean.getId()); } else { - + CommonHttpUtil.noInterest(activeBean.getUser_id(), new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + ToastUtil.show(msg); + } + }); } } }); @@ -217,7 +236,7 @@ public class CommunityDetailsActivity extends AbsActivity { public void onSuccess(int code, String msg, String[] info) { List list = JSON.parseArray(Arrays.toString(info), CommentBean.class); if (list != null) { - commentAdapter = new CommentAdapter(mContext, list); + commentAdapter = new CommentAdapter(mContext, list, activeBean.getUser_id()); commentAdapter.setOnItemClickListener(new CommentAdapter.onItemClickListener() { @Override public void onReply(CommentBean commentBean) { @@ -231,8 +250,43 @@ public class CommunityDetailsActivity extends AbsActivity { @Override public void onReport(CommentBean commentBean) { + //一级回复 举报 RouteUtil.forwardCommentReportActivity(activeBean.getId(), commentBean.getId()); } + + @Override + public void onDel(CommentBean activeBean, int position) { + //一级回复 删除 + CommonHttpUtil.delCom(activeBean.getId(), new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0) { + ToastUtil.show(msg); + getReply(); + } + } + }); + } + + @Override + public void onReport(CommentBean.ReplyComment activeBean) { + //二级回复 举报 + RouteUtil.forwardCommentReportActivity(activeBean.getId(), activeBean.getId()); + } + + @Override + public void onDel(CommentBean.ReplyComment activeBean) { + //二级回复 删除 + CommonHttpUtil.delCom(activeBean.getId(), new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0) { + ToastUtil.show(msg); + getReply(); + } + } + }); + } }); commentRecyclerView.setAdapter(commentAdapter); replyCount.setText("评论 " + list.size()); diff --git a/common/src/main/java/com/yunbao/common/activity/UserHomeActivity.java b/common/src/main/java/com/yunbao/common/activity/UserHomeActivity.java index 3b8209c..d010656 100644 --- a/common/src/main/java/com/yunbao/common/activity/UserHomeActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/UserHomeActivity.java @@ -2,41 +2,99 @@ package com.yunbao.common.activity; import android.content.Context; import android.content.Intent; +import android.graphics.Color; import android.graphics.Outline; import android.view.View; import android.view.ViewOutlineProvider; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import androidx.viewpager.widget.ViewPager; +import com.alibaba.fastjson.JSONArray; +import com.makeramen.roundedimageview.RoundedImageView; import com.ms.banner.Banner; import com.ms.banner.listener.OnBannerClickListener; +import com.xuexiang.xui.widget.flowlayout.FlowTagLayout; import com.yunbao.common.Constants; import com.yunbao.common.R; +import com.yunbao.common.adapter.LabelTagAdapter; +import com.yunbao.common.adapter.UserCommunityAdapter; import com.yunbao.common.adapter.UserHomeImgAdapter; +import com.yunbao.common.bean.ActiveOtherBean; +import com.yunbao.common.bean.HomeUserExhibitInfoBean; +import com.yunbao.common.bean.HomeUserInfoBean; +import com.yunbao.common.bean.IMLoginModel; +import com.yunbao.common.bean.LabelBean; +import com.yunbao.common.bean.MessageUserInfoBean; import com.yunbao.common.bean.UserHomeImgBean; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; -import com.yunbao.common.views.TopGradual; import com.yunbao.common.views.UserHomeImgsViewHolder; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; public class UserHomeActivity extends AbsActivity { - String uid; - Banner mBanner; - RecyclerView imgsRecyclerView; - UserHomeImgAdapter userHomeImgAdapter; + private String uid; + private Banner mBanner; + private RecyclerView imgsRecyclerView; + private UserHomeImgAdapter userHomeImgAdapter; + private List bannerImgList = new ArrayList<>(); + private List tempList; + private RoundedImageView avatar; + private TextView userName; + private TextView fansCount; + private TextView likeCount; + private LinearLayout followLayout; + private ImageView followIcon; + private TextView followName; + private TextView userId; + private TextView userStatus; + private ImageView userStatusIcon; + private ImageView user_sex; + private ImageView authorIcon; + private TextView level; + private ImageView levelIcon; + private TextView vipLevel; + private LinearLayout authenticationLayout; + private TextView signature; + private LinearLayout moreLayout; + private TextView moreText; + private ImageView moreIcon; + private HomeUserInfoBean userInfo; + RecyclerView communityRecyclerView; + private LinearLayout itemLayout01; + private LinearLayout itemLayout02; + private LinearLayout itemLayout03; + private LinearLayout itemLayout04; + FlowTagLayout myFlowTag; //我的标签 + LabelTagAdapter myAdapter; + private boolean isShowcase; + private boolean isAnchor; + private RelativeLayout userPresidentLayout; + private TextView userPresidentName; + private RelativeLayout authorLayout; + private RelativeLayout levelLayout; + private RoundedImageView fansImg1; + private RoundedImageView fansImg2; + private RoundedImageView fansImg3; - List bannerImgList = new ArrayList<>(); - List tempList; + private List fansImgViewList = new ArrayList<>(); public static void forwardUserHomeActivity(Context content, String uid) { Intent intent = new Intent(content, UserHomeActivity.class); - intent.putExtra(Constants.TO_UID, String.valueOf(97717)); + intent.putExtra(Constants.TO_UID, uid); content.startActivity(intent); } @@ -59,48 +117,233 @@ public class UserHomeActivity extends AbsActivity { return; } initView(); - initUseData(); - initUserImgs(); + getUseData(); + getCommunityList(); } - private void initView() { - mBanner = (Banner) findViewById(R.id.banner); - imgsRecyclerView = findViewById(R.id.imgsRecyclerView); - imgsRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false)); - imgsRecyclerView.addItemDecoration(new TopGradual()); - imgsRecyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER); + private void getCommunityList() { + CommonHttpUtil.getOtherDynamicList(uid, new com.yunbao.common.http.HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + List beanList = JSONArray.parseArray(Arrays.toString(info), ActiveOtherBean.class); + UserCommunityAdapter userCommunityAdapter = new UserCommunityAdapter(mContext, beanList); + communityRecyclerView.setAdapter(userCommunityAdapter); + } + }); } - private void initUserImgs() { + private void initData(HomeUserInfoBean userInfoBean) { + userInfo = userInfoBean; + if (!userInfo.getCheckBlack().get(0).getU2t().equals("0")) { + ToastUtil.show("已拉黑,无法查看"); + finish(); + return; + } + if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getUser_president_name())) { + userPresidentLayout.setVisibility(View.VISIBLE); + userPresidentName.setText(userInfo.getUserHomeTopInfo().getUser_president_name()); + } + isAnchor = userInfo.getUserHomeTopInfo().getIs_anchor() == 1; + if (isAnchor) { + authorLayout.setVisibility(View.VISIBLE); + levelLayout.setVisibility(View.VISIBLE); + } else { + authorLayout.setVisibility(View.GONE); + } + ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_avatar(), avatar); + userName.setText(userInfo.getUserHomeTopInfo().getUser_name());//用户名称 + fansCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_fans_num()));//粉丝数量 + likeCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_love_num()));//关注数量 + + userId.setText("ID:" + userInfo.getUserHomeTopInfo().getUser_id());//用户ID + userStatus.setText("");//认证状态 + ImgLoader.display(UserHomeActivity.this, Integer.parseInt(String.valueOf(userInfo.getUserHomeTopInfo().getUser_sex())) == 0 ? R.mipmap.icon_man_new : R.mipmap.icon_wumen, user_sex); + ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_anchor_img(), authorIcon); + ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_img(), levelIcon); + + if (isAnchor) {//是否是主播 + authenticationLayout.setVisibility(View.VISIBLE); + itemLayout01.setVisibility(View.VISIBLE); + itemLayout02.setVisibility(View.VISIBLE); + itemLayout03.setVisibility(View.VISIBLE); + itemLayout04.setVisibility(View.VISIBLE); + } else { + authenticationLayout.setVisibility(View.GONE); + itemLayout03.setVisibility(View.VISIBLE); + itemLayout04.setVisibility(View.VISIBLE); + } + signature.setText(userInfo.getUserHomeTopInfo().getUser_signature());//个性签名 + //标签 + myAdapter = new LabelTagAdapter(mContext, new LabelTagAdapter.OnSureOnClickListener() { + @Override + public void sure(LabelBean.Children labelBean) { + + } + }); + if (userInfo.getUserHomeTopInfo().getCn_label() != null) { + if (userInfo.getUserHomeTopInfo().getCn_label().size() > 0) { + myFlowTag.setAdapter(myAdapter); + myFlowTag.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE); + myAdapter.setData(userInfo.getUserHomeTopInfo().getCn_label()); + } + } mBanner.setOutlineProvider(new ViewOutlineProvider() { @Override public void getOutline(View view, Outline outline) { - outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10); + outline.setRoundRect(0, 0, 0, 0, 0); } }); - LiveNetManager.get(UserHomeActivity.this).getUserHomeBanner(uid, new HttpCallback>() { + mBanner.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override - public void onSuccess(List data) { - bannerImgList = data; - tempList = new ArrayList<>(); - for (int i = 0; i < data.size(); i++) { - tempList.add(new UserHomeImgBean(data.get(i))); - } - tempList.get(0).setShow(true); - userHomeImgAdapter = new UserHomeImgAdapter(UserHomeActivity.this, tempList); - imgsRecyclerView.setAdapter(userHomeImgAdapter); - mBanner.setAutoPlay(false).setPages(bannerImgList, new UserHomeImgsViewHolder()).setOnBannerClickListener(new OnBannerClickListener() { - @Override - public void onBannerClick(List datas, int position) { + public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { - } - }).start(); } @Override - public void onError(String error) { + public void onPageSelected(int position) { } + + @Override + public void onPageScrollStateChanged(int state) { + + } + }); + bannerImgList = userInfo.getUserHomeTopInfo().getUser_home_banner(); + tempList = new ArrayList<>(); + for (int i = 0; i < bannerImgList.size(); i++) { + tempList.add(new UserHomeImgBean(bannerImgList.get(i))); + } + tempList.get(0).setShow(true); + userHomeImgAdapter = new UserHomeImgAdapter(UserHomeActivity.this, tempList); + imgsRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false)); + imgsRecyclerView.setAdapter(userHomeImgAdapter); + + userHomeImgAdapter.setOnItemClickListener(new UserHomeImgAdapter.onItemClickListener() { + @Override + public void onImgItem(UserHomeImgBean activeBean, int position) { + mBanner.onPageSelected(position); + mBanner.setCurrentPage(position); + for (int i = 0; i < tempList.size(); i++) { + if (i == position) { + tempList.get(i).setShow(true); + } else { + tempList.get(i).setShow(false); + } + } + userHomeImgAdapter.setCommentBeanList(tempList); + } + }); + mBanner.setAutoPlay(false).setPages(bannerImgList, new UserHomeImgsViewHolder()).setOnBannerClickListener(new OnBannerClickListener() { + @Override + public void onBannerClick(List datas, int position) { + + } + }).start(); + } + + private void initView() { + fansImg1 = findViewById(R.id.fansImg1); + fansImg2 = findViewById(R.id.fansImg2); + fansImg3 = findViewById(R.id.fansImg3); + fansImgViewList = new ArrayList<>(); + fansImgViewList.add(fansImg1); + fansImgViewList.add(fansImg2); + fansImgViewList.add(fansImg3); + authorLayout = findViewById(R.id.authorLayout); + levelLayout = findViewById(R.id.levelLayout); + userPresidentLayout = findViewById(R.id.userPresidentLayout); + userPresidentName = findViewById(R.id.userPresidentName); + itemLayout01 = findViewById(R.id.itemLayout01); + itemLayout02 = findViewById(R.id.itemLayout02); + itemLayout03 = findViewById(R.id.itemLayout03); + itemLayout04 = findViewById(R.id.itemLayout04); + communityRecyclerView = findViewById(R.id.communityRecyclerView); + myFlowTag = findViewById(R.id.myFlowTag); + avatar = findViewById(R.id.avatar); + userName = findViewById(R.id.name); + fansCount = findViewById(R.id.fansCount); + likeCount = findViewById(R.id.likeCount); + followLayout = findViewById(R.id.followLayout); + followName = findViewById(R.id.followName); + followIcon = findViewById(R.id.followIcon); + userId = findViewById(R.id.userId); + userStatus = findViewById(R.id.userStatus); + userStatusIcon = findViewById(R.id.userStatusIcon); + user_sex = findViewById(R.id.user_sex); + levelIcon = findViewById(R.id.levelIcon); + level = findViewById(R.id.level); + authorIcon = findViewById(R.id.authorlIcon); + authenticationLayout = findViewById(R.id.authenticationLayout); + signature = findViewById(R.id.signature); + moreLayout = findViewById(R.id.moreLayout); + moreText = findViewById(R.id.moreText); + moreIcon = findViewById(R.id.moreIcon); + + mBanner = findViewById(R.id.banner); + imgsRecyclerView = findViewById(R.id.imgsRecyclerView); + + communityRecyclerView = findViewById(R.id.communityRecyclerView); + communityRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); + communityRecyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER); + + findViewById(R.id.back).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + finish(); + } + }); + followLayout.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + CommonHttpUtil.setAttention(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()), new CommonCallback() { + @Override + public void callback(Integer isAttention) { + if (isAttention == 1) { + ImgLoader.display(UserHomeActivity.this, R.mipmap.icon_like_followed, followIcon); + followName.setText("已关注"); + followName.setTextColor(Color.parseColor("#777777")); + followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type_1)); + } else { + ImgLoader.display(UserHomeActivity.this, R.mipmap.icon_like_follow, followIcon); + followName.setText("关注"); + followName.setTextColor(getResources().getColor(R.color.white)); + followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type)); + } + } + }); + } + }); + moreLayout.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (isShowcase) { + if (isAnchor) { + itemLayout01.setVisibility(View.GONE); + itemLayout02.setVisibility(View.GONE); + itemLayout03.setVisibility(View.GONE); + itemLayout04.setVisibility(View.GONE); + } else { + itemLayout03.setVisibility(View.GONE); + itemLayout04.setVisibility(View.GONE); + } + moreText.setText("查看更多"); + ImgLoader.display(mContext, R.mipmap.icon_down, moreIcon); + } else { + if (isAnchor) { + itemLayout01.setVisibility(View.VISIBLE); + itemLayout02.setVisibility(View.VISIBLE); + itemLayout03.setVisibility(View.VISIBLE); + itemLayout04.setVisibility(View.VISIBLE); + } else { + itemLayout01.setVisibility(View.GONE); + itemLayout02.setVisibility(View.GONE); + } + moreText.setText("收起"); + ImgLoader.display(mContext, R.mipmap.icon_up, moreIcon); + } + isShowcase = !isShowcase; + } }); findViewById(R.id.back).setOnClickListener(new View.OnClickListener() { @Override @@ -110,8 +353,33 @@ public class UserHomeActivity extends AbsActivity { }); } - private void initUseData() { + private void getUseData() { + LiveNetManager.get(mContext).getUserHomeInfo(uid, new HttpCallback() { + @Override + public void onSuccess(HomeUserInfoBean data) { + initData(data); + } + @Override + public void onError(String error) { + + } + }); + LiveNetManager.get(mContext).getUserExhibitInfoInfo(uid, new HttpCallback() { + @Override + public void onSuccess(HomeUserExhibitInfoBean data) { + if (data.getUserHomeTopInfo().getFans().getList() != null) { + for (int i = 0; i < data.getUserHomeTopInfo().getFans().getList().size(); i++) { + ImgLoader.display(mContext, data.getUserHomeTopInfo().getFans().getList().get(i).getAvatar(), fansImgViewList.get(i)); + } + } + } + + @Override + public void onError(String error) { + + } + }); } @Override diff --git a/common/src/main/java/com/yunbao/common/adapter/CommentAdapter.java b/common/src/main/java/com/yunbao/common/adapter/CommentAdapter.java index 836deef..e811a04 100644 --- a/common/src/main/java/com/yunbao/common/adapter/CommentAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/CommentAdapter.java @@ -13,6 +13,7 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.makeramen.roundedimageview.RoundedImageView; +import com.yunbao.common.CommonAppConfig; import com.yunbao.common.R; import com.yunbao.common.bean.CommentBean; import com.yunbao.common.glide.ImgLoader; @@ -24,15 +25,19 @@ import java.util.List; public class CommentAdapter extends RecyclerView.Adapter { private List commentBeanList; private Context mContext; + private String authorId; + private String myUid; private onItemClickListener onItemClickListener; public void setOnItemClickListener(CommentAdapter.onItemClickListener onItemClickListener) { this.onItemClickListener = onItemClickListener; } - public CommentAdapter(Context content, List commentBeanList) { + public CommentAdapter(Context content, List commentBeanList, String authorId) { this.mContext = content; this.commentBeanList = commentBeanList; + this.authorId = authorId; + myUid = CommonAppConfig.getInstance().getUid(); } @NonNull @@ -66,6 +71,10 @@ public class CommentAdapter extends RecyclerView.Adapter { private LinearLayout replyLayout; private TextView firstName; private TextView isAuth; + private TextView del; + private TextView author; + private TextView del1; + private TextView report1; public CommentViewHolder(@NonNull View itemView) { super(itemView); @@ -81,6 +90,10 @@ public class CommentAdapter extends RecyclerView.Adapter { replyCount = itemView.findViewById(R.id.expand); replyLayout = itemView.findViewById(R.id.replyLayout); recyclerView = itemView.findViewById(R.id.recyclerView); + del = itemView.findViewById(R.id.del); + author = itemView.findViewById(R.id.author); + del1 = itemView.findViewById(R.id.del1); + report1 = itemView.findViewById(R.id.report1); report.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -99,6 +112,15 @@ public class CommentAdapter extends RecyclerView.Adapter { } } }); + del.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (onItemClickListener != null) { + CommentBean bean = (CommentBean) v.getTag(); + onItemClickListener.onDel(bean, 0); + } + } + }); } @SuppressLint("SetTextI18n") @@ -108,6 +130,16 @@ public class CommentAdapter extends RecyclerView.Adapter { ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar); name.setText(bean.getUser_name()); content.setText(bean.getContent()); + if (bean.getUser_id().equals(authorId)) { + author.setVisibility(View.VISIBLE); + } else { + author.setVisibility(View.GONE); + } + if (bean.getUser_id().equals(myUid)) { + del.setVisibility(View.VISIBLE); + } else { + del.setVisibility(View.GONE); + } if (bean.getReplyCommentList() != null) { replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>"); if (bean.getReplyCommentList().size() > 0) { @@ -115,6 +147,16 @@ public class CommentAdapter extends RecyclerView.Adapter { ImgLoader.display(itemView.getContext(), bean.getReplyCommentList().get(0).getUser_avatar(), mAvatar01); firstName.setText(bean.getReplyCommentList().get(0).getUser_name()); replyLayout.setVisibility(View.VISIBLE); + if (bean.getReplyCommentList().get(0).getUser_id().equals(authorId)) { + isAuth.setVisibility(View.VISIBLE); + } else { + isAuth.setVisibility(View.GONE); + } + if (bean.getUser_id().equals(myUid)) { + del.setVisibility(View.VISIBLE); + } else { + del.setVisibility(View.GONE); + } } else { replyLayout.setVisibility(View.GONE); replyCount.setVisibility(View.GONE); @@ -127,7 +169,22 @@ public class CommentAdapter extends RecyclerView.Adapter { List tempList = new ArrayList<>(); tempList.addAll(bean.getReplyCommentList()); tempList.remove(0); - CommentReplyAdapter commentReplyAdapter = new CommentReplyAdapter(mContext, tempList); + CommentReplyAdapter commentReplyAdapter = new CommentReplyAdapter(mContext, tempList, authorId); + commentReplyAdapter.setOnItemClickListener(new CommentReplyAdapter.onItemClickListener() { + @Override + public void onReport(CommentBean.ReplyComment activeBean) { + if (onItemClickListener != null) { + onItemClickListener.onReport(activeBean); + } + } + + @Override + public void onDel(CommentBean.ReplyComment activeBean) { + if (onItemClickListener != null) { + onItemClickListener.onDel(activeBean); + } + } + }); recyclerView.setAdapter(commentReplyAdapter); recyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER); replyCount.setOnClickListener(new View.OnClickListener() { @@ -152,6 +209,12 @@ public class CommentAdapter extends RecyclerView.Adapter { void onReply(CommentBean activeBean); void onReport(CommentBean activeBean); + + void onDel(CommentBean activeBean, int position); + + void onReport(CommentBean.ReplyComment activeBean); + + void onDel(CommentBean.ReplyComment activeBean); } } diff --git a/common/src/main/java/com/yunbao/common/adapter/CommentReplyAdapter.java b/common/src/main/java/com/yunbao/common/adapter/CommentReplyAdapter.java index 41458d0..c2b1fef 100644 --- a/common/src/main/java/com/yunbao/common/adapter/CommentReplyAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/CommentReplyAdapter.java @@ -11,6 +11,7 @@ import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.makeramen.roundedimageview.RoundedImageView; +import com.yunbao.common.CommonAppConfig; import com.yunbao.common.R; import com.yunbao.common.bean.CommentBean; import com.yunbao.common.glide.ImgLoader; @@ -20,10 +21,19 @@ import java.util.List; public class CommentReplyAdapter extends RecyclerView.Adapter { private List commentBeanList; private Context mContext; + private String authorId; + private String myUid; + private onItemClickListener onItemClickListener; - public CommentReplyAdapter(Context content, List commentBeanList) { + public void setOnItemClickListener(onItemClickListener onItemClickListener) { + this.onItemClickListener = onItemClickListener; + } + + public CommentReplyAdapter(Context content, List commentBeanList, String authorId) { this.mContext = content; this.commentBeanList = commentBeanList; + this.authorId = authorId; + myUid = CommonAppConfig.getInstance().getUid(); } @NonNull @@ -48,19 +58,58 @@ public class CommentReplyAdapter extends RecyclerView.Adapter { private TextView name; private RoundedImageView mAvatar01; private TextView replyContent; + private TextView author; + private TextView del; + private TextView report; public CommentViewHolder(@NonNull View itemView) { super(itemView); name = itemView.findViewById(R.id.name); mAvatar01 = itemView.findViewById(R.id.avatar01); replyContent = itemView.findViewById(R.id.replyContent); + author = itemView.findViewById(R.id.author); + del = itemView.findViewById(R.id.del); + report = itemView.findViewById(R.id.report); + del.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (onItemClickListener != null) { + onItemClickListener.onDel((CommentBean.ReplyComment) v.getTag()); + } + } + }); + report.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (onItemClickListener != null) { + onItemClickListener.onReport((CommentBean.ReplyComment) v.getTag()); + } + } + }); } @SuppressLint("SetTextI18n") public void setData(CommentBean.ReplyComment bean) { + del.setTag(bean); ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar01); name.setText(bean.getUser_name()); replyContent.setText(bean.getContent()); + if (bean.getUser_id().equals(authorId)) { + author.setVisibility(View.VISIBLE); + } else { + author.setVisibility(View.GONE); + } + if (bean.getUser_id().equals(myUid)) { + del.setVisibility(View.VISIBLE); + } else { + del.setVisibility(View.GONE); + } } } + + public interface onItemClickListener { + void onReport(CommentBean.ReplyComment activeBean); + + void onDel(CommentBean.ReplyComment activeBean); + } } diff --git a/common/src/main/java/com/yunbao/common/adapter/ImagePreviewAdapter.java b/common/src/main/java/com/yunbao/common/adapter/ImagePreviewAdapter.java new file mode 100644 index 0000000..bc22ba7 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/adapter/ImagePreviewAdapter.java @@ -0,0 +1,112 @@ +package com.yunbao.common.adapter; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.PagerSnapHelper; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; + + +/** + * Created by cxf on 2018/11/28. + */ + +public class ImagePreviewAdapter extends RecyclerView.Adapter { + + private LayoutInflater mInflater; + private ActionListener mActionListener; + private int mPageCount; + private LinearLayoutManager mLayoutManager; + private int mCurPosition; + + public ImagePreviewAdapter(Context context, int pageCount) { + mPageCount = pageCount; + mInflater = LayoutInflater.from(context); + } + + @NonNull + @Override + public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return new Vh(mInflater.inflate(R.layout.item_preview_img, parent, false)); + } + + @Override + public void onBindViewHolder(@NonNull Vh vh, int position) { + vh.setData(position); + } + + @Override + public int getItemCount() { + return mPageCount; + } + + + class Vh extends RecyclerView.ViewHolder { + + ImageView mImg; + + public Vh(View itemView) { + super(itemView); + mImg = (ImageView) itemView; + } + + void setData(int position) { + if (mActionListener != null) { + mActionListener.loadImage(mImg, position); + } + } + } + + public void setActionListener(ActionListener actionListener) { + mActionListener = actionListener; + } + + public void setCurPosition(int curPosition) { + mCurPosition = curPosition; + if (mActionListener != null) { + mActionListener.onPageChanged(curPosition); + } + } + + public int getCurPosition(){ + return mCurPosition; + } + + @Override + public void onAttachedToRecyclerView(RecyclerView recyclerView) { + super.onAttachedToRecyclerView(recyclerView); + mLayoutManager = (LinearLayoutManager) recyclerView.getLayoutManager(); + PagerSnapHelper pagerSnapHelper = new PagerSnapHelper(); + pagerSnapHelper.attachToRecyclerView(recyclerView); + recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() { + @Override + public void onScrollStateChanged(RecyclerView recyclerView, int newState) { + } + + @Override + public void onScrolled(RecyclerView recyclerView, int dx, int dy) { + int position = mLayoutManager.findFirstCompletelyVisibleItemPosition(); + if (position >= 0 && mCurPosition != position) { + mCurPosition = position; + if (mActionListener != null) { + mActionListener.onPageChanged(position); + } + } + } + }); + } + + + public interface ActionListener { + void onPageChanged(int position); + + void loadImage(ImageView imageView, int position); + } +} diff --git a/common/src/main/java/com/yunbao/common/adapter/LabelTagAdapter.java b/common/src/main/java/com/yunbao/common/adapter/LabelTagAdapter.java new file mode 100644 index 0000000..f1737b6 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/adapter/LabelTagAdapter.java @@ -0,0 +1,47 @@ +package com.yunbao.common.adapter; + +import android.content.Context; +import android.view.View; +import android.widget.TextView; + +import com.xuexiang.xui.widget.flowlayout.BaseTagAdapter; +import com.yunbao.common.R; +import com.yunbao.common.bean.LabelBean; + +public class LabelTagAdapter extends BaseTagAdapter { + + OnSureOnClickListener onSureOnClickListener; + + Context mContext; + + public LabelTagAdapter(Context context, OnSureOnClickListener onSureOnClickListener) { + super(context); + this.onSureOnClickListener = onSureOnClickListener; + this.mContext = context; + } + + public LabelTagAdapter(Context context) { + super(context); + } + + @Override + protected TextView newViewHolder(View convertView) { + return (TextView) convertView.findViewById(R.id.tv_tag); + } + + @Override + protected int getLayoutId() { + return R.layout.adapter_item_tag; + } + + @Override + protected void convert(TextView textView, String item, int position) { + textView.setText(item); + textView.setTextColor(mContext.getResources().getColor(R.color.black2)); + } + + public interface OnSureOnClickListener { + void sure(LabelBean.Children labelBean); + } + +} diff --git a/common/src/main/java/com/yunbao/common/adapter/UserCommunityAdapter.java b/common/src/main/java/com/yunbao/common/adapter/UserCommunityAdapter.java new file mode 100644 index 0000000..37b91bf --- /dev/null +++ b/common/src/main/java/com/yunbao/common/adapter/UserCommunityAdapter.java @@ -0,0 +1,129 @@ +package com.yunbao.common.adapter; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.makeramen.roundedimageview.RoundedImageView; +import com.yunbao.common.R; +import com.yunbao.common.bean.ActiveOtherBean; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.views.NineGridLayout; + +import java.util.ArrayList; +import java.util.List; + +public class UserCommunityAdapter extends RecyclerView.Adapter { + private List commentBeanList; + private Context mContext; + private onItemClickListener onItemClickListener; + + public void setOnItemClickListener(UserCommunityAdapter.onItemClickListener onItemClickListener) { + this.onItemClickListener = onItemClickListener; + } + + public UserCommunityAdapter(Context content, List commentBeanList) { + this.mContext = content; + this.commentBeanList = commentBeanList; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.activity_user_community_item, parent, false); + return new CommentViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + CommentViewHolder commentViewHolder = (CommentViewHolder) holder; + commentViewHolder.setData(commentBeanList.get(position)); + } + + @Override + public int getItemCount() { + return commentBeanList.size(); + } + + class CommentViewHolder extends RecyclerView.ViewHolder { + private RoundedImageView mAvatar; + private TextView userName; + private TextView time; + private TextView content; + private NineGridLayout nineGridLayout; + private RelativeLayout videoLayout; + private ImageView videoImage; + private TextView likeCount; + private TextView comCount; + private TextView shareCount; + + public CommentViewHolder(@NonNull View itemView) { + super(itemView); + mAvatar = itemView.findViewById(R.id.avatar); + userName = itemView.findViewById(R.id.userName); + time = itemView.findViewById(R.id.time); + content = itemView.findViewById(R.id.content); + nineGridLayout = itemView.findViewById(R.id.nine_grid_layout); + videoLayout = itemView.findViewById(R.id.videoLayout); + videoImage = itemView.findViewById(R.id.videoImage); + likeCount = itemView.findViewById(R.id.likeCount); + comCount = itemView.findViewById(R.id.comCount); + shareCount = itemView.findViewById(R.id.shareCount); + + mAvatar.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onItemClickListener.onImgItem((String) v.getTag(), getPosition()); + } + }); + } + + @SuppressLint("SetTextI18n") + public void setData(ActiveOtherBean bean) { + mAvatar.setTag(bean); + ImgLoader.display(mContext, bean.getUser_avatar(), mAvatar); + userName.setText(bean.getUser_name()); + time.setText(bean.getCreate_time()); + content.setText(String.valueOf(JSONObject.parseObject(bean.getContent()).get("msg"))); + likeCount.setText(String.valueOf(bean.getLove_num())); + comCount.setText(String.valueOf(bean.getComment_num())); + shareCount.setText(String.valueOf(bean.getShare_num())); + nineGridLayout.setActionListener(new NineGridLayout.ActionListener() { + @Override + public void onItemClick(List dataList, int position) { + + } + + @Override + public void displayImage(Object path, ImageView imageView) { + ImgLoader.display(mContext, String.valueOf(path), imageView); + } + }); + if (bean.getImg_or_video().equals("1")) {//图片 + JSONArray jsonArray = (JSONArray) JSONArray.parse(bean.getImg_json()); + List tempList = new ArrayList<>(); + for (int i = 0; i < jsonArray.size(); i++) { + tempList.add(String.valueOf(jsonArray.get(i))); + } + nineGridLayout.setData(tempList); + } else { + ImgLoader.display(mContext, bean.getUser_avatar(), videoImage); + } + + } + } + + public interface onItemClickListener { + void onImgItem(String activeBean, int position); + } +} diff --git a/common/src/main/java/com/yunbao/common/adapter/UserHomeImgAdapter.java b/common/src/main/java/com/yunbao/common/adapter/UserHomeImgAdapter.java index 2379bd1..543fa3d 100644 --- a/common/src/main/java/com/yunbao/common/adapter/UserHomeImgAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/UserHomeImgAdapter.java @@ -5,6 +5,8 @@ import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.LinearLayout; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; @@ -25,11 +27,20 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter { this.onItemClickListener = onItemClickListener; } + public List getCommentBeanList() { + return commentBeanList; + } + public UserHomeImgAdapter(Context content, List commentBeanList) { this.mContext = content; this.commentBeanList = commentBeanList; } + public void setCommentBeanList(List commentBeanList) { + this.commentBeanList = commentBeanList; + notifyDataSetChanged(); + } + @NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { @@ -39,8 +50,7 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter { @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { - CommentViewHolder commentViewHolder = (CommentViewHolder) holder; - commentViewHolder.setData(commentBeanList.get(position)); + ((CommentViewHolder) holder).setData(commentBeanList.get(position), position); } @Override @@ -49,38 +59,37 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter { } class CommentViewHolder extends RecyclerView.ViewHolder { - private RoundedImageView mAvatar; + RoundedImageView mAvatar01; + RoundedImageView mAvatar02; public CommentViewHolder(@NonNull View itemView) { super(itemView); - mAvatar = itemView.findViewById(R.id.avatar); - mAvatar.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - onItemClickListener.onImgItem((String) v.getTag()); - } - }); + mAvatar01 = itemView.findViewById(R.id.avatar01); + mAvatar02 = itemView.findViewById(R.id.avatar02); } @SuppressLint("SetTextI18n") - public void setData(UserHomeImgBean bean) { - mAvatar.setTag(bean); - ImgLoader.display(itemView.getContext(), bean.getImgurl(), mAvatar); + public void setData(UserHomeImgBean bean, int position) { + mAvatar01.setTag(bean); + mAvatar01.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onItemClickListener.onImgItem((UserHomeImgBean) v.getTag(), position); + } + }); + ImgLoader.display(mContext, bean.getImgurl(), mAvatar01); + ImgLoader.display(mContext, bean.getImgurl(), mAvatar02); if (bean.isShow()) { - ViewGroup.LayoutParams viewGroup = mAvatar.getLayoutParams(); - viewGroup.height = 200; - viewGroup.width = 200; - mAvatar.setLayoutParams(viewGroup); + mAvatar01.setVisibility(View.GONE); + mAvatar02.setVisibility(View.VISIBLE); } else { - ViewGroup.LayoutParams viewGroup = mAvatar.getLayoutParams(); - viewGroup.height = 100; - viewGroup.width = 100; - mAvatar.setLayoutParams(viewGroup); + mAvatar01.setVisibility(View.VISIBLE); + mAvatar02.setVisibility(View.GONE); } } } public interface onItemClickListener { - void onImgItem(String activeBean); + void onImgItem(UserHomeImgBean activeBean, int position); } } diff --git a/common/src/main/java/com/yunbao/common/bean/ActiveOtherBean.java b/common/src/main/java/com/yunbao/common/bean/ActiveOtherBean.java new file mode 100644 index 0000000..be8b4cd --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/ActiveOtherBean.java @@ -0,0 +1,281 @@ +package com.yunbao.common.bean; + +import android.os.Parcel; +import android.os.Parcelable; + +import androidx.annotation.NonNull; + +/** + * 社區动态 + */ +public class ActiveOtherBean extends BaseModel implements Parcelable { + private String id; + private String img_or_video; + private String img_json; + private String video; + private String content; + private String talk_id; + private String love_num; + private String comment_num; + private String share_num; + private String gift_num; + private String hot_num; + private String create_time; + private String ai_content; + private String is_delete; + private String user_name; + private String user_avatar; + private String is_anchor; + private String is_live; + private String is_attention; + private String user_id; + private String talk_name; + private String is_love; + + public ActiveOtherBean() { + } + + protected ActiveOtherBean(Parcel in) { + id = in.readString(); + img_or_video = in.readString(); + img_json = in.readString(); + video = in.readString(); + content = in.readString(); + talk_id = in.readString(); + love_num = in.readString(); + comment_num = in.readString(); + share_num = in.readString(); + gift_num = in.readString(); + hot_num = in.readString(); + create_time = in.readString(); + ai_content = in.readString(); + is_delete = in.readString(); + user_name = in.readString(); + user_avatar = in.readString(); + is_anchor = in.readString(); + is_live = in.readString(); + is_attention = in.readString(); + user_id = in.readString(); + talk_name = in.readString(); + is_love = in.readString(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public ActiveOtherBean createFromParcel(Parcel in) { + return new ActiveOtherBean(in); + } + + @Override + public ActiveOtherBean[] newArray(int size) { + return new ActiveOtherBean[size]; + } + }; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getImg_or_video() { + return img_or_video; + } + + public void setImg_or_video(String img_or_video) { + this.img_or_video = img_or_video; + } + + public String getImg_json() { + return img_json; + } + + public void setImg_json(String img_json) { + this.img_json = img_json; + } + + public String getVideo() { + return video; + } + + public void setVideo(String video) { + this.video = video; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getTalk_id() { + return talk_id; + } + + public void setTalk_id(String talk_id) { + this.talk_id = talk_id; + } + + public String getLove_num() { + return love_num; + } + + public void setLove_num(String love_num) { + this.love_num = love_num; + } + + public String getComment_num() { + return comment_num; + } + + public void setComment_num(String comment_num) { + this.comment_num = comment_num; + } + + public String getShare_num() { + return share_num; + } + + public void setShare_num(String share_num) { + this.share_num = share_num; + } + + public String getGift_num() { + return gift_num; + } + + public void setGift_num(String gift_num) { + this.gift_num = gift_num; + } + + public String getHot_num() { + return hot_num; + } + + public void setHot_num(String hot_num) { + this.hot_num = hot_num; + } + + public String getCreate_time() { + return create_time; + } + + public void setCreate_time(String create_time) { + this.create_time = create_time; + } + + public String getAi_content() { + return ai_content; + } + + public void setAi_content(String ai_content) { + this.ai_content = ai_content; + } + + public String getIs_delete() { + return is_delete; + } + + public void setIs_delete(String is_delete) { + this.is_delete = is_delete; + } + + public String getUser_name() { + return user_name; + } + + public void setUser_name(String user_name) { + this.user_name = user_name; + } + + public String getUser_avatar() { + return user_avatar; + } + + public void setUser_avatar(String user_avatar) { + this.user_avatar = user_avatar; + } + + public String getIs_anchor() { + return is_anchor; + } + + public void setIs_anchor(String is_anchor) { + this.is_anchor = is_anchor; + } + + public String getIs_live() { + return is_live; + } + + public void setIs_live(String is_live) { + this.is_live = is_live; + } + + public String getIs_attention() { + return is_attention; + } + + public void setIs_attention(String is_attention) { + this.is_attention = is_attention; + } + + public String getUser_id() { + return user_id; + } + + public void setUser_id(String user_id) { + this.user_id = user_id; + } + + public String getTalk_name() { + return talk_name; + } + + public void setTalk_name(String talk_name) { + this.talk_name = talk_name; + } + + public String getIs_love() { + return is_love; + } + + public void setIs_love(String is_love) { + this.is_love = is_love; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(@NonNull Parcel dest, int flags) { + dest.writeString(id); + dest.writeString(img_or_video); + dest.writeString(img_json); + dest.writeString(video); + dest.writeString(content); + dest.writeString(talk_id); + dest.writeString(love_num); + dest.writeString(comment_num); + dest.writeString(share_num); + dest.writeString(gift_num); + dest.writeString(hot_num); + dest.writeString(create_time); + dest.writeString(ai_content); + dest.writeString(is_delete); + dest.writeString(user_name); + dest.writeString(user_avatar); + dest.writeString(is_anchor); + dest.writeString(is_live); + dest.writeString(is_attention); + dest.writeString(user_id); + dest.writeString(talk_name); + dest.writeString(is_love); + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/HomeUserExhibitInfoBean.java b/common/src/main/java/com/yunbao/common/bean/HomeUserExhibitInfoBean.java new file mode 100644 index 0000000..77e732c --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/HomeUserExhibitInfoBean.java @@ -0,0 +1,129 @@ +package com.yunbao.common.bean; + +import java.util.List; + +public class HomeUserExhibitInfoBean extends BaseModel { + public UserHomeTopInfo userHomeTopInfo; + public List giftAlreadyWall; + + public UserHomeTopInfo getUserHomeTopInfo() { + return userHomeTopInfo; + } + + public void setUserHomeTopInfo(UserHomeTopInfo userHomeTopInfo) { + this.userHomeTopInfo = userHomeTopInfo; + } + + + public class UserHomeTopInfo { + Fans fans; + + public Fans getFans() { + return fans; + } + + public void setFans(Fans fans) { + this.fans = fans; + } + + public class Fans { + public List list; + public String fans_name; + + public String getFans_name() { + return fans_name; + } + + public void setFans_name(String fans_name) { + this.fans_name = fans_name; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public class AvatarList { + String avatar; + + public String getAvatar() { + return avatar; + } + + public void setAvatar(String avatar) { + this.avatar = avatar; + } + } + } + + public class Guard { + String avatar; + + public String getAvatar() { + return avatar; + } + + public void setAvatar(String avatar) { + this.avatar = avatar; + } + } + + public class Dress { + String display_src; + + public String getDisplay_src() { + return display_src; + } + + public void setDisplay_src(String display_src) { + this.display_src = display_src; + } + } + } + + + public class GiftAlreadyWall { + private String gift_wall_lighten_number; + private String gift_wall_lighten_total; + private List gift_wall; + + public String getGift_wall_lighten_number() { + return gift_wall_lighten_number; + } + + public void setGift_wall_lighten_number(String gift_wall_lighten_number) { + this.gift_wall_lighten_number = gift_wall_lighten_number; + } + + public String getGift_wall_lighten_total() { + return gift_wall_lighten_total; + } + + public void setGift_wall_lighten_total(String gift_wall_lighten_total) { + this.gift_wall_lighten_total = gift_wall_lighten_total; + } + + public List getGift_wall() { + return gift_wall; + } + + public void setGift_wall(List gift_wall) { + this.gift_wall = gift_wall; + } + + public class GiftWall { + private String gifticon; + + public String getGifticon() { + return gifticon; + } + + public void setGifticon(String gifticon) { + this.gifticon = gifticon; + } + } + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/HomeUserInfoBean.java b/common/src/main/java/com/yunbao/common/bean/HomeUserInfoBean.java new file mode 100644 index 0000000..c302f92 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/HomeUserInfoBean.java @@ -0,0 +1,255 @@ +package com.yunbao.common.bean; + +import java.util.List; + +public class HomeUserInfoBean extends BaseModel { + public UserHomeTopInfo userHomeTopInfo; + public List checkBlack; + + public UserHomeTopInfo getUserHomeTopInfo() { + return userHomeTopInfo; + } + + public void setUserHomeTopInfo(UserHomeTopInfo userHomeTopInfo) { + this.userHomeTopInfo = userHomeTopInfo; + } + + public List getCheckBlack() { + return checkBlack; + } + + public void setCheckBlack(List checkBlack) { + this.checkBlack = checkBlack; + } + + public class UserHomeTopInfo { + private long user_id; + private String user_name; + private String user_avatar; + private String user_signature; + private int user_sex; + private String user_level; + private String user_level_anchor; + private String user_goodnum; + private String user_level_img; + private String user_level_anchor_img; + private String user_president_name; + private int user_fans_num; + private int user_love_num; + private List user_home_banner; + private int is_live; + private int is_anchor; + private String fans_name; + private int is_attention; + private String user_avatar_frame; + private List cn_label; + private List en_label; + + public List getCn_label() { + return cn_label; + } + + public void setCn_label(List cn_label) { + this.cn_label = cn_label; + } + + public List getEn_label() { + return en_label; + } + + public void setEn_label(List en_label) { + this.en_label = en_label; + } + + public void setUser_id(long user_id) { + this.user_id = user_id; + } + + public long getUser_id() { + return user_id; + } + + public void setUser_name(String user_name) { + this.user_name = user_name; + } + + public String getUser_name() { + return user_name; + } + + public void setUser_avatar(String user_avatar) { + this.user_avatar = user_avatar; + } + + public String getUser_avatar() { + return user_avatar; + } + + public void setUser_signature(String user_signature) { + this.user_signature = user_signature; + } + + public String getUser_signature() { + return user_signature; + } + + public void setUser_sex(int user_sex) { + this.user_sex = user_sex; + } + + public int getUser_sex() { + return user_sex; + } + + public void setUser_level(String user_level) { + this.user_level = user_level; + } + + public String getUser_level() { + return user_level; + } + + public void setUser_level_anchor(String user_level_anchor) { + this.user_level_anchor = user_level_anchor; + } + + public String getUser_level_anchor() { + return user_level_anchor; + } + + public void setUser_goodnum(String user_goodnum) { + this.user_goodnum = user_goodnum; + } + + public String getUser_goodnum() { + return user_goodnum; + } + + public void setUser_level_img(String user_level_img) { + this.user_level_img = user_level_img; + } + + public String getUser_level_img() { + return user_level_img; + } + + public void setUser_level_anchor_img(String user_level_anchor_img) { + this.user_level_anchor_img = user_level_anchor_img; + } + + public String getUser_level_anchor_img() { + return user_level_anchor_img; + } + + public void setUser_president_name(String user_president_name) { + this.user_president_name = user_president_name; + } + + public String getUser_president_name() { + return user_president_name; + } + + public void setUser_fans_num(int user_fans_num) { + this.user_fans_num = user_fans_num; + } + + public int getUser_fans_num() { + return user_fans_num; + } + + public void setUser_love_num(int user_love_num) { + this.user_love_num = user_love_num; + } + + public int getUser_love_num() { + return user_love_num; + } + + public void setUser_home_banner(List user_home_banner) { + this.user_home_banner = user_home_banner; + } + + public List getUser_home_banner() { + return user_home_banner; + } + + public void setIs_live(int is_live) { + this.is_live = is_live; + } + + public int getIs_live() { + return is_live; + } + + public void setIs_anchor(int is_anchor) { + this.is_anchor = is_anchor; + } + + public int getIs_anchor() { + return is_anchor; + } + + public void setFans_name(String fans_name) { + this.fans_name = fans_name; + } + + public String getFans_name() { + return fans_name; + } + + public void setIs_attention(int is_attention) { + this.is_attention = is_attention; + } + + public int getIs_attention() { + return is_attention; + } + + public void setUser_avatar_frame(String user_avatar_frame) { + this.user_avatar_frame = user_avatar_frame; + } + + public String getUser_avatar_frame() { + return user_avatar_frame; + } + } + + public class CheckBlack { + private String uidIsAuth; + private String touidIsAuth; + private String u2t; + private String t2u; + + public String getUidIsAuth() { + return uidIsAuth; + } + + public void setUidIsAuth(String uidIsAuth) { + this.uidIsAuth = uidIsAuth; + } + + public String getTouidIsAuth() { + return touidIsAuth; + } + + public void setTouidIsAuth(String touidIsAuth) { + this.touidIsAuth = touidIsAuth; + } + + public String getU2t() { + return u2t; + } + + public void setU2t(String u2t) { + this.u2t = u2t; + } + + public String getT2u() { + return t2u; + } + + public void setT2u(String t2u) { + this.t2u = t2u; + } + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/LabelBean.java b/common/src/main/java/com/yunbao/common/bean/LabelBean.java new file mode 100644 index 0000000..fe6e5b4 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/LabelBean.java @@ -0,0 +1,128 @@ +package com.yunbao.common.bean; + +import java.util.ArrayList; +import java.util.List; + +public class LabelBean extends BaseModel { + private int id; + private int pid; + private String cn_title; + private String en_title; + private List children; + + public static class Children { + private int id; + private int pid; + private String cn_title; + private String en_title; + private List children; + + private boolean isSelect; + + public boolean isSelect() { + return isSelect; + } + + public void setSelect(boolean select) { + isSelect = select; + } + + public Children() { + + } + + public Children(int id, String cn_title) { + this.id = id; + this.cn_title = cn_title; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getPid() { + return pid; + } + + public void setPid(int pid) { + this.pid = pid; + } + + public String getCn_title() { + return cn_title; + } + + public void setCn_title(String cn_title) { + this.cn_title = cn_title; + } + + public String getEn_title() { + return en_title; + } + + public void setEn_title(String en_title) { + this.en_title = en_title; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getPid() { + return pid; + } + + public void setPid(int pid) { + this.pid = pid; + } + + public String getCn_title() { + return cn_title; + } + + public void setCn_title(String cn_title) { + this.cn_title = cn_title; + } + + public String getEn_title() { + return en_title; + } + + public void setEn_title(String en_title) { + this.en_title = en_title; + } + + public List getChildren() { + return children; + } + + + public List getStringChildren() { + List stringList = new ArrayList<>(); + for (int i = 0; i < children.size(); i++) { + stringList.add(children.get(i).getCn_title()); + } + return stringList; + } + + public void setChildren(List children) { + this.children = children; + } +} diff --git a/common/src/main/java/com/yunbao/common/dialog/ImagePreviewDialog.java b/common/src/main/java/com/yunbao/common/dialog/ImagePreviewDialog.java new file mode 100644 index 0000000..a194490 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/ImagePreviewDialog.java @@ -0,0 +1,160 @@ +package com.yunbao.common.dialog; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.animation.ValueAnimator; +import android.os.Bundle; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.view.animation.AccelerateDecelerateInterpolator; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.adapter.ImagePreviewAdapter; +import com.yunbao.common.utils.StringUtil; + +/** + * Created by Martin on 2024/3/15. + * 图片预览弹窗 + */ + +public class ImagePreviewDialog extends AbsDialogFragment implements View.OnClickListener { + + private View mBg; + private RecyclerView mRecyclerView; + private ValueAnimator mAnimator; + private int mPosition; + private int mPageCount; + private ActionListener mActionListener; + private TextView mCount; + private ImagePreviewAdapter mAdapter; + private boolean mNeedDelete; + + + @Override + protected int getLayoutId() { + return R.layout.view_preview_image; + } + + @Override + protected int getDialogStyle() { + return R.style.dialog2; + } + + @Override + protected boolean canCancel() { + return true; + } + + @Override + protected void setWindowAttributes(Window window) { + WindowManager.LayoutParams params = window.getAttributes(); + params.width = WindowManager.LayoutParams.MATCH_PARENT; + params.height = WindowManager.LayoutParams.MATCH_PARENT; + window.setAttributes(params); + } + + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + mBg = mRootView.findViewById(R.id.bg); + mCount = (TextView) findViewById(R.id.count); + findViewById(R.id.btn_close).setOnClickListener(this); + if (mNeedDelete) { + View btnDelete = findViewById(R.id.btn_delete); + btnDelete.setVisibility(View.VISIBLE); + btnDelete.setOnClickListener(this); + } + mRecyclerView = mRootView.findViewById(R.id.recyclerView); + mRecyclerView.setHasFixedSize(true); + mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false)); + mAnimator = ValueAnimator.ofFloat(0, 1); + mAnimator.setDuration(150); + mAnimator.setInterpolator(new AccelerateDecelerateInterpolator()); + mAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { + @Override + public void onAnimationUpdate(ValueAnimator animation) { + float v = (float) animation.getAnimatedValue(); + mBg.setAlpha(v); + } + }); + mAnimator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + if (mRecyclerView != null && mPageCount > 0) { + ImagePreviewAdapter adapter = new ImagePreviewAdapter(mContext, mPageCount); + mAdapter = adapter; + adapter.setActionListener(new ImagePreviewAdapter.ActionListener() { + @Override + public void onPageChanged(int position) { + if (mCount != null) { + mCount.setText(StringUtil.contact(String.valueOf(position + 1), "/", String.valueOf(mPageCount))); + } + } + + @Override + public void loadImage(ImageView imageView, int position) { + if (mActionListener != null) { + mActionListener.loadImage(imageView, position); + } + } + }); + mRecyclerView.setAdapter(adapter); + if (mPosition >= 0 && mPosition < mPageCount) { + adapter.setCurPosition(mPosition); + mRecyclerView.scrollToPosition(mPosition); + } + } + } + }); + mAnimator.start(); + } + + public void setImageInfo(int pageCount, int position, boolean needDelete, ActionListener actionListener) { + mActionListener = actionListener; + mPageCount = pageCount; + mPosition = position; + mNeedDelete = needDelete; + } + + + @Override + public void onDestroy() { + if (mAnimator != null) { + mAnimator.cancel(); + } + mContext = null; + mActionListener = null; + super.onDestroy(); + } + + @Override + public void onClick(View v) { + int i = v.getId(); + if (i == R.id.btn_close) { + dismiss(); + } else if (i == R.id.btn_delete) { + delete(); + } + } + + private void delete() { + if (mAdapter != null && mActionListener != null) { + mActionListener.onDeleteClick(mAdapter.getCurPosition()); + } + dismiss(); + } + + public interface ActionListener { + void loadImage(ImageView imageView, int position); + + void onDeleteClick(int position); + } + +} diff --git a/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java b/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java index b964156..a14a2fe 100644 --- a/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java +++ b/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java @@ -527,7 +527,6 @@ public class CommonHttpUtil { .execute(callback); } - /** * 获取动态列表-热门 * @@ -593,7 +592,6 @@ public class CommonHttpUtil { .execute(callback); } - /** * 获取动态-分类 */ @@ -609,6 +607,39 @@ public class CommonHttpUtil { .execute(callback); } + public static void getOtherDynamicList(String toUid, HttpCallback callback) { + HttpClient.getInstance().get("Pdlcommunity.getOtherDynamicList", "Pdlcommunity.getOtherDynamicList") + .params("tuid", toUid) + .execute(callback); + } + + /** + * 动态-删除 + */ + public static void delCom(String comment_id, HttpCallback callback) { + HttpClient.getInstance().get("Pdlcommunity.delComment", "Pdlcommunity.delComment") + .params("comment_id", comment_id) + .execute(callback); + } + + /** + * 动态-不感兴趣 + */ + public static void noInterest(String uid, HttpCallback callback) { + HttpClient.getInstance().get("User.setBlack", "User.setBlack") + .params("touid", uid) + .execute(callback); + } + + /** + * 用户主页-用户数据 + */ + public static void getUserInfoTop(String uid, HttpCallback callback) { + HttpClient.getInstance().get("Pdluserhome.getUserHomeTopInfo", "Pdluserhome.getUserHomeTopInfo") + .params("select_uid", uid) + .execute(callback); + } + } diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 69a6b4f..149a9fe 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -26,6 +26,8 @@ import com.yunbao.common.bean.GiftGuideModel; import com.yunbao.common.bean.GiftNamingInfoModel; import com.yunbao.common.bean.GiftWallGiftDetail; import com.yunbao.common.bean.GiftWallModel; +import com.yunbao.common.bean.HomeUserExhibitInfoBean; +import com.yunbao.common.bean.HomeUserInfoBean; import com.yunbao.common.bean.HourRank; import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.IMLoginModel; @@ -1178,4 +1180,8 @@ public interface PDLiveApi { Observable> getOtherInfo(@Query("tuid") String tuid); @GET("/api/public/?service=Userhome.getUserHomeBanner") Observable>> getUserHomeBanner(@Query("select_uid") String tuid); + @GET("/api/public/?service=Pdluserhome.getUserHomeTopInfo") + Observable> getUserHomeInfo(@Query("select_uid") String tuid); + @GET("/api/public/?service=Pdluserhome.getUserHomeInfo") + Observable> getUserHomeExhibitInfo(@Query("select_uid") String tuid); } diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index e799ca0..41de024 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -27,6 +27,8 @@ import com.yunbao.common.bean.GiftGuideModel; import com.yunbao.common.bean.GiftNamingInfoModel; import com.yunbao.common.bean.GiftWallGiftDetail; import com.yunbao.common.bean.GiftWallModel; +import com.yunbao.common.bean.HomeUserExhibitInfoBean; +import com.yunbao.common.bean.HomeUserInfoBean; import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.LinkMicUserBean; import com.yunbao.common.bean.LinkMicUserBeanV2; @@ -2959,9 +2961,12 @@ public class LiveNetManager { .getOtherInfo(touid) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) - .subscribe(roomMicStatusModelResponseModel -> { - if (callback != null) { - callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo()); + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel messageUserInfoBeanResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(messageUserInfoBeanResponseModel.getData().getInfo()); + } } }, new Consumer() { @Override @@ -3034,7 +3039,7 @@ public class LiveNetManager { }).isDisposed(); } - public void getUserHomeBanner(String search,HttpCallback> callback) { + public void getUserHomeBanner(String search, HttpCallback> callback) { API.get().pdLiveApi(mContext) .getUserHomeBanner(search) .subscribeOn(Schedulers.io()) @@ -3054,6 +3059,53 @@ public class LiveNetManager { }).isDisposed(); } + public void getUserHomeInfo(String touid, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .getUserHomeInfo(touid) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel messageUserInfoBeanResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(messageUserInfoBeanResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getUserExhibitInfoInfo(String touid, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .getUserHomeExhibitInfo(touid) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel messageUserInfoBeanResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(messageUserInfoBeanResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + /** * 直播间取消网络请求 */ diff --git a/common/src/main/res/drawable/bg_flow_tag.xml b/common/src/main/res/drawable/bg_flow_tag.xml new file mode 100644 index 0000000..d049cdc --- /dev/null +++ b/common/src/main/res/drawable/bg_flow_tag.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/bg_user_home_04.xml b/common/src/main/res/drawable/bg_user_home_04.xml new file mode 100644 index 0000000..e4b5746 --- /dev/null +++ b/common/src/main/res/drawable/bg_user_home_04.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/activity_user_community_item.xml b/common/src/main/res/layout/activity_user_community_item.xml new file mode 100644 index 0000000..4bdb14c --- /dev/null +++ b/common/src/main/res/layout/activity_user_community_item.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/activity_user_home.xml b/common/src/main/res/layout/activity_user_home.xml index 3a68e2d..064641f 100644 --- a/common/src/main/res/layout/activity_user_home.xml +++ b/common/src/main/res/layout/activity_user_home.xml @@ -1,5 +1,5 @@ - + android:layout_marginBottom="35dp" + android:paddingStart="10dp" /> @@ -62,6 +63,7 @@ android:orientation="horizontal"> - - - - @@ -144,9 +134,10 @@ android:orientation="vertical"> @@ -167,18 +158,21 @@ @@ -222,7 +222,7 @@ @@ -231,76 +231,422 @@ android:id="@+id/user_sex" android:layout_width="30dp" android:layout_height="20dp" - android:src="@mipmap/icon_man" /> + android:src="@mipmap/icon_wumen" /> + android:gravity="center_vertical" + android:visibility="gone"> + android:visibility="visible" /> + android:textSize="12dp" + android:visibility="gone" /> + android:gravity="center_vertical" + android:visibility="gone"> + android:visibility="visible" /> + + + + + + + + + + + + + + + - + app:ftl_check_mode="none" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + android:layout_height="wrap_content"> + + - - @@ -392,4 +748,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/common/src/main/res/layout/adapter_item_tag.xml b/common/src/main/res/layout/adapter_item_tag.xml new file mode 100644 index 0000000..a961ad3 --- /dev/null +++ b/common/src/main/res/layout/adapter_item_tag.xml @@ -0,0 +1,21 @@ + + + + + + diff --git a/common/src/main/res/layout/item_comment_reply_view.xml b/common/src/main/res/layout/item_comment_reply_view.xml index 23e02a9..b647ac5 100644 --- a/common/src/main/res/layout/item_comment_reply_view.xml +++ b/common/src/main/res/layout/item_comment_reply_view.xml @@ -4,13 +4,13 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical" + android:orientation="horizontal" tools:ignore="MissingDefaultResource"> @@ -38,6 +38,7 @@ android:textStyle="bold" /> + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/item_comment_view.xml b/common/src/main/res/layout/item_comment_view.xml index 6b77117..4af43e1 100644 --- a/common/src/main/res/layout/item_comment_view.xml +++ b/common/src/main/res/layout/item_comment_view.xml @@ -21,11 +21,10 @@ app:riv_oval="true" /> @@ -48,6 +47,36 @@ + + + + + + + + + + + + + diff --git a/common/src/main/res/layout/item_user_home_img.xml b/common/src/main/res/layout/item_user_home_img.xml index e71b0cc..c3f9e39 100644 --- a/common/src/main/res/layout/item_user_home_img.xml +++ b/common/src/main/res/layout/item_user_home_img.xml @@ -2,17 +2,27 @@ + + - + android:visibility="gone" + app:riv_corner_radius="15dp" /> \ No newline at end of file diff --git a/common/src/main/res/layout/view_preview_image.xml b/common/src/main/res/layout/view_preview_image.xml index c57bb5b..9978752 100644 --- a/common/src/main/res/layout/view_preview_image.xml +++ b/common/src/main/res/layout/view_preview_image.xml @@ -1,5 +1,6 @@ @@ -31,7 +32,7 @@ android:layout_gravity="center_vertical" android:padding="9dp" android:src="@mipmap/icon_back" - android:tint="@color/white" /> + app:tint="@color/white" /> + android:visibility="gone" /> diff --git a/common/src/main/res/mipmap-mdpi/bg_user_home_01.png b/common/src/main/res/mipmap-mdpi/bg_user_home_01.png new file mode 100644 index 0000000..2e9a838 Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/bg_user_home_01.png differ diff --git a/common/src/main/res/mipmap-mdpi/bg_user_home_02.png b/common/src/main/res/mipmap-mdpi/bg_user_home_02.png new file mode 100644 index 0000000..8220261 Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/bg_user_home_02.png differ diff --git a/common/src/main/res/mipmap-mdpi/bg_user_home_03.png b/common/src/main/res/mipmap-mdpi/bg_user_home_03.png new file mode 100644 index 0000000..494934a Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/bg_user_home_03.png differ diff --git a/common/src/main/res/mipmap-mdpi/icon_com_com.png b/common/src/main/res/mipmap-mdpi/icon_com_com.png new file mode 100644 index 0000000..019ce0c Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/icon_com_com.png differ diff --git a/common/src/main/res/mipmap-mdpi/icon_com_like.png b/common/src/main/res/mipmap-mdpi/icon_com_like.png new file mode 100644 index 0000000..bd72d72 Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/icon_com_like.png differ diff --git a/common/src/main/res/mipmap-mdpi/icon_com_share.png b/common/src/main/res/mipmap-mdpi/icon_com_share.png new file mode 100644 index 0000000..cad84d0 Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/icon_com_share.png differ diff --git a/common/src/main/res/mipmap-mdpi/icon_gray_new_right.png b/common/src/main/res/mipmap-mdpi/icon_gray_new_right.png new file mode 100644 index 0000000..5bc9f0d Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/icon_gray_new_right.png differ diff --git a/common/src/main/res/mipmap-mdpi/icon_man_new.png b/common/src/main/res/mipmap-mdpi/icon_man_new.png new file mode 100644 index 0000000..f5a03a2 Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/icon_man_new.png differ diff --git a/common/src/main/res/mipmap-mdpi/icon_trade_union.png b/common/src/main/res/mipmap-mdpi/icon_trade_union.png new file mode 100644 index 0000000..af58be2 Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/icon_trade_union.png differ diff --git a/common/src/main/res/mipmap-mdpi/icon_up.png b/common/src/main/res/mipmap-mdpi/icon_up.png new file mode 100644 index 0000000..d4730b3 Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/icon_up.png differ diff --git a/common/src/main/res/mipmap-mdpi/icon_man.png b/common/src/main/res/mipmap-mdpi/icon_wumen.png similarity index 100% rename from common/src/main/res/mipmap-mdpi/icon_man.png rename to common/src/main/res/mipmap-mdpi/icon_wumen.png diff --git a/common/src/main/res/mipmap-mdpi/img_honor_default.png b/common/src/main/res/mipmap-mdpi/img_honor_default.png new file mode 100644 index 0000000..9959d92 Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/img_honor_default.png differ diff --git a/common/src/main/res/mipmap-mdpi/img_no1.png b/common/src/main/res/mipmap-mdpi/img_no1.png new file mode 100644 index 0000000..f79cfc6 Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/img_no1.png differ diff --git a/common/src/main/res/mipmap-mdpi/img_no2.png b/common/src/main/res/mipmap-mdpi/img_no2.png new file mode 100644 index 0000000..d84f3bf Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/img_no2.png differ diff --git a/common/src/main/res/mipmap-mdpi/img_no3.png b/common/src/main/res/mipmap-mdpi/img_no3.png new file mode 100644 index 0000000..4f6e581 Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/img_no3.png differ diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index e650fb8..22a1b94 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -1133,10 +1133,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene mainHomeComViewHolder = new MainHomeComViewHolder(mContext, parent); vh = mainHomeComViewHolder; } else if (position == 1) { - mainHomeLiveViewHolder = new MainHomeLiveViewHolder(mContext, parent);//直播 - vh = mainHomeLiveViewHolder; - /* mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//直播 - vh = mMainHomeCommunityViewHolder;*/ + /* mainHomeLiveViewHolder = new MainHomeLiveViewHolder(mContext, parent);//直播 + vh = mainHomeLiveViewHolder;*/ + mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//直播 + vh = mMainHomeCommunityViewHolder; } else if (position == 2) { mainMessageViewHolder = new MainMessageViewHolder(this, parent); vh = mainMessageViewHolder;