6-
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package com.yunbao.video.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -13,6 +15,7 @@ import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.adapter.ImChatFacePagerAdapter;
|
||||
import com.yunbao.common.bean.CommentBean;
|
||||
import com.yunbao.common.interfaces.OnFaceClickListener;
|
||||
import com.yunbao.common.utils.ProcessResultUtil;
|
||||
import com.yunbao.video.R;
|
||||
@@ -67,6 +70,44 @@ public abstract class AbsVideoCommentActivity extends AbsActivity implements Vie
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 打开评论输入框
|
||||
*/
|
||||
public void openCommentInputWindow(boolean openFace, String videoId, String videoUid, CommentBean bean) {
|
||||
if (mFaceView == null) {
|
||||
mFaceView = initFaceView();
|
||||
}
|
||||
VideoInputDialogFragment fragment = new VideoInputDialogFragment();
|
||||
fragment.setVideoInfo(videoId, videoUid);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean(Constants.VIDEO_FACE_OPEN, openFace);
|
||||
bundle.putInt(Constants.VIDEO_FACE_HEIGHT, mFaceHeight);
|
||||
bundle.putParcelable(Constants.VIDEO_COMMENT_BEAN, bean);
|
||||
fragment.setArguments(bundle);
|
||||
mVideoInputDialogFragment = fragment;
|
||||
fragment.show(getSupportFragmentManager(), "VideoInputDialogFragment");
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开评论输入框
|
||||
*/
|
||||
public void openCommentInputWindowNew(boolean openFace, String videoId, String videoUid, boolean isComment,String relpId,int commentCount) {
|
||||
if (mFaceView == null) {
|
||||
mFaceView = initFaceView();
|
||||
}
|
||||
VideoInputDialogFragment fragment = new VideoInputDialogFragment();
|
||||
fragment.setVideoInfo(videoId, videoUid);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean(Constants.VIDEO_FACE_OPEN, openFace);
|
||||
bundle.putBoolean(Constants.VIDEO_IS_COMMENT, isComment);
|
||||
bundle.putString(Constants.VIDEO_REPLY_ID, relpId);
|
||||
bundle.putInt(Constants.VIDEO_FACE_HEIGHT, mFaceHeight);
|
||||
fragment.setArguments(bundle);
|
||||
mVideoInputDialogFragment = fragment;
|
||||
fragment.show(getSupportFragmentManager(), "VideoInputDialogFragment");
|
||||
}
|
||||
|
||||
|
||||
public View getFaceView() {
|
||||
if (mFaceView == null) {
|
||||
mFaceView = initFaceView();
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.widget.ImageView;
|
||||
import com.binioter.guideview.Guide;
|
||||
import com.binioter.guideview.GuideBuilder;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.video.R;
|
||||
@@ -39,12 +40,11 @@ public class VideoPlayActivity extends AbsVideoPlayActivity {
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
public static void forwardSingle(Context context, VideoBean videoBean) {
|
||||
public static void forwardSingle(Context context, ActiveBean videoBean) {
|
||||
if (videoBean == null) {
|
||||
return;
|
||||
}
|
||||
List<VideoBean> list = new ArrayList<>();
|
||||
List<ActiveBean> list = new ArrayList<>();
|
||||
list.add(videoBean);
|
||||
VideoStorge.getInstance().put(Constants.VIDEO_SINGLE, list);
|
||||
Intent intent = new Intent(context, VideoPlayActivity.class);
|
||||
|
||||
@@ -13,6 +13,7 @@ import android.util.SparseArray;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.custom.ItemSlideHelper;
|
||||
import com.yunbao.common.utils.ClickUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
@@ -33,7 +34,7 @@ public class VideoScrollAdapter extends RecyclerView.Adapter<VideoScrollAdapter.
|
||||
private static final String TAG = "VideoScrollAdapter";
|
||||
private static final int COUNT = 50;//接口每页返回多少条
|
||||
private Context mContext;
|
||||
private List<VideoBean> mList;
|
||||
private List<ActiveBean> mList;
|
||||
private SparseArray<VideoPlayWrapViewHolder> mMap;
|
||||
private int mCurPosition;
|
||||
private ActionListener mActionListener;
|
||||
@@ -43,7 +44,7 @@ public class VideoScrollAdapter extends RecyclerView.Adapter<VideoScrollAdapter.
|
||||
private Drawable[] mLikeAnimDrawables;
|
||||
private Handler mHandler;
|
||||
|
||||
public VideoScrollAdapter(Context context, List<VideoBean> list, int curPosition) {
|
||||
public VideoScrollAdapter(Context context, List<ActiveBean> list, int curPosition) {
|
||||
mContext = context;
|
||||
mList = list;
|
||||
mCurPosition = curPosition;
|
||||
@@ -213,7 +214,7 @@ public class VideoScrollAdapter extends RecyclerView.Adapter<VideoScrollAdapter.
|
||||
mVideoPlayWrapViewHolder = videoPlayWrapViewHolder;
|
||||
}
|
||||
|
||||
void setData(VideoBean bean, int position, Object payload) {
|
||||
void setData(ActiveBean bean, int position, Object payload) {
|
||||
if (mVideoPlayWrapViewHolder != null) {
|
||||
mMap.put(position, mVideoPlayWrapViewHolder);
|
||||
mVideoPlayWrapViewHolder.setData(bean, payload);
|
||||
@@ -297,7 +298,7 @@ public class VideoScrollAdapter extends RecyclerView.Adapter<VideoScrollAdapter.
|
||||
/**
|
||||
* 插入数据
|
||||
*/
|
||||
public void insertList(List<VideoBean> list) {
|
||||
public void insertList(List<ActiveBean> list) {
|
||||
// if (list != null && list.size() > 0 && mList != null && mRecyclerView != null) {
|
||||
// int position = mList.size();
|
||||
// mList.addAll(list);
|
||||
|
||||
@@ -20,16 +20,16 @@ import android.widget.TextView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.CommentBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.dialog.ChatFaceDialog;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.video.R;
|
||||
import com.yunbao.video.activity.AbsVideoPlayActivity;
|
||||
import com.yunbao.video.bean.VideoCommentBean;
|
||||
import com.yunbao.video.event.VideoCommentEvent;
|
||||
import com.yunbao.video.http.VideoHttpConsts;
|
||||
import com.yunbao.video.http.VideoHttpUtil;
|
||||
@@ -47,6 +47,8 @@ public class VideoInputDialogFragment extends AbsDialogFragment implements View.
|
||||
private InputMethodManager imm;
|
||||
private EditText mInput;
|
||||
private boolean mOpenFace;
|
||||
private boolean isComment;
|
||||
private String replyCommentId;
|
||||
private int mOriginHeight;
|
||||
private int mFaceHeight;
|
||||
private CheckBox mCheckBox;
|
||||
@@ -54,7 +56,6 @@ public class VideoInputDialogFragment extends AbsDialogFragment implements View.
|
||||
private Handler mHandler;
|
||||
private String mVideoId;
|
||||
private String mVideoUid;
|
||||
private VideoCommentBean mVideoCommentBean;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -105,13 +106,8 @@ public class VideoInputDialogFragment extends AbsDialogFragment implements View.
|
||||
if (bundle != null) {
|
||||
mOpenFace = bundle.getBoolean(Constants.VIDEO_FACE_OPEN, false);
|
||||
mFaceHeight = bundle.getInt(Constants.VIDEO_FACE_HEIGHT, 0);
|
||||
mVideoCommentBean = bundle.getParcelable(Constants.VIDEO_COMMENT_BEAN);
|
||||
if (mVideoCommentBean != null) {
|
||||
UserBean replyUserBean = mVideoCommentBean.getUserBean();//要回复的人
|
||||
if (replyUserBean != null) {
|
||||
mInput.setHint(mContext.getString(R.string.video_comment_reply) + replyUserBean.getUserNiceName());
|
||||
}
|
||||
}
|
||||
isComment = bundle.getBoolean(Constants.VIDEO_IS_COMMENT,false);
|
||||
replyCommentId = bundle.getString(Constants.VIDEO_REPLY_ID);
|
||||
}
|
||||
if (mOpenFace) {
|
||||
if (mCheckBox != null) {
|
||||
@@ -268,30 +264,15 @@ public class VideoInputDialogFragment extends AbsDialogFragment implements View.
|
||||
ToastUtil.show(mContext.getString(R.string.content_empty));
|
||||
return;
|
||||
}
|
||||
String toUid = mVideoUid;
|
||||
String commentId = "0";
|
||||
String parentId = "0";
|
||||
if (mVideoCommentBean != null) {
|
||||
toUid = mVideoCommentBean.getUid();
|
||||
commentId = mVideoCommentBean.getCommentId();
|
||||
parentId = mVideoCommentBean.getId();
|
||||
}
|
||||
VideoHttpUtil.setComment(toUid, mVideoId, content, commentId, parentId, new HttpCallback() {
|
||||
CommonHttpUtil.dynamicReply(mVideoId, isComment ? replyCommentId : "0", content, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
if (mInput != null) {
|
||||
mInput.setText("");
|
||||
}
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
String commentNum = obj.getString("comments");
|
||||
EventBus.getDefault().post(new VideoCommentEvent(mVideoId, commentNum));
|
||||
ToastUtil.show(msg);
|
||||
dismiss();
|
||||
((AbsVideoPlayActivity) mContext).hideCommentWindow(true);
|
||||
} else if (code == 500) {
|
||||
ToastUtil.show(msg);
|
||||
if (mInput != null) {
|
||||
mInput.setText("");
|
||||
}
|
||||
ToastUtil.show(msg);
|
||||
dismiss();
|
||||
((AbsVideoPlayActivity) mContext).hideCommentWindow(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.view.WindowManager;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.video.R;
|
||||
@@ -23,7 +24,7 @@ public class VideoShareDialogFragment extends AbsDialogFragment {
|
||||
|
||||
private RecyclerView mRecyclerView;
|
||||
private RecyclerView mRecyclerView2;
|
||||
private VideoBean mVideoBean;
|
||||
private ActiveBean mVideoBean;
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yunbao.video.utils;
|
||||
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.VideoBean;
|
||||
import com.yunbao.video.interfaces.VideoScrollDataHelper;
|
||||
|
||||
@@ -14,7 +15,7 @@ import java.util.Map;
|
||||
public class VideoStorge {
|
||||
|
||||
private static VideoStorge sInstance;
|
||||
private Map<String, List<VideoBean>> mMap;
|
||||
private Map<String, List<ActiveBean>> mMap;
|
||||
private Map<String, VideoScrollDataHelper> mHelperMap;
|
||||
|
||||
private VideoStorge() {
|
||||
@@ -33,14 +34,14 @@ public class VideoStorge {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public void put(String key, List<VideoBean> list) {
|
||||
public void put(String key, List<ActiveBean> list) {
|
||||
if (mMap != null) {
|
||||
mMap.put(key, list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<VideoBean> get(String key) {
|
||||
public List<ActiveBean> get(String key) {
|
||||
if (mMap != null) {
|
||||
return mMap.get(key);
|
||||
}
|
||||
|
||||
@@ -4,29 +4,41 @@ import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.TimeInterpolator;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.AccelerateDecelerateInterpolator;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.adapter.CommentAdapter;
|
||||
import com.yunbao.common.adapter.CommentVideoAdapter;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.CommentBean;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.custom.MyLinearLayout3;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.interfaces.OnItemLongClickListener;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.AbsViewHolder;
|
||||
import com.yunbao.live.activity.LiveReportActivity;
|
||||
import com.yunbao.video.R;
|
||||
@@ -47,13 +59,13 @@ import java.util.List;
|
||||
* 视频评论相关
|
||||
*/
|
||||
|
||||
public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClickListener, OnItemClickListener<VideoCommentBean>, OnItemLongClickListener<VideoCommentBean>, VideoCommentAdapter.ActionListener {
|
||||
public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClickListener {
|
||||
|
||||
private View mRoot;
|
||||
private MyLinearLayout3 mBottom;
|
||||
private CommonRefreshView mRefreshView;
|
||||
private TextView mCommentNum;
|
||||
private VideoCommentAdapter mVideoCommentAdapter;
|
||||
private CommentVideoAdapter commentAdapter;
|
||||
private String mVideoId;
|
||||
private String mVideoUid;
|
||||
private String mCommentString;
|
||||
@@ -61,6 +73,8 @@ public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClic
|
||||
private ObjectAnimator mHideAnimator;
|
||||
private boolean mAnimating;
|
||||
private boolean mNeedRefresh;//是否需要刷新
|
||||
private boolean isComment = false;
|
||||
private RoundedImageView avatar;
|
||||
|
||||
public VideoCommentViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
@@ -74,6 +88,8 @@ public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClic
|
||||
@Override
|
||||
public void init() {
|
||||
mRoot = findViewById(R.id.root);
|
||||
avatar = (RoundedImageView) findViewById(R.id.avatar);
|
||||
ImgLoader.display(mContext, CommonAppConfig.getInstance().getUserBean().getAvatar(), avatar);
|
||||
mBottom = (MyLinearLayout3) findViewById(R.id.bottom);
|
||||
int height = mBottom.getHeight2();
|
||||
mBottom.setTranslationY(height);
|
||||
@@ -114,10 +130,11 @@ public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClic
|
||||
findViewById(R.id.btn_close).setOnClickListener(this);
|
||||
findViewById(R.id.input).setOnClickListener(this);
|
||||
findViewById(R.id.btn_face).setOnClickListener(this);
|
||||
mCommentString =mContext.getString(R.string.video_comment);
|
||||
mCommentString = mContext.getString(R.string.video_comment);
|
||||
mCommentNum = (TextView) findViewById(R.id.comment_num);
|
||||
mRefreshView = (CommonRefreshView) findViewById(R.id.refreshView);
|
||||
mRefreshView.setEmptyLayoutId(R.layout.view_no_data_comment);
|
||||
mRefreshView.setLoadMoreEnable(false);
|
||||
mRefreshView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false) {
|
||||
@Override
|
||||
public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
|
||||
@@ -129,35 +146,80 @@ public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClic
|
||||
}
|
||||
});
|
||||
|
||||
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<VideoCommentBean>() {
|
||||
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<CommentBean>() {
|
||||
@Override
|
||||
public RefreshAdapter<VideoCommentBean> getAdapter() {
|
||||
if (mVideoCommentAdapter == null) {
|
||||
mVideoCommentAdapter = new VideoCommentAdapter(mContext);
|
||||
mVideoCommentAdapter.setOnItemClickListener(VideoCommentViewHolder.this);
|
||||
mVideoCommentAdapter.setOnItemLongClickListener(VideoCommentViewHolder.this);
|
||||
mVideoCommentAdapter.setActionListener(VideoCommentViewHolder.this);
|
||||
public RefreshAdapter<CommentBean> getAdapter() {
|
||||
if (commentAdapter == null) {
|
||||
commentAdapter = new CommentVideoAdapter(mContext, mVideoUid, new CommentVideoAdapter.onItemClickListener() {
|
||||
@Override
|
||||
public void onReply(CommentBean activeBean) {
|
||||
isComment = true;
|
||||
if (!TextUtils.isEmpty(mVideoId) && !TextUtils.isEmpty(mVideoUid)) {
|
||||
((AbsVideoCommentActivity) mContext).openCommentInputWindowNew(false, mVideoId, mVideoUid, isComment, activeBean.getId(), commentAdapter.getItemCount());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReport(CommentBean activeBean) {
|
||||
//一级回复 举报
|
||||
RouteUtil.forwardCommentReportActivity(activeBean.getId(), activeBean.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReport(CommentBean.ReplyComment activeBean) {
|
||||
//二级回复 举报
|
||||
RouteUtil.forwardCommentReportActivity(activeBean.getId(), activeBean.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDel(CommentBean activeBean) {
|
||||
//一级回复 删除
|
||||
CommonHttpUtil.delCom(activeBean.getId(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
ToastUtil.show(msg);
|
||||
mRefreshView.initData();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@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);
|
||||
mRefreshView.initData();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return mVideoCommentAdapter;
|
||||
return commentAdapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData(int p, HttpCallback callback) {
|
||||
if (!TextUtils.isEmpty(mVideoId)) {
|
||||
VideoHttpUtil.getVideoCommentList(mVideoId, p, callback);
|
||||
CommonHttpUtil.getCommunityComment(mVideoId, mVideoUid, p, callback);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public List<VideoCommentBean> processData(String[] info) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
String commentNum = obj.getString("comments");
|
||||
public List<CommentBean> processData(String[] info) {
|
||||
List<CommentBean> list = JSON.parseArray(Arrays.toString(info), CommentBean.class);
|
||||
String commentNum = String.valueOf(list.size());
|
||||
EventBus.getDefault().post(new VideoCommentEvent(mVideoId, commentNum));
|
||||
if (mCommentNum != null) {
|
||||
mCommentNum.setText(mCommentString + " " + commentNum);
|
||||
}
|
||||
List<VideoCommentBean> list = JSON.parseArray(obj.getString("commentlist"), VideoCommentBean.class);
|
||||
for (VideoCommentBean bean : list) {
|
||||
for (CommentBean bean : list) {
|
||||
if (bean != null) {
|
||||
bean.setParentNode(true);
|
||||
}
|
||||
@@ -166,7 +228,7 @@ public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClic
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshSuccess(List<VideoCommentBean> list, int listCount) {
|
||||
public void onRefreshSuccess(List<CommentBean> list, int listCount) {
|
||||
|
||||
}
|
||||
|
||||
@@ -176,7 +238,7 @@ public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClic
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreSuccess(List<VideoCommentBean> loadItemList, int loadItemCount) {
|
||||
public void onLoadMoreSuccess(List<CommentBean> loadItemList, int loadItemCount) {
|
||||
|
||||
}
|
||||
|
||||
@@ -190,8 +252,8 @@ public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClic
|
||||
public void setVideoInfo(String videoId, String videoUid) {
|
||||
if (!TextUtils.isEmpty(videoId) && !TextUtils.isEmpty(videoUid)) {
|
||||
if (!TextUtils.isEmpty(mVideoId) && !mVideoId.equals(videoId)) {
|
||||
if (mVideoCommentAdapter != null) {
|
||||
mVideoCommentAdapter.clearData();
|
||||
if (commentAdapter != null) {
|
||||
commentAdapter.clearData();
|
||||
}
|
||||
}
|
||||
if (!videoId.equals(mVideoId)) {
|
||||
@@ -235,11 +297,11 @@ public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClic
|
||||
hideBottom();
|
||||
} else if (i == R.id.input) {
|
||||
if (!TextUtils.isEmpty(mVideoId) && !TextUtils.isEmpty(mVideoUid)) {
|
||||
((AbsVideoCommentActivity) mContext).openCommentInputWindow(false, mVideoId, mVideoUid, null);
|
||||
((AbsVideoCommentActivity) mContext).openCommentInputWindowNew(false, mVideoId, mVideoUid, false, "", commentAdapter.getItemCount());
|
||||
}
|
||||
} else if (i == R.id.btn_face) {
|
||||
if (!TextUtils.isEmpty(mVideoId) && !TextUtils.isEmpty(mVideoUid)) {
|
||||
((AbsVideoCommentActivity) mContext).openCommentInputWindow(true, mVideoId, mVideoUid, null);
|
||||
((AbsVideoCommentActivity) mContext).openCommentInputWindowNew(true, mVideoId, mVideoUid, false, "", commentAdapter.getItemCount());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -259,77 +321,8 @@ public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClic
|
||||
VideoHttpUtil.cancel(VideoHttpConsts.GET_COMMENT_REPLY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(VideoCommentBean bean, int position) {
|
||||
if (position != -1) {
|
||||
if (!TextUtils.isEmpty(mVideoId) && !TextUtils.isEmpty(mVideoUid)) {
|
||||
((AbsVideoCommentActivity) mContext).openCommentInputWindow(false, mVideoId, mVideoUid, bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemLongClick(VideoCommentBean bean, int position, View view) {
|
||||
if (position == -1) {
|
||||
showMoreDialog(bean, view);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExpandClicked(final VideoCommentBean commentBean) {
|
||||
final VideoCommentBean parentNodeBean = commentBean.getParentNodeBean();
|
||||
if (parentNodeBean == null) {
|
||||
return;
|
||||
}
|
||||
VideoHttpUtil.getCommentReply(parentNodeBean.getId(), parentNodeBean.getChildPage(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
List<VideoCommentBean> list = JSON.parseArray(Arrays.toString(info), VideoCommentBean.class);
|
||||
if (list == null || list.size() == 0) {
|
||||
return;
|
||||
}
|
||||
if (parentNodeBean.getChildPage() == 1) {
|
||||
if (list.size() > 1) {
|
||||
list = list.subList(1, list.size());
|
||||
}
|
||||
}
|
||||
for (VideoCommentBean bean : list) {
|
||||
bean.setParentNodeBean(parentNodeBean);
|
||||
}
|
||||
List<VideoCommentBean> childList = parentNodeBean.getChildList();
|
||||
if (childList != null) {
|
||||
childList.addAll(list);
|
||||
if (childList.size() < parentNodeBean.getReplyNum()) {
|
||||
parentNodeBean.setChildPage(parentNodeBean.getChildPage() + 1);
|
||||
}
|
||||
if (mVideoCommentAdapter != null) {
|
||||
mVideoCommentAdapter.insertReplyList(commentBean, list.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCollapsedClicked(VideoCommentBean commentBean) {
|
||||
VideoCommentBean parentNodeBean = commentBean.getParentNodeBean();
|
||||
if (parentNodeBean == null) {
|
||||
return;
|
||||
}
|
||||
List<VideoCommentBean> childList = parentNodeBean.getChildList();
|
||||
VideoCommentBean node0 = childList.get(0);
|
||||
int orignSize = childList.size();
|
||||
parentNodeBean.removeChild();
|
||||
parentNodeBean.setChildPage(1);
|
||||
if (mVideoCommentAdapter != null) {
|
||||
mVideoCommentAdapter.removeReplyList(node0, orignSize - childList.size());
|
||||
}
|
||||
}
|
||||
|
||||
//view当前点击的控件,手指长按任意位置弹窗
|
||||
private void showMoreDialog(final VideoCommentBean bean, View view) {
|
||||
private void showMoreDialog(final CommentBean bean, View view) {
|
||||
View pop_layout = LayoutInflater.from(mContext).inflate(R.layout.popwindow_video_report, null);
|
||||
final PopupWindow mPopupWindow = new PopupWindow(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
mPopupWindow.setContentView(pop_layout);
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.tencent.rtmp.TXLiveConstants;
|
||||
import com.tencent.rtmp.TXVodPlayConfig;
|
||||
import com.tencent.rtmp.TXVodPlayer;
|
||||
import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.views.AbsViewHolder;
|
||||
import com.yunbao.video.R;
|
||||
@@ -39,7 +40,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
private ObjectAnimator mPlayBtnAnimator;//暂停按钮的动画
|
||||
private boolean mStartPlay;
|
||||
private boolean mEndPlay;
|
||||
private VideoBean mVideoBean;
|
||||
private ActiveBean mVideoBean;
|
||||
private String mCachePath;
|
||||
private TXVodPlayConfig mTXVodPlayConfig;
|
||||
|
||||
@@ -97,7 +98,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
if (!mEndPlay) {
|
||||
mEndPlay = true;
|
||||
if (mVideoBean != null) {
|
||||
VideoHttpUtil.videoWatchEnd(mVideoBean.getUid(), mVideoBean.getId());
|
||||
VideoHttpUtil.videoWatchEnd(mVideoBean.getUser_id(), mVideoBean.getId());
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -152,7 +153,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
/**
|
||||
* 开始播放
|
||||
*/
|
||||
public void startPlay(VideoBean videoBean) {
|
||||
public void startPlay(ActiveBean videoBean) {
|
||||
mStartPlay = false;
|
||||
mClickPaused = false;
|
||||
mEndPlay = false;
|
||||
@@ -165,7 +166,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
if (videoBean == null) {
|
||||
return;
|
||||
}
|
||||
String url = videoBean.getHref();
|
||||
String url = videoBean.getVideo();
|
||||
if (TextUtils.isEmpty(url)) {
|
||||
return;
|
||||
}
|
||||
@@ -183,7 +184,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
if (mPlayer != null) {
|
||||
mPlayer.startPlay(url);
|
||||
}
|
||||
VideoHttpUtil.videoWatchStart(videoBean.getUid(), videoBean.getId());
|
||||
VideoHttpUtil.videoWatchStart(videoBean.getUser_id(), videoBean.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,28 +19,31 @@ import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.utils.TextUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.xuexiang.xui.widget.flowlayout.FlowTagLayout;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.adapter.LabelVideoTagAdapter;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.AbsViewHolder;
|
||||
import com.yunbao.live.activity.LiveReportActivity;
|
||||
import com.yunbao.video.R;
|
||||
import com.yunbao.video.activity.AbsVideoPlayActivity;
|
||||
import com.yunbao.common.bean.VideoBean;
|
||||
import com.yunbao.video.dialog.VideoShareDialogFragment;
|
||||
import com.yunbao.video.event.VideoLikeEvent;
|
||||
import com.yunbao.video.http.VideoHttpUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/11/26.
|
||||
* 视频播放外框
|
||||
@@ -58,7 +61,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
||||
private TextView mCommentNum;//评论数
|
||||
private TextView mShareNum;//分享数
|
||||
private ImageView mBtnFollow;//关注按钮
|
||||
private VideoBean mVideoBean;
|
||||
private ActiveBean mVideoBean;
|
||||
private Drawable mFollowDrawable = null;//已关注
|
||||
private Drawable mUnFollowDrawable;//未关注
|
||||
private Animation mFollowAnimation;
|
||||
@@ -71,6 +74,8 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
||||
private LinearLayout progressTextLayout;
|
||||
private TextView progressTextView;
|
||||
private TextView progressCount;
|
||||
private FlowTagLayout myFlowTag; //我的标签
|
||||
private LabelVideoTagAdapter myAdapter;
|
||||
|
||||
public VideoPlayWrapViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
@@ -84,7 +89,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
||||
@Override
|
||||
public void init() {
|
||||
mTag = this.toString();
|
||||
|
||||
myFlowTag = (FlowTagLayout) findViewById(R.id.myFlowTag);
|
||||
seekbar = (SeekBar) findViewById(R.id.seekbar);
|
||||
progressTextLayout = (LinearLayout) findViewById(R.id.progressTextLayout);
|
||||
progressTextView = (TextView) findViewById(R.id.progress);
|
||||
@@ -176,7 +181,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
||||
@Override
|
||||
public void onAnimationRepeat(Animation animation) {
|
||||
if (mBtnFollow != null && mVideoBean != null) {
|
||||
if (mVideoBean.getAttent() == 1) {
|
||||
if (mVideoBean.getIs_attention().equals("1")) {
|
||||
mBtnFollow.setImageDrawable(mFollowDrawable);
|
||||
} else {
|
||||
mBtnFollow.setImageDrawable(mUnFollowDrawable);
|
||||
@@ -190,51 +195,50 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
||||
mLikeAnimDrawables = drawables;
|
||||
}
|
||||
|
||||
public void setData(VideoBean bean, Object payload) {
|
||||
public void setData(ActiveBean bean, Object payload) {
|
||||
if (bean == null) {
|
||||
return;
|
||||
}
|
||||
mVideoBean = bean;
|
||||
UserBean u = mVideoBean.getUserBean();
|
||||
if (payload == null) {
|
||||
if (mCover != null) {
|
||||
setCoverImage();
|
||||
}
|
||||
if (mTitle != null) {
|
||||
mTitle.setText(bean.getTitle());
|
||||
mTitle.setText(String.valueOf(JSONObject.parseObject(bean.getContent()).get("msg")));
|
||||
}
|
||||
if (u != null) {
|
||||
if (mVideoBean != null) {
|
||||
if (mAvatar != null) {
|
||||
ImgLoader.displayAvatar(mContext, u.getAvatar(), mAvatar);
|
||||
ImgLoader.displayAvatar(mContext, mVideoBean.getUser_avatar(), mAvatar);
|
||||
}
|
||||
if (mName != null) {
|
||||
mName.setText("@" + u.getUserNiceName());
|
||||
mName.setText("@" + mVideoBean.getUser_name());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mBtnLike != null) {
|
||||
if (bean.getLike() == 1) {
|
||||
if (bean.getIs_love().equals("1")) {
|
||||
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new02);
|
||||
} else {
|
||||
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new01);
|
||||
}
|
||||
}
|
||||
if (mLikeNum != null) {
|
||||
mLikeNum.setText(bean.getLikeNum());
|
||||
mLikeNum.setText(String.valueOf(bean.getLove_num()));
|
||||
}
|
||||
if (mCommentNum != null) {
|
||||
mCommentNum.setText(bean.getCommentNum());
|
||||
mCommentNum.setText(String.valueOf(bean.getComment_num()));
|
||||
}
|
||||
if (mShareNum != null) {
|
||||
mShareNum.setText(bean.getShareNum());
|
||||
mShareNum.setText(String.valueOf(bean.getShare_num()));
|
||||
}
|
||||
if (u != null && mBtnFollow != null) {
|
||||
String toUid = u.getId();
|
||||
if (mVideoBean != null && mBtnFollow != null) {
|
||||
String toUid = mVideoBean.getUser_id();
|
||||
if (!TextUtils.isEmpty(toUid) && !toUid.equals(CommonAppConfig.getInstance().getUid())) {
|
||||
if (mBtnFollow.getVisibility() != View.VISIBLE) {
|
||||
mBtnFollow.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (bean.getAttent() == 1) {
|
||||
if (bean.getIs_attention().equals("1")) {
|
||||
mBtnFollow.setImageDrawable(mFollowDrawable);
|
||||
} else {
|
||||
mBtnFollow.setImageDrawable(mUnFollowDrawable);
|
||||
@@ -245,10 +249,10 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!Constants.myUid.endsWith(bean.getUid())) {
|
||||
if (bean.getAttent() == 2) {
|
||||
if (!Constants.myUid.endsWith(bean.getUser_id())) {
|
||||
if (bean.getIs_attention().equals("2")) {
|
||||
mBtnFollow.setVisibility(View.VISIBLE);
|
||||
if (bean.getAttent() == 1) {
|
||||
if (bean.getIs_attention().equals("1")) {
|
||||
mBtnFollow.setImageDrawable(mFollowDrawable);
|
||||
} else {
|
||||
mBtnFollow.setImageDrawable(mUnFollowDrawable);
|
||||
@@ -259,10 +263,18 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
||||
} else {
|
||||
mBtnFollow.setVisibility(View.GONE);
|
||||
}
|
||||
if (!StringUtil.isEmpty(bean.getTalk_name())) {
|
||||
List<String> tagList = new ArrayList<>();
|
||||
tagList.add("#" + bean.getTalk_name());
|
||||
myAdapter = new LabelVideoTagAdapter(mContext);
|
||||
myFlowTag.setAdapter(myAdapter);
|
||||
myFlowTag.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE);
|
||||
myAdapter.setData(tagList);
|
||||
}
|
||||
}
|
||||
|
||||
private void setCoverImage() {
|
||||
ImgLoader.displayDrawable(mContext, mVideoBean.getThumb(), new ImgLoader.DrawableCallback() {
|
||||
ImgLoader.displayDrawable(mContext, mVideoBean.getVideo() + "?vframe/jpg/offset/0", new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
if (mCover != null && drawable != null) {
|
||||
@@ -305,7 +317,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
||||
}
|
||||
}
|
||||
|
||||
public VideoBean getVideoBean() {
|
||||
public ActiveBean getVideoBean() {
|
||||
return mVideoBean;
|
||||
}
|
||||
|
||||
@@ -376,7 +388,10 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
||||
clickLike();
|
||||
} else if (i == R.id.avatar2) {
|
||||
clickAvatar();
|
||||
} /*else if (i == R.id.tv_video_report) {
|
||||
} else if (i == R.id.avatar) {
|
||||
|
||||
}
|
||||
/*else if (i == R.id.tv_video_report) {
|
||||
if (mVideoBean == null) {
|
||||
return;
|
||||
}
|
||||
@@ -390,7 +405,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
||||
*/
|
||||
public void clickAvatar() {
|
||||
if (mVideoBean != null) {
|
||||
RouteUtil.forwardUserHome(mContext, mVideoBean.getUid(), 2);
|
||||
RouteUtil.forwardUserHome(mVideoBean.getUser_id());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,27 +416,25 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
||||
if (mVideoBean == null) {
|
||||
return;
|
||||
}
|
||||
VideoHttpUtil.setVideoLike(mTag, mVideoBean.getId(), new HttpCallback() {
|
||||
CommonHttpUtil.dynamicLove(mVideoBean.getId(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
String likeNum = obj.getString("likes");
|
||||
int like = obj.getIntValue("islike");
|
||||
if (mVideoBean != null) {
|
||||
mVideoBean.setLikeNum(likeNum);
|
||||
mVideoBean.setLike(like);
|
||||
EventBus.getDefault().post(new VideoLikeEvent(mVideoBean.getId(), like, likeNum));
|
||||
if (code == 0) {
|
||||
ToastUtil.show(msg);
|
||||
if (mVideoBean.getIs_love().equals("1")) {
|
||||
int loveNum = Integer.parseInt(mVideoBean.getLove_num());
|
||||
mVideoBean.setIs_love(String.valueOf(loveNum - 1));
|
||||
} else {
|
||||
int loveNum = Integer.parseInt(mVideoBean.getLove_num());
|
||||
mVideoBean.setIs_love(String.valueOf(loveNum + 1));
|
||||
}
|
||||
if (mLikeNum != null) {
|
||||
mLikeNum.setText(likeNum);
|
||||
}
|
||||
if (mBtnLike != null) {
|
||||
if (like == 1) {
|
||||
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new02);
|
||||
} else {
|
||||
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new01);
|
||||
}
|
||||
String isLike = mVideoBean.getIs_love().equals("1") ? "0" : "1";
|
||||
mVideoBean.setIs_love(isLike);
|
||||
EventBus.getDefault().post(new VideoLikeEvent(mVideoBean.getId(), Integer.parseInt(mVideoBean.getLove_num()), mVideoBean.getLove_num()));
|
||||
if (mVideoBean.getIs_love().equals("1")) {
|
||||
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new02);
|
||||
} else {
|
||||
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new01);
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
@@ -437,14 +450,10 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
||||
if (mVideoBean == null) {
|
||||
return;
|
||||
}
|
||||
final UserBean u = mVideoBean.getUserBean();
|
||||
if (u == null) {
|
||||
return;
|
||||
}
|
||||
CommonHttpUtil.setAttention(mTag, u.getId(), new CommonCallback<Integer>() {
|
||||
CommonHttpUtil.setAttention(mTag, mVideoBean.getUser_id(), new CommonCallback<Integer>() {
|
||||
@Override
|
||||
public void callback(Integer attent) {
|
||||
mVideoBean.setAttent(attent);
|
||||
mVideoBean.setIs_attention(String.valueOf(attent));
|
||||
if (attent == 1) {
|
||||
mBtnFollow.setImageDrawable(mFollowDrawable);
|
||||
} else {
|
||||
@@ -470,7 +479,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
||||
* 点击评论按钮
|
||||
*/
|
||||
private void clickComment() {
|
||||
((AbsVideoPlayActivity) mContext).openCommentWindow(mVideoBean.getId(), mVideoBean.getUid());
|
||||
((AbsVideoPlayActivity) mContext).openCommentWindow(mVideoBean.getId(), mVideoBean.getUser_id());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,12 +10,15 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.CommentBean;
|
||||
import com.yunbao.common.event.FollowEvent;
|
||||
import com.yunbao.common.views.AbsViewHolder;
|
||||
import com.yunbao.video.R;
|
||||
import com.yunbao.video.activity.AbsVideoPlayActivity;
|
||||
import com.yunbao.video.adapter.VideoScrollAdapter;
|
||||
import com.yunbao.common.bean.VideoBean;
|
||||
import com.yunbao.video.bean.VideoCommentBean;
|
||||
import com.yunbao.video.custom.VideoLoadingBar;
|
||||
import com.yunbao.video.event.VideoCommentEvent;
|
||||
import com.yunbao.video.event.VideoLikeEvent;
|
||||
@@ -51,7 +54,7 @@ public class VideoScrollViewHolder extends AbsViewHolder implements VideoScrollA
|
||||
// private HttpCallback mRefreshCallback;//下拉刷新回调
|
||||
// private HttpCallback mLoadMoreCallback;//上拉加载更多回调
|
||||
private VideoScrollDataHelper mVideoDataHelper;
|
||||
private VideoBean mVideoBean;
|
||||
private ActiveBean mVideoBean;
|
||||
private boolean mPaused;//生命周期暂停
|
||||
|
||||
public VideoScrollViewHolder(Context context, ViewGroup parentView, int position, String videoKey, int page) {
|
||||
@@ -72,7 +75,7 @@ public class VideoScrollViewHolder extends AbsViewHolder implements VideoScrollA
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
List<VideoBean> list = VideoStorge.getInstance().get(mVideoKey);
|
||||
List<ActiveBean> list = VideoStorge.getInstance().get(mVideoKey);
|
||||
if (list == null || list.size() == 0) {
|
||||
return;
|
||||
}
|
||||
@@ -143,7 +146,7 @@ public class VideoScrollViewHolder extends AbsViewHolder implements VideoScrollA
|
||||
public void onPageSelected(VideoPlayWrapViewHolder videoPlayWrapViewHolder, boolean needLoadMore) {
|
||||
if (videoPlayWrapViewHolder != null) {
|
||||
MobclickAgent.onEvent(mContext, "community_video_slide", "社区视频上下滑动");
|
||||
VideoBean videoBean = videoPlayWrapViewHolder.getVideoBean();
|
||||
ActiveBean videoBean = videoPlayWrapViewHolder.getVideoBean();
|
||||
if (videoBean != null) {
|
||||
mVideoBean = videoBean;
|
||||
mVideoPlayWrapViewHolder = videoPlayWrapViewHolder;
|
||||
@@ -252,7 +255,7 @@ public class VideoScrollViewHolder extends AbsViewHolder implements VideoScrollA
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onFollowEvent(FollowEvent e) {
|
||||
if (mVideoScrollAdapter != null && mVideoPlayWrapViewHolder != null) {
|
||||
VideoBean videoBean = mVideoPlayWrapViewHolder.getVideoBean();
|
||||
ActiveBean videoBean = mVideoPlayWrapViewHolder.getVideoBean();
|
||||
if (videoBean != null) {
|
||||
mVideoScrollAdapter.onFollowChanged(!mPaused, videoBean.getId(), e.getToUid(), e.getIsAttention());
|
||||
}
|
||||
@@ -315,7 +318,7 @@ public class VideoScrollViewHolder extends AbsViewHolder implements VideoScrollA
|
||||
*/
|
||||
private void openCommentInputWindow(boolean openFace) {
|
||||
if (mVideoBean != null) {
|
||||
((AbsVideoPlayActivity) mContext).openCommentInputWindow(openFace, mVideoBean.getId(), mVideoBean.getUid(), null);
|
||||
((AbsVideoPlayActivity) mContext).openCommentInputWindowNew(openFace, mVideoBean.getId(), mVideoBean.getUser_id(), false,"",Integer.parseInt(mVideoBean.getComment_num()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
android:layout_height="36dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="5dp">
|
||||
android:paddingRight="5dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/comment_num"
|
||||
@@ -36,7 +37,7 @@
|
||||
android:layout_height="36dp"
|
||||
android:padding="10dp"
|
||||
android:src="@mipmap/icon_video_comment_close"
|
||||
android:tint="@color/gray1" />
|
||||
app:tint="@color/gray1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -54,6 +55,13 @@
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
app:riv_corner_radius="15dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/input"
|
||||
android:layout_width="0dp"
|
||||
@@ -77,7 +85,7 @@
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:src="@mipmap/icon_chat_face"
|
||||
android:tint="@color/gray1" />
|
||||
app:tint="@color/gray1" />
|
||||
</LinearLayout>
|
||||
</com.yunbao.common.custom.MyLinearLayout3>
|
||||
</FrameLayout>
|
||||
@@ -17,27 +17,13 @@
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@mipmap/icon_video_back" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginBottom="120dp"
|
||||
android:layout_marginBottom="100dp"
|
||||
android:visibility="visible">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
@@ -141,7 +127,7 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="9dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
@@ -164,6 +150,12 @@
|
||||
android:textSize="16sp"
|
||||
android:visibility="visible" />
|
||||
|
||||
<com.xuexiang.xui.widget.flowlayout.FlowTagLayout
|
||||
android:id="@+id/myFlowTag"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:ftl_check_mode="none" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -203,7 +195,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:max="100"
|
||||
android:min="0" />
|
||||
android:min="0"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user