Merge remote-tracking branch 'origin/dev_改版主分支-升级融云SDK&AGP8' into dev_改版主分支-升级融云SDK&AGP8
This commit is contained in:
@@ -17,6 +17,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.ActiveOtherBean;
|
||||
import com.yunbao.common.dialog.ImagePreviewDialog;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
@@ -27,7 +28,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class UserCommunityAdapter extends RecyclerView.Adapter {
|
||||
private List<ActiveOtherBean> commentBeanList;
|
||||
private List<ActiveBean> commentBeanList;
|
||||
private Context mContext;
|
||||
private onItemClickListener onItemClickListener;
|
||||
private boolean isMe;
|
||||
@@ -36,7 +37,7 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
||||
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.commentBeanList = commentBeanList;
|
||||
this.isMe = isMe;
|
||||
@@ -90,7 +91,7 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
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
|
||||
public void onClick(View v) {
|
||||
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")
|
||||
public void setData(ActiveOtherBean bean) {
|
||||
public void setData(ActiveBean bean) {
|
||||
itemView.setTag(bean);
|
||||
mAvatar.setTag(bean);
|
||||
more_del.setTag(bean);
|
||||
if (isMe) {
|
||||
more_del.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
more_del.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
ImgLoader.display(mContext, bean.getUser_avatar(), mAvatar);
|
||||
userName.setText(bean.getUser_name());
|
||||
@@ -161,8 +169,10 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/icon_data_empty"
|
||||
app:riv_oval="true" />
|
||||
|
||||
@@ -55,7 +56,7 @@
|
||||
android:layout_height="30dp"
|
||||
android:padding="4dp"
|
||||
android:src="@mipmap/icon_active_more"
|
||||
android:visibility="invisible" />
|
||||
android:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -800,7 +800,8 @@
|
||||
android:id="@+id/setting"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@mipmap/icon_right_gray" />
|
||||
android:src="@mipmap/icon_right_gray"
|
||||
android:visibility="invisible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
android:paddingEnd="15dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="标签"
|
||||
android:textColor="@color/black2"
|
||||
android:textColor="#C38764"
|
||||
android:textSize="11dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user