Merge remote-tracking branch 'origin/dev_改版主分支-升级融云SDK&AGP8' into dev_改版主分支-升级融云SDK&AGP8

This commit is contained in:
zlzw 2024-03-28 16:29:19 +08:00
commit 4725e67c75
7 changed files with 69 additions and 47 deletions

View File

@ -17,6 +17,7 @@ import com.alibaba.fastjson.JSONObject;
import com.makeramen.roundedimageview.RoundedImageView; import com.makeramen.roundedimageview.RoundedImageView;
import com.yunbao.common.R; import com.yunbao.common.R;
import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.ActiveBean;
import com.yunbao.common.bean.ActiveOtherBean; import com.yunbao.common.bean.ActiveOtherBean;
import com.yunbao.common.dialog.ImagePreviewDialog; import com.yunbao.common.dialog.ImagePreviewDialog;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
@ -27,7 +28,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class UserCommunityAdapter extends RecyclerView.Adapter { public class UserCommunityAdapter extends RecyclerView.Adapter {
private List<ActiveOtherBean> commentBeanList; private List<ActiveBean> commentBeanList;
private Context mContext; private Context mContext;
private onItemClickListener onItemClickListener; private onItemClickListener onItemClickListener;
private boolean isMe; private boolean isMe;
@ -36,7 +37,7 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
this.onItemClickListener = onItemClickListener; this.onItemClickListener = onItemClickListener;
} }
public UserCommunityAdapter(Context content, List<ActiveOtherBean> commentBeanList, boolean isMe) { public UserCommunityAdapter(Context content, List<ActiveBean> commentBeanList, boolean isMe) {
this.mContext = content; this.mContext = content;
this.commentBeanList = commentBeanList; this.commentBeanList = commentBeanList;
this.isMe = isMe; this.isMe = isMe;
@ -90,7 +91,7 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (onItemClickListener != null) { if (onItemClickListener != null) {
onItemClickListener.onItemMore((ActiveOtherBean) v.getTag(), getPosition()); onItemClickListener.onItemMore((ActiveBean) v.getTag(), getPosition());
} }
} }
}); });
@ -98,19 +99,26 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (onItemClickListener != null) { if (onItemClickListener != null) {
onItemClickListener.onImgItem((ActiveOtherBean) v.getTag(), getPosition()); ActiveBean activeOtherBean = (ActiveBean) v.getTag();
if (activeOtherBean.getImg_or_video().equals("1")) {
onItemClickListener.onImgItem(activeOtherBean, getPosition());
} else {
onItemClickListener.onItemVideo(activeOtherBean, getPosition());
}
} }
} }
}); });
} }
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
public void setData(ActiveOtherBean bean) { public void setData(ActiveBean bean) {
itemView.setTag(bean); itemView.setTag(bean);
mAvatar.setTag(bean); mAvatar.setTag(bean);
more_del.setTag(bean); more_del.setTag(bean);
if (isMe) { if (isMe) {
more_del.setVisibility(View.VISIBLE); more_del.setVisibility(View.VISIBLE);
} else {
more_del.setVisibility(View.INVISIBLE);
} }
ImgLoader.display(mContext, bean.getUser_avatar(), mAvatar); ImgLoader.display(mContext, bean.getUser_avatar(), mAvatar);
userName.setText(bean.getUser_name()); userName.setText(bean.getUser_name());
@ -161,8 +169,10 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
} }
public interface onItemClickListener { public interface onItemClickListener {
void onImgItem(ActiveOtherBean activeBean, int position); void onImgItem(ActiveBean activeBean, int position);
void onItemMore(ActiveOtherBean activeBean, int position); void onItemMore(ActiveBean activeBean, int position);
void onItemVideo(ActiveBean activeBean, int position);
} }
} }

View File

@ -19,6 +19,7 @@
android:id="@+id/avatar" android:id="@+id/avatar"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:scaleType="centerCrop"
android:src="@mipmap/icon_data_empty" android:src="@mipmap/icon_data_empty"
app:riv_oval="true" /> app:riv_oval="true" />
@ -55,7 +56,7 @@
android:layout_height="30dp" android:layout_height="30dp"
android:padding="4dp" android:padding="4dp"
android:src="@mipmap/icon_active_more" android:src="@mipmap/icon_active_more"
android:visibility="invisible" /> android:visibility="visible" />
</LinearLayout> </LinearLayout>

View File

@ -800,7 +800,8 @@
android:id="@+id/setting" android:id="@+id/setting"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:src="@mipmap/icon_right_gray" /> android:src="@mipmap/icon_right_gray"
android:visibility="invisible" />
</LinearLayout> </LinearLayout>

View File

@ -15,7 +15,7 @@
android:paddingEnd="15dp" android:paddingEnd="15dp"
android:paddingBottom="5dp" android:paddingBottom="5dp"
android:text="标签" android:text="标签"
android:textColor="@color/black2" android:textColor="#C38764"
android:textSize="11dp" /> android:textSize="11dp" />
</LinearLayout> </LinearLayout>

View File

@ -519,12 +519,9 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
//选中监听 //选中监听
mTabButtonGroup.addTabButtonGroupChangeListener((view, index) -> { mTabButtonGroup.addTabButtonGroupChangeListener((view, index) -> {
if (index == 0) { if (index == 1) {
floatBanner.setVisibility(View.GONE); isfloatBannernet = true;
floatRedPacket.setVisibility(View.GONE); initAnchorRecommendBanner();
floatWarOrder.setVisibility(View.GONE);
findViewById(R.id.banner_click).setVisibility(View.GONE);
isfloatBannernet = false;
} else if (index == 2) { } else if (index == 2) {
floatBanner.setVisibility(View.GONE); floatBanner.setVisibility(View.GONE);
floatRedPacket.setVisibility(View.GONE); floatRedPacket.setVisibility(View.GONE);
@ -533,8 +530,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
isfloatBannernet = false; isfloatBannernet = false;
if (mainMessageViewHolder != null) mainMessageViewHolder.onResume(); if (mainMessageViewHolder != null) mainMessageViewHolder.onResume();
} else { } else {
isfloatBannernet = true; floatBanner.setVisibility(View.GONE);
initAnchorRecommendBanner(); floatRedPacket.setVisibility(View.GONE);
floatWarOrder.setVisibility(View.GONE);
findViewById(R.id.banner_click).setVisibility(View.GONE);
isfloatBannernet = false;
} }
}); });
//获取指导员账号 //获取指导员账号
@ -545,20 +545,19 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
} }
private void showFirstLogin() { private void showFirstLogin() {
LiveNetManager.get(mContext) LiveNetManager.get(mContext).isFirstLogin(new com.yunbao.common.http.base.HttpCallback<FirstLoginBean>() {
.isFirstLogin(new com.yunbao.common.http.base.HttpCallback<FirstLoginBean>() { @Override
@Override public void onSuccess(FirstLoginBean data) {
public void onSuccess(FirstLoginBean data) { if (data.getStatus() == 0) {
if (data.getStatus() == 0) { mContext.startActivity(new Intent(mContext, CompleteUserInfoActivity.class));
mContext.startActivity(new Intent(mContext, CompleteUserInfoActivity.class)); }
} }
}
@Override @Override
public void onError(String error) { public void onError(String error) {
} }
}); });
} }
/** /**

View File

@ -71,6 +71,8 @@ import com.yunbao.common.views.UserHomeImgsViewHolder;
import com.yunbao.live.activity.LiveRyAnchorActivity; import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.dialog.GiftWallDialog; import com.yunbao.live.dialog.GiftWallDialog;
import com.yunbao.live.views.ShowBigPhoto; import com.yunbao.live.views.ShowBigPhoto;
import com.yunbao.video.activity.VideoPlayActivity;
import com.yunbao.video.utils.VideoStorge;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
@ -152,7 +154,7 @@ public class UserHomeActivity extends AbsActivity {
private LinearLayout bottomEditLayout; private LinearLayout bottomEditLayout;
private UploadQnImpl mUploadStrategy; private UploadQnImpl mUploadStrategy;
private List<ActiveBean> videoList = new ArrayList<>(); private List<ActiveBean> videoList = new ArrayList<>();
List<ActiveOtherBean> beanList = new ArrayList<>(); List<ActiveBean> beanList = new ArrayList<>();
private UserHomeImgsViewHolder userHomeImgsViewHolder; private UserHomeImgsViewHolder userHomeImgsViewHolder;
private Map<String, String> gotoRoomKey = new HashMap<>(); private Map<String, String> gotoRoomKey = new HashMap<>();
@ -176,33 +178,27 @@ public class UserHomeActivity extends AbsActivity {
} }
initView(); initView();
getUseData(); getUseData();
getCommunityList();
} }
private void getCommunityList() { private void getCommunityList() {
CommonHttpUtil.getOtherDynamicList(uid, new com.yunbao.common.http.HttpCallback() { CommonHttpUtil.getOtherDynamicList(uid, new com.yunbao.common.http.HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
beanList = JSONArray.parseArray(Arrays.toString(info), ActiveOtherBean.class); beanList = JSONArray.parseArray(Arrays.toString(info), ActiveBean.class);
for (int j = 0; j < beanList.size(); j++) {
if (beanList.get(j).getImg_or_video().equals("2")) {
videoList.add(beanList.get(j));
}
}
UserCommunityAdapter userCommunityAdapter = new UserCommunityAdapter(mContext, beanList, isMe); UserCommunityAdapter userCommunityAdapter = new UserCommunityAdapter(mContext, beanList, isMe);
userCommunityAdapter.setOnItemClickListener(new UserCommunityAdapter.onItemClickListener() { userCommunityAdapter.setOnItemClickListener(new UserCommunityAdapter.onItemClickListener() {
@Override @Override
public void onImgItem(ActiveOtherBean bean, int position) { public void onImgItem(ActiveBean bean, int position) {
if (bean.getImg_or_video().equals("1")) { RouteUtil.forwardCommunity(bean.getId());
RouteUtil.forwardCommunity(bean.getId());
} else {
/*int playPosition = 0;
for (int i = 0; i < videoList.size(); i++) {
if (videoList.get(i).getId().equals(bean.getId())) {
playPosition = i;
}
}
RouteUtil.forwardVideoActivity();*/
}
} }
@Override @Override
public void onItemMore(ActiveOtherBean bean, int position) { public void onItemMore(ActiveBean bean, int position) {
DialogUitl.showSimpleDialog(mContext, getResources().getString(com.yunbao.main.R.string.msg_del_sure), false, new DialogUitl.SimpleCallback() { DialogUitl.showSimpleDialog(mContext, getResources().getString(com.yunbao.main.R.string.msg_del_sure), false, new DialogUitl.SimpleCallback() {
@Override @Override
public void onConfirmClick(Dialog dialog, String content) { public void onConfirmClick(Dialog dialog, String content) {
@ -218,6 +214,18 @@ public class UserHomeActivity extends AbsActivity {
} }
}); });
} }
@Override
public void onItemVideo(ActiveBean activeBean, int position) {
int playPosition = 0;
for (int i = 0; i < videoList.size(); i++) {
if (videoList.get(i).getId().equals(activeBean.getId())) {
playPosition = i;
}
}
VideoStorge.getInstance().put(Constants.VIDEO_HOME, videoList);
VideoPlayActivity.forward(mContext, playPosition, Constants.VIDEO_HOME, 1);
}
}); });
communityRecyclerView.setAdapter(userCommunityAdapter); communityRecyclerView.setAdapter(userCommunityAdapter);
} }
@ -240,6 +248,7 @@ public class UserHomeActivity extends AbsActivity {
likeCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_love_num()));//关注数量 likeCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_love_num()));//关注数量
if (isMe) { if (isMe) {
findViewById(R.id.setting).setVisibility(View.VISIBLE);
bottomEditLayout.setVisibility(View.VISIBLE); bottomEditLayout.setVisibility(View.VISIBLE);
imgUp.setVisibility(View.VISIBLE); imgUp.setVisibility(View.VISIBLE);
imgLabel.setVisibility(View.VISIBLE); imgLabel.setVisibility(View.VISIBLE);
@ -437,6 +446,7 @@ public class UserHomeActivity extends AbsActivity {
} }
}); });
mBanner.start(); mBanner.start();
getCommunityList();
} }
private void initView() { private void initView() {

View File

@ -144,7 +144,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
public void onClick(View v) { public void onClick(View v) {
SparseArray<String> array = new SparseArray<>(); SparseArray<String> array = new SparseArray<>();
array.append(0, mContext.getResources().getString(com.yunbao.common.R.string.report)); array.append(0, mContext.getResources().getString(com.yunbao.common.R.string.report));
array.append(1, "不感兴趣"); array.append(1, mContext.getResources().getString(com.yunbao.common.R.string.not_interested));
DialogUitl.showStringArrayDialog(mContext, array, new DialogUitl.StringArrayDialogCallback() { DialogUitl.showStringArrayDialog(mContext, array, new DialogUitl.StringArrayDialogCallback() {
@Override @Override
public void onItemClick(String text, int tag) { public void onItemClick(String text, int tag) {
@ -441,6 +441,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
} }
String isLike = mVideoBean.getIs_love().equals("1") ? "0" : "1"; String isLike = mVideoBean.getIs_love().equals("1") ? "0" : "1";
mVideoBean.setIs_love(isLike); mVideoBean.setIs_love(isLike);
mLikeNum.setText(String.valueOf(mVideoBean.getLove_num()));
EventBus.getDefault().post(new VideoLikeEvent(mVideoBean.getId(), Integer.parseInt(mVideoBean.getIs_love()), mVideoBean.getLove_num())); EventBus.getDefault().post(new VideoLikeEvent(mVideoBean.getId(), Integer.parseInt(mVideoBean.getIs_love()), mVideoBean.getLove_num()));
if (mVideoBean.getIs_love().equals("1")) { if (mVideoBean.getIs_love().equals("1")) {
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new02); mBtnLike.setImageResource(R.mipmap.icon_video_zan_new02);