6-
@ -15,6 +15,12 @@ android {
|
|||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
javaCompileOptions {
|
||||||
|
annotationProcessorOptions {
|
||||||
|
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
@ -65,6 +71,7 @@ repositories {
|
|||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||||
api files('libs/jcc-bate-0.7.3.jar')
|
api files('libs/jcc-bate-0.7.3.jar')
|
||||||
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
|
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
|
||||||
|
@ -240,6 +240,8 @@ public class Constants {
|
|||||||
public static final String VIDEO_ID = "videoId";
|
public static final String VIDEO_ID = "videoId";
|
||||||
public static final String VIDEO_COMMENT_BEAN = "videoCommnetBean";
|
public static final String VIDEO_COMMENT_BEAN = "videoCommnetBean";
|
||||||
public static final String VIDEO_FACE_OPEN = "videoOpenFace";
|
public static final String VIDEO_FACE_OPEN = "videoOpenFace";
|
||||||
|
public static final String VIDEO_IS_COMMENT = "videoIsComment";
|
||||||
|
public static final String VIDEO_REPLY_ID = "VIDEO_REPLY_ID";
|
||||||
public static final String VIDEO_FACE_HEIGHT = "videoFaceHeight";
|
public static final String VIDEO_FACE_HEIGHT = "videoFaceHeight";
|
||||||
public static final String VIDEO_DURATION = "videoDuration";
|
public static final String VIDEO_DURATION = "videoDuration";
|
||||||
public static final String VIDEO_PATH = "videoPath";
|
public static final String VIDEO_PATH = "videoPath";
|
||||||
@ -306,5 +308,6 @@ public class Constants {
|
|||||||
public static String isSetRemarkText = "";//修改的备注信息
|
public static String isSetRemarkText = "";//修改的备注信息
|
||||||
public static boolean isShowLiveDialog = false;//是否在直播间打开单聊
|
public static boolean isShowLiveDialog = false;//是否在直播间打开单聊
|
||||||
public static int firstInto = 0;//
|
public static int firstInto = 0;//
|
||||||
|
public static final String TO_COMMUNITY_ID = "to_id";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,15 +11,18 @@ import android.view.inputmethod.InputMethodManager;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.adapter.CommentAdapter;
|
import com.yunbao.common.adapter.CommentAdapter;
|
||||||
import com.yunbao.common.bean.ActiveBean;
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
@ -28,6 +31,7 @@ import com.yunbao.common.dialog.ImagePreviewDialog;
|
|||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
import com.yunbao.common.interfaces.CommonCallback;
|
import com.yunbao.common.interfaces.CommonCallback;
|
||||||
import com.yunbao.common.manager.OpenAdManager;
|
import com.yunbao.common.manager.OpenAdManager;
|
||||||
import com.yunbao.common.utils.DialogUitl;
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
@ -41,8 +45,10 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@Route(path = RouteUtil.PATH_COMMUNITY)
|
||||||
public class CommunityDetailsActivity extends AbsActivity {
|
public class CommunityDetailsActivity extends AbsActivity {
|
||||||
ActiveBean activeBean;
|
private ActiveBean activeBean;
|
||||||
|
private String activeId;
|
||||||
private ImageView avatar;
|
private ImageView avatar;
|
||||||
private TextView name;
|
private TextView name;
|
||||||
private TextView time;
|
private TextView time;
|
||||||
@ -61,6 +67,7 @@ public class CommunityDetailsActivity extends AbsActivity {
|
|||||||
private EditText comment;
|
private EditText comment;
|
||||||
private ImageView send;
|
private ImageView send;
|
||||||
private boolean isComment = false;
|
private boolean isComment = false;
|
||||||
|
private RelativeLayout videoLayout;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
@ -81,13 +88,13 @@ public class CommunityDetailsActivity extends AbsActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void main() {
|
protected void main() {
|
||||||
activeBean = getIntent().getParcelableExtra("active");
|
activeId = getIntent().getStringExtra(Constants.TO_COMMUNITY_ID);
|
||||||
initView();
|
initView();
|
||||||
initData();
|
initData();
|
||||||
getReply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initView() {
|
private void initView() {
|
||||||
|
videoLayout = findViewById(R.id.videoLayout);
|
||||||
send = findViewById(R.id.send);
|
send = findViewById(R.id.send);
|
||||||
comment = findViewById(R.id.comment);
|
comment = findViewById(R.id.comment);
|
||||||
replyCount = findViewById(R.id.replyCount);
|
replyCount = findViewById(R.id.replyCount);
|
||||||
@ -222,7 +229,13 @@ public class CommunityDetailsActivity extends AbsActivity {
|
|||||||
findViewById(R.id.userLayout).setOnClickListener(new View.OnClickListener() {
|
findViewById(R.id.userLayout).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
UserHomeActivity.forwardUserHomeActivity(CommunityDetailsActivity.this, activeBean.getUser_id());
|
RouteUtil.forwardUserHome(activeBean.getUser_id());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
videoLayout.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -231,7 +244,7 @@ public class CommunityDetailsActivity extends AbsActivity {
|
|||||||
CommentBean replyComment;
|
CommentBean replyComment;
|
||||||
|
|
||||||
private void getReply() {
|
private void getReply() {
|
||||||
CommonHttpUtil.getCommunityComment(activeBean.getId(), activeBean.getUser_id(), new HttpCallback() {
|
CommonHttpUtil.getCommunityComment(activeBean.getId(), activeBean.getUser_id(), 1, new HttpCallback() {
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
@ -256,7 +269,7 @@ public class CommunityDetailsActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDel(CommentBean activeBean, int position) {
|
public void onDel(CommentBean activeBean) {
|
||||||
//一级回复 删除
|
//一级回复 删除
|
||||||
CommonHttpUtil.delCom(activeBean.getId(), new HttpCallback() {
|
CommonHttpUtil.delCom(activeBean.getId(), new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
@ -298,6 +311,22 @@ public class CommunityDetailsActivity extends AbsActivity {
|
|||||||
|
|
||||||
@SuppressLint("UseCompatLoadingForDrawables")
|
@SuppressLint("UseCompatLoadingForDrawables")
|
||||||
private void initData() {
|
private void initData() {
|
||||||
|
LiveNetManager.get(mContext).getDynamicInfo(activeId, new com.yunbao.common.http.base.HttpCallback<ActiveBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(ActiveBean data) {
|
||||||
|
activeBean = data;
|
||||||
|
initInfo();
|
||||||
|
getReply();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initInfo() {
|
||||||
ImgLoader.display(CommunityDetailsActivity.this, CommonAppConfig.getInstance().getUserBean().getAvatarThumb(), userAvatar);
|
ImgLoader.display(CommunityDetailsActivity.this, CommonAppConfig.getInstance().getUserBean().getAvatarThumb(), userAvatar);
|
||||||
ImgLoader.display(CommunityDetailsActivity.this, activeBean.getUser_avatar(), avatar);
|
ImgLoader.display(CommunityDetailsActivity.this, activeBean.getUser_avatar(), avatar);
|
||||||
name.setText(activeBean.getUser_name());
|
name.setText(activeBean.getUser_name());
|
||||||
@ -325,7 +354,8 @@ public class CommunityDetailsActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
mNineGridLayout.setData(tempList);
|
mNineGridLayout.setData(tempList);
|
||||||
} else {
|
} else {
|
||||||
ImgLoader.display(CommunityDetailsActivity.this, activeBean.getUser_avatar(), videoImage);
|
ImgLoader.display(CommunityDetailsActivity.this, activeBean.getVideo() + "?vframe/jpg/offset/0", videoImage);
|
||||||
|
videoLayout.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
if (activeBean.getIs_love().equals("1")) {
|
if (activeBean.getIs_love().equals("1")) {
|
||||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like, like);
|
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like, like);
|
||||||
|
@ -27,6 +27,7 @@ import androidx.fragment.app.FragmentActivity;
|
|||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||||
import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
||||||
import com.bigkoo.pickerview.listener.OnDismissListener;
|
import com.bigkoo.pickerview.listener.OnDismissListener;
|
||||||
@ -34,23 +35,33 @@ import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
|
|||||||
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
|
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
|
||||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||||
import com.bigkoo.pickerview.view.TimePickerView;
|
import com.bigkoo.pickerview.view.TimePickerView;
|
||||||
|
import com.google.gson.Gson;
|
||||||
import com.lzy.okgo.utils.HttpUtils;
|
import com.lzy.okgo.utils.HttpUtils;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.NewCommunityType;
|
||||||
import com.yunbao.common.custom.ItemDecoration;
|
import com.yunbao.common.custom.ItemDecoration;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
import com.yunbao.common.manager.CommunityTypeManager;
|
||||||
import com.yunbao.common.manager.OpenAdManager;
|
import com.yunbao.common.manager.OpenAdManager;
|
||||||
|
import com.yunbao.common.upload.UploadBean;
|
||||||
|
import com.yunbao.common.upload.UploadCallback;
|
||||||
|
import com.yunbao.common.upload.UploadQnImpl;
|
||||||
import com.yunbao.common.utils.ActiveImageAdapter;
|
import com.yunbao.common.utils.ActiveImageAdapter;
|
||||||
import com.yunbao.common.utils.DateFormatUtil;
|
import com.yunbao.common.utils.DateFormatUtil;
|
||||||
|
import com.yunbao.common.utils.FilesUtils;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
import com.yunbao.common.utils.ProcessImageUtil;
|
import com.yunbao.common.utils.ProcessImageUtil;
|
||||||
import com.yunbao.common.utils.ProcessResultUtil;
|
import com.yunbao.common.utils.ProcessResultUtil;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class CommunitySendActivity extends AbsActivity {
|
public class CommunitySendActivity extends AbsActivity {
|
||||||
public static final int PERMISSION_REQUEST_CODE_IMG = 0;
|
public static final int PERMISSION_REQUEST_CODE_IMG = 0;
|
||||||
@ -65,7 +76,7 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
private final int CHOOSE_IMG = 100;//Android 5.0以下的
|
private final int CHOOSE_IMG = 100;//Android 5.0以下的
|
||||||
private final int CHOOSE_VIDEO = 200;//Android 5.0以上的
|
private final int CHOOSE_VIDEO = 200;//Android 5.0以上的
|
||||||
private List<Uri> uriList = new ArrayList<>();
|
private List<Uri> uriList = new ArrayList<>();
|
||||||
private Uri videoUri;
|
private File videoFile;
|
||||||
private ActiveImageAdapter activeImageAdapter;
|
private ActiveImageAdapter activeImageAdapter;
|
||||||
private VideoView videoView;
|
private VideoView videoView;
|
||||||
private RelativeLayout videoViewLayout;
|
private RelativeLayout videoViewLayout;
|
||||||
@ -74,6 +85,12 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
private List<String> talkList = new ArrayList<>();
|
private List<String> talkList = new ArrayList<>();
|
||||||
private TextView submit;
|
private TextView submit;
|
||||||
private boolean isImage;
|
private boolean isImage;
|
||||||
|
UploadQnImpl mUploadStrategy;
|
||||||
|
|
||||||
|
private List<String> imgUrlList = new ArrayList<>();
|
||||||
|
private String videoUrl;
|
||||||
|
List<NewCommunityType> newCommunityTypeList = new ArrayList<>();
|
||||||
|
int talkId;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
@ -82,14 +99,7 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void main() {
|
protected void main() {
|
||||||
talkList.add("热门");
|
newCommunityTypeList = new CommunityTypeManager(mContext).getCommunityTypeList();
|
||||||
talkList.add("新秀");
|
|
||||||
talkList.add("颜值");
|
|
||||||
talkList.add("舞蹈");
|
|
||||||
talkList.add("男神");
|
|
||||||
talkList.add("音乐");
|
|
||||||
talkList.add("英语");
|
|
||||||
|
|
||||||
content = findViewById(R.id.content);
|
content = findViewById(R.id.content);
|
||||||
submit = findViewById(R.id.submit);
|
submit = findViewById(R.id.submit);
|
||||||
submit.setVisibility(View.VISIBLE);
|
submit.setVisibility(View.VISIBLE);
|
||||||
@ -106,13 +116,23 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
submit.setOnClickListener(new View.OnClickListener() {
|
submit.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
submit();
|
List<UploadBean> uploadBeanList = new ArrayList<>();
|
||||||
|
if (isImage) {
|
||||||
|
for (int i = 0; i < activeImageAdapter.getImageFileList().size(); i++) {
|
||||||
|
UploadBean uploadBean = new UploadBean(activeImageAdapter.getImageFileList().get(i), UploadBean.IMG);
|
||||||
|
uploadBeanList.add(uploadBean);
|
||||||
|
}
|
||||||
|
uploadFile(uploadBeanList, true);
|
||||||
|
} else {
|
||||||
|
uploadBeanList.add(new UploadBean(videoFile, UploadBean.VIDEO));
|
||||||
|
uploadFile(uploadBeanList, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
delVideo.setOnClickListener(new View.OnClickListener() {
|
delVideo.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
videoUri = null;
|
videoFile = null;
|
||||||
videoView.stopPlayback();
|
videoView.stopPlayback();
|
||||||
videoViewLayout.setVisibility(View.GONE);
|
videoViewLayout.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
@ -201,31 +221,49 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void submit() {
|
private void submit() {
|
||||||
StringBuffer files = new StringBuffer();
|
|
||||||
if (isImage) {
|
if (isImage) {
|
||||||
for (int i = 0; i < uriList.size(); i++) {
|
if (imgUrlList.size() == 0) {
|
||||||
if (i == 0) {
|
ToastUtil.show("请选择图片或者视频");
|
||||||
files.append(uri2File(uriList.get(i)).getPath());
|
return;
|
||||||
} else {
|
|
||||||
files.append("," + uri2File(uriList.get(i)).getPath());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
files.append(uri2File(videoUri).getPath());
|
if (StringUtil.isEmpty(videoUrl)) {
|
||||||
|
ToastUtil.show("请选择图片或者视频");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
CommonHttpUtil.pushCommunity(isImage, content.getText().toString(), "1", files.toString(), chooseTime.getText().toString(), new HttpCallback() {
|
}
|
||||||
|
String imgUrl = "";
|
||||||
|
if (isImage) {
|
||||||
|
imgUrl = new Gson().toJson(imgUrlList);
|
||||||
|
}
|
||||||
|
String tempTime = "";
|
||||||
|
if (!chooseTime.getText().toString().equals("立即发表")) {
|
||||||
|
tempTime = chooseTime.getText().toString();
|
||||||
|
}
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("msg", content.getText().toString());
|
||||||
|
CommonHttpUtil.pushCommunity(isImage, jsonObject.toString(), String.valueOf(talkId), imgUrl, videoUrl, tempTime, new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0) {
|
||||||
|
ToastUtil.show("发布成功");
|
||||||
|
finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showTalkChooseDialog() {
|
private void showTalkChooseDialog() {
|
||||||
|
talkList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < newCommunityTypeList.size(); i++) {
|
||||||
|
talkList.add(newCommunityTypeList.get(i).getTalk_name());
|
||||||
|
}
|
||||||
OptionsPickerView pickerView = new OptionsPickerBuilder(CommunitySendActivity.this, new OnOptionsSelectListener() {
|
OptionsPickerView pickerView = new OptionsPickerBuilder(CommunitySendActivity.this, new OnOptionsSelectListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
||||||
|
talkId = newCommunityTypeList.get(options1).getId();
|
||||||
talkContent.setText(talkList.get(options1));
|
talkContent.setText(talkList.get(options1));
|
||||||
|
talkContent.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}).setTitleText("选择话题").setContentTextSize(16).build();
|
}).setTitleText("选择话题").setContentTextSize(16).build();
|
||||||
pickerView.setPicker(talkList, null, null);
|
pickerView.setPicker(talkList, null, null);
|
||||||
@ -304,7 +342,7 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
List<String> tempList = new ArrayList<>();
|
List<String> tempList = new ArrayList<>();
|
||||||
for (int i = 0; i < clipData.getItemCount(); i++) {
|
for (int i = 0; i < clipData.getItemCount(); i++) {
|
||||||
imageUris[i] = clipData.getItemAt(i).getUri();
|
imageUris[i] = clipData.getItemAt(i).getUri();
|
||||||
File file = new File(uri2File(imageUris[i]).getPath());
|
File file = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, imageUris[i])));
|
||||||
tempList.add(file.getPath());
|
tempList.add(file.getPath());
|
||||||
L.e("imageUris:" + imageUris[i].getPath() + "_" + imageUris[i].getEncodedPath());
|
L.e("imageUris:" + imageUris[i].getPath() + "_" + imageUris[i].getEncodedPath());
|
||||||
}
|
}
|
||||||
@ -314,7 +352,7 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
imageUris = new Uri[]{data.getData()};
|
imageUris = new Uri[]{data.getData()};
|
||||||
uriList.add(imageUris[0]);
|
uriList.add(imageUris[0]);
|
||||||
List<String> tempList = new ArrayList<>();
|
List<String> tempList = new ArrayList<>();
|
||||||
File file = new File(uri2File(imageUris[0]).getPath());
|
File file = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, imageUris[0])));
|
||||||
tempList.add(file.getPath());
|
tempList.add(file.getPath());
|
||||||
activeImageAdapter.insertList(tempList);
|
activeImageAdapter.insertList(tempList);
|
||||||
}
|
}
|
||||||
@ -322,26 +360,34 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
isImage = true;
|
isImage = true;
|
||||||
} else if (requestCode == CHOOSE_VIDEO && resultCode == RESULT_OK && data != null) {
|
} else if (requestCode == CHOOSE_VIDEO && resultCode == RESULT_OK && data != null) {
|
||||||
Uri uri = data.getData();
|
Uri uri = data.getData();
|
||||||
videoUri = uri;
|
videoFile = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, uri)));
|
||||||
videoView.setVideoURI(videoUri);
|
videoView.setVideoURI(uri);
|
||||||
videoView.start();
|
videoView.start();
|
||||||
videoViewLayout.setVisibility(View.VISIBLE);
|
videoViewLayout.setVisibility(View.VISIBLE);
|
||||||
isImage = false;
|
isImage = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private File uri2File(Uri uri) {
|
private void uploadFile(List<UploadBean> uploadBeans, boolean isImg) {
|
||||||
String img_path;
|
if (mUploadStrategy == null) {
|
||||||
String[] proj = {MediaStore.Images.Media.DATA};
|
mUploadStrategy = new UploadQnImpl(mContext);
|
||||||
Cursor actualimagecursor = this.managedQuery(uri, proj, null, null, null);
|
|
||||||
if (actualimagecursor == null) {
|
|
||||||
img_path = uri.getPath();
|
|
||||||
} else {
|
|
||||||
int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
|
||||||
actualimagecursor.moveToFirst();
|
|
||||||
img_path = actualimagecursor.getString(actual_image_column_index);
|
|
||||||
}
|
}
|
||||||
File file = new File(img_path);
|
mUploadStrategy.upload(uploadBeans, true, new UploadCallback() {
|
||||||
return file;
|
@Override
|
||||||
|
public void onFinish(List<UploadBean> list, boolean success) {
|
||||||
|
if (!success) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (isImage) {
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
imgUrlList.add(list.get(i).getRemoteAccessUrl());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
videoUrl = list.get(0).getRemoteAccessUrl();
|
||||||
|
}
|
||||||
|
submit();
|
||||||
|
L.e(new Gson().toJson(list));
|
||||||
|
}
|
||||||
|
}, isImg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,24 +1,36 @@
|
|||||||
package com.yunbao.common.activity;
|
package com.yunbao.common.activity;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.Manifest;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.database.Cursor;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Outline;
|
import android.graphics.Outline;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.provider.MediaStore;
|
||||||
|
import android.util.SparseArray;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewOutlineProvider;
|
import android.view.ViewOutlineProvider;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import androidx.viewpager.widget.ViewPager;
|
import androidx.viewpager.widget.ViewPager;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.google.gson.Gson;
|
||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
import com.ms.banner.Banner;
|
import com.ms.banner.Banner;
|
||||||
import com.ms.banner.listener.OnBannerClickListener;
|
|
||||||
import com.xuexiang.xui.widget.flowlayout.FlowTagLayout;
|
import com.xuexiang.xui.widget.flowlayout.FlowTagLayout;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
@ -26,27 +38,40 @@ import com.yunbao.common.R;
|
|||||||
import com.yunbao.common.adapter.LabelTagAdapter;
|
import com.yunbao.common.adapter.LabelTagAdapter;
|
||||||
import com.yunbao.common.adapter.UserCommunityAdapter;
|
import com.yunbao.common.adapter.UserCommunityAdapter;
|
||||||
import com.yunbao.common.adapter.UserHomeImgAdapter;
|
import com.yunbao.common.adapter.UserHomeImgAdapter;
|
||||||
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
import com.yunbao.common.bean.ActiveOtherBean;
|
import com.yunbao.common.bean.ActiveOtherBean;
|
||||||
import com.yunbao.common.bean.HomeUserExhibitInfoBean;
|
import com.yunbao.common.bean.HomeUserExhibitInfoBean;
|
||||||
import com.yunbao.common.bean.HomeUserInfoBean;
|
import com.yunbao.common.bean.HomeUserInfoBean;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
|
||||||
import com.yunbao.common.bean.LabelBean;
|
import com.yunbao.common.bean.LabelBean;
|
||||||
import com.yunbao.common.bean.MessageUserInfoBean;
|
|
||||||
import com.yunbao.common.bean.UserHomeImgBean;
|
import com.yunbao.common.bean.UserHomeImgBean;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
import com.yunbao.common.interfaces.CommonCallback;
|
import com.yunbao.common.interfaces.CommonCallback;
|
||||||
|
import com.yunbao.common.upload.UploadBean;
|
||||||
|
import com.yunbao.common.upload.UploadCallback;
|
||||||
|
import com.yunbao.common.upload.UploadQnImpl;
|
||||||
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
|
import com.yunbao.common.utils.FilesUtils;
|
||||||
|
import com.yunbao.common.utils.L;
|
||||||
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.views.UserHomeImgsViewHolder;
|
import com.yunbao.common.views.UserHomeImgsViewHolder;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import pl.droidsonroids.gif.GifImageView;
|
||||||
|
|
||||||
|
@Route(path = RouteUtil.PATH_USER_HOME)
|
||||||
public class UserHomeActivity extends AbsActivity {
|
public class UserHomeActivity extends AbsActivity {
|
||||||
|
private final int CHOOSE_IMG = 100;//Android 5.0以下的
|
||||||
|
public static final int PERMISSION_REQUEST_CODE_IMG = 0;
|
||||||
private String uid;
|
private String uid;
|
||||||
private Banner mBanner;
|
private Banner mBanner;
|
||||||
private RecyclerView imgsRecyclerView;
|
private RecyclerView imgsRecyclerView;
|
||||||
@ -65,39 +90,53 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
private ImageView userStatusIcon;
|
private ImageView userStatusIcon;
|
||||||
private ImageView user_sex;
|
private ImageView user_sex;
|
||||||
private ImageView authorIcon;
|
private ImageView authorIcon;
|
||||||
private TextView level;
|
|
||||||
private ImageView levelIcon;
|
private ImageView levelIcon;
|
||||||
private TextView vipLevel;
|
|
||||||
private LinearLayout authenticationLayout;
|
private LinearLayout authenticationLayout;
|
||||||
private TextView signature;
|
private TextView signature;
|
||||||
private LinearLayout moreLayout;
|
private LinearLayout moreLayout;
|
||||||
private TextView moreText;
|
private TextView moreText;
|
||||||
private ImageView moreIcon;
|
private ImageView moreIcon;
|
||||||
private HomeUserInfoBean userInfo;
|
private HomeUserInfoBean userInfo;
|
||||||
RecyclerView communityRecyclerView;
|
private RecyclerView communityRecyclerView;
|
||||||
private LinearLayout itemLayout01;
|
private LinearLayout itemLayout01;
|
||||||
private LinearLayout itemLayout02;
|
private LinearLayout itemLayout02;
|
||||||
private LinearLayout itemLayout03;
|
private LinearLayout itemLayout03;
|
||||||
private LinearLayout itemLayout04;
|
private LinearLayout itemLayout04;
|
||||||
FlowTagLayout myFlowTag; //我的标签
|
private FlowTagLayout myFlowTag; //我的标签
|
||||||
LabelTagAdapter myAdapter;
|
private LabelTagAdapter myAdapter;
|
||||||
private boolean isShowcase;
|
private boolean isShowcase;
|
||||||
private boolean isAnchor;
|
private boolean isAnchor;
|
||||||
|
private boolean isMe;
|
||||||
private RelativeLayout userPresidentLayout;
|
private RelativeLayout userPresidentLayout;
|
||||||
private TextView userPresidentName;
|
private TextView userPresidentName;
|
||||||
private RelativeLayout authorLayout;
|
|
||||||
private RelativeLayout levelLayout;
|
|
||||||
private RoundedImageView fansImg1;
|
private RoundedImageView fansImg1;
|
||||||
private RoundedImageView fansImg2;
|
private RoundedImageView fansImg2;
|
||||||
private RoundedImageView fansImg3;
|
private RoundedImageView fansImg3;
|
||||||
|
|
||||||
private List<RoundedImageView> fansImgViewList = new ArrayList<>();
|
private List<RoundedImageView> fansImgViewList = new ArrayList<>();
|
||||||
|
private RoundedImageView guardImg1;
|
||||||
public static void forwardUserHomeActivity(Context content, String uid) {
|
private RoundedImageView guardImg2;
|
||||||
Intent intent = new Intent(content, UserHomeActivity.class);
|
private RoundedImageView guardImg3;
|
||||||
intent.putExtra(Constants.TO_UID, uid);
|
private List<RoundedImageView> guardImgViewList = new ArrayList<>();
|
||||||
content.startActivity(intent);
|
private RoundedImageView giftImg1;
|
||||||
}
|
private RoundedImageView giftImg2;
|
||||||
|
private RoundedImageView giftImg3;
|
||||||
|
private List<RoundedImageView> giftImgViewList = new ArrayList<>();
|
||||||
|
private RoundedImageView honorImg1;
|
||||||
|
private RoundedImageView honorImg2;
|
||||||
|
private RoundedImageView honorImg3;
|
||||||
|
private List<RoundedImageView> honorImgViewList = new ArrayList<>();
|
||||||
|
private TextView giftCount;
|
||||||
|
private List<String> tagList;
|
||||||
|
private GifImageView liveStatus;
|
||||||
|
private TextView topName;
|
||||||
|
private LinearLayout topLayout;
|
||||||
|
private ScrollView scrollView;
|
||||||
|
private RelativeLayout topImgLayout;
|
||||||
|
private ImageView imgUp;
|
||||||
|
private ImageView imgLabel;
|
||||||
|
private LinearLayout bottomEditLayout;
|
||||||
|
private UploadQnImpl mUploadStrategy;
|
||||||
|
private List<ActiveBean> videoList = new ArrayList<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
@ -128,11 +167,33 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
List<ActiveOtherBean> beanList = JSONArray.parseArray(Arrays.toString(info), ActiveOtherBean.class);
|
List<ActiveOtherBean> beanList = JSONArray.parseArray(Arrays.toString(info), ActiveOtherBean.class);
|
||||||
UserCommunityAdapter userCommunityAdapter = new UserCommunityAdapter(mContext, beanList);
|
UserCommunityAdapter userCommunityAdapter = new UserCommunityAdapter(mContext, beanList);
|
||||||
|
userCommunityAdapter.setOnItemClickListener(new UserCommunityAdapter.onItemClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onImgItem(ActiveOtherBean bean, int position) {
|
||||||
|
if (bean.getImg_or_video().equals("1")) {
|
||||||
|
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
|
||||||
|
public void onVideoItem(String activeBean, int position) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
communityRecyclerView.setAdapter(userCommunityAdapter);
|
communityRecyclerView.setAdapter(userCommunityAdapter);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint({"SetTextI18n", "UseCompatLoadingForDrawables"})
|
||||||
private void initData(HomeUserInfoBean userInfoBean) {
|
private void initData(HomeUserInfoBean userInfoBean) {
|
||||||
userInfo = userInfoBean;
|
userInfo = userInfoBean;
|
||||||
if (!userInfo.getCheckBlack().get(0).getU2t().equals("0")) {
|
if (!userInfo.getCheckBlack().get(0).getU2t().equals("0")) {
|
||||||
@ -145,30 +206,46 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
userPresidentName.setText(userInfo.getUserHomeTopInfo().getUser_president_name());
|
userPresidentName.setText(userInfo.getUserHomeTopInfo().getUser_president_name());
|
||||||
}
|
}
|
||||||
isAnchor = userInfo.getUserHomeTopInfo().getIs_anchor() == 1;
|
isAnchor = userInfo.getUserHomeTopInfo().getIs_anchor() == 1;
|
||||||
|
isMe = CommonAppConfig.getInstance().getUserBean().getId().equals(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()));
|
||||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_avatar(), avatar);
|
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_avatar(), avatar);
|
||||||
|
topName.setText(userInfo.getUserHomeTopInfo().getUser_name()); //用户名称-顶部
|
||||||
userName.setText(userInfo.getUserHomeTopInfo().getUser_name());//用户名称
|
userName.setText(userInfo.getUserHomeTopInfo().getUser_name());//用户名称
|
||||||
fansCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_fans_num()));//粉丝数量
|
fansCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_fans_num()));//粉丝数量
|
||||||
likeCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_love_num()));//关注数量
|
likeCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_love_num()));//关注数量
|
||||||
|
|
||||||
|
if (isMe) {
|
||||||
|
bottomEditLayout.setVisibility(View.VISIBLE);
|
||||||
|
imgUp.setVisibility(View.VISIBLE);
|
||||||
|
imgLabel.setVisibility(View.VISIBLE);
|
||||||
|
followLayout.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getUser_goodnum())) {
|
||||||
|
userId.setText("靓号:" + userInfo.getUserHomeTopInfo().getUser_goodnum());//用户靓号
|
||||||
|
} else {
|
||||||
userId.setText("ID:" + userInfo.getUserHomeTopInfo().getUser_id());//用户ID
|
userId.setText("ID:" + userInfo.getUserHomeTopInfo().getUser_id());//用户ID
|
||||||
userStatus.setText("");//认证状态
|
}
|
||||||
|
|
||||||
|
if (userInfo.getUserHomeTopInfo().getRong_online().equals("0")) {
|
||||||
|
userStatus.setText("在线");
|
||||||
|
userStatusIcon.setImageDrawable(getResources().getDrawable(R.mipmap.icon_green));
|
||||||
|
} else {
|
||||||
|
userStatus.setText("离线");
|
||||||
|
userStatusIcon.setImageDrawable(getResources().getDrawable(R.mipmap.icon_gray));
|
||||||
|
}
|
||||||
|
if (userInfo.getUserHomeTopInfo().getIs_live() == 1) {
|
||||||
|
liveStatus.setVisibility(View.VISIBLE);
|
||||||
|
avatar.setBackground(getResources().getDrawable(R.drawable.bg_live_1));
|
||||||
|
}
|
||||||
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, Integer.parseInt(String.valueOf(userInfo.getUserHomeTopInfo().getUser_sex())) == 0 ? R.mipmap.icon_man_new : R.mipmap.icon_wumen, user_sex);
|
||||||
ImgLoader.display(UserHomeActivity.this, CommonAppConfig.HOST + userInfo.getUserHomeTopInfo().getUser_level_anchor_img(), authorIcon);
|
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_anchor_img(), authorIcon);
|
||||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_img(), levelIcon);
|
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_img(), levelIcon);
|
||||||
|
|
||||||
if (isAnchor) {//是否是主播
|
if (isAnchor) {//是否是主播
|
||||||
authorLayout.setVisibility(View.VISIBLE);
|
authorIcon.setVisibility(View.VISIBLE);
|
||||||
levelLayout.setVisibility(View.VISIBLE);
|
|
||||||
authenticationLayout.setVisibility(View.VISIBLE);
|
authenticationLayout.setVisibility(View.VISIBLE);
|
||||||
itemLayout01.setVisibility(View.VISIBLE);
|
|
||||||
itemLayout02.setVisibility(View.VISIBLE);
|
|
||||||
itemLayout03.setVisibility(View.VISIBLE);
|
|
||||||
itemLayout04.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
} else {
|
||||||
authorLayout.setVisibility(View.GONE);
|
authorIcon.setVisibility(View.GONE);
|
||||||
authenticationLayout.setVisibility(View.GONE);
|
authenticationLayout.setVisibility(View.GONE);
|
||||||
itemLayout03.setVisibility(View.VISIBLE);
|
|
||||||
itemLayout04.setVisibility(View.VISIBLE);
|
|
||||||
}
|
}
|
||||||
signature.setText(userInfo.getUserHomeTopInfo().getUser_signature());//个性签名
|
signature.setText(userInfo.getUserHomeTopInfo().getUser_signature());//个性签名
|
||||||
//标签
|
//标签
|
||||||
@ -178,11 +255,26 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
tagList = new ArrayList<>();
|
||||||
|
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getAge())) {
|
||||||
|
tagList.add(userInfo.getUserHomeTopInfo().getAge() + "岁");
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getHeight())) {
|
||||||
|
tagList.add(userInfo.getUserHomeTopInfo().getHeight());
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getCareer())) {
|
||||||
|
tagList.add(userInfo.getUserHomeTopInfo().getCareer());
|
||||||
|
}
|
||||||
if (userInfo.getUserHomeTopInfo().getCn_label() != null) {
|
if (userInfo.getUserHomeTopInfo().getCn_label() != null) {
|
||||||
if (userInfo.getUserHomeTopInfo().getCn_label().size() > 0) {
|
if (userInfo.getUserHomeTopInfo().getCn_label().size() > 0) {
|
||||||
|
for (int i = 0; i < userInfo.getUserHomeTopInfo().getCn_label().size(); i++) {
|
||||||
|
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getCn_label().get(i))) {
|
||||||
|
tagList.add(userInfo.getUserHomeTopInfo().getCn_label().get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
myFlowTag.setAdapter(myAdapter);
|
myFlowTag.setAdapter(myAdapter);
|
||||||
myFlowTag.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE);
|
myFlowTag.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE);
|
||||||
myAdapter.setData(userInfo.getUserHomeTopInfo().getCn_label());
|
myAdapter.setData(tagList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mBanner.setOutlineProvider(new ViewOutlineProvider() {
|
mBanner.setOutlineProvider(new ViewOutlineProvider() {
|
||||||
@ -212,16 +304,18 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
for (int i = 0; i < bannerImgList.size(); i++) {
|
for (int i = 0; i < bannerImgList.size(); i++) {
|
||||||
tempList.add(new UserHomeImgBean(bannerImgList.get(i)));
|
tempList.add(new UserHomeImgBean(bannerImgList.get(i)));
|
||||||
}
|
}
|
||||||
|
if (tempList.size() > 0) {
|
||||||
tempList.get(0).setShow(true);
|
tempList.get(0).setShow(true);
|
||||||
userHomeImgAdapter = new UserHomeImgAdapter(UserHomeActivity.this, tempList);
|
}
|
||||||
|
userHomeImgAdapter = new UserHomeImgAdapter(UserHomeActivity.this, tempList, isMe);
|
||||||
imgsRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
imgsRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||||
imgsRecyclerView.setAdapter(userHomeImgAdapter);
|
imgsRecyclerView.setAdapter(userHomeImgAdapter);
|
||||||
|
|
||||||
userHomeImgAdapter.setOnItemClickListener(new UserHomeImgAdapter.onItemClickListener() {
|
userHomeImgAdapter.setOnItemClickListener(new UserHomeImgAdapter.onItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onImgItem(UserHomeImgBean activeBean, int position) {
|
public void onImgItem(UserHomeImgBean activeBean, int position) {
|
||||||
mBanner.onPageSelected(position);
|
L.e("onImgItem:" + position);
|
||||||
mBanner.setCurrentPage(position);
|
mBanner.setCurrentPage(position).start();
|
||||||
for (int i = 0; i < tempList.size(); i++) {
|
for (int i = 0; i < tempList.size(); i++) {
|
||||||
if (i == position) {
|
if (i == position) {
|
||||||
tempList.get(i).setShow(true);
|
tempList.get(i).setShow(true);
|
||||||
@ -231,16 +325,53 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
userHomeImgAdapter.setCommentBeanList(tempList);
|
userHomeImgAdapter.setCommentBeanList(tempList);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
mBanner.setAutoPlay(false).setPages(bannerImgList, new UserHomeImgsViewHolder()).setOnBannerClickListener(new OnBannerClickListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onBannerClick(List datas, int position) {
|
public void onImgDel(UserHomeImgBean activeBean, int position) {
|
||||||
|
bannerImgList.remove(position);
|
||||||
|
uploadImg(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mBanner.setAutoPlay(false).setPages(bannerImgList, new UserHomeImgsViewHolder()).setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}).start();
|
|
||||||
|
@Override
|
||||||
|
public void onPageSelected(int position) {
|
||||||
|
L.e("onPageSelected:" + 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPageScrollStateChanged(int state) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mBanner.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initView() {
|
private void initView() {
|
||||||
|
bottomEditLayout = findViewById(R.id.bottomEditLayout);
|
||||||
|
imgUp = findViewById(R.id.imgUp);
|
||||||
|
imgLabel = findViewById(R.id.imgLabel);
|
||||||
|
topImgLayout = findViewById(R.id.topImgLayout);
|
||||||
|
|
||||||
|
topLayout = findViewById(R.id.topLayout);
|
||||||
|
scrollView = findViewById(R.id.scrollView);
|
||||||
|
|
||||||
|
topName = findViewById(R.id.topName);
|
||||||
|
liveStatus = findViewById(R.id.liveStatus);
|
||||||
|
giftCount = findViewById(R.id.giftCount);
|
||||||
|
|
||||||
fansImg1 = findViewById(R.id.fansImg1);
|
fansImg1 = findViewById(R.id.fansImg1);
|
||||||
fansImg2 = findViewById(R.id.fansImg2);
|
fansImg2 = findViewById(R.id.fansImg2);
|
||||||
fansImg3 = findViewById(R.id.fansImg3);
|
fansImg3 = findViewById(R.id.fansImg3);
|
||||||
@ -248,8 +379,31 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
fansImgViewList.add(fansImg1);
|
fansImgViewList.add(fansImg1);
|
||||||
fansImgViewList.add(fansImg2);
|
fansImgViewList.add(fansImg2);
|
||||||
fansImgViewList.add(fansImg3);
|
fansImgViewList.add(fansImg3);
|
||||||
authorLayout = findViewById(R.id.authorLayout);
|
|
||||||
levelLayout = findViewById(R.id.levelLayout);
|
guardImg1 = findViewById(R.id.guardImg1);
|
||||||
|
guardImg2 = findViewById(R.id.guardImg2);
|
||||||
|
guardImg3 = findViewById(R.id.guardImg3);
|
||||||
|
guardImgViewList = new ArrayList<>();
|
||||||
|
guardImgViewList.add(guardImg1);
|
||||||
|
guardImgViewList.add(guardImg2);
|
||||||
|
guardImgViewList.add(guardImg3);
|
||||||
|
|
||||||
|
giftImg1 = findViewById(R.id.giftImg1);
|
||||||
|
giftImg2 = findViewById(R.id.giftImg2);
|
||||||
|
giftImg3 = findViewById(R.id.giftImg3);
|
||||||
|
giftImgViewList = new ArrayList<>();
|
||||||
|
giftImgViewList.add(giftImg1);
|
||||||
|
giftImgViewList.add(giftImg2);
|
||||||
|
giftImgViewList.add(giftImg3);
|
||||||
|
|
||||||
|
honorImg1 = findViewById(R.id.honorImg1);
|
||||||
|
honorImg2 = findViewById(R.id.honorImg2);
|
||||||
|
honorImg3 = findViewById(R.id.honorImg3);
|
||||||
|
honorImgViewList = new ArrayList<>();
|
||||||
|
honorImgViewList.add(honorImg1);
|
||||||
|
honorImgViewList.add(honorImg2);
|
||||||
|
honorImgViewList.add(honorImg3);
|
||||||
|
|
||||||
userPresidentLayout = findViewById(R.id.userPresidentLayout);
|
userPresidentLayout = findViewById(R.id.userPresidentLayout);
|
||||||
userPresidentName = findViewById(R.id.userPresidentName);
|
userPresidentName = findViewById(R.id.userPresidentName);
|
||||||
itemLayout01 = findViewById(R.id.itemLayout01);
|
itemLayout01 = findViewById(R.id.itemLayout01);
|
||||||
@ -269,9 +423,10 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
userStatus = findViewById(R.id.userStatus);
|
userStatus = findViewById(R.id.userStatus);
|
||||||
userStatusIcon = findViewById(R.id.userStatusIcon);
|
userStatusIcon = findViewById(R.id.userStatusIcon);
|
||||||
user_sex = findViewById(R.id.user_sex);
|
user_sex = findViewById(R.id.user_sex);
|
||||||
|
|
||||||
levelIcon = findViewById(R.id.levelIcon);
|
levelIcon = findViewById(R.id.levelIcon);
|
||||||
level = findViewById(R.id.level);
|
|
||||||
authorIcon = findViewById(R.id.authorlIcon);
|
authorIcon = findViewById(R.id.authorlIcon);
|
||||||
|
|
||||||
authenticationLayout = findViewById(R.id.authenticationLayout);
|
authenticationLayout = findViewById(R.id.authenticationLayout);
|
||||||
signature = findViewById(R.id.signature);
|
signature = findViewById(R.id.signature);
|
||||||
moreLayout = findViewById(R.id.moreLayout);
|
moreLayout = findViewById(R.id.moreLayout);
|
||||||
@ -349,6 +504,110 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
scrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
|
||||||
|
int height = (int) (topImgLayout.getMeasuredHeight() * 1.2);
|
||||||
|
if (scrollY <= 0) {
|
||||||
|
//滑动之前,标题栏布局背景颜色为完全透明,标题文字完全透明
|
||||||
|
topLayout.setBackgroundColor(Color.argb(0, 0, 0, 0));
|
||||||
|
topName.setTextColor(Color.argb(0, 255, 255, 255));
|
||||||
|
//让mScrollView滑动的距离在0~height之间时颜色发生渐变
|
||||||
|
} else if (scrollY > 0 && scrollY <= height) {
|
||||||
|
//获取渐变率
|
||||||
|
float scale = (float) scrollY / height;
|
||||||
|
//获取渐变数值
|
||||||
|
float alpha = (255 * scale);
|
||||||
|
//布局文本颜色逐渐发生变化
|
||||||
|
topLayout.setBackgroundColor(Color.argb((int) alpha, 0, 0, 0));
|
||||||
|
topName.setTextColor(Color.argb((int) alpha, 255, 255, 255));
|
||||||
|
} else {
|
||||||
|
//当滑动距离超过height,布局文本颜色完全不透明
|
||||||
|
topLayout.setBackgroundColor(Color.argb(255, 0, 0, 0));
|
||||||
|
topName.setTextColor(Color.argb(255, 255, 255, 255));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
topLayout.setBackgroundColor(Color.argb(0, 0, 0, 0));
|
||||||
|
topName.setTextColor(Color.argb(0, 255, 255, 255));
|
||||||
|
}
|
||||||
|
imgUp.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (bannerImgList.size() < 9) {
|
||||||
|
selectImg();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
bottomEditLayout.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
RouteUtil.forwardEditProfileActivity();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
findViewById(R.id.setting).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
SparseArray<String> array = new SparseArray<>();
|
||||||
|
array.append(1, "不感兴趣");
|
||||||
|
array.append(0, "举报");
|
||||||
|
array.append(2, "加入黑名单");
|
||||||
|
DialogUitl.showStringArrayDialog(UserHomeActivity.this, array, new DialogUitl.StringArrayDialogCallback() {
|
||||||
|
@Override
|
||||||
|
public void onItemClick(String text, int tag) {
|
||||||
|
if (tag == 0) {
|
||||||
|
CommonHttpUtil.noInterest(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()), new com.yunbao.common.http.HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
ToastUtil.show(msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (tag == 1) {
|
||||||
|
RouteUtil.forwardLiveReportActivity(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()));
|
||||||
|
} else {
|
||||||
|
RouteUtil.forwardLiveReportActivity(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void selectImg() {
|
||||||
|
String permission1 = Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||||
|
String permission2 = Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
permission1 = Manifest.permission.READ_MEDIA_IMAGES;
|
||||||
|
permission2 = Manifest.permission.READ_MEDIA_VIDEO;
|
||||||
|
}
|
||||||
|
int isPermission1 = ContextCompat.checkSelfPermission(mContext, permission1);
|
||||||
|
int isPermission2 = ContextCompat.checkSelfPermission(mContext, permission2);
|
||||||
|
if (isPermission1 == PackageManager.PERMISSION_GRANTED && isPermission2 == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
openImageChooserActivity();
|
||||||
|
} else {
|
||||||
|
//申请权限
|
||||||
|
ActivityCompat.requestPermissions(UserHomeActivity.this, new String[]{permission1, permission2}, PERMISSION_REQUEST_CODE_IMG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openImageChooserActivity() {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||||
|
intent.setType("image/*");
|
||||||
|
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, false);
|
||||||
|
startActivityForResult(intent, CHOOSE_IMG);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
if (requestCode == PERMISSION_REQUEST_CODE_IMG) {
|
||||||
|
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
openImageChooserActivity();
|
||||||
|
} else {
|
||||||
|
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE_IMG);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getUseData() {
|
private void getUseData() {
|
||||||
@ -364,14 +623,59 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
LiveNetManager.get(mContext).getUserExhibitInfoInfo(uid, new HttpCallback<HomeUserExhibitInfoBean>() {
|
LiveNetManager.get(mContext).getUserExhibitInfoInfo(uid, new HttpCallback<HomeUserExhibitInfoBean>() {
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(HomeUserExhibitInfoBean data) {
|
public void onSuccess(HomeUserExhibitInfoBean data) {
|
||||||
|
//主播粉丝团
|
||||||
if (data.getUserHomeTopInfo().getFans().getList() != null) {
|
if (data.getUserHomeTopInfo().getFans().getList() != null) {
|
||||||
|
if (data.getUserHomeTopInfo().getFans().getList().size() >= 3) {
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
ImgLoader.display(mContext, data.getUserHomeTopInfo().getFans().getList().get(i).getAvatar(), fansImgViewList.get(i));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
for (int i = 0; i < data.getUserHomeTopInfo().getFans().getList().size(); i++) {
|
for (int i = 0; i < data.getUserHomeTopInfo().getFans().getList().size(); i++) {
|
||||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getFans().getList().get(i).getAvatar(), fansImgViewList.get(i));
|
ImgLoader.display(mContext, data.getUserHomeTopInfo().getFans().getList().get(i).getAvatar(), fansImgViewList.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//主播守护团
|
||||||
|
if (data.getUserHomeTopInfo().getGuard() != null) {
|
||||||
|
if (data.getUserHomeTopInfo().getGuard().size() >= 3) {
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
ImgLoader.display(mContext, data.getUserHomeTopInfo().getGuard().get(i).getAvatar(), guardImgViewList.get(i));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < data.getUserHomeTopInfo().getGuard().size(); i++) {
|
||||||
|
ImgLoader.display(mContext, data.getUserHomeTopInfo().getGuard().get(i).getAvatar(), guardImgViewList.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//礼物墙
|
||||||
|
if (data.getGiftAlreadyWall().getGift_wall() != null) {
|
||||||
|
if (data.getGiftAlreadyWall().getGift_wall().size() >= 3) {
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
ImgLoader.display(mContext, data.getGiftAlreadyWall().getGift_wall().get(i).getGifticon(), giftImgViewList.get(i));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < data.getGiftAlreadyWall().getGift_wall().size(); i++) {
|
||||||
|
ImgLoader.display(mContext, data.getGiftAlreadyWall().getGift_wall().get(i).getGifticon(), giftImgViewList.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
giftCount.setText(data.getGiftAlreadyWall().getGift_wall().size() + "/36");
|
||||||
|
}
|
||||||
|
//荣誉墙
|
||||||
|
if (data.getUserHomeTopInfo().getDress() != null) {
|
||||||
|
if (data.getUserHomeTopInfo().getDress().size() >= 3) {
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
ImgLoader.display(mContext, data.getUserHomeTopInfo().getDress().get(i).getDisplay_src(), honorImgViewList.get(i));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < data.getUserHomeTopInfo().getDress().size(); i++) {
|
||||||
|
ImgLoader.display(mContext, data.getUserHomeTopInfo().getDress().get(i).getDisplay_src(), honorImgViewList.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
@ -381,7 +685,75 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, intent);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (resultCode == RESULT_OK && requestCode == CHOOSE_IMG) {
|
||||||
|
// 获取用户选择的图片 URI
|
||||||
|
Uri[] imageUris = null;
|
||||||
|
if (data != null) {
|
||||||
|
imageUris = new Uri[]{data.getData()};
|
||||||
|
File file = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, imageUris[0])));
|
||||||
|
uploadFile(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void uploadFile(File file) {
|
||||||
|
if (mUploadStrategy == null) {
|
||||||
|
mUploadStrategy = new UploadQnImpl(mContext);
|
||||||
|
}
|
||||||
|
List<UploadBean> uploadBeans = new ArrayList<>();
|
||||||
|
UploadBean upVideoBean = new UploadBean(file, UploadBean.IMG);
|
||||||
|
uploadBeans.add(upVideoBean);
|
||||||
|
mUploadStrategy.upload(uploadBeans, true, new UploadCallback() {
|
||||||
|
@Override
|
||||||
|
public void onFinish(List<UploadBean> list, boolean success) {
|
||||||
|
if (!success) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
bannerImgList.add("https://downs.yaoulive.com/" + list.get(0).getRemoteAccessUrl());
|
||||||
|
uploadImg(true);
|
||||||
|
L.e(new Gson().toJson(list));
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void uploadImg(boolean isUp) {
|
||||||
|
CommonHttpUtil.uploadUserInfoImg(new Gson().toJson(bannerImgList), new com.yunbao.common.http.HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0 && info != null) {
|
||||||
|
if (isUp) {
|
||||||
|
ToastUtil.show("上传成功");
|
||||||
|
} else {
|
||||||
|
ToastUtil.show("删除成功");
|
||||||
|
}
|
||||||
|
mBanner.setPages(bannerImgList, new UserHomeImgsViewHolder()).start();
|
||||||
|
tempList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < bannerImgList.size(); i++) {
|
||||||
|
tempList.add(new UserHomeImgBean(bannerImgList.get(i)));
|
||||||
|
}
|
||||||
|
if (tempList.size() > 0) {
|
||||||
|
tempList.get(0).setShow(true);
|
||||||
|
}
|
||||||
|
userHomeImgAdapter.setCommentBeanList(tempList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private File uri2File(Uri uri) {
|
||||||
|
String img_path;
|
||||||
|
String[] proj = {MediaStore.Images.Media.DATA};
|
||||||
|
Cursor actualimagecursor = this.managedQuery(uri, proj, null, null, null);
|
||||||
|
if (actualimagecursor == null) {
|
||||||
|
img_path = uri.getPath();
|
||||||
|
} else {
|
||||||
|
int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||||
|
actualimagecursor.moveToFirst();
|
||||||
|
img_path = actualimagecursor.getString(actual_image_column_index);
|
||||||
|
}
|
||||||
|
File file = new File(img_path);
|
||||||
|
return file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,16 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (onItemClickListener != null) {
|
if (onItemClickListener != null) {
|
||||||
CommentBean bean = (CommentBean) v.getTag();
|
CommentBean bean = (CommentBean) v.getTag();
|
||||||
onItemClickListener.onDel(bean, 0);
|
onItemClickListener.onDel(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
del1.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
CommentBean.ReplyComment bean = (CommentBean.ReplyComment) v.getTag();
|
||||||
|
onItemClickListener.onDel(bean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -125,6 +134,7 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
public void setData(CommentBean bean) {
|
public void setData(CommentBean bean) {
|
||||||
|
del.setTag(bean);
|
||||||
report.setTag(bean);
|
report.setTag(bean);
|
||||||
replyTextView.setTag(bean);
|
replyTextView.setTag(bean);
|
||||||
ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar);
|
ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar);
|
||||||
@ -143,6 +153,7 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
|||||||
if (bean.getReplyCommentList() != null) {
|
if (bean.getReplyCommentList() != null) {
|
||||||
replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>");
|
replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>");
|
||||||
if (bean.getReplyCommentList().size() > 0) {
|
if (bean.getReplyCommentList().size() > 0) {
|
||||||
|
del1.setTag(bean.getReplyCommentList().get(0));
|
||||||
replyContent.setText(bean.getReplyCommentList().get(0).getContent());
|
replyContent.setText(bean.getReplyCommentList().get(0).getContent());
|
||||||
ImgLoader.display(itemView.getContext(), bean.getReplyCommentList().get(0).getUser_avatar(), mAvatar01);
|
ImgLoader.display(itemView.getContext(), bean.getReplyCommentList().get(0).getUser_avatar(), mAvatar01);
|
||||||
firstName.setText(bean.getReplyCommentList().get(0).getUser_name());
|
firstName.setText(bean.getReplyCommentList().get(0).getUser_name());
|
||||||
@ -152,10 +163,10 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
|||||||
} else {
|
} else {
|
||||||
isAuth.setVisibility(View.GONE);
|
isAuth.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
if (bean.getUser_id().equals(myUid)) {
|
if (bean.getReplyCommentList().get(0).getUser_id().equals(myUid)) {
|
||||||
del.setVisibility(View.VISIBLE);
|
del1.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
del.setVisibility(View.GONE);
|
del1.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
replyLayout.setVisibility(View.GONE);
|
replyLayout.setVisibility(View.GONE);
|
||||||
@ -210,10 +221,10 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
void onReport(CommentBean activeBean);
|
void onReport(CommentBean activeBean);
|
||||||
|
|
||||||
void onDel(CommentBean activeBean, int position);
|
|
||||||
|
|
||||||
void onReport(CommentBean.ReplyComment activeBean);
|
void onReport(CommentBean.ReplyComment activeBean);
|
||||||
|
|
||||||
|
void onDel(CommentBean activeBean);
|
||||||
|
|
||||||
void onDel(CommentBean.ReplyComment activeBean);
|
void onDel(CommentBean.ReplyComment activeBean);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,231 @@
|
|||||||
|
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.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
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;
|
||||||
|
import com.yunbao.common.views.TopGradual;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class CommentVideoAdapter extends RefreshAdapter<CommentBean> {
|
||||||
|
private Context mContext;
|
||||||
|
private String authorId;
|
||||||
|
private String myUid;
|
||||||
|
private onItemClickListener onItemClickListener;
|
||||||
|
|
||||||
|
public void setOnItemClickListener(CommentVideoAdapter.onItemClickListener onItemClickListener) {
|
||||||
|
this.onItemClickListener = onItemClickListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CommentVideoAdapter(Context content, String authorId,CommentVideoAdapter.onItemClickListener onItemClickListener ) {
|
||||||
|
super(content);
|
||||||
|
this.onItemClickListener = onItemClickListener;
|
||||||
|
this.mContext = content;
|
||||||
|
this.authorId = authorId;
|
||||||
|
myUid = CommonAppConfig.getInstance().getUid();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_comment_video_view, parent, false);
|
||||||
|
return new CommentViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
|
CommentViewHolder commentViewHolder = (CommentViewHolder) holder;
|
||||||
|
commentViewHolder.setData(mList.get(position));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return mList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
class CommentViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
private RoundedImageView mAvatar;
|
||||||
|
private TextView name;
|
||||||
|
private TextView content;
|
||||||
|
private TextView report;
|
||||||
|
private TextView replyTextView;
|
||||||
|
private RoundedImageView mAvatar01;
|
||||||
|
private TextView replyContent;
|
||||||
|
private TextView replyCount;
|
||||||
|
private RecyclerView recyclerView;
|
||||||
|
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);
|
||||||
|
firstName = itemView.findViewById(R.id.firstName);
|
||||||
|
mAvatar = itemView.findViewById(R.id.avatar);
|
||||||
|
name = itemView.findViewById(R.id.name);
|
||||||
|
content = itemView.findViewById(R.id.content);
|
||||||
|
replyTextView = itemView.findViewById(R.id.replyTextView);
|
||||||
|
report = itemView.findViewById(R.id.report);
|
||||||
|
mAvatar01 = itemView.findViewById(R.id.avatar01);
|
||||||
|
isAuth = itemView.findViewById(R.id.isAuth);
|
||||||
|
replyContent = itemView.findViewById(R.id.replyContent);
|
||||||
|
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) {
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
CommentBean bean = (CommentBean) v.getTag();
|
||||||
|
onItemClickListener.onReport(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
replyTextView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
CommentBean bean = (CommentBean) v.getTag();
|
||||||
|
onItemClickListener.onReply(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
del.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
CommentBean bean = (CommentBean) v.getTag();
|
||||||
|
onItemClickListener.onDel(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
del1.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
CommentBean.ReplyComment bean = (CommentBean.ReplyComment) v.getTag();
|
||||||
|
onItemClickListener.onDel(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
public void setData(CommentBean bean) {
|
||||||
|
del.setTag(bean);
|
||||||
|
report.setTag(bean);
|
||||||
|
replyTextView.setTag(bean);
|
||||||
|
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) {
|
||||||
|
del1.setTag(bean.getReplyCommentList().get(0));
|
||||||
|
replyContent.setText(bean.getReplyCommentList().get(0).getContent());
|
||||||
|
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.getReplyCommentList().get(0).getUser_id().equals(myUid)) {
|
||||||
|
del1.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
del1.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
replyLayout.setVisibility(View.GONE);
|
||||||
|
replyCount.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
if (bean.getReplyCommentList().size() > 1) {
|
||||||
|
replyCount.setVisibility(View.VISIBLE);
|
||||||
|
replyLayout.setVisibility(View.VISIBLE);
|
||||||
|
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||||
|
recyclerView.addItemDecoration(new TopGradual());
|
||||||
|
List<CommentBean.ReplyComment> tempList = new ArrayList<>();
|
||||||
|
tempList.addAll(bean.getReplyCommentList());
|
||||||
|
tempList.remove(0);
|
||||||
|
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() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (!bean.isShow()) {
|
||||||
|
recyclerView.setVisibility(View.VISIBLE);
|
||||||
|
replyCount.setText("收起");
|
||||||
|
} else {
|
||||||
|
recyclerView.setVisibility(View.GONE);
|
||||||
|
replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>");
|
||||||
|
}
|
||||||
|
bean.setShow(!bean.isShow());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface onItemClickListener {
|
||||||
|
void onReply(CommentBean activeBean);
|
||||||
|
|
||||||
|
void onReport(CommentBean activeBean);
|
||||||
|
|
||||||
|
void onReport(CommentBean.ReplyComment activeBean);
|
||||||
|
|
||||||
|
void onDel(CommentBean activeBean);
|
||||||
|
|
||||||
|
void onDel(CommentBean.ReplyComment activeBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -37,7 +37,6 @@ public class LabelTagAdapter extends BaseTagAdapter<String, TextView> {
|
|||||||
@Override
|
@Override
|
||||||
protected void convert(TextView textView, String item, int position) {
|
protected void convert(TextView textView, String item, int position) {
|
||||||
textView.setText(item);
|
textView.setText(item);
|
||||||
textView.setTextColor(mContext.getResources().getColor(R.color.black2));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OnSureOnClickListener {
|
public interface OnSureOnClickListener {
|
||||||
|
@ -0,0 +1,46 @@
|
|||||||
|
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 LabelVideoTagAdapter extends BaseTagAdapter<String, TextView> {
|
||||||
|
|
||||||
|
OnSureOnClickListener onSureOnClickListener;
|
||||||
|
|
||||||
|
Context mContext;
|
||||||
|
|
||||||
|
public LabelVideoTagAdapter(Context context, OnSureOnClickListener onSureOnClickListener) {
|
||||||
|
super(context);
|
||||||
|
this.onSureOnClickListener = onSureOnClickListener;
|
||||||
|
this.mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LabelVideoTagAdapter(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_video_tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void convert(TextView textView, String item, int position) {
|
||||||
|
textView.setText(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnSureOnClickListener {
|
||||||
|
void sure(LabelBean.Children labelBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -16,7 +16,9 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
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.bean.ActiveOtherBean;
|
import com.yunbao.common.bean.ActiveOtherBean;
|
||||||
|
import com.yunbao.common.dialog.ImagePreviewDialog;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.views.NineGridLayout;
|
import com.yunbao.common.views.NineGridLayout;
|
||||||
@ -81,16 +83,17 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
|||||||
comCount = itemView.findViewById(R.id.comCount);
|
comCount = itemView.findViewById(R.id.comCount);
|
||||||
shareCount = itemView.findViewById(R.id.shareCount);
|
shareCount = itemView.findViewById(R.id.shareCount);
|
||||||
|
|
||||||
mAvatar.setOnClickListener(new View.OnClickListener() {
|
itemView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
onItemClickListener.onImgItem((String) v.getTag(), getPosition());
|
onItemClickListener.onImgItem((ActiveOtherBean) v.getTag(), getPosition());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
public void setData(ActiveOtherBean bean) {
|
public void setData(ActiveOtherBean bean) {
|
||||||
|
itemView.setTag(bean);
|
||||||
mAvatar.setTag(bean);
|
mAvatar.setTag(bean);
|
||||||
ImgLoader.display(mContext, bean.getUser_avatar(), mAvatar);
|
ImgLoader.display(mContext, bean.getUser_avatar(), mAvatar);
|
||||||
userName.setText(bean.getUser_name());
|
userName.setText(bean.getUser_name());
|
||||||
@ -104,7 +107,19 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
|||||||
nineGridLayout.setActionListener(new NineGridLayout.ActionListener() {
|
nineGridLayout.setActionListener(new NineGridLayout.ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(List<?> dataList, int position) {
|
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
|
@Override
|
||||||
@ -119,14 +134,18 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
|||||||
tempList.add(String.valueOf(jsonArray.get(i)));
|
tempList.add(String.valueOf(jsonArray.get(i)));
|
||||||
}
|
}
|
||||||
nineGridLayout.setData(tempList);
|
nineGridLayout.setData(tempList);
|
||||||
|
videoLayout.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
ImgLoader.display(mContext, bean.getUser_avatar(), videoImage);
|
videoLayout.setVisibility(View.VISIBLE);
|
||||||
|
ImgLoader.display(mContext, bean.getVideo() + "?vframe/jpg/offset/0", videoImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface onItemClickListener {
|
public interface onItemClickListener {
|
||||||
void onImgItem(String activeBean, int position);
|
void onImgItem(ActiveOtherBean activeBean, int position);
|
||||||
|
|
||||||
|
void onVideoItem(String activeBean, int position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
@ -22,17 +21,15 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter {
|
|||||||
private List<UserHomeImgBean> commentBeanList;
|
private List<UserHomeImgBean> commentBeanList;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private onItemClickListener onItemClickListener;
|
private onItemClickListener onItemClickListener;
|
||||||
|
private boolean isMe;
|
||||||
|
|
||||||
public void setOnItemClickListener(UserHomeImgAdapter.onItemClickListener onItemClickListener) {
|
public void setOnItemClickListener(UserHomeImgAdapter.onItemClickListener onItemClickListener) {
|
||||||
this.onItemClickListener = onItemClickListener;
|
this.onItemClickListener = onItemClickListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<UserHomeImgBean> getCommentBeanList() {
|
public UserHomeImgAdapter(Context content, List<UserHomeImgBean> commentBeanList, boolean isMe) {
|
||||||
return commentBeanList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public UserHomeImgAdapter(Context content, List<UserHomeImgBean> commentBeanList) {
|
|
||||||
this.mContext = content;
|
this.mContext = content;
|
||||||
|
this.isMe = isMe;
|
||||||
this.commentBeanList = commentBeanList;
|
this.commentBeanList = commentBeanList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,11 +58,13 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter {
|
|||||||
class CommentViewHolder extends RecyclerView.ViewHolder {
|
class CommentViewHolder extends RecyclerView.ViewHolder {
|
||||||
RoundedImageView mAvatar01;
|
RoundedImageView mAvatar01;
|
||||||
RoundedImageView mAvatar02;
|
RoundedImageView mAvatar02;
|
||||||
|
ImageView del;
|
||||||
|
|
||||||
public CommentViewHolder(@NonNull View itemView) {
|
public CommentViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
mAvatar01 = itemView.findViewById(R.id.avatar01);
|
mAvatar01 = itemView.findViewById(R.id.avatar01);
|
||||||
mAvatar02 = itemView.findViewById(R.id.avatar02);
|
mAvatar02 = itemView.findViewById(R.id.avatar02);
|
||||||
|
del = itemView.findViewById(R.id.del);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
@ -74,15 +73,29 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter {
|
|||||||
mAvatar01.setOnClickListener(new View.OnClickListener() {
|
mAvatar01.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
if (onItemClickListener != null) {
|
||||||
onItemClickListener.onImgItem((UserHomeImgBean) v.getTag(), position);
|
onItemClickListener.onImgItem((UserHomeImgBean) v.getTag(), position);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
del.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
onItemClickListener.onImgDel((UserHomeImgBean) v.getTag(), position);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
ImgLoader.display(mContext, bean.getImgurl(), mAvatar01);
|
ImgLoader.display(mContext, bean.getImgurl(), mAvatar01);
|
||||||
ImgLoader.display(mContext, bean.getImgurl(), mAvatar02);
|
ImgLoader.display(mContext, bean.getImgurl(), mAvatar02);
|
||||||
if (bean.isShow()) {
|
if (bean.isShow()) {
|
||||||
|
if (isMe) {
|
||||||
|
del.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
mAvatar01.setVisibility(View.GONE);
|
mAvatar01.setVisibility(View.GONE);
|
||||||
mAvatar02.setVisibility(View.VISIBLE);
|
mAvatar02.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
|
del.setVisibility(View.GONE);
|
||||||
mAvatar01.setVisibility(View.VISIBLE);
|
mAvatar01.setVisibility(View.VISIBLE);
|
||||||
mAvatar02.setVisibility(View.GONE);
|
mAvatar02.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
@ -91,5 +104,7 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
public interface onItemClickListener {
|
public interface onItemClickListener {
|
||||||
void onImgItem(UserHomeImgBean activeBean, int position);
|
void onImgItem(UserHomeImgBean activeBean, int position);
|
||||||
|
|
||||||
|
void onImgDel(UserHomeImgBean activeBean, int position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
package com.yunbao.common.bean;
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 社區动态
|
* 社區动态
|
||||||
*/
|
*/
|
||||||
public class CommentBean extends BaseModel {
|
public class CommentBean extends BaseModel implements Parcelable {
|
||||||
private String id;
|
private String id;
|
||||||
private String dynamic_id;
|
private String dynamic_id;
|
||||||
private String uid;
|
private String uid;
|
||||||
@ -17,8 +22,40 @@ public class CommentBean extends BaseModel {
|
|||||||
private String user_name;
|
private String user_name;
|
||||||
private String user_id;
|
private String user_id;
|
||||||
private String user_avatar;
|
private String user_avatar;
|
||||||
|
private boolean mParentNode;//是否是父元素
|
||||||
private List<ReplyComment> child;
|
private List<ReplyComment> child;
|
||||||
|
|
||||||
|
public CommentBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public CommentBean(Parcel in) {
|
||||||
|
id = in.readString();
|
||||||
|
dynamic_id = in.readString();
|
||||||
|
uid = in.readString();
|
||||||
|
to_comment_id = in.readString();
|
||||||
|
content = in.readString();
|
||||||
|
create_time = in.readString();
|
||||||
|
status = in.readString();
|
||||||
|
is_dynamic_user = in.readString();
|
||||||
|
user_name = in.readString();
|
||||||
|
user_id = in.readString();
|
||||||
|
user_avatar = in.readString();
|
||||||
|
mParentNode = in.readByte() != 0;
|
||||||
|
isShow = in.readByte() != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<CommentBean> CREATOR = new Creator<CommentBean>() {
|
||||||
|
@Override
|
||||||
|
public CommentBean createFromParcel(Parcel in) {
|
||||||
|
return new CommentBean(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommentBean[] newArray(int size) {
|
||||||
|
return new CommentBean[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public List<ReplyComment> getChild() {
|
public List<ReplyComment> getChild() {
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
@ -27,6 +64,14 @@ public class CommentBean extends BaseModel {
|
|||||||
this.child = child;
|
this.child = child;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean ismParentNode() {
|
||||||
|
return mParentNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentNode(boolean mParentNode) {
|
||||||
|
this.mParentNode = mParentNode;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isShow;
|
private boolean isShow;
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
@ -133,6 +178,28 @@ public class CommentBean extends BaseModel {
|
|||||||
isShow = show;
|
isShow = show;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||||
|
dest.writeString(id);
|
||||||
|
dest.writeString(dynamic_id);
|
||||||
|
dest.writeString(uid);
|
||||||
|
dest.writeString(to_comment_id);
|
||||||
|
dest.writeString(content);
|
||||||
|
dest.writeString(create_time);
|
||||||
|
dest.writeString(status);
|
||||||
|
dest.writeString(is_dynamic_user);
|
||||||
|
dest.writeString(user_name);
|
||||||
|
dest.writeString(user_id);
|
||||||
|
dest.writeString(user_avatar);
|
||||||
|
dest.writeByte((byte) (mParentNode ? 1 : 0));
|
||||||
|
dest.writeByte((byte) (isShow ? 1 : 0));
|
||||||
|
}
|
||||||
|
|
||||||
public static class ReplyComment {
|
public static class ReplyComment {
|
||||||
private String id;
|
private String id;
|
||||||
private String dynamic_id;
|
private String dynamic_id;
|
||||||
|
@ -4,13 +4,13 @@ import java.util.List;
|
|||||||
|
|
||||||
public class HomeUserExhibitInfoBean extends BaseModel {
|
public class HomeUserExhibitInfoBean extends BaseModel {
|
||||||
public UserHomeTopInfo userHomeTopInfo;
|
public UserHomeTopInfo userHomeTopInfo;
|
||||||
public List<GiftAlreadyWall> giftAlreadyWall;
|
public GiftAlreadyWall giftAlreadyWall;
|
||||||
|
|
||||||
public List<GiftAlreadyWall> getGiftAlreadyWall() {
|
public GiftAlreadyWall getGiftAlreadyWall() {
|
||||||
return giftAlreadyWall;
|
return giftAlreadyWall;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGiftAlreadyWall(List<GiftAlreadyWall> giftAlreadyWall) {
|
public void setGiftAlreadyWall(GiftAlreadyWall giftAlreadyWall) {
|
||||||
this.giftAlreadyWall = giftAlreadyWall;
|
this.giftAlreadyWall = giftAlreadyWall;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,9 +22,26 @@ public class HomeUserExhibitInfoBean extends BaseModel {
|
|||||||
this.userHomeTopInfo = userHomeTopInfo;
|
this.userHomeTopInfo = userHomeTopInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class UserHomeTopInfo {
|
public class UserHomeTopInfo {
|
||||||
Fans fans;
|
public Fans fans;
|
||||||
|
public List<Guard> guard;
|
||||||
|
public List<Dress> dress;
|
||||||
|
|
||||||
|
public List<Guard> getGuard() {
|
||||||
|
return guard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGuard(List<Guard> guard) {
|
||||||
|
this.guard = guard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Dress> getDress() {
|
||||||
|
return dress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDress(List<Dress> dress) {
|
||||||
|
this.dress = dress;
|
||||||
|
}
|
||||||
|
|
||||||
public Fans getFans() {
|
public Fans getFans() {
|
||||||
return fans;
|
return fans;
|
||||||
@ -92,7 +109,6 @@ public class HomeUserExhibitInfoBean extends BaseModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class GiftAlreadyWall {
|
public class GiftAlreadyWall {
|
||||||
private String gift_wall_lighten_number;
|
private String gift_wall_lighten_number;
|
||||||
private String gift_wall_lighten_total;
|
private String gift_wall_lighten_total;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.yunbao.common.bean;
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class HomeUserInfoBean extends BaseModel {
|
public class HomeUserInfoBean extends BaseModel {
|
||||||
@ -45,6 +47,53 @@ public class HomeUserInfoBean extends BaseModel {
|
|||||||
private List<String> cn_label;
|
private List<String> cn_label;
|
||||||
private List<String> en_label;
|
private List<String> en_label;
|
||||||
|
|
||||||
|
private String age;
|
||||||
|
private String height;
|
||||||
|
private String career;
|
||||||
|
private String en_career;
|
||||||
|
|
||||||
|
private String rong_online;
|
||||||
|
|
||||||
|
public String getRong_online() {
|
||||||
|
return rong_online;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRong_online(String rong_online) {
|
||||||
|
this.rong_online = rong_online;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAge() {
|
||||||
|
return age;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAge(String age) {
|
||||||
|
this.age = age;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHeight() {
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeight(String height) {
|
||||||
|
this.height = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCareer() {
|
||||||
|
return career;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCareer(String career) {
|
||||||
|
this.career = career;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEn_career() {
|
||||||
|
return en_career;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEn_career(String en_career) {
|
||||||
|
this.en_career = en_career;
|
||||||
|
}
|
||||||
|
|
||||||
public List<String> getCn_label() {
|
public List<String> getCn_label() {
|
||||||
return cn_label;
|
return cn_label;
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@ import java.util.Locale;
|
|||||||
|
|
||||||
public class CommonHttpUtil {
|
public class CommonHttpUtil {
|
||||||
|
|
||||||
|
public static final String GET_UPLOAD_QI_NIU_TOKEN = "getUploadQiNiuToken";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化
|
* 初始化
|
||||||
@ -506,12 +507,13 @@ public class CommonHttpUtil {
|
|||||||
* @param createAt
|
* @param createAt
|
||||||
* @param callback
|
* @param callback
|
||||||
*/
|
*/
|
||||||
public static void pushCommunity(boolean isImgOrVideo, String content, String talkId, String fileAry, String createAt, HttpCallback callback) {
|
public static void pushCommunity(boolean isImgOrVideo, String content, String talkId, String fileAry, String videoUrl, String createAt, HttpCallback callback) {
|
||||||
HttpClient.getInstance().get("Pdlcommunity.sendDynamic", CommonHttpConsts.GET_USER_BASEINFO)
|
HttpClient.getInstance().post("Pdlcommunity.sendDynamic", CommonHttpConsts.GET_USER_BASEINFO)
|
||||||
.params("img_or_video", isImgOrVideo ? 1 : 2)
|
.params("img_or_video", isImgOrVideo ? 1 : 2)
|
||||||
.params("content", content)
|
.params("content", content)
|
||||||
.params("talk_id", talkId)
|
.params("talk_id", talkId)
|
||||||
.params("file_name_ary", fileAry)
|
.params("file_name_ary", fileAry)
|
||||||
|
.params("video", videoUrl)
|
||||||
.params("created_at", createAt)
|
.params("created_at", createAt)
|
||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
@ -522,31 +524,21 @@ public class CommonHttpUtil {
|
|||||||
* @param callback
|
* @param callback
|
||||||
*/
|
*/
|
||||||
public static void getCommunityHotList(int p, HttpCallback callback) {
|
public static void getCommunityHotList(int p, HttpCallback callback) {
|
||||||
HttpClient.getInstance().get("Pdlcommunity.getFindDynamicList", "Pdlcommunity.getFindDynamicList")
|
HttpClient.getInstance().get("Pdlcommunity.getHotDynamicList", "Pdlcommunity.getHotDynamicList")
|
||||||
.params("p", p)
|
.params("p", p)
|
||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取动态列表-热门
|
|
||||||
*
|
|
||||||
* @param callback
|
|
||||||
*/
|
|
||||||
public static void getCommunityDetails(String dynamic_id, HttpCallback callback) {
|
|
||||||
HttpClient.getInstance().get("Pdlcommunity.getDynamicInfo", "Pdlcommunity.getDynamicInfo")
|
|
||||||
.params("dynamic_id", dynamic_id)
|
|
||||||
.execute(callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取动态列表-评论
|
* 获取动态列表-评论
|
||||||
*
|
*
|
||||||
* @param callback
|
* @param callback
|
||||||
*/
|
*/
|
||||||
public static void getCommunityComment(String dynamic_id, String dynamic_uid, HttpCallback callback) {
|
public static void getCommunityComment(String dynamic_id, String dynamic_uid, int p, HttpCallback callback) {
|
||||||
HttpClient.getInstance().get("Pdlcommunity.getDynamicCommentList", "Pdlcommunity.getDynamicCommentList")
|
HttpClient.getInstance().get("Pdlcommunity.getDynamicCommentList", "Pdlcommunity.getDynamicCommentList")
|
||||||
.params("dynamic_id", dynamic_id)
|
.params("dynamic_id", dynamic_id)
|
||||||
.params("dynamic_uid", dynamic_uid)
|
.params("dynamic_uid", dynamic_uid)
|
||||||
|
.params("p", p)
|
||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -587,7 +579,7 @@ public class CommonHttpUtil {
|
|||||||
* 获取动态-关注
|
* 获取动态-关注
|
||||||
*/
|
*/
|
||||||
public static void getCommunityFollow(int p, HttpCallback callback) {
|
public static void getCommunityFollow(int p, HttpCallback callback) {
|
||||||
HttpClient.getInstance().get("Pdlcommunity.getFindDynamicList", "Pdlcommunity.getFindDynamicList")
|
HttpClient.getInstance().get("Pdlcommunity.getAttentionDynamicList", "Pdlcommunity.getAttentionDynamicList")
|
||||||
.params("p", p)
|
.params("p", p)
|
||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
@ -596,7 +588,7 @@ public class CommonHttpUtil {
|
|||||||
* 获取动态-分类
|
* 获取动态-分类
|
||||||
*/
|
*/
|
||||||
public static void getTag(HttpCallback callback) {
|
public static void getTag(HttpCallback callback) {
|
||||||
HttpClient.getInstance().get("Pdlcommunity.getTalkBanner", "Pdlcommunity.getTalkBanner")
|
HttpClient.getInstance().get("Pdlcommunity.getHotTalk", "Pdlcommunity.getHotTalk")
|
||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -640,7 +632,25 @@ public class CommonHttpUtil {
|
|||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传文件 获取七牛云token的接口
|
||||||
|
*/
|
||||||
|
public static void getUploadQiNiuToken(HttpCallback callback, boolean isImg) {
|
||||||
|
HttpClient.getInstance().get("Pdluserhome.getQiNiuToken", "Pdluserhome.getQiNiuToken")
|
||||||
|
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||||
|
.params("token", CommonAppConfig.getInstance().getToken())
|
||||||
|
.params("ext", isImg ? ".jpeg" : ".mp4")
|
||||||
|
.execute(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户背景墙
|
||||||
|
*/
|
||||||
|
public static void uploadUserInfoImg(String imgs, HttpCallback callback) {
|
||||||
|
HttpClient.getInstance().post("Pdluserhome.saveUserHomeBanner", "Userhome.saveUserHomeBanner")
|
||||||
|
.params("home_banner_url_ary", imgs)
|
||||||
|
.execute(callback);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.yunbao.common.http;
|
package com.yunbao.common.http;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
import com.yunbao.common.bean.ActiveModel;
|
import com.yunbao.common.bean.ActiveModel;
|
||||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||||
@ -210,6 +211,7 @@ public interface PDLiveApi {
|
|||||||
/**
|
/**
|
||||||
* 获取直播间信息
|
* 获取直播间信息
|
||||||
*
|
*
|
||||||
|
* @param liveui 主播id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Live.getLiveInfo")
|
@GET("/api/public/?service=Live.getLiveInfo")
|
||||||
@ -1194,6 +1196,7 @@ public interface PDLiveApi {
|
|||||||
@GET("/api/public/?service=Userhome.getUserHomeBanner")
|
@GET("/api/public/?service=Userhome.getUserHomeBanner")
|
||||||
Observable<ResponseModel<List<String>>> getUserHomeBanner(@Query("select_uid") String tuid);
|
Observable<ResponseModel<List<String>>> getUserHomeBanner(@Query("select_uid") String tuid);
|
||||||
|
|
||||||
|
|
||||||
@GET("/api/public/?service=Pdlinfos.getIsAnchor")
|
@GET("/api/public/?service=Pdlinfos.getIsAnchor")
|
||||||
Observable<ResponseModel<MessageChatIsAnchor>> getIsAnchor();
|
Observable<ResponseModel<MessageChatIsAnchor>> getIsAnchor();
|
||||||
|
|
||||||
@ -1267,4 +1270,7 @@ public interface PDLiveApi {
|
|||||||
@GET("/api/public/?service=Pdluserhome.getUserHomeInfo")
|
@GET("/api/public/?service=Pdluserhome.getUserHomeInfo")
|
||||||
Observable<ResponseModel<HomeUserExhibitInfoBean>> getUserHomeExhibitInfo(@Query("select_uid") String tuid);
|
Observable<ResponseModel<HomeUserExhibitInfoBean>> getUserHomeExhibitInfo(@Query("select_uid") String tuid);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=Pdlcommunity.getDynamicInfo")
|
||||||
|
Observable<ResponseModel<ActiveBean>> getDynamicInfo(@Query("dynamic_id") String dynamic_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
import com.yunbao.common.bean.ActiveModel;
|
import com.yunbao.common.bean.ActiveModel;
|
||||||
import com.yunbao.common.bean.AvatarBean;
|
import com.yunbao.common.bean.AvatarBean;
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
@ -3382,6 +3383,29 @@ public class LiveNetManager {
|
|||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void getDynamicInfo(String dynamic_id, HttpCallback<ActiveBean> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getDynamicInfo(dynamic_id)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<ActiveBean>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<ActiveBean> messageUserInfoBeanResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(messageUserInfoBeanResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
throwable.printStackTrace();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
private MultipartBody.Part createUploadFile(File file) {
|
private MultipartBody.Part createUploadFile(File file) {
|
||||||
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||||
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
||||||
|
@ -4,9 +4,7 @@ import android.content.Context;
|
|||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.yunbao.common.bean.FansModel;
|
|
||||||
import com.yunbao.common.bean.NewCommunityType;
|
import com.yunbao.common.bean.NewCommunityType;
|
||||||
import com.yunbao.common.bean.NewLevelModel;
|
|
||||||
import com.yunbao.common.manager.base.BaseCacheManager;
|
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -30,7 +28,7 @@ public class CommunityTypeManager extends BaseCacheManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void UpCommunityType(String json) {
|
public void UpCommunityType(String json) {
|
||||||
newCommunityTypeList = new Gson().fromJson(json, new TypeToken<List<NewLevelModel>>() {
|
newCommunityTypeList = new Gson().fromJson(json, new TypeToken<List<NewCommunityType>>() {
|
||||||
}.getType());
|
}.getType());
|
||||||
put(KEY_COMMUNITY_TYPE, newCommunityTypeList);
|
put(KEY_COMMUNITY_TYPE, newCommunityTypeList);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,92 @@
|
|||||||
|
package com.yunbao.common.upload;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cxf on 2019/4/16.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class UploadBean {
|
||||||
|
|
||||||
|
public static final int IMG = 0;
|
||||||
|
public static final int VIDEO = 1;
|
||||||
|
public static final int VOICE = 2;
|
||||||
|
private File mOriginFile;//要被上传的源文件
|
||||||
|
private File mCompressFile;//压缩后的图片文件
|
||||||
|
private String mRemoteFileName;//上传成功后在云存储上的文件名字
|
||||||
|
private String mRemoteAccessUrl;//上传成功后在云存储上的访问地址
|
||||||
|
private boolean mSuccess;//是否上传成功了
|
||||||
|
private int mType;
|
||||||
|
private Object mTag;
|
||||||
|
|
||||||
|
public UploadBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public UploadBean(File originFile, int type) {
|
||||||
|
mOriginFile = originFile;
|
||||||
|
mType = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File getOriginFile() {
|
||||||
|
return mOriginFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginFile(File originFile) {
|
||||||
|
mOriginFile = originFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemoteFileName() {
|
||||||
|
return mRemoteFileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemoteFileName(String remoteFileName) {
|
||||||
|
mRemoteFileName = remoteFileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemoteAccessUrl() {
|
||||||
|
return mRemoteAccessUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemoteAccessUrl(String remoteAccessUrl) {
|
||||||
|
mRemoteAccessUrl = remoteAccessUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File getCompressFile() {
|
||||||
|
return mCompressFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompressFile(File compressFile) {
|
||||||
|
mCompressFile = compressFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSuccess() {
|
||||||
|
return mSuccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuccess(boolean success) {
|
||||||
|
mSuccess = success;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setEmpty() {
|
||||||
|
mOriginFile = null;
|
||||||
|
mRemoteFileName = null;
|
||||||
|
mRemoteAccessUrl = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return mOriginFile == null && mRemoteFileName == null && mRemoteAccessUrl == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return mType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getTag() {
|
||||||
|
return mTag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTag(Object tag) {
|
||||||
|
mTag = tag;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.yunbao.common.upload;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cxf on 2019/4/16.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface UploadCallback {
|
||||||
|
void onFinish(List<UploadBean> list, boolean success);
|
||||||
|
}
|
215
common/src/main/java/com/yunbao/common/upload/UploadQnImpl.java
Normal file
@ -0,0 +1,215 @@
|
|||||||
|
package com.yunbao.common.upload;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.qiniu.android.common.ServiceAddress;
|
||||||
|
import com.qiniu.android.common.Zone;
|
||||||
|
import com.qiniu.android.http.ResponseInfo;
|
||||||
|
import com.qiniu.android.storage.Configuration;
|
||||||
|
import com.qiniu.android.storage.UpCompletionHandler;
|
||||||
|
import com.qiniu.android.storage.UploadManager;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
import com.yunbao.common.utils.L;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import top.zibin.luban.Luban;
|
||||||
|
import top.zibin.luban.OnCompressListener;
|
||||||
|
import top.zibin.luban.OnRenameListener;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cxf on 2019/4/16.
|
||||||
|
* 七牛上传文件
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class UploadQnImpl implements UploadStrategy {
|
||||||
|
|
||||||
|
private static final String TAG = "UploadQnImpl";
|
||||||
|
private Context mContext;
|
||||||
|
private List<UploadBean> mList;
|
||||||
|
private int mIndex;
|
||||||
|
private boolean mNeedCompress;
|
||||||
|
private UploadCallback mUploadCallback;
|
||||||
|
private HttpCallback mGetUploadTokenCallback;
|
||||||
|
private String mToken;
|
||||||
|
private UploadManager mUploadManager;
|
||||||
|
private UpCompletionHandler mCompletionHandler;//上传回调
|
||||||
|
private Luban.Builder mLubanBuilder;
|
||||||
|
|
||||||
|
public UploadQnImpl(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
mCompletionHandler = new UpCompletionHandler() {
|
||||||
|
@Override
|
||||||
|
public void complete(String key, ResponseInfo info, JSONObject response) {
|
||||||
|
L.e("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null));
|
||||||
|
try {
|
||||||
|
assert response != null;
|
||||||
|
mList.get(mIndex).setRemoteAccessUrl(response.getString("key"));
|
||||||
|
} catch (JSONException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
if (mList == null || mList.size() == 0) {
|
||||||
|
if (mUploadCallback != null) {
|
||||||
|
mUploadCallback.onFinish(mList, false);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
UploadBean uploadBean = mList.get(mIndex);
|
||||||
|
if (info.isOK()) {
|
||||||
|
uploadBean.setSuccess(true);
|
||||||
|
if (uploadBean.getType() == UploadBean.IMG && mNeedCompress) {
|
||||||
|
//上传完成后把 压缩后的图片 删掉
|
||||||
|
File compressedFile = uploadBean.getCompressFile();
|
||||||
|
if (compressedFile != null && compressedFile.exists()) {
|
||||||
|
File originFile = uploadBean.getOriginFile();
|
||||||
|
if (originFile != null && !compressedFile.getAbsolutePath().equals(originFile.getAbsolutePath())) {
|
||||||
|
compressedFile.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mIndex++;
|
||||||
|
if (mIndex < mList.size()) {
|
||||||
|
uploadNext();
|
||||||
|
} else {
|
||||||
|
if (mUploadCallback != null) {
|
||||||
|
mUploadCallback.onFinish(mList, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
upload(mList.get(mIndex));//上传失败后 重新上传
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void upload(List<UploadBean> list, boolean needCompress, UploadCallback callback, boolean isImg) {
|
||||||
|
if (callback == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (list == null || list.size() == 0) {
|
||||||
|
callback.onFinish(list, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
boolean hasFile = false;
|
||||||
|
for (UploadBean bean : list) {
|
||||||
|
if (bean.getOriginFile() != null) {
|
||||||
|
hasFile = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!hasFile) {
|
||||||
|
callback.onFinish(list, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mList = list;
|
||||||
|
mNeedCompress = needCompress;
|
||||||
|
mUploadCallback = callback;
|
||||||
|
mIndex = 0;
|
||||||
|
|
||||||
|
if (mGetUploadTokenCallback == null) {
|
||||||
|
mGetUploadTokenCallback = new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0 && info.length > 0) {
|
||||||
|
mToken = info[0];
|
||||||
|
L.e(TAG, "-------上传的token------>" + mToken);
|
||||||
|
uploadNext();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
CommonHttpUtil.getUploadQiNiuToken(mGetUploadTokenCallback, isImg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cancelUpload() {
|
||||||
|
CommonHttpUtil.cancel(CommonHttpUtil.GET_UPLOAD_QI_NIU_TOKEN);
|
||||||
|
if (mList != null) {
|
||||||
|
mList.clear();
|
||||||
|
}
|
||||||
|
mUploadCallback = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void uploadNext() {
|
||||||
|
UploadBean bean = null;
|
||||||
|
while (mIndex < mList.size() && (bean = mList.get(mIndex)).getOriginFile() == null) {
|
||||||
|
mIndex++;
|
||||||
|
}
|
||||||
|
if (mIndex >= mList.size()) {
|
||||||
|
if (mUploadCallback != null) {
|
||||||
|
mUploadCallback.onFinish(mList, true);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (bean.getType() == UploadBean.IMG) {
|
||||||
|
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".jpg"));
|
||||||
|
} else if (bean.getType() == UploadBean.VIDEO) {
|
||||||
|
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".mp4"));
|
||||||
|
} else if (bean.getType() == UploadBean.VOICE) {
|
||||||
|
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".m4a"));
|
||||||
|
}
|
||||||
|
if (bean.getType() == UploadBean.IMG && mNeedCompress) {
|
||||||
|
if (mLubanBuilder == null) {
|
||||||
|
mLubanBuilder = Luban.with(mContext).ignoreBy(8)//8k以下不压缩
|
||||||
|
.setTargetDir(CommonAppConfig.INNER_PATH).setRenameListener(new OnRenameListener() {
|
||||||
|
@Override
|
||||||
|
public String rename(String filePath) {
|
||||||
|
return mList.get(mIndex).getRemoteFileName();
|
||||||
|
}
|
||||||
|
}).setCompressListener(new OnCompressListener() {
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(File file) {
|
||||||
|
UploadBean uploadBean = mList.get(mIndex);
|
||||||
|
uploadBean.setCompressFile(file);
|
||||||
|
upload(uploadBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
upload(mList.get(mIndex));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
mLubanBuilder.load(bean.getOriginFile()).launch();
|
||||||
|
} else {
|
||||||
|
upload(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void upload(UploadBean bean) {
|
||||||
|
if (bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null) {
|
||||||
|
if (mUploadManager == null) {
|
||||||
|
Zone zone = new Zone(new ServiceAddress("http://upload-z0.qiniup.com"), new ServiceAddress("http://up-z0.qiniup.com"));
|
||||||
|
Configuration configuration = new Configuration.Builder().zone(zone).build();
|
||||||
|
mUploadManager = new UploadManager(configuration);
|
||||||
|
}
|
||||||
|
File uploadFile = bean.getOriginFile();
|
||||||
|
if (bean.getType() == UploadBean.IMG && mNeedCompress) {
|
||||||
|
File compressedFile = bean.getCompressFile();
|
||||||
|
if (compressedFile != null && compressedFile.exists()) {
|
||||||
|
uploadFile = compressedFile;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mUploadManager.put(uploadFile, bean.getRemoteFileName(), mToken, mCompletionHandler, null);
|
||||||
|
} else {
|
||||||
|
if (mUploadCallback != null) {
|
||||||
|
mUploadCallback.onFinish(mList, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.yunbao.common.upload;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cxf on 2019/4/16.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface UploadStrategy {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行上传
|
||||||
|
*
|
||||||
|
* @param list 被上传的文件列表
|
||||||
|
* @param needCompress 是否需要压缩
|
||||||
|
* @param callback 上传回调
|
||||||
|
*/
|
||||||
|
void upload(List<UploadBean> list, boolean needCompress, UploadCallback callback,boolean isImg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消上传
|
||||||
|
*/
|
||||||
|
void cancelUpload();
|
||||||
|
}
|
@ -24,6 +24,7 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
|
|||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
private View.OnClickListener mOnClickListener;
|
private View.OnClickListener mOnClickListener;
|
||||||
private View.OnClickListener mODelListener;
|
private View.OnClickListener mODelListener;
|
||||||
|
private View.OnClickListener onAddClick;
|
||||||
private ActionListener mActionListener;
|
private ActionListener mActionListener;
|
||||||
|
|
||||||
public ActiveImageAdapter(Context context) {
|
public ActiveImageAdapter(Context context) {
|
||||||
@ -70,6 +71,14 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
onAddClick = new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (mActionListener != null) {
|
||||||
|
mActionListener.onAddClick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActionListener(ActionListener actionListener) {
|
public void setActionListener(ActionListener actionListener) {
|
||||||
@ -174,6 +183,7 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
|
|||||||
del = itemView.findViewById(R.id.del);
|
del = itemView.findViewById(R.id.del);
|
||||||
itemView.setOnClickListener(mOnClickListener);
|
itemView.setOnClickListener(mOnClickListener);
|
||||||
del.setOnClickListener(mODelListener);
|
del.setOnClickListener(mODelListener);
|
||||||
|
mIconAdd.setOnClickListener(onAddClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setData(ActiveImageBean bean, int position) {
|
void setData(ActiveImageBean bean, int position) {
|
||||||
@ -183,15 +193,15 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
|
|||||||
if (mIconAdd.getVisibility() != View.VISIBLE) {
|
if (mIconAdd.getVisibility() != View.VISIBLE) {
|
||||||
mIconAdd.setVisibility(View.VISIBLE);
|
mIconAdd.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
if (del.getVisibility() != View.VISIBLE) {
|
if (del.getVisibility() != View.GONE) {
|
||||||
del.setVisibility(View.VISIBLE);
|
del.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mIconAdd.getVisibility() == View.VISIBLE) {
|
if (mIconAdd.getVisibility() == View.VISIBLE) {
|
||||||
mIconAdd.setVisibility(View.INVISIBLE);
|
mIconAdd.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
if (del.getVisibility() == View.VISIBLE) {
|
if (del.getVisibility() == View.GONE) {
|
||||||
del.setVisibility(View.GONE);
|
del.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
ImgLoader.display(mContext, bean.getImageFile(), mImg);
|
ImgLoader.display(mContext, bean.getImageFile(), mImg);
|
||||||
}
|
}
|
||||||
@ -201,8 +211,11 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
public interface ActionListener {
|
public interface ActionListener {
|
||||||
void onAddClick();
|
void onAddClick();
|
||||||
|
|
||||||
void onItemClick(int position);
|
void onItemClick(int position);
|
||||||
|
|
||||||
void onDeleteAll();
|
void onDeleteAll();
|
||||||
|
|
||||||
void onDel(int position);
|
void onDel(int position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,12 +36,11 @@ public class DateFormatUtil {
|
|||||||
|
|
||||||
public static String getTimeStrings(long time) {
|
public static String getTimeStrings(long time) {
|
||||||
Date date = new Date(time); // 创建Date对象并传入时间戳参数
|
Date date = new Date(time); // 创建Date对象并传入时间戳参数
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); // 设置日期格式
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 设置日期格式
|
||||||
String formattedDate = sdf.format(date); // 格式化日期字符串
|
String formattedDate = sdf.format(date); // 格式化日期字符串
|
||||||
return formattedDate;
|
return formattedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String getVideoCurTimeString() {
|
public static String getVideoCurTimeString() {
|
||||||
return sFormat2.format(new Date());
|
return sFormat2.format(new Date());
|
||||||
}
|
}
|
||||||
|
368
common/src/main/java/com/yunbao/common/utils/FilesUtils.java
Normal file
@ -0,0 +1,368 @@
|
|||||||
|
package com.yunbao.common.utils;
|
||||||
|
|
||||||
|
import android.content.ContentUris;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.media.MediaMetadataRetriever;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.provider.DocumentsContract;
|
||||||
|
import android.provider.MediaStore;
|
||||||
|
import android.provider.OpenableColumns;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import java.io.BufferedOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
public class FilesUtils {
|
||||||
|
|
||||||
|
public final static String FILE_TAG = "/rich_editor";
|
||||||
|
public static final String DOCUMENTS_DIR = "documents";
|
||||||
|
|
||||||
|
public static String getPath(final Context context, final Uri uri) {
|
||||||
|
// DocumentProvider
|
||||||
|
if (hasKitKat() && DocumentsContract.isDocumentUri(context, uri)) {
|
||||||
|
// ExternalStorageProvider
|
||||||
|
if (isExternalStorageDocument(uri)) {
|
||||||
|
final String docId = DocumentsContract.getDocumentId(uri);
|
||||||
|
final String[] split = docId.split(":");
|
||||||
|
final String type = split[0];
|
||||||
|
|
||||||
|
if ("primary".equalsIgnoreCase(type)) {
|
||||||
|
return Environment.getExternalStorageDirectory() + "/" + split[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO handle non-primary volumes
|
||||||
|
} else if (isDownloadsDocument(uri)) { // DownloadsProvider
|
||||||
|
final String id = DocumentsContract.getDocumentId(uri);
|
||||||
|
if (id != null && id.startsWith("raw:")) {
|
||||||
|
return id.substring(4);
|
||||||
|
}
|
||||||
|
String[] contentUriPrefixesToTry = new String[]{
|
||||||
|
"content://downloads/public_downloads",
|
||||||
|
"content://downloads/my_downloads"
|
||||||
|
};
|
||||||
|
for (String contentUriPrefix : contentUriPrefixesToTry) {
|
||||||
|
Uri contentUri = ContentUris.withAppendedId(Uri.parse(contentUriPrefix), Long.valueOf(id));
|
||||||
|
try {
|
||||||
|
String path = getDataColumn(context, contentUri, null, null);
|
||||||
|
if (path != null && !path.equals("")) {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// path could not be retrieved using ContentResolver, therefore copy file to accessible cache using streams
|
||||||
|
String fileName = getFileName(context, uri);
|
||||||
|
File cacheDir = getDocumentCacheDir(context);
|
||||||
|
File file = generateFileNamePlus(fileName, cacheDir);
|
||||||
|
String destinationPath = null;
|
||||||
|
if (file != null) {
|
||||||
|
destinationPath = file.getAbsolutePath();
|
||||||
|
saveFileFromUri(context, uri, destinationPath);
|
||||||
|
}
|
||||||
|
return destinationPath;
|
||||||
|
} else if (isMediaDocument(uri)) { // MediaProvider
|
||||||
|
final String docId = DocumentsContract.getDocumentId(uri);
|
||||||
|
final String[] split = docId.split(":");
|
||||||
|
final String type = split[0];
|
||||||
|
|
||||||
|
Uri contentUri = null;
|
||||||
|
if ("image".equals(type)) {
|
||||||
|
contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
|
||||||
|
} else if ("video".equals(type)) {
|
||||||
|
contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
|
||||||
|
} else if ("audio".equals(type)) {
|
||||||
|
contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
|
||||||
|
} else {
|
||||||
|
//其它类型
|
||||||
|
contentUri = MediaStore.Files.getContentUri("external");
|
||||||
|
}
|
||||||
|
|
||||||
|
final String selection = "_id=?";
|
||||||
|
final String[] selectionArgs = new String[]{
|
||||||
|
split[1]
|
||||||
|
};
|
||||||
|
|
||||||
|
return getDataColumn(context, contentUri, selection, selectionArgs);
|
||||||
|
}
|
||||||
|
} else if ("content".equalsIgnoreCase(uri.getScheme())) { // MediaStore (and general)
|
||||||
|
return getDataColumn(context, uri, null, null);
|
||||||
|
} else if ("file".equalsIgnoreCase(uri.getScheme())) { // File
|
||||||
|
return uri.getPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public static File generateFileNamePlus(@Nullable String name, File directory) {
|
||||||
|
if (name == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
File file = new File(directory, name);
|
||||||
|
|
||||||
|
if (file.exists()) {
|
||||||
|
String fileName = name;
|
||||||
|
String extension = "";
|
||||||
|
int dotIndex = name.lastIndexOf('.');
|
||||||
|
if (dotIndex > 0) {
|
||||||
|
fileName = name.substring(0, dotIndex);
|
||||||
|
extension = name.substring(dotIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
while (file.exists()) {
|
||||||
|
index++;
|
||||||
|
name = fileName + '(' + index + ')' + extension;
|
||||||
|
file = new File(directory, name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (!file.createNewFile()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String getFileName(@NonNull Context context, Uri uri) {
|
||||||
|
String mimeType = context.getContentResolver().getType(uri);
|
||||||
|
String filename = null;
|
||||||
|
|
||||||
|
if (mimeType == null && context != null) {
|
||||||
|
String path = getPath(context, uri);
|
||||||
|
if (path == null) {
|
||||||
|
filename = getName(uri.toString());
|
||||||
|
} else {
|
||||||
|
File file = new File(path);
|
||||||
|
filename = file.getName();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Cursor returnCursor = context.getContentResolver().query(uri, null,
|
||||||
|
null, null, null);
|
||||||
|
if (returnCursor != null) {
|
||||||
|
int nameIndex = returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
|
||||||
|
returnCursor.moveToFirst();
|
||||||
|
filename = returnCursor.getString(nameIndex);
|
||||||
|
returnCursor.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getName(String filename) {
|
||||||
|
if (filename == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
int index = filename.lastIndexOf('/');
|
||||||
|
return filename.substring(index + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static File getDocumentCacheDir(@NonNull Context context) {
|
||||||
|
File dir = new File(context.getCacheDir(), DOCUMENTS_DIR);
|
||||||
|
if (!dir.exists()) {
|
||||||
|
dir.mkdirs();
|
||||||
|
}
|
||||||
|
|
||||||
|
return dir;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static void saveFileFromUri(Context context, Uri uri, String destinationPath) {
|
||||||
|
InputStream is = null;
|
||||||
|
BufferedOutputStream bos = null;
|
||||||
|
try {
|
||||||
|
is = context.getContentResolver().openInputStream(uri);
|
||||||
|
bos = new BufferedOutputStream(new FileOutputStream(destinationPath, false));
|
||||||
|
byte[] buf = new byte[1024];
|
||||||
|
is.read(buf);
|
||||||
|
do {
|
||||||
|
bos.write(buf);
|
||||||
|
} while (is.read(buf) != -1);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (is != null) is.close();
|
||||||
|
if (bos != null) bos.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of the data column for this Uri. This is useful for
|
||||||
|
* MediaStore Uris, and other file-based ContentProviders.
|
||||||
|
*
|
||||||
|
* @param context The context.
|
||||||
|
* @param uri The Uri to query.
|
||||||
|
* @param selection (Optional) Filter used in the query.
|
||||||
|
* @param selectionArgs (Optional) Selection arguments used in the query.
|
||||||
|
* @return The value of the _data column, which is typically a file path.
|
||||||
|
*/
|
||||||
|
public static String getDataColumn(Context context, Uri uri, String selection,
|
||||||
|
String[] selectionArgs) {
|
||||||
|
|
||||||
|
Cursor cursor = null;
|
||||||
|
final String column = "_data";
|
||||||
|
final String[] projection = {
|
||||||
|
column
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null);
|
||||||
|
if (cursor != null && cursor.moveToFirst()) {
|
||||||
|
final int columnIndex = cursor.getColumnIndexOrThrow(column);
|
||||||
|
return cursor.getString(columnIndex);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
if (cursor != null) {
|
||||||
|
cursor.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param uri The Uri to check.
|
||||||
|
* @return Whether the Uri authority is ExternalStorageProvider.
|
||||||
|
*/
|
||||||
|
public static boolean isExternalStorageDocument(Uri uri) {
|
||||||
|
return "com.android.externalstorage.documents".equals(uri.getAuthority());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param uri The Uri to check.
|
||||||
|
* @return Whether the Uri authority is DownloadsProvider.
|
||||||
|
*/
|
||||||
|
public static boolean isDownloadsDocument(Uri uri) {
|
||||||
|
return "com.android.providers.downloads.documents".equals(uri.getAuthority());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param uri The Uri to check.
|
||||||
|
* @return Whether the Uri authority is MediaProvider.
|
||||||
|
*/
|
||||||
|
public static boolean isMediaDocument(Uri uri) {
|
||||||
|
return "com.android.providers.media.documents".equals(uri.getAuthority());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean hasICS() {
|
||||||
|
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean hasKitKat() {
|
||||||
|
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final String IN_PATH = "/rich_editor/pic/";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 随机生产文件名
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static String generateFileName() {
|
||||||
|
return "poster" + System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void clearLocalRichEditorCache() {
|
||||||
|
File file = new File(Environment.getExternalStorageDirectory().getPath() + FILE_TAG);
|
||||||
|
deleteDirectory(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String saveBitmap(Bitmap bmp) {
|
||||||
|
String parent = Environment.getExternalStorageDirectory().getPath() + FILE_TAG;
|
||||||
|
File parentF = new File(parent);
|
||||||
|
File f = new File(parent, generateFileName() + ".png");
|
||||||
|
if (!parentF.exists()) {
|
||||||
|
parentF.mkdirs();
|
||||||
|
}
|
||||||
|
if (f.exists()) {
|
||||||
|
f.delete();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
FileOutputStream out = new FileOutputStream(f);
|
||||||
|
bmp.compress(Bitmap.CompressFormat.PNG, 90, out);
|
||||||
|
out.flush();
|
||||||
|
out.close();
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return f.getAbsolutePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取视频缩略图
|
||||||
|
*
|
||||||
|
* @param filePath
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Bitmap getVideoThumbnail(String filePath) {
|
||||||
|
Bitmap frameAtTime = null;
|
||||||
|
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
||||||
|
try {
|
||||||
|
retriever.setDataSource(filePath);
|
||||||
|
frameAtTime = retriever.getFrameAtTime();
|
||||||
|
return frameAtTime;
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
retriever.release();
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return frameAtTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static void deleteDirectory(File file) {
|
||||||
|
if (file == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (file.isFile()) {
|
||||||
|
file.delete();
|
||||||
|
} else {
|
||||||
|
String[] childFilePaths = file.list();
|
||||||
|
if (childFilePaths == null || childFilePaths.length == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (String childFilePath : childFilePaths) {
|
||||||
|
File childFile = new File(file.getAbsolutePath() + "/" + childFilePath);
|
||||||
|
deleteDirectory(childFile);
|
||||||
|
}
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -50,6 +50,24 @@ public class RouteUtil {
|
|||||||
public static final String PATH_BattlePassActivity = "/main/BattlePassActivity";
|
public static final String PATH_BattlePassActivity = "/main/BattlePassActivity";
|
||||||
public static final String PATH_SudGameActivity = "/live/SudGameActivity";
|
public static final String PATH_SudGameActivity = "/live/SudGameActivity";
|
||||||
public static final String PATH_COMMUNITY_Activity = "/main/MainHomeCommunityActivity";
|
public static final String PATH_COMMUNITY_Activity = "/main/MainHomeCommunityActivity";
|
||||||
|
public static final String PATH_VIDEO_ACTIVITY = "/activity/VideoPlayActivity";
|
||||||
|
public static final String PATH_COMMUNITY = "/common/CommunityDetailsActivity";
|
||||||
|
public static final String PATH_USER_HOME = "/common/UserHomeActivity";
|
||||||
|
|
||||||
|
public static void forwardUserHome(String uid) {
|
||||||
|
ARouter.getInstance().build(PATH_USER_HOME)
|
||||||
|
.withString(Constants.TO_UID, uid)
|
||||||
|
.navigation();
|
||||||
|
}
|
||||||
|
public static void forwardCommunity(String id) {
|
||||||
|
ARouter.getInstance().build(PATH_COMMUNITY)
|
||||||
|
.withString(Constants.TO_COMMUNITY_ID, id)
|
||||||
|
.navigation();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void forwardVideoActivity() {
|
||||||
|
|
||||||
|
}
|
||||||
public static final String PATH_ADDRESSBOOK = "/main/MsgAddressBookActivity";
|
public static final String PATH_ADDRESSBOOK = "/main/MsgAddressBookActivity";
|
||||||
|
|
||||||
|
|
||||||
|
@ -160,4 +160,16 @@ public class StringUtil {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取随机文件名
|
||||||
|
*/
|
||||||
|
public static String generateFileName() {
|
||||||
|
return contact("android_",
|
||||||
|
CommonAppConfig.getInstance().getUid(),
|
||||||
|
"_",
|
||||||
|
DateFormatUtil.getVideoCurTimeString(),
|
||||||
|
String.valueOf(sRandom.nextInt(9999)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
8
common/src/main/res/drawable/bg_live_1.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/white" />
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="#EB6FFF" />
|
||||||
|
<corners android:radius="90dp" />
|
||||||
|
</shape>
|
8
common/src/main/res/drawable/bg_user_home_gift.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<gradient
|
||||||
|
android:angle="90"
|
||||||
|
android:endColor="#f9f7ff"
|
||||||
|
android:startColor="#e5ecff" />
|
||||||
|
<corners android:radius="6dp" />
|
||||||
|
</shape>
|
8
common/src/main/res/drawable/bg_user_home_img.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/white" />
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="@color/white" />
|
||||||
|
<corners android:radius="15dp" />
|
||||||
|
</shape>
|
10
common/src/main/res/drawable/bg_user_stauts.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="90dp"
|
||||||
|
android:bottomRightRadius="90dp"
|
||||||
|
android:topLeftRadius="90dp"
|
||||||
|
android:topRightRadius="90dp" />
|
||||||
|
|
||||||
|
<solid android:color="#15151D" />
|
||||||
|
</shape>
|
11
common/src/main/res/drawable/bg_video_flow_tag.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="8dp" />
|
||||||
|
<solid android:color="@color/transparent" />
|
||||||
|
<stroke android:width="1dp" android:color="#FF88BA" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</selector>
|
@ -105,18 +105,19 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
app:ngl_corner_radius="5dp"
|
app:ngl_corner_radius="5dp"
|
||||||
app:ngl_divider_width="6dp"
|
app:ngl_divider_width="6dp"
|
||||||
app:ngl_space="30dp" />
|
app:ngl_space="50dp" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/videoLayout"
|
android:id="@+id/videoLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="200dp"
|
||||||
android:layout_height="400dp"
|
android:layout_height="200dp"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/videoImage"
|
android:id="@+id/videoImage"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="400dp" />
|
android:layout_height="200dp"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="15dp"
|
android:layout_marginLeft="15dp"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp"
|
||||||
android:visibility="visible">
|
android:visibility="gone">
|
||||||
|
|
||||||
<VideoView
|
<VideoView
|
||||||
android:id="@+id/videoView"
|
android:id="@+id/videoView"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/itemLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/transparent"
|
android:background="@color/transparent"
|
||||||
@ -67,19 +68,20 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
app:ngl_corner_radius="5dp"
|
app:ngl_corner_radius="5dp"
|
||||||
app:ngl_divider_width="6dp"
|
app:ngl_divider_width="6dp"
|
||||||
app:ngl_space="30dp" />
|
app:ngl_space="90dp" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/videoLayout"
|
android:id="@+id/videoLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="200dp"
|
||||||
android:layout_height="400dp"
|
android:layout_height="200dp"
|
||||||
android:layout_marginLeft="50dp"
|
android:layout_marginLeft="50dp"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/videoImage"
|
android:id="@+id/videoImage"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="400dp" />
|
android:layout_height="200dp"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<com.yunbao.common.views.MyScrollview xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@mipmap/main_bg"
|
android:background="@mipmap/main_bg"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.yunbao.common.views.MyScrollview
|
||||||
|
android:id="@+id/scrollView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
@ -27,6 +32,7 @@
|
|||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
android:id="@+id/topImgLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="380dp"
|
android:layout_height="380dp"
|
||||||
android:background="@color/gray1">
|
android:background="@color/gray1">
|
||||||
@ -35,17 +41,45 @@
|
|||||||
android:id="@+id/banner"
|
android:id="@+id/banner"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop" />
|
||||||
android:src="@mipmap/temp" />
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginBottom="35dp"
|
||||||
|
android:gravity="bottom"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/imgsRecyclerView"
|
android:id="@+id/imgsRecyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="65dp"
|
android:layout_height="65dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_weight="1"
|
||||||
android:layout_marginBottom="35dp"
|
|
||||||
android:paddingStart="10dp" />
|
android:paddingStart="10dp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imgUp"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:src="@mipmap/icon_img_up"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imgLabel"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginBottom="80dp"
|
||||||
|
android:src="@mipmap/icon_img_up_label"
|
||||||
|
android:visibility="gone" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -62,13 +96,29 @@
|
|||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="90dp">
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="80dp"
|
android:layout_width="80dp"
|
||||||
android:layout_height="80dp"
|
android:layout_height="80dp"
|
||||||
|
android:padding="1dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/temp"
|
app:riv_oval="true" />
|
||||||
app:riv_corner_radius="20dp" />
|
|
||||||
|
<pl.droidsonroids.gif.GifImageView
|
||||||
|
android:id="@+id/liveStatus"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginBottom="2dp"
|
||||||
|
android:src="@mipmap/icon_liveing_cn" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@ -223,7 +273,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="8dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
@ -233,58 +283,15 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:src="@mipmap/icon_wumen" />
|
android:src="@mipmap/icon_wumen" />
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/authorLayout"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/authorlIcon"
|
android:id="@+id/authorlIcon"
|
||||||
android:layout_width="56dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp" />
|
||||||
android:layout_marginLeft="5dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/author"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_marginLeft="25dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="Lv 42"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="12dp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/levelLayout"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_marginLeft="5dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/levelIcon"
|
android:id="@+id/levelIcon"
|
||||||
android:layout_width="56dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp" />
|
||||||
android:layout_marginLeft="5dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/level"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_marginLeft="27dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="Lv 42"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="12dp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/userPresidentLayout"
|
android:id="@+id/userPresidentLayout"
|
||||||
@ -365,7 +372,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="20dp"
|
android:layout_marginLeft="20dp"
|
||||||
android:gravity="center"
|
android:gravity="center_vertical"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -403,10 +410,11 @@
|
|||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/fansImg1"
|
android:id="@+id/fansImg1"
|
||||||
android:layout_width="45dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="45dp"
|
android:layout_height="40dp"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_centerVertical="true" />
|
android:layout_centerVertical="true"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@ -421,10 +429,11 @@
|
|||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/fansImg2"
|
android:id="@+id/fansImg2"
|
||||||
android:layout_width="45dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="45dp"
|
android:layout_height="40dp"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_centerVertical="true" />
|
android:layout_centerVertical="true"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@ -439,10 +448,11 @@
|
|||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/fansImg3"
|
android:id="@+id/fansImg3"
|
||||||
android:layout_width="45dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="45dp"
|
android:layout_height="40dp"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_centerVertical="true" />
|
android:layout_centerVertical="true"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@ -488,23 +498,63 @@
|
|||||||
android:gravity="center_vertical|right"
|
android:gravity="center_vertical|right"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:src="@mipmap/img_no1" />
|
android:src="@mipmap/img_no1" />
|
||||||
|
|
||||||
<ImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/guardImg1"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp">
|
||||||
android:layout_marginLeft="5dp"
|
|
||||||
android:src="@mipmap/img_no2" />
|
<ImageView
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:src="@mipmap/img_no2" />
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/guardImg2"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_marginLeft="5dp"
|
|
||||||
android:src="@mipmap/img_no3" />
|
android:src="@mipmap/img_no3" />
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/guardImg3"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="12dp"
|
android:layout_width="12dp"
|
||||||
android:layout_height="12dp"
|
android:layout_height="12dp"
|
||||||
@ -520,11 +570,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:background="@drawable/bg_user_home_04"
|
android:background="@drawable/bg_user_home_gift"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@ -541,6 +590,7 @@
|
|||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/giftCount"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
@ -556,18 +606,21 @@
|
|||||||
android:gravity="center_vertical|right"
|
android:gravity="center_vertical|right"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:layout_width="50dp"
|
android:id="@+id/giftImg1"
|
||||||
android:layout_height="50dp" />
|
android:layout_width="45dp"
|
||||||
|
android:layout_height="45dp" />
|
||||||
|
|
||||||
<ImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:layout_width="50dp"
|
android:id="@+id/giftImg2"
|
||||||
android:layout_height="50dp"
|
android:layout_width="45dp"
|
||||||
|
android:layout_height="45dp"
|
||||||
android:layout_marginLeft="5dp" />
|
android:layout_marginLeft="5dp" />
|
||||||
|
|
||||||
<ImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:layout_width="50dp"
|
android:id="@+id/giftImg3"
|
||||||
android:layout_height="50dp"
|
android:layout_width="45dp"
|
||||||
|
android:layout_height="45dp"
|
||||||
android:layout_marginLeft="5dp" />
|
android:layout_marginLeft="5dp" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -612,20 +665,22 @@
|
|||||||
android:gravity="center_vertical|right"
|
android:gravity="center_vertical|right"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:layout_width="50dp"
|
android:id="@+id/honorImg1"
|
||||||
android:layout_height="50dp" />
|
android:layout_width="45dp"
|
||||||
|
android:layout_height="45dp" />
|
||||||
|
|
||||||
<ImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:layout_width="50dp"
|
android:id="@+id/honorImg2"
|
||||||
android:layout_height="50dp"
|
android:layout_width="45dp"
|
||||||
|
android:layout_height="45dp"
|
||||||
android:layout_marginLeft="5dp" />
|
android:layout_marginLeft="5dp" />
|
||||||
|
|
||||||
<ImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:layout_width="50dp"
|
android:id="@+id/honorImg3"
|
||||||
android:layout_height="50dp"
|
android:layout_width="45dp"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_height="45dp"
|
||||||
android:src="@mipmap/img_honor_default" />
|
android:layout_marginLeft="5dp" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="12dp"
|
android:layout_width="12dp"
|
||||||
@ -710,15 +765,18 @@
|
|||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</com.yunbao.common.views.MyScrollview>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/topLayout"
|
android:id="@+id/topLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="80dp"
|
android:layout_height="80dp"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:clickable="true"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:paddingLeft="20dp"
|
android:paddingLeft="20dp"
|
||||||
android:paddingTop="40dp"
|
android:paddingTop="20dp"
|
||||||
android:paddingRight="20dp">
|
android:paddingRight="20dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -728,15 +786,16 @@
|
|||||||
android:src="@mipmap/icon_left" />
|
android:src="@mipmap/icon_left" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/topName"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="用户名称"
|
android:text=""
|
||||||
android:textColor="#333333"
|
android:textColor="#333333"
|
||||||
android:textSize="16dp"
|
android:textSize="16dp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:visibility="invisible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/setting"
|
android:id="@+id/setting"
|
||||||
@ -746,5 +805,33 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
<LinearLayout
|
||||||
</com.yunbao.common.views.MyScrollview>
|
android:id="@+id/bottomEditLayout"
|
||||||
|
android:layout_width="180dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginBottom="30dp"
|
||||||
|
android:background="@drawable/bg_main_com_type"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:src="@mipmap/icon_user_home_edit_new" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:text="编辑资料"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14dp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
@ -6,9 +6,8 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_tag"
|
android:id="@+id/tv_tag"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="32dp"
|
android:layout_height="26dp"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginTop="5dp"
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:background="@drawable/bg_flow_tag"
|
android:background="@drawable/bg_flow_tag"
|
||||||
android:paddingStart="15dp"
|
android:paddingStart="15dp"
|
||||||
@ -16,6 +15,7 @@
|
|||||||
android:paddingEnd="15dp"
|
android:paddingEnd="15dp"
|
||||||
android:paddingBottom="5dp"
|
android:paddingBottom="5dp"
|
||||||
android:text="标签"
|
android:text="标签"
|
||||||
android:textColor="@color/black2" />
|
android:textColor="@color/black2"
|
||||||
|
android:textSize="11dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
21
common/src/main/res/layout/adapter_video_tag.xml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_tag"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="26dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:background="@drawable/bg_video_flow_tag"
|
||||||
|
android:paddingStart="15dp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingEnd="15dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="11dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
213
common/src/main/res/layout/item_comment_video_view.xml
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="10dp"
|
||||||
|
tools:ignore="MissingDefaultResource">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/avatar"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:src="@mipmap/icon_data_empty"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginTop="7dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="栗子栗子🌰zzz"
|
||||||
|
android:textColor="#777777"
|
||||||
|
android:textSize="12dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:text="栗子栗子🌰zzz"
|
||||||
|
android:textColor="#333333"
|
||||||
|
android:textSize="12dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/author"
|
||||||
|
android:layout_width="45dp"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@drawable/bg_main_com_author"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:text="作者"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="10dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/del"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="删除"
|
||||||
|
android:textColor="#777777"
|
||||||
|
android:textSize="11dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/replyTextView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="回复"
|
||||||
|
android:textColor="#777777"
|
||||||
|
android:textSize="11dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/report"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="举报"
|
||||||
|
android:textColor="#333333"
|
||||||
|
android:textSize="11dp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/replyLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="50dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:background="@drawable/bg_item_comment"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:visibility="visible">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/avatar01"
|
||||||
|
android:layout_width="23dp"
|
||||||
|
android:layout_height="23dp"
|
||||||
|
android:src="@mipmap/icon_data_empty"
|
||||||
|
app:riv_corner_radius="20dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/firstName"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#333333"
|
||||||
|
android:textSize="12dp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/isAuth"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@drawable/bg_main_com_author"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:text="作者"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="11dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/del1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="删除"
|
||||||
|
android:textColor="#777777"
|
||||||
|
android:textSize="11dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/report1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="举报"
|
||||||
|
android:textColor="#333333"
|
||||||
|
android:textSize="11dp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/replyContent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="30dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#777777"
|
||||||
|
android:textSize="11dp" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/expand"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="30dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:text="共4条回复>"
|
||||||
|
android:textColor="#FF4874"
|
||||||
|
android:textSize="12dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -163,7 +163,7 @@
|
|||||||
android:text="删除"
|
android:text="删除"
|
||||||
android:textColor="#777777"
|
android:textColor="#777777"
|
||||||
android:textSize="11dp"
|
android:textSize="11dp"
|
||||||
android:visibility="visible" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/report1"
|
android:id="@+id/report1"
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/itemLayout"
|
android:id="@+id/itemLayout"
|
||||||
android:layout_width="65dp"
|
android:layout_width="63dp"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:ignore="MissingDefaultResource">
|
tools:ignore="MissingDefaultResource">
|
||||||
|
|
||||||
@ -13,6 +12,8 @@
|
|||||||
android:id="@+id/avatar01"
|
android:id="@+id/avatar01"
|
||||||
android:layout_width="42dp"
|
android:layout_width="42dp"
|
||||||
android:layout_height="42dp"
|
android:layout_height="42dp"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/icon_data_empty"
|
android:src="@mipmap/icon_data_empty"
|
||||||
app:riv_corner_radius="15dp" />
|
app:riv_corner_radius="15dp" />
|
||||||
@ -21,8 +22,21 @@
|
|||||||
android:id="@+id/avatar02"
|
android:id="@+id/avatar02"
|
||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:padding="1dp"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/icon_data_empty"
|
android:src="@mipmap/icon_data_empty"
|
||||||
|
android:background="@drawable/bg_user_home_img"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:riv_corner_radius="15dp" />
|
app:riv_corner_radius="15dp" />
|
||||||
</LinearLayout>
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/del"
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:src="@mipmap/icon_img_del"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
@ -57,15 +57,14 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/submit"
|
android:id="@+id/submit"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="30dp"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@drawable/main_community_send"
|
android:background="@drawable/main_community_send"
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
android:paddingTop="10dp"
|
android:gravity="center"
|
||||||
android:paddingRight="15dp"
|
android:paddingRight="15dp"
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:text="发布"
|
android:text="发布"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="16dp"
|
android:textSize="16dp"
|
||||||
|
BIN
common/src/main/res/mipmap-mdpi/bg_avatar.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 2.0 KiB |
BIN
common/src/main/res/mipmap-mdpi/icon_gray.png
Normal file
After Width: | Height: | Size: 346 B |
BIN
common/src/main/res/mipmap-mdpi/icon_img_del.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
common/src/main/res/mipmap-mdpi/icon_img_up.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
common/src/main/res/mipmap-mdpi/icon_img_up_label.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
common/src/main/res/mipmap-mdpi/icon_liveing_cn.gif
Normal file
After Width: | Height: | Size: 321 KiB |
BIN
common/src/main/res/mipmap-mdpi/icon_liveing_en.gif
Normal file
After Width: | Height: | Size: 320 KiB |
BIN
common/src/main/res/mipmap-mdpi/icon_user_home_edit_new.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
common/src/main/res/mipmap-mdpi/liveing.gif
Normal file
After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 1005 KiB |
@ -20,7 +20,6 @@ public class Adapter extends RecyclerView.Adapter<VH> {
|
|||||||
context = ctx;
|
context = ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setSelectedCountries(ArrayList<Country> selectedCountries) {
|
public void setSelectedCountries(ArrayList<Country> selectedCountries) {
|
||||||
this.selectedCountries = selectedCountries;
|
this.selectedCountries = selectedCountries;
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
|
@ -197,8 +197,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
|
|
||||||
private View floatWarOrder;//战令浮窗
|
private View floatWarOrder;//战令浮窗
|
||||||
private List<AnchorStartLiveBean> startListNotifyList = new ArrayList<>();
|
private List<AnchorStartLiveBean> startListNotifyList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
return R.layout.activity_main;
|
return R.layout.activity_main;
|
||||||
@ -211,13 +209,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
getWindow().setSharedElementEnterTransition(new FullAdToBannerTransition(1, 0.4f, new DecelerateInterpolator()));
|
getWindow().setSharedElementEnterTransition(new FullAdToBannerTransition(1, 0.4f, new DecelerateInterpolator()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
OpenAdManager.getInstance().dismiss();
|
OpenAdManager.getInstance().dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void main() {
|
protected void main() {
|
||||||
ActivityCompat.postponeEnterTransition(this);
|
ActivityCompat.postponeEnterTransition(this);
|
||||||
@ -936,10 +932,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
|
|
||||||
for (int j = 0; j < list.size(); j++) {
|
for (int j = 0; j < list.size(); j++) {
|
||||||
Log.e("--->", list.get(j).getGiftname() + list.get(j).getSwf());
|
Log.e("--->", list.get(j).getGiftname() + list.get(j).getSwf());
|
||||||
|
|
||||||
|
|
||||||
Log.e("--->", list.get(j).getGiftname() + list.get(j).getSwf());
|
Log.e("--->", list.get(j).getGiftname() + list.get(j).getSwf());
|
||||||
|
|
||||||
GiftCacheUtil.getFile(MainActivity.this, Constants.GIF_GIFT_PREFIX + list.get(j).getId(), list.get(j).getSwf(), "0", new CommonCallback<File>() {
|
GiftCacheUtil.getFile(MainActivity.this, Constants.GIF_GIFT_PREFIX + list.get(j).getId(), list.get(j).getSwf(), "0", new CommonCallback<File>() {
|
||||||
@Override
|
@Override
|
||||||
public void callback(File bean) {
|
public void callback(File bean) {
|
||||||
|
@ -569,8 +569,8 @@ public class MyWebViewActivity extends AbsActivity {
|
|||||||
Constants.firstInto = 0;
|
Constants.firstInto = 0;
|
||||||
EventBus.getDefault().post(new MainHomeCommunityToChatEvent().setTargetId(event.getUserId()));
|
EventBus.getDefault().post(new MainHomeCommunityToChatEvent().setTargetId(event.getUserId()));
|
||||||
} else if (TextUtils.equals(event.getMethod(), "androidPlayVideo")) {
|
} else if (TextUtils.equals(event.getMethod(), "androidPlayVideo")) {
|
||||||
VideoStorge.getInstance().put(Constants.VIDEO_COMMUNITY, event.getVideoBeanList());
|
/*VideoStorge.getInstance().put(Constants.VIDEO_COMMUNITY, event.getVideoBeanList());
|
||||||
VideoPlayActivity.forward(mContext, event.getPosition(), Constants.VIDEO_COMMUNITY, 1);
|
VideoPlayActivity.forward(mContext, event.getPosition(), Constants.VIDEO_COMMUNITY, 1);*/
|
||||||
} else if (TextUtils.equals(event.getMethod(), "openUpdataName")) {
|
} else if (TextUtils.equals(event.getMethod(), "openUpdataName")) {
|
||||||
isUpdataUser = event.isUpdataUser();
|
isUpdataUser = event.isUpdataUser();
|
||||||
} else if (TextUtils.equals(event.getMethod(), "openUpdataAutograph")) {
|
} else if (TextUtils.equals(event.getMethod(), "openUpdataAutograph")) {
|
||||||
|
@ -416,8 +416,8 @@ public class MyWebViewActivity2 extends AbsActivity {
|
|||||||
Constants.firstInto = 0;
|
Constants.firstInto = 0;
|
||||||
SystemMessageActivity.forward(mContext, "-2", event.getUserId(), event.getName(), event.getImage());
|
SystemMessageActivity.forward(mContext, "-2", event.getUserId(), event.getName(), event.getImage());
|
||||||
} else if (TextUtils.equals(event.getMethod(), "androidPlayVideo")) {
|
} else if (TextUtils.equals(event.getMethod(), "androidPlayVideo")) {
|
||||||
VideoStorge.getInstance().put(Constants.VIDEO_COMMUNITY, event.getVideoBeanList());
|
/*VideoStorge.getInstance().put(Constants.VIDEO_COMMUNITY, event.getVideoBeanList());
|
||||||
VideoPlayActivity.forward(mContext, event.getPosition(), Constants.VIDEO_COMMUNITY, 1);
|
VideoPlayActivity.forward(mContext, event.getPosition(), Constants.VIDEO_COMMUNITY, 1);*/
|
||||||
} else if (TextUtils.equals(event.getMethod(), "openWebView")) {
|
} else if (TextUtils.equals(event.getMethod(), "openWebView")) {
|
||||||
ZhuangBanActivity.forward(mContext, event.getData(), false);
|
ZhuangBanActivity.forward(mContext, event.getData(), false);
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ public class MainHomeComAdapter extends RefreshAdapter<ActiveBean> {
|
|||||||
}
|
}
|
||||||
isVideo.setVisibility(View.GONE);
|
isVideo.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
ImgLoader.display(mContext, bean.getUser_avatar(), img);
|
ImgLoader.display(mContext, bean.getVideo() + "?vframe/jpg/offset/0", img);
|
||||||
isVideo.setVisibility(View.VISIBLE);
|
isVideo.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
name.setText(bean.getUser_name());
|
name.setText(bean.getUser_name());
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
package com.yunbao.main.adapter;
|
package com.yunbao.main.adapter;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -10,15 +12,15 @@ import android.widget.ImageView;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.yunbao.common.adapter.RefreshAdapter;
|
import com.yunbao.common.adapter.RefreshAdapter;
|
||||||
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.main.R;
|
import com.yunbao.main.R;
|
||||||
import com.yunbao.common.bean.VideoBean;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/12/14.
|
* Created by cxf on 2018/12/14.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class VideoHomeAdapter extends RefreshAdapter<VideoBean> {
|
public class VideoHomeAdapter extends RefreshAdapter<ActiveBean> {
|
||||||
|
|
||||||
private View.OnClickListener mOnClickListener;
|
private View.OnClickListener mOnClickListener;
|
||||||
|
|
||||||
@ -32,7 +34,7 @@ public class VideoHomeAdapter extends RefreshAdapter<VideoBean> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int position = (int) tag;
|
int position = (int) tag;
|
||||||
VideoBean bean = mList.get(position);
|
ActiveBean bean = mList.get(position);
|
||||||
if (bean != null && mOnItemClickListener != null) {
|
if (bean != null && mOnItemClickListener != null) {
|
||||||
mOnItemClickListener.onItemClick(bean, position);
|
mOnItemClickListener.onItemClick(bean, position);
|
||||||
}
|
}
|
||||||
@ -77,11 +79,10 @@ public class VideoHomeAdapter extends RefreshAdapter<VideoBean> {
|
|||||||
itemView.setOnClickListener(mOnClickListener);
|
itemView.setOnClickListener(mOnClickListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setData(VideoBean bean, int position) {
|
void setData(ActiveBean bean, int position) {
|
||||||
itemView.setTag(position);
|
itemView.setTag(position);
|
||||||
ImgLoader.display(mContext,bean.getThumb(), mImg);
|
ImgLoader.display(mContext, bean.getVideo() + "?vframe/jpg/offset/0", mImg);
|
||||||
mNum.setText(bean.getViewNum());
|
mNum.setText(bean.getLove_num());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -364,8 +364,8 @@ public class MainHomeCommunityFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (TextUtils.equals(event.getMethod(), "androidPlayVideo")) {
|
} else if (TextUtils.equals(event.getMethod(), "androidPlayVideo")) {
|
||||||
VideoStorge.getInstance().put(Constants.VIDEO_COMMUNITY, event.getVideoBeanList());
|
/*VideoStorge.getInstance().put(Constants.VIDEO_COMMUNITY, event.getVideoBeanList());
|
||||||
VideoPlayActivity.forward(mContext, event.getPosition(), Constants.VIDEO_COMMUNITY, 1);
|
VideoPlayActivity.forward(mContext, event.getPosition(), Constants.VIDEO_COMMUNITY, 1);*/
|
||||||
} else if (TextUtils.equals(event.getMethod(), "androidMethodLookToLive")) {
|
} else if (TextUtils.equals(event.getMethod(), "androidMethodLookToLive")) {
|
||||||
//看直播
|
//看直播
|
||||||
gotoLive(event.getLiveId());
|
gotoLive(event.getLiveId());
|
||||||
|
@ -6,6 +6,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.umeng.analytics.MobclickAgent;
|
import com.umeng.analytics.MobclickAgent;
|
||||||
import com.yunbao.common.activity.CommunitySendActivity;
|
import com.yunbao.common.activity.CommunitySendActivity;
|
||||||
@ -26,6 +27,7 @@ public class MainHomeComViewHolder extends AbsMainHomeParentComViewHolder {
|
|||||||
private MainHomeRecomComViewHolder mainHomeRecomComViewHolder;
|
private MainHomeRecomComViewHolder mainHomeRecomComViewHolder;
|
||||||
private MainHomeGameViewHolder mainHomeGameLiveViewHolder;
|
private MainHomeGameViewHolder mainHomeGameLiveViewHolder;
|
||||||
private final String mPageName = "home_page";
|
private final String mPageName = "home_page";
|
||||||
|
private TextView tvPlay;
|
||||||
private ImageView btnSend;
|
private ImageView btnSend;
|
||||||
private boolean floatWarOrder;
|
private boolean floatWarOrder;
|
||||||
|
|
||||||
@ -53,6 +55,13 @@ public class MainHomeComViewHolder extends AbsMainHomeParentComViewHolder {
|
|||||||
mContext.startActivity(intent);
|
mContext.startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
tvPlay = (TextView) findViewById(R.id.tvPlay);
|
||||||
|
tvPlay.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
RouteUtil.forwardCommunityActivity();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCurPosition(int position) {
|
public void setCurPosition(int position) {
|
||||||
@ -138,12 +147,12 @@ public class MainHomeComViewHolder extends AbsMainHomeParentComViewHolder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getPageCount() {
|
protected int getPageCount() {
|
||||||
return 4;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getTitles() {
|
protected String[] getTitles() {
|
||||||
return new String[]{mContext.getString(R.string.follow), mContext.getString(R.string.hot), mContext.getString(R.string.main_type_find), mContext.getString(R.string.main_type_theater),};
|
return new String[]{mContext.getString(R.string.follow), mContext.getString(R.string.hot), mContext.getString(R.string.main_type_find)};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,31 +1,25 @@
|
|||||||
package com.yunbao.main.views;
|
package com.yunbao.main.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Parcelable;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.activity.CommunityDetailsActivity;
|
|
||||||
import com.yunbao.common.adapter.RefreshAdapter;
|
import com.yunbao.common.adapter.RefreshAdapter;
|
||||||
import com.yunbao.common.bean.ActiveBean;
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||||
import com.yunbao.common.bean.ActiveBean;
|
|
||||||
import com.yunbao.common.custom.CommonRefreshWaterfallView;
|
import com.yunbao.common.custom.CommonRefreshWaterfallView;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
import com.yunbao.common.utils.RouteUtil;
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
import com.yunbao.main.R;
|
import com.yunbao.main.R;
|
||||||
import com.yunbao.main.activity.MainActivity;
|
|
||||||
import com.yunbao.main.activity.WeekWebViewActivity;
|
|
||||||
import com.yunbao.main.adapter.MainHomeComAdapter;
|
import com.yunbao.main.adapter.MainHomeComAdapter;
|
||||||
import com.yunbao.main.adapter.MainHomeRemFollComAdapter;
|
|
||||||
import com.yunbao.main.http.MainHttpConsts;
|
import com.yunbao.main.http.MainHttpConsts;
|
||||||
import com.yunbao.main.http.MainHttpUtil;
|
import com.yunbao.main.http.MainHttpUtil;
|
||||||
|
import com.yunbao.video.activity.VideoPlayActivity;
|
||||||
|
import com.yunbao.video.utils.VideoStorge;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
@ -38,6 +32,8 @@ import java.util.List;
|
|||||||
public class MainHomeFollComViewHolder extends AbsMainHomeChildViewHolder implements OnItemClickListener<ActiveBean> {
|
public class MainHomeFollComViewHolder extends AbsMainHomeChildViewHolder implements OnItemClickListener<ActiveBean> {
|
||||||
private CommonRefreshWaterfallView mRefreshView;
|
private CommonRefreshWaterfallView mRefreshView;
|
||||||
private MainHomeComAdapter mAdapter;
|
private MainHomeComAdapter mAdapter;
|
||||||
|
private List<ActiveBean> videoList = new ArrayList<>();
|
||||||
|
private List<ActiveBean> new_data;
|
||||||
|
|
||||||
public MainHomeFollComViewHolder(Context context, ViewGroup parentView) {
|
public MainHomeFollComViewHolder(Context context, ViewGroup parentView) {
|
||||||
super(context, parentView);
|
super(context, parentView);
|
||||||
@ -96,7 +92,15 @@ public class MainHomeFollComViewHolder extends AbsMainHomeChildViewHolder implem
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ActiveBean> processData(String[] info) {
|
public List<ActiveBean> processData(String[] info) {
|
||||||
return JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
new_data = new ArrayList<>();
|
||||||
|
new_data = JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
||||||
|
videoList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < new_data.size(); i++) {
|
||||||
|
if (new_data.get(i).getImg_or_video().equals("2")) {
|
||||||
|
videoList.add(new_data.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -111,7 +115,16 @@ public class MainHomeFollComViewHolder extends AbsMainHomeChildViewHolder implem
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoadMoreSuccess(List<ActiveBean> loadItemList, int loadItemCount) {
|
public void onLoadMoreSuccess(List<ActiveBean> loadItemList, int loadItemCount) {
|
||||||
mAdapter.insertList(loadItemList);
|
new_data = new ArrayList<>();
|
||||||
|
for (int j = 0; j < loadItemList.size(); j++) {
|
||||||
|
new_data.add(loadItemList.get(j));
|
||||||
|
if (loadItemList.get(j).getImg_or_video().equals("2")) {
|
||||||
|
videoList.add(loadItemList.get(j));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (loadItemList.size() > 0) {
|
||||||
|
mAdapter.insertList(new_data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -124,9 +137,18 @@ public class MainHomeFollComViewHolder extends AbsMainHomeChildViewHolder implem
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(ActiveBean bean, int position) {
|
public void onItemClick(ActiveBean bean, int position) {
|
||||||
Intent intent = new Intent(mContext, CommunityDetailsActivity.class);
|
if (bean.getImg_or_video().equals("1")) {
|
||||||
intent.putExtra("active", (Parcelable) bean);
|
RouteUtil.forwardCommunity(bean.getId());
|
||||||
mContext.startActivity(intent);
|
} else {
|
||||||
|
int playPosition = 0;
|
||||||
|
for (int i = 0; i < videoList.size(); i++) {
|
||||||
|
if (videoList.get(i).getId().equals(bean.getId())) {
|
||||||
|
playPosition = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
VideoStorge.getInstance().put(Constants.VIDEO_HOME, videoList);
|
||||||
|
VideoPlayActivity.forward(mContext, playPosition, Constants.VIDEO_HOME, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -3,9 +3,6 @@ package com.yunbao.main.views;
|
|||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Parcelable;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -16,7 +13,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.yunbao.common.activity.CommunityDetailsActivity;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.adapter.RefreshAdapter;
|
import com.yunbao.common.adapter.RefreshAdapter;
|
||||||
import com.yunbao.common.bean.ActiveBean;
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
import com.yunbao.common.bean.NewCommunityType;
|
import com.yunbao.common.bean.NewCommunityType;
|
||||||
@ -27,13 +24,14 @@ import com.yunbao.common.interfaces.OnItemClickListener;
|
|||||||
import com.yunbao.common.manager.CommunityTypeManager;
|
import com.yunbao.common.manager.CommunityTypeManager;
|
||||||
import com.yunbao.common.manager.OpenAdManager;
|
import com.yunbao.common.manager.OpenAdManager;
|
||||||
import com.yunbao.common.utils.DialogUitl;
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
import com.yunbao.live.bean.RedPackBean;
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
import com.yunbao.main.R;
|
import com.yunbao.main.R;
|
||||||
import com.yunbao.main.adapter.MainHomeComAdapter;
|
import com.yunbao.main.adapter.MainHomeComAdapter;
|
||||||
import com.yunbao.main.adapter.MainHomeComClassAdapter;
|
import com.yunbao.main.adapter.MainHomeComClassAdapter;
|
||||||
import com.yunbao.main.http.MainHttpConsts;
|
import com.yunbao.main.http.MainHttpConsts;
|
||||||
import com.yunbao.main.http.MainHttpUtil;
|
import com.yunbao.main.http.MainHttpUtil;
|
||||||
import com.yunbao.video.interfaces.VideoScrollDataHelper;
|
import com.yunbao.video.activity.VideoPlayActivity;
|
||||||
|
import com.yunbao.video.utils.VideoStorge;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
@ -65,6 +63,7 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
|||||||
private Map<String, String> gotoRoomKey = new HashMap<>();
|
private Map<String, String> gotoRoomKey = new HashMap<>();
|
||||||
private Dialog mShowLoadingDialog;
|
private Dialog mShowLoadingDialog;
|
||||||
private String typeHot;
|
private String typeHot;
|
||||||
|
private List<ActiveBean> videoList = new ArrayList<>();
|
||||||
|
|
||||||
public MainHomeNewViewHolder(Context context, ViewGroup parentView) {
|
public MainHomeNewViewHolder(Context context, ViewGroup parentView) {
|
||||||
super(context, parentView);
|
super(context, parentView);
|
||||||
@ -92,16 +91,6 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
CommonHttpUtil.getTag(new HttpCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
List<NewCommunityType> list = JSON.parseArray(Arrays.toString(info), NewCommunityType.class);
|
|
||||||
CommunityTypeManager communityTypeManager = new CommunityTypeManager(mContext);
|
|
||||||
communityTypeManager.UpCommunityType(Arrays.toString(info));
|
|
||||||
initCommunityTypeList(list);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
List<NewCommunityType> list = new CommunityTypeManager(mContext).getCommunityTypeList();
|
List<NewCommunityType> list = new CommunityTypeManager(mContext).getCommunityTypeList();
|
||||||
if (list != null && !list.isEmpty()) {
|
if (list != null && !list.isEmpty()) {
|
||||||
typeHot = list.get(0).getTalk_name();
|
typeHot = list.get(0).getTalk_name();
|
||||||
@ -111,8 +100,14 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
List<NewCommunityType> list = JSON.parseArray(Arrays.toString(info), NewCommunityType.class);
|
List<NewCommunityType> list = JSON.parseArray(Arrays.toString(info), NewCommunityType.class);
|
||||||
|
NewCommunityType newCommunityType = new NewCommunityType();
|
||||||
|
newCommunityType.setId(0);
|
||||||
|
newCommunityType.setTalk_name(mContext.getString(R.string.recomment));
|
||||||
|
list.add(0, newCommunityType);
|
||||||
CommunityTypeManager communityTypeManager = new CommunityTypeManager(mContext);
|
CommunityTypeManager communityTypeManager = new CommunityTypeManager(mContext);
|
||||||
communityTypeManager.UpCommunityType(Arrays.toString(info));
|
communityTypeManager.UpCommunityType(new Gson().toJson(list));
|
||||||
|
typeHot = list.get(0).getTalk_name();
|
||||||
|
select = list.get(0).getId();
|
||||||
initCommunityTypeList(list);
|
initCommunityTypeList(list);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -151,8 +146,7 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
|||||||
@Override
|
@Override
|
||||||
public void loadData(int p, HttpCallback callback) {
|
public void loadData(int p, HttpCallback callback) {
|
||||||
Log.i("t2", "aaa" + p);
|
Log.i("t2", "aaa" + p);
|
||||||
CommonHttpUtil.getCommunityHotList(p, callback);
|
if (select == 0) {
|
||||||
if (TextUtils.equals(typeHot, "Hot") || TextUtils.equals(typeHot, "hot") || TextUtils.equals(typeHot, "熱門")) {
|
|
||||||
CommonHttpUtil.getCommunityHotList(p, callback);
|
CommonHttpUtil.getCommunityHotList(p, callback);
|
||||||
} else {
|
} else {
|
||||||
CommonHttpUtil.getTalkHotDynamicList(select, p, callback);
|
CommonHttpUtil.getTalkHotDynamicList(select, p, callback);
|
||||||
@ -163,6 +157,12 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
|||||||
public List<ActiveBean> processData(String[] info) {
|
public List<ActiveBean> processData(String[] info) {
|
||||||
new_data = new ArrayList<>();
|
new_data = new ArrayList<>();
|
||||||
new_data = JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
new_data = JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
||||||
|
videoList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < new_data.size(); i++) {
|
||||||
|
if (new_data.get(i).getImg_or_video().equals("2")) {
|
||||||
|
videoList.add(new_data.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
return new_data;
|
return new_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,6 +181,9 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
|||||||
new_data = new ArrayList<>();
|
new_data = new ArrayList<>();
|
||||||
for (int j = 0; j < loadItemList.size(); j++) {
|
for (int j = 0; j < loadItemList.size(); j++) {
|
||||||
new_data.add(loadItemList.get(j));
|
new_data.add(loadItemList.get(j));
|
||||||
|
if (loadItemList.get(j).getImg_or_video().equals("2")) {
|
||||||
|
videoList.add(loadItemList.get(j));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (loadItemList.size() > 0) {
|
if (loadItemList.size() > 0) {
|
||||||
mAdapter.insertList(new_data);
|
mAdapter.insertList(new_data);
|
||||||
@ -251,40 +254,20 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private VideoScrollDataHelper mVideoScrollDataHelper;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(ActiveBean bean, int position) {
|
public void onItemClick(ActiveBean bean, int position) {
|
||||||
Intent intent = new Intent(mContext, CommunityDetailsActivity.class);
|
if (bean.getImg_or_video().equals("1")) {
|
||||||
intent.putExtra("active", (Parcelable) bean);
|
RouteUtil.forwardCommunity(bean.getId());
|
||||||
mContext.startActivity(intent);
|
} else {
|
||||||
|
int playPosition = 0;
|
||||||
/*if (bean.getImg_or_video().equals("2")) {
|
for (int i = 0; i < videoList.size(); i++) {
|
||||||
if (mVideoScrollDataHelper == null) {
|
if (videoList.get(i).getId().equals(bean.getId())) {
|
||||||
mVideoScrollDataHelper = new VideoScrollDataHelper() {
|
playPosition = i;
|
||||||
@Override
|
|
||||||
public void loadData(int p, HttpCallback callback) {
|
|
||||||
VideoHttpUtil.getHomeVideoList(p, callback);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
VideoStorge.getInstance().putDataHelper(Constants.VIDEO_HOME, mVideoScrollDataHelper);
|
|
||||||
VideoPlayActivity.forward(mContext, position, Constants.VIDEO_HOME, 1);
|
|
||||||
}*/
|
|
||||||
/*VideoHttpUtil.getHomeVideoList(1, new HttpCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
if (code == 0) {
|
|
||||||
List<VideoBean> tempList = new ArrayList<>();
|
|
||||||
for (String s : info) {
|
|
||||||
VideoBean videoBean = JSONObject.parseObject(s, VideoBean.class);
|
|
||||||
tempList.add(videoBean);
|
|
||||||
}
|
|
||||||
VideoStorge.getInstance().put(Constants.VIDEO_HOME, tempList);
|
|
||||||
VideoPlayActivity.forward(mContext, position, Constants.VIDEO_HOME, 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});*/
|
VideoStorge.getInstance().put(Constants.VIDEO_HOME, videoList);
|
||||||
|
VideoPlayActivity.forward(mContext, playPosition, Constants.VIDEO_HOME, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,40 +1,31 @@
|
|||||||
package com.yunbao.main.views;
|
package com.yunbao.main.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Parcelable;
|
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.activity.CommunityDetailsActivity;
|
|
||||||
import com.yunbao.common.adapter.RefreshAdapter;
|
import com.yunbao.common.adapter.RefreshAdapter;
|
||||||
import com.yunbao.common.bean.ActiveBean;
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||||
import com.yunbao.common.bean.LiveBean;
|
|
||||||
import com.yunbao.common.custom.CommonRefreshView;
|
|
||||||
import com.yunbao.common.custom.CommonRefreshWaterfallView;
|
import com.yunbao.common.custom.CommonRefreshWaterfallView;
|
||||||
import com.yunbao.common.custom.ItemDecoration;
|
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
import com.yunbao.common.utils.RouteUtil;
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
import com.yunbao.main.R;
|
import com.yunbao.main.R;
|
||||||
import com.yunbao.main.activity.MainActivity;
|
|
||||||
import com.yunbao.main.activity.WeekWebViewActivity;
|
|
||||||
import com.yunbao.main.adapter.MainHomeComAdapter;
|
import com.yunbao.main.adapter.MainHomeComAdapter;
|
||||||
import com.yunbao.main.adapter.MainHomeRemFindComAdapter;
|
|
||||||
import com.yunbao.main.adapter.MainHomeRemFollLiveAdapter;
|
|
||||||
import com.yunbao.main.http.MainHttpConsts;
|
import com.yunbao.main.http.MainHttpConsts;
|
||||||
import com.yunbao.main.http.MainHttpUtil;
|
import com.yunbao.main.http.MainHttpUtil;
|
||||||
|
import com.yunbao.video.activity.VideoPlayActivity;
|
||||||
|
import com.yunbao.video.utils.VideoStorge;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -44,6 +35,8 @@ import java.util.List;
|
|||||||
public class MainHomeRecomComViewHolder extends AbsMainHomeChildViewHolder implements OnItemClickListener<ActiveBean> {
|
public class MainHomeRecomComViewHolder extends AbsMainHomeChildViewHolder implements OnItemClickListener<ActiveBean> {
|
||||||
private CommonRefreshWaterfallView mRefreshView;
|
private CommonRefreshWaterfallView mRefreshView;
|
||||||
private MainHomeComAdapter mAdapter;
|
private MainHomeComAdapter mAdapter;
|
||||||
|
private List<ActiveBean> videoList = new ArrayList<>();
|
||||||
|
private List<ActiveBean> new_data = new ArrayList<>();
|
||||||
|
|
||||||
public MainHomeRecomComViewHolder(Context context, ViewGroup parentView) {
|
public MainHomeRecomComViewHolder(Context context, ViewGroup parentView) {
|
||||||
super(context, parentView);
|
super(context, parentView);
|
||||||
@ -97,7 +90,15 @@ public class MainHomeRecomComViewHolder extends AbsMainHomeChildViewHolder imple
|
|||||||
@Override
|
@Override
|
||||||
public List<ActiveBean> processData(String[] info) {
|
public List<ActiveBean> processData(String[] info) {
|
||||||
if (pp == 1) {
|
if (pp == 1) {
|
||||||
return JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
new_data = new ArrayList<>();
|
||||||
|
new_data = JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
||||||
|
videoList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < new_data.size(); i++) {
|
||||||
|
if (new_data.get(i).getImg_or_video().equals("2")) {
|
||||||
|
videoList.add(new_data.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new_data;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -131,9 +132,18 @@ public class MainHomeRecomComViewHolder extends AbsMainHomeChildViewHolder imple
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(ActiveBean bean, int position) {
|
public void onItemClick(ActiveBean bean, int position) {
|
||||||
Intent intent = new Intent(mContext, CommunityDetailsActivity.class);
|
if (bean.getImg_or_video().equals("1")) {
|
||||||
intent.putExtra("active", (Parcelable) bean);
|
RouteUtil.forwardCommunity(bean.getId());
|
||||||
mContext.startActivity(intent);
|
} else {
|
||||||
|
int playPosition = 0;
|
||||||
|
for (int i = 0; i < videoList.size(); i++) {
|
||||||
|
if (videoList.get(i).getId().equals(bean.getId())) {
|
||||||
|
playPosition = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
VideoStorge.getInstance().put(Constants.VIDEO_HOME, videoList);
|
||||||
|
VideoPlayActivity.forward(mContext, playPosition, Constants.VIDEO_HOME, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -83,7 +83,7 @@ public class MainHomeVideoViewHolder extends AbsMainHomeChildViewHolder implemen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRefreshSuccess(List<VideoBean> list, int listCount) {
|
public void onRefreshSuccess(List<VideoBean> list, int listCount) {
|
||||||
VideoStorge.getInstance().put(Constants.VIDEO_HOME, list);
|
//VideoStorge.getInstance().put(Constants.VIDEO_HOME, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -33,6 +33,7 @@ import com.yunbao.common.CommonAppConfig;
|
|||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.HtmlConfig;
|
import com.yunbao.common.HtmlConfig;
|
||||||
|
import com.yunbao.common.activity.UserHomeActivity;
|
||||||
import com.yunbao.common.activity.WebViewActivity;
|
import com.yunbao.common.activity.WebViewActivity;
|
||||||
import com.yunbao.common.bean.GoogleBean;
|
import com.yunbao.common.bean.GoogleBean;
|
||||||
import com.yunbao.common.bean.UserBean;
|
import com.yunbao.common.bean.UserBean;
|
||||||
@ -134,7 +135,8 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
|||||||
@Override
|
@Override
|
||||||
public void onViewClicks() {
|
public void onViewClicks() {
|
||||||
MobclickAgent.onEvent(mContext, "my_avatar", "个人头像按钮");
|
MobclickAgent.onEvent(mContext, "my_avatar", "个人头像按钮");
|
||||||
RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2);
|
RouteUtil.forwardUserHome(CommonAppConfig.getInstance().getUid());
|
||||||
|
//RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -145,7 +147,8 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
|||||||
@Override
|
@Override
|
||||||
public void onViewClicks() {
|
public void onViewClicks() {
|
||||||
MobclickAgent.onEvent(mContext, "my_avatar", "个人头像按钮");
|
MobclickAgent.onEvent(mContext, "my_avatar", "个人头像按钮");
|
||||||
RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2);
|
RouteUtil.forwardUserHome(CommonAppConfig.getInstance().getUid());
|
||||||
|
//RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
user_noble_ico = (ImageView) findViewById(R.id.user_noble_ico);
|
user_noble_ico = (ImageView) findViewById(R.id.user_noble_ico);
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package com.yunbao.main.views;
|
package com.yunbao.main.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
@ -9,6 +11,7 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.adapter.RefreshAdapter;
|
import com.yunbao.common.adapter.RefreshAdapter;
|
||||||
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
import com.yunbao.common.custom.CommonRefreshView;
|
import com.yunbao.common.custom.CommonRefreshView;
|
||||||
import com.yunbao.common.custom.ItemDecoration;
|
import com.yunbao.common.custom.ItemDecoration;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
@ -37,7 +40,7 @@ import java.util.List;
|
|||||||
* 用户个人中心发布的视频列表
|
* 用户个人中心发布的视频列表
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItemClickListener<VideoBean> {
|
public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItemClickListener<ActiveBean> {
|
||||||
|
|
||||||
private CommonRefreshView mRefreshView;
|
private CommonRefreshView mRefreshView;
|
||||||
private VideoHomeAdapter mAdapter;
|
private VideoHomeAdapter mAdapter;
|
||||||
@ -76,9 +79,9 @@ public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItem
|
|||||||
ItemDecoration decoration = new ItemDecoration(mContext, 0x00000000, 2, 0);
|
ItemDecoration decoration = new ItemDecoration(mContext, 0x00000000, 2, 0);
|
||||||
decoration.setOnlySetItemOffsetsButNoDraw(true);
|
decoration.setOnlySetItemOffsetsButNoDraw(true);
|
||||||
mRefreshView.setItemDecoration(decoration);
|
mRefreshView.setItemDecoration(decoration);
|
||||||
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<VideoBean>() {
|
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<ActiveBean>() {
|
||||||
@Override
|
@Override
|
||||||
public RefreshAdapter<VideoBean> getAdapter() {
|
public RefreshAdapter<ActiveBean> getAdapter() {
|
||||||
if (mAdapter == null) {
|
if (mAdapter == null) {
|
||||||
mAdapter = new VideoHomeAdapter(mContext);
|
mAdapter = new VideoHomeAdapter(mContext);
|
||||||
mAdapter.setOnItemClickListener(VideoHomeViewHolder.this);
|
mAdapter.setOnItemClickListener(VideoHomeViewHolder.this);
|
||||||
@ -92,12 +95,12 @@ public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItem
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<VideoBean> processData(String[] info) {
|
public List<ActiveBean> processData(String[] info) {
|
||||||
return JSON.parseArray(Arrays.toString(info), VideoBean.class);
|
return JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRefreshSuccess(List<VideoBean> list, int listCount) {
|
public void onRefreshSuccess(List<ActiveBean> list, int listCount) {
|
||||||
VideoStorge.getInstance().put(mKey, list);
|
VideoStorge.getInstance().put(mKey, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +110,7 @@ public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItem
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoadMoreSuccess(List<VideoBean> loadItemList, int loadItemCount) {
|
public void onLoadMoreSuccess(List<ActiveBean> loadItemList, int loadItemCount) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,10 +130,9 @@ public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItem
|
|||||||
EventBus.getDefault().register(VideoHomeViewHolder.this);
|
EventBus.getDefault().register(VideoHomeViewHolder.this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadData() {
|
public void loadData() {
|
||||||
if(isFirstLoadData()){
|
if (isFirstLoadData()) {
|
||||||
mRefreshView.initData();
|
mRefreshView.initData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -142,7 +144,6 @@ public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItem
|
|||||||
EventBus.getDefault().unregister(this);
|
EventBus.getDefault().unregister(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onVideoScrollPageEvent(VideoScrollPageEvent e) {
|
public void onVideoScrollPageEvent(VideoScrollPageEvent e) {
|
||||||
if (!TextUtils.isEmpty(mKey) && mKey.equals(e.getKey()) && mRefreshView != null) {
|
if (!TextUtils.isEmpty(mKey) && mKey.equals(e.getKey()) && mRefreshView != null) {
|
||||||
@ -164,7 +165,7 @@ public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItem
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(VideoBean bean, int position) {
|
public void onItemClick(ActiveBean bean, int position) {
|
||||||
int page = 1;
|
int page = 1;
|
||||||
if (mRefreshView != null) {
|
if (mRefreshView != null) {
|
||||||
page = mRefreshView.getPageCount();
|
page = mRefreshView.getPageCount();
|
||||||
|
@ -2,21 +2,20 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="15dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="12dp"
|
android:paddingTop="12dp"
|
||||||
android:paddingRight="5dp"
|
|
||||||
android:paddingBottom="10dp">
|
android:paddingBottom="10dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_class_name"
|
android:id="@+id/tv_class_name"
|
||||||
android:layout_width="65dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:background="@drawable/bg_main_com_type"
|
android:background="@drawable/bg_main_com_type"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="音乐"
|
android:text="音乐"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="16sp" />
|
android:textSize="13sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -15,8 +15,10 @@
|
|||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/rt_main_tab"
|
android:id="@+id/rt_main_tab"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="71dp"
|
android:layout_height="55dp"
|
||||||
android:layout_alignParentBottom="true">
|
android:layout_alignParentBottom="true"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:paddingTop="5dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/img_main_bg_tab"
|
android:id="@+id/img_main_bg_tab"
|
||||||
@ -28,8 +30,9 @@
|
|||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/bottom"
|
android:id="@+id/bottom"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="45dp"
|
android:layout_height="55dp"
|
||||||
android:layout_alignParentBottom="true">
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_centerVertical="true">
|
||||||
|
|
||||||
<com.yunbao.common.custom.TabButtonGroup
|
<com.yunbao.common.custom.TabButtonGroup
|
||||||
android:id="@+id/tab_group"
|
android:id="@+id/tab_group"
|
||||||
@ -46,7 +49,8 @@
|
|||||||
app:tbn_icon_size="28dp"
|
app:tbn_icon_size="28dp"
|
||||||
app:tbn_text_color_checked="@color/colorAccent"
|
app:tbn_text_color_checked="@color/colorAccent"
|
||||||
app:tbn_text_color_unchecked="@color/gray1"
|
app:tbn_text_color_unchecked="@color/gray1"
|
||||||
app:tbn_text_size="11sp" />
|
app:tbn_text_size="11sp"
|
||||||
|
app:tbn_tip="@string/main_home" />
|
||||||
|
|
||||||
<com.yunbao.common.custom.TabButton
|
<com.yunbao.common.custom.TabButton
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@ -57,7 +61,8 @@
|
|||||||
app:tbn_icon_size="28dp"
|
app:tbn_icon_size="28dp"
|
||||||
app:tbn_text_color_checked="@color/colorAccent"
|
app:tbn_text_color_checked="@color/colorAccent"
|
||||||
app:tbn_text_color_unchecked="@color/gray1"
|
app:tbn_text_color_unchecked="@color/gray1"
|
||||||
app:tbn_text_size="11sp" />
|
app:tbn_text_size="11sp"
|
||||||
|
app:tbn_tip="@string/live" />
|
||||||
|
|
||||||
<com.yunbao.common.custom.TabButton
|
<com.yunbao.common.custom.TabButton
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@ -67,7 +72,8 @@
|
|||||||
app:tbn_icon_size="28dp"
|
app:tbn_icon_size="28dp"
|
||||||
app:tbn_text_color_checked="@color/colorAccent"
|
app:tbn_text_color_checked="@color/colorAccent"
|
||||||
app:tbn_text_color_unchecked="@color/gray1"
|
app:tbn_text_color_unchecked="@color/gray1"
|
||||||
app:tbn_text_size="11sp" />
|
app:tbn_text_size="11sp"
|
||||||
|
app:tbn_tip="@string/chat" />
|
||||||
|
|
||||||
<com.yunbao.common.custom.TabButton
|
<com.yunbao.common.custom.TabButton
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@ -77,7 +83,8 @@
|
|||||||
app:tbn_icon_size="28dp"
|
app:tbn_icon_size="28dp"
|
||||||
app:tbn_text_color_checked="@color/colorAccent"
|
app:tbn_text_color_checked="@color/colorAccent"
|
||||||
app:tbn_text_color_unchecked="@color/gray1"
|
app:tbn_text_color_unchecked="@color/gray1"
|
||||||
app:tbn_text_size="11sp" />
|
app:tbn_text_size="11sp"
|
||||||
|
app:tbn_tip="@string/main_me" />
|
||||||
|
|
||||||
</com.yunbao.common.custom.TabButtonGroup>
|
</com.yunbao.common.custom.TabButtonGroup>
|
||||||
|
|
||||||
@ -139,14 +146,13 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/btn_start"
|
android:id="@+id/btn_start"
|
||||||
android:layout_width="60dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="40dp"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:onClick="mainClick"
|
android:onClick="mainClick"
|
||||||
android:src="@mipmap/icon_middle" />
|
android:src="@mipmap/icon_middle" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
<com.yunbao.main.views.FloatBannerView
|
<com.yunbao.main.views.FloatBannerView
|
||||||
android:id="@+id/float_banner_home"
|
android:id="@+id/float_banner_home"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -179,8 +185,8 @@
|
|||||||
android:layout_above="@id/rt_main_tab"
|
android:layout_above="@id/rt_main_tab"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_marginRight="12dp"
|
android:layout_marginRight="12dp"
|
||||||
android:visibility="gone"
|
android:layout_marginBottom="10dp"
|
||||||
android:layout_marginBottom="10dp" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/war_order"
|
android:id="@+id/war_order"
|
||||||
@ -189,8 +195,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_above="@id/rt_main_tab"
|
android:layout_above="@id/rt_main_tab"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_marginRight="25dp"
|
android:layout_marginRight="25dp" />
|
||||||
/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
app:layout_scrollFlags="scroll|enterAlways">
|
app:layout_scrollFlags="scroll|enterAlways">
|
||||||
|
|
||||||
|
|
||||||
<FrameLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
@ -35,10 +35,24 @@
|
|||||||
|
|
||||||
<net.lucode.hackware.magicindicator.MagicIndicator
|
<net.lucode.hackware.magicindicator.MagicIndicator
|
||||||
android:id="@+id/indicator"
|
android:id="@+id/indicator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
</FrameLayout>
|
<TextView
|
||||||
|
android:id="@+id/tvPlay"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_toRightOf="@+id/indicator"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingTop="1dp"
|
||||||
|
android:text="@string/main_type_theater"
|
||||||
|
android:textColor="@color/black1"
|
||||||
|
android:textSize="18dp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/btn_send"
|
android:id="@+id/btn_send"
|
||||||
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 14 KiB |
@ -10,6 +10,14 @@
|
|||||||
<item>@mipmap/icon_dynamic_selected</item>
|
<item>@mipmap/icon_dynamic_selected</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="main_tab_list">
|
||||||
|
<item>@mipmap/icon_live_uncheck</item>
|
||||||
|
<item>@mipmap/icon_live_selected</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="main_tab_chat">
|
||||||
|
<item>@mipmap/icon_me_uncheck</item>
|
||||||
|
<item>@mipmap/icon_me_selected</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
<string-array name="main_tab_near">
|
<string-array name="main_tab_near">
|
||||||
<!-- <item>@mipmap/icon_main_tab_near_00</item>-->
|
<!-- <item>@mipmap/icon_main_tab_near_00</item>-->
|
||||||
@ -22,12 +30,4 @@
|
|||||||
<!-- <item>@mipmap/icon_main_tab_near_07</item>-->
|
<!-- <item>@mipmap/icon_main_tab_near_07</item>-->
|
||||||
<!-- <item>@mipmap/icon_main_tab_near_08</item>-->
|
<!-- <item>@mipmap/icon_main_tab_near_08</item>-->
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="main_tab_list">
|
|
||||||
<item>@mipmap/icon_live_uncheck</item>
|
|
||||||
<item>@mipmap/icon_live_selected</item>
|
|
||||||
</string-array>
|
|
||||||
<string-array name="main_tab_chat">
|
|
||||||
<item>@mipmap/icon_me_uncheck</item>
|
|
||||||
<item>@mipmap/icon_me_selected</item>
|
|
||||||
</string-array>
|
|
||||||
</resources>
|
</resources>
|
@ -1,7 +1,9 @@
|
|||||||
package com.yunbao.video.activity;
|
package com.yunbao.video.activity;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.viewpager.widget.ViewPager;
|
import androidx.viewpager.widget.ViewPager;
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -13,6 +15,7 @@ import com.umeng.analytics.MobclickAgent;
|
|||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.activity.AbsActivity;
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
import com.yunbao.common.adapter.ImChatFacePagerAdapter;
|
import com.yunbao.common.adapter.ImChatFacePagerAdapter;
|
||||||
|
import com.yunbao.common.bean.CommentBean;
|
||||||
import com.yunbao.common.interfaces.OnFaceClickListener;
|
import com.yunbao.common.interfaces.OnFaceClickListener;
|
||||||
import com.yunbao.common.utils.ProcessResultUtil;
|
import com.yunbao.common.utils.ProcessResultUtil;
|
||||||
import com.yunbao.video.R;
|
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() {
|
public View getFaceView() {
|
||||||
if (mFaceView == null) {
|
if (mFaceView == null) {
|
||||||
mFaceView = initFaceView();
|
mFaceView = initFaceView();
|
||||||
|
@ -11,6 +11,7 @@ import android.widget.ImageView;
|
|||||||
import com.binioter.guideview.Guide;
|
import com.binioter.guideview.Guide;
|
||||||
import com.binioter.guideview.GuideBuilder;
|
import com.binioter.guideview.GuideBuilder;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
import com.yunbao.common.utils.SpUtil;
|
import com.yunbao.common.utils.SpUtil;
|
||||||
import com.yunbao.video.R;
|
import com.yunbao.video.R;
|
||||||
@ -39,12 +40,11 @@ public class VideoPlayActivity extends AbsVideoPlayActivity {
|
|||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void forwardSingle(Context context, ActiveBean videoBean) {
|
||||||
public static void forwardSingle(Context context, VideoBean videoBean) {
|
|
||||||
if (videoBean == null) {
|
if (videoBean == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<VideoBean> list = new ArrayList<>();
|
List<ActiveBean> list = new ArrayList<>();
|
||||||
list.add(videoBean);
|
list.add(videoBean);
|
||||||
VideoStorge.getInstance().put(Constants.VIDEO_SINGLE, list);
|
VideoStorge.getInstance().put(Constants.VIDEO_SINGLE, list);
|
||||||
Intent intent = new Intent(context, VideoPlayActivity.class);
|
Intent intent = new Intent(context, VideoPlayActivity.class);
|
||||||
|
@ -13,6 +13,7 @@ import android.util.SparseArray;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
import com.yunbao.common.custom.ItemSlideHelper;
|
import com.yunbao.common.custom.ItemSlideHelper;
|
||||||
import com.yunbao.common.utils.ClickUtil;
|
import com.yunbao.common.utils.ClickUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
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 String TAG = "VideoScrollAdapter";
|
||||||
private static final int COUNT = 50;//接口每页返回多少条
|
private static final int COUNT = 50;//接口每页返回多少条
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private List<VideoBean> mList;
|
private List<ActiveBean> mList;
|
||||||
private SparseArray<VideoPlayWrapViewHolder> mMap;
|
private SparseArray<VideoPlayWrapViewHolder> mMap;
|
||||||
private int mCurPosition;
|
private int mCurPosition;
|
||||||
private ActionListener mActionListener;
|
private ActionListener mActionListener;
|
||||||
@ -43,7 +44,7 @@ public class VideoScrollAdapter extends RecyclerView.Adapter<VideoScrollAdapter.
|
|||||||
private Drawable[] mLikeAnimDrawables;
|
private Drawable[] mLikeAnimDrawables;
|
||||||
private Handler mHandler;
|
private Handler mHandler;
|
||||||
|
|
||||||
public VideoScrollAdapter(Context context, List<VideoBean> list, int curPosition) {
|
public VideoScrollAdapter(Context context, List<ActiveBean> list, int curPosition) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mList = list;
|
mList = list;
|
||||||
mCurPosition = curPosition;
|
mCurPosition = curPosition;
|
||||||
@ -213,7 +214,7 @@ public class VideoScrollAdapter extends RecyclerView.Adapter<VideoScrollAdapter.
|
|||||||
mVideoPlayWrapViewHolder = videoPlayWrapViewHolder;
|
mVideoPlayWrapViewHolder = videoPlayWrapViewHolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setData(VideoBean bean, int position, Object payload) {
|
void setData(ActiveBean bean, int position, Object payload) {
|
||||||
if (mVideoPlayWrapViewHolder != null) {
|
if (mVideoPlayWrapViewHolder != null) {
|
||||||
mMap.put(position, mVideoPlayWrapViewHolder);
|
mMap.put(position, mVideoPlayWrapViewHolder);
|
||||||
mVideoPlayWrapViewHolder.setData(bean, payload);
|
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) {
|
// if (list != null && list.size() > 0 && mList != null && mRecyclerView != null) {
|
||||||
// int position = mList.size();
|
// int position = mList.size();
|
||||||
// mList.addAll(list);
|
// mList.addAll(list);
|
||||||
|
@ -20,16 +20,16 @@ import android.widget.TextView;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
|
import com.yunbao.common.bean.CommentBean;
|
||||||
import com.yunbao.common.bean.UserBean;
|
import com.yunbao.common.bean.UserBean;
|
||||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||||
import com.yunbao.common.dialog.ChatFaceDialog;
|
import com.yunbao.common.dialog.ChatFaceDialog;
|
||||||
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.utils.DpUtil;
|
import com.yunbao.common.utils.DpUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
|
||||||
import com.yunbao.video.R;
|
import com.yunbao.video.R;
|
||||||
import com.yunbao.video.activity.AbsVideoPlayActivity;
|
import com.yunbao.video.activity.AbsVideoPlayActivity;
|
||||||
import com.yunbao.video.bean.VideoCommentBean;
|
|
||||||
import com.yunbao.video.event.VideoCommentEvent;
|
import com.yunbao.video.event.VideoCommentEvent;
|
||||||
import com.yunbao.video.http.VideoHttpConsts;
|
import com.yunbao.video.http.VideoHttpConsts;
|
||||||
import com.yunbao.video.http.VideoHttpUtil;
|
import com.yunbao.video.http.VideoHttpUtil;
|
||||||
@ -47,6 +47,8 @@ public class VideoInputDialogFragment extends AbsDialogFragment implements View.
|
|||||||
private InputMethodManager imm;
|
private InputMethodManager imm;
|
||||||
private EditText mInput;
|
private EditText mInput;
|
||||||
private boolean mOpenFace;
|
private boolean mOpenFace;
|
||||||
|
private boolean isComment;
|
||||||
|
private String replyCommentId;
|
||||||
private int mOriginHeight;
|
private int mOriginHeight;
|
||||||
private int mFaceHeight;
|
private int mFaceHeight;
|
||||||
private CheckBox mCheckBox;
|
private CheckBox mCheckBox;
|
||||||
@ -54,7 +56,6 @@ public class VideoInputDialogFragment extends AbsDialogFragment implements View.
|
|||||||
private Handler mHandler;
|
private Handler mHandler;
|
||||||
private String mVideoId;
|
private String mVideoId;
|
||||||
private String mVideoUid;
|
private String mVideoUid;
|
||||||
private VideoCommentBean mVideoCommentBean;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
@ -105,13 +106,8 @@ public class VideoInputDialogFragment extends AbsDialogFragment implements View.
|
|||||||
if (bundle != null) {
|
if (bundle != null) {
|
||||||
mOpenFace = bundle.getBoolean(Constants.VIDEO_FACE_OPEN, false);
|
mOpenFace = bundle.getBoolean(Constants.VIDEO_FACE_OPEN, false);
|
||||||
mFaceHeight = bundle.getInt(Constants.VIDEO_FACE_HEIGHT, 0);
|
mFaceHeight = bundle.getInt(Constants.VIDEO_FACE_HEIGHT, 0);
|
||||||
mVideoCommentBean = bundle.getParcelable(Constants.VIDEO_COMMENT_BEAN);
|
isComment = bundle.getBoolean(Constants.VIDEO_IS_COMMENT,false);
|
||||||
if (mVideoCommentBean != null) {
|
replyCommentId = bundle.getString(Constants.VIDEO_REPLY_ID);
|
||||||
UserBean replyUserBean = mVideoCommentBean.getUserBean();//要回复的人
|
|
||||||
if (replyUserBean != null) {
|
|
||||||
mInput.setHint(mContext.getString(R.string.video_comment_reply) + replyUserBean.getUserNiceName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (mOpenFace) {
|
if (mOpenFace) {
|
||||||
if (mCheckBox != null) {
|
if (mCheckBox != null) {
|
||||||
@ -268,30 +264,15 @@ public class VideoInputDialogFragment extends AbsDialogFragment implements View.
|
|||||||
ToastUtil.show(mContext.getString(R.string.content_empty));
|
ToastUtil.show(mContext.getString(R.string.content_empty));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String toUid = mVideoUid;
|
CommonHttpUtil.dynamicReply(mVideoId, isComment ? replyCommentId : "0", content, new HttpCallback() {
|
||||||
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() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
if (code == 0 && info.length > 0) {
|
|
||||||
if (mInput != null) {
|
if (mInput != null) {
|
||||||
mInput.setText("");
|
mInput.setText("");
|
||||||
}
|
}
|
||||||
JSONObject obj = JSON.parseObject(info[0]);
|
|
||||||
String commentNum = obj.getString("comments");
|
|
||||||
EventBus.getDefault().post(new VideoCommentEvent(mVideoId, commentNum));
|
|
||||||
ToastUtil.show(msg);
|
ToastUtil.show(msg);
|
||||||
dismiss();
|
dismiss();
|
||||||
((AbsVideoPlayActivity) mContext).hideCommentWindow(true);
|
((AbsVideoPlayActivity) mContext).hideCommentWindow(true);
|
||||||
} else if (code == 500) {
|
|
||||||
ToastUtil.show(msg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import android.view.WindowManager;
|
|||||||
|
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
import com.yunbao.common.bean.ConfigBean;
|
import com.yunbao.common.bean.ConfigBean;
|
||||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||||
import com.yunbao.video.R;
|
import com.yunbao.video.R;
|
||||||
@ -23,7 +24,7 @@ public class VideoShareDialogFragment extends AbsDialogFragment {
|
|||||||
|
|
||||||
private RecyclerView mRecyclerView;
|
private RecyclerView mRecyclerView;
|
||||||
private RecyclerView mRecyclerView2;
|
private RecyclerView mRecyclerView2;
|
||||||
private VideoBean mVideoBean;
|
private ActiveBean mVideoBean;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.yunbao.video.utils;
|
package com.yunbao.video.utils;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
import com.yunbao.common.bean.VideoBean;
|
import com.yunbao.common.bean.VideoBean;
|
||||||
import com.yunbao.video.interfaces.VideoScrollDataHelper;
|
import com.yunbao.video.interfaces.VideoScrollDataHelper;
|
||||||
|
|
||||||
@ -14,7 +15,7 @@ import java.util.Map;
|
|||||||
public class VideoStorge {
|
public class VideoStorge {
|
||||||
|
|
||||||
private static VideoStorge sInstance;
|
private static VideoStorge sInstance;
|
||||||
private Map<String, List<VideoBean>> mMap;
|
private Map<String, List<ActiveBean>> mMap;
|
||||||
private Map<String, VideoScrollDataHelper> mHelperMap;
|
private Map<String, VideoScrollDataHelper> mHelperMap;
|
||||||
|
|
||||||
private VideoStorge() {
|
private VideoStorge() {
|
||||||
@ -33,14 +34,14 @@ public class VideoStorge {
|
|||||||
return sInstance;
|
return sInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void put(String key, List<VideoBean> list) {
|
public void put(String key, List<ActiveBean> list) {
|
||||||
if (mMap != null) {
|
if (mMap != null) {
|
||||||
mMap.put(key, list);
|
mMap.put(key, list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<VideoBean> get(String key) {
|
public List<ActiveBean> get(String key) {
|
||||||
if (mMap != null) {
|
if (mMap != null) {
|
||||||
return mMap.get(key);
|
return mMap.get(key);
|
||||||
}
|
}
|
||||||
|
@ -4,29 +4,41 @@ import android.animation.Animator;
|
|||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.animation.TimeInterpolator;
|
import android.animation.TimeInterpolator;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.animation.AccelerateDecelerateInterpolator;
|
import android.view.animation.AccelerateDecelerateInterpolator;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.PopupWindow;
|
import android.widget.PopupWindow;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
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.Constants;
|
||||||
|
import com.yunbao.common.adapter.CommentAdapter;
|
||||||
|
import com.yunbao.common.adapter.CommentVideoAdapter;
|
||||||
import com.yunbao.common.adapter.RefreshAdapter;
|
import com.yunbao.common.adapter.RefreshAdapter;
|
||||||
|
import com.yunbao.common.bean.CommentBean;
|
||||||
import com.yunbao.common.custom.CommonRefreshView;
|
import com.yunbao.common.custom.CommonRefreshView;
|
||||||
import com.yunbao.common.custom.MyLinearLayout3;
|
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.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
import com.yunbao.common.interfaces.OnItemLongClickListener;
|
import com.yunbao.common.interfaces.OnItemLongClickListener;
|
||||||
import com.yunbao.common.utils.L;
|
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.common.views.AbsViewHolder;
|
||||||
import com.yunbao.live.activity.LiveReportActivity;
|
import com.yunbao.live.activity.LiveReportActivity;
|
||||||
import com.yunbao.video.R;
|
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 View mRoot;
|
||||||
private MyLinearLayout3 mBottom;
|
private MyLinearLayout3 mBottom;
|
||||||
private CommonRefreshView mRefreshView;
|
private CommonRefreshView mRefreshView;
|
||||||
private TextView mCommentNum;
|
private TextView mCommentNum;
|
||||||
private VideoCommentAdapter mVideoCommentAdapter;
|
private CommentVideoAdapter commentAdapter;
|
||||||
private String mVideoId;
|
private String mVideoId;
|
||||||
private String mVideoUid;
|
private String mVideoUid;
|
||||||
private String mCommentString;
|
private String mCommentString;
|
||||||
@ -61,6 +73,8 @@ public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClic
|
|||||||
private ObjectAnimator mHideAnimator;
|
private ObjectAnimator mHideAnimator;
|
||||||
private boolean mAnimating;
|
private boolean mAnimating;
|
||||||
private boolean mNeedRefresh;//是否需要刷新
|
private boolean mNeedRefresh;//是否需要刷新
|
||||||
|
private boolean isComment = false;
|
||||||
|
private RoundedImageView avatar;
|
||||||
|
|
||||||
public VideoCommentViewHolder(Context context, ViewGroup parentView) {
|
public VideoCommentViewHolder(Context context, ViewGroup parentView) {
|
||||||
super(context, parentView);
|
super(context, parentView);
|
||||||
@ -74,6 +88,8 @@ public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClic
|
|||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
mRoot = findViewById(R.id.root);
|
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);
|
mBottom = (MyLinearLayout3) findViewById(R.id.bottom);
|
||||||
int height = mBottom.getHeight2();
|
int height = mBottom.getHeight2();
|
||||||
mBottom.setTranslationY(height);
|
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.btn_close).setOnClickListener(this);
|
||||||
findViewById(R.id.input).setOnClickListener(this);
|
findViewById(R.id.input).setOnClickListener(this);
|
||||||
findViewById(R.id.btn_face).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);
|
mCommentNum = (TextView) findViewById(R.id.comment_num);
|
||||||
mRefreshView = (CommonRefreshView) findViewById(R.id.refreshView);
|
mRefreshView = (CommonRefreshView) findViewById(R.id.refreshView);
|
||||||
mRefreshView.setEmptyLayoutId(R.layout.view_no_data_comment);
|
mRefreshView.setEmptyLayoutId(R.layout.view_no_data_comment);
|
||||||
|
mRefreshView.setLoadMoreEnable(false);
|
||||||
mRefreshView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false) {
|
mRefreshView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false) {
|
||||||
@Override
|
@Override
|
||||||
public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
|
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
|
@Override
|
||||||
public RefreshAdapter<VideoCommentBean> getAdapter() {
|
public RefreshAdapter<CommentBean> getAdapter() {
|
||||||
if (mVideoCommentAdapter == null) {
|
if (commentAdapter == null) {
|
||||||
mVideoCommentAdapter = new VideoCommentAdapter(mContext);
|
commentAdapter = new CommentVideoAdapter(mContext, mVideoUid, new CommentVideoAdapter.onItemClickListener() {
|
||||||
mVideoCommentAdapter.setOnItemClickListener(VideoCommentViewHolder.this);
|
@Override
|
||||||
mVideoCommentAdapter.setOnItemLongClickListener(VideoCommentViewHolder.this);
|
public void onReply(CommentBean activeBean) {
|
||||||
mVideoCommentAdapter.setActionListener(VideoCommentViewHolder.this);
|
isComment = true;
|
||||||
|
if (!TextUtils.isEmpty(mVideoId) && !TextUtils.isEmpty(mVideoUid)) {
|
||||||
|
((AbsVideoCommentActivity) mContext).openCommentInputWindowNew(false, mVideoId, mVideoUid, isComment, activeBean.getId(), commentAdapter.getItemCount());
|
||||||
}
|
}
|
||||||
return mVideoCommentAdapter;
|
}
|
||||||
|
|
||||||
|
@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 commentAdapter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadData(int p, HttpCallback callback) {
|
public void loadData(int p, HttpCallback callback) {
|
||||||
if (!TextUtils.isEmpty(mVideoId)) {
|
if (!TextUtils.isEmpty(mVideoId)) {
|
||||||
VideoHttpUtil.getVideoCommentList(mVideoId, p, callback);
|
CommonHttpUtil.getCommunityComment(mVideoId, mVideoUid, p, callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
@Override
|
@Override
|
||||||
public List<VideoCommentBean> processData(String[] info) {
|
public List<CommentBean> processData(String[] info) {
|
||||||
JSONObject obj = JSON.parseObject(info[0]);
|
List<CommentBean> list = JSON.parseArray(Arrays.toString(info), CommentBean.class);
|
||||||
String commentNum = obj.getString("comments");
|
String commentNum = String.valueOf(list.size());
|
||||||
EventBus.getDefault().post(new VideoCommentEvent(mVideoId, commentNum));
|
EventBus.getDefault().post(new VideoCommentEvent(mVideoId, commentNum));
|
||||||
if (mCommentNum != null) {
|
if (mCommentNum != null) {
|
||||||
mCommentNum.setText(mCommentString + " " + commentNum);
|
mCommentNum.setText(mCommentString + " " + commentNum);
|
||||||
}
|
}
|
||||||
List<VideoCommentBean> list = JSON.parseArray(obj.getString("commentlist"), VideoCommentBean.class);
|
for (CommentBean bean : list) {
|
||||||
for (VideoCommentBean bean : list) {
|
|
||||||
if (bean != null) {
|
if (bean != null) {
|
||||||
bean.setParentNode(true);
|
bean.setParentNode(true);
|
||||||
}
|
}
|
||||||
@ -166,7 +228,7 @@ public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClic
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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
|
@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) {
|
public void setVideoInfo(String videoId, String videoUid) {
|
||||||
if (!TextUtils.isEmpty(videoId) && !TextUtils.isEmpty(videoUid)) {
|
if (!TextUtils.isEmpty(videoId) && !TextUtils.isEmpty(videoUid)) {
|
||||||
if (!TextUtils.isEmpty(mVideoId) && !mVideoId.equals(videoId)) {
|
if (!TextUtils.isEmpty(mVideoId) && !mVideoId.equals(videoId)) {
|
||||||
if (mVideoCommentAdapter != null) {
|
if (commentAdapter != null) {
|
||||||
mVideoCommentAdapter.clearData();
|
commentAdapter.clearData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!videoId.equals(mVideoId)) {
|
if (!videoId.equals(mVideoId)) {
|
||||||
@ -235,11 +297,11 @@ public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClic
|
|||||||
hideBottom();
|
hideBottom();
|
||||||
} else if (i == R.id.input) {
|
} else if (i == R.id.input) {
|
||||||
if (!TextUtils.isEmpty(mVideoId) && !TextUtils.isEmpty(mVideoUid)) {
|
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) {
|
} else if (i == R.id.btn_face) {
|
||||||
if (!TextUtils.isEmpty(mVideoId) && !TextUtils.isEmpty(mVideoUid)) {
|
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);
|
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当前点击的控件,手指长按任意位置弹窗
|
//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);
|
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);
|
final PopupWindow mPopupWindow = new PopupWindow(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
mPopupWindow.setContentView(pop_layout);
|
mPopupWindow.setContentView(pop_layout);
|
||||||
|
@ -15,6 +15,7 @@ import com.tencent.rtmp.TXLiveConstants;
|
|||||||
import com.tencent.rtmp.TXVodPlayConfig;
|
import com.tencent.rtmp.TXVodPlayConfig;
|
||||||
import com.tencent.rtmp.TXVodPlayer;
|
import com.tencent.rtmp.TXVodPlayer;
|
||||||
import com.tencent.rtmp.ui.TXCloudVideoView;
|
import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||||
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
import com.yunbao.common.views.AbsViewHolder;
|
import com.yunbao.common.views.AbsViewHolder;
|
||||||
import com.yunbao.video.R;
|
import com.yunbao.video.R;
|
||||||
@ -39,7 +40,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
|||||||
private ObjectAnimator mPlayBtnAnimator;//暂停按钮的动画
|
private ObjectAnimator mPlayBtnAnimator;//暂停按钮的动画
|
||||||
private boolean mStartPlay;
|
private boolean mStartPlay;
|
||||||
private boolean mEndPlay;
|
private boolean mEndPlay;
|
||||||
private VideoBean mVideoBean;
|
private ActiveBean mVideoBean;
|
||||||
private String mCachePath;
|
private String mCachePath;
|
||||||
private TXVodPlayConfig mTXVodPlayConfig;
|
private TXVodPlayConfig mTXVodPlayConfig;
|
||||||
|
|
||||||
@ -97,7 +98,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
|||||||
if (!mEndPlay) {
|
if (!mEndPlay) {
|
||||||
mEndPlay = true;
|
mEndPlay = true;
|
||||||
if (mVideoBean != null) {
|
if (mVideoBean != null) {
|
||||||
VideoHttpUtil.videoWatchEnd(mVideoBean.getUid(), mVideoBean.getId());
|
VideoHttpUtil.videoWatchEnd(mVideoBean.getUser_id(), mVideoBean.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -152,7 +153,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
|||||||
/**
|
/**
|
||||||
* 开始播放
|
* 开始播放
|
||||||
*/
|
*/
|
||||||
public void startPlay(VideoBean videoBean) {
|
public void startPlay(ActiveBean videoBean) {
|
||||||
mStartPlay = false;
|
mStartPlay = false;
|
||||||
mClickPaused = false;
|
mClickPaused = false;
|
||||||
mEndPlay = false;
|
mEndPlay = false;
|
||||||
@ -165,7 +166,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
|||||||
if (videoBean == null) {
|
if (videoBean == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String url = videoBean.getHref();
|
String url = videoBean.getVideo();
|
||||||
if (TextUtils.isEmpty(url)) {
|
if (TextUtils.isEmpty(url)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -183,7 +184,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
|||||||
if (mPlayer != null) {
|
if (mPlayer != null) {
|
||||||
mPlayer.startPlay(url);
|
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 android.widget.TextView;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.utils.TextUtils;
|
import com.alibaba.android.arouter.utils.TextUtils;
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.xuexiang.xui.widget.flowlayout.FlowTagLayout;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.Constants;
|
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.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.interfaces.CommonCallback;
|
import com.yunbao.common.interfaces.CommonCallback;
|
||||||
import com.yunbao.common.utils.RouteUtil;
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.views.AbsViewHolder;
|
import com.yunbao.common.views.AbsViewHolder;
|
||||||
import com.yunbao.live.activity.LiveReportActivity;
|
|
||||||
import com.yunbao.video.R;
|
import com.yunbao.video.R;
|
||||||
import com.yunbao.video.activity.AbsVideoPlayActivity;
|
import com.yunbao.video.activity.AbsVideoPlayActivity;
|
||||||
import com.yunbao.common.bean.VideoBean;
|
|
||||||
import com.yunbao.video.dialog.VideoShareDialogFragment;
|
import com.yunbao.video.dialog.VideoShareDialogFragment;
|
||||||
import com.yunbao.video.event.VideoLikeEvent;
|
import com.yunbao.video.event.VideoLikeEvent;
|
||||||
import com.yunbao.video.http.VideoHttpUtil;
|
import com.yunbao.video.http.VideoHttpUtil;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/11/26.
|
* Created by cxf on 2018/11/26.
|
||||||
* 视频播放外框
|
* 视频播放外框
|
||||||
@ -58,7 +61,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
private TextView mCommentNum;//评论数
|
private TextView mCommentNum;//评论数
|
||||||
private TextView mShareNum;//分享数
|
private TextView mShareNum;//分享数
|
||||||
private ImageView mBtnFollow;//关注按钮
|
private ImageView mBtnFollow;//关注按钮
|
||||||
private VideoBean mVideoBean;
|
private ActiveBean mVideoBean;
|
||||||
private Drawable mFollowDrawable = null;//已关注
|
private Drawable mFollowDrawable = null;//已关注
|
||||||
private Drawable mUnFollowDrawable;//未关注
|
private Drawable mUnFollowDrawable;//未关注
|
||||||
private Animation mFollowAnimation;
|
private Animation mFollowAnimation;
|
||||||
@ -71,6 +74,8 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
private LinearLayout progressTextLayout;
|
private LinearLayout progressTextLayout;
|
||||||
private TextView progressTextView;
|
private TextView progressTextView;
|
||||||
private TextView progressCount;
|
private TextView progressCount;
|
||||||
|
private FlowTagLayout myFlowTag; //我的标签
|
||||||
|
private LabelVideoTagAdapter myAdapter;
|
||||||
|
|
||||||
public VideoPlayWrapViewHolder(Context context, ViewGroup parentView) {
|
public VideoPlayWrapViewHolder(Context context, ViewGroup parentView) {
|
||||||
super(context, parentView);
|
super(context, parentView);
|
||||||
@ -84,7 +89,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
mTag = this.toString();
|
mTag = this.toString();
|
||||||
|
myFlowTag = (FlowTagLayout) findViewById(R.id.myFlowTag);
|
||||||
seekbar = (SeekBar) findViewById(R.id.seekbar);
|
seekbar = (SeekBar) findViewById(R.id.seekbar);
|
||||||
progressTextLayout = (LinearLayout) findViewById(R.id.progressTextLayout);
|
progressTextLayout = (LinearLayout) findViewById(R.id.progressTextLayout);
|
||||||
progressTextView = (TextView) findViewById(R.id.progress);
|
progressTextView = (TextView) findViewById(R.id.progress);
|
||||||
@ -176,7 +181,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
@Override
|
@Override
|
||||||
public void onAnimationRepeat(Animation animation) {
|
public void onAnimationRepeat(Animation animation) {
|
||||||
if (mBtnFollow != null && mVideoBean != null) {
|
if (mBtnFollow != null && mVideoBean != null) {
|
||||||
if (mVideoBean.getAttent() == 1) {
|
if (mVideoBean.getIs_attention().equals("1")) {
|
||||||
mBtnFollow.setImageDrawable(mFollowDrawable);
|
mBtnFollow.setImageDrawable(mFollowDrawable);
|
||||||
} else {
|
} else {
|
||||||
mBtnFollow.setImageDrawable(mUnFollowDrawable);
|
mBtnFollow.setImageDrawable(mUnFollowDrawable);
|
||||||
@ -190,51 +195,50 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
mLikeAnimDrawables = drawables;
|
mLikeAnimDrawables = drawables;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setData(VideoBean bean, Object payload) {
|
public void setData(ActiveBean bean, Object payload) {
|
||||||
if (bean == null) {
|
if (bean == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mVideoBean = bean;
|
mVideoBean = bean;
|
||||||
UserBean u = mVideoBean.getUserBean();
|
|
||||||
if (payload == null) {
|
if (payload == null) {
|
||||||
if (mCover != null) {
|
if (mCover != null) {
|
||||||
setCoverImage();
|
setCoverImage();
|
||||||
}
|
}
|
||||||
if (mTitle != null) {
|
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) {
|
if (mAvatar != null) {
|
||||||
ImgLoader.displayAvatar(mContext, u.getAvatar(), mAvatar);
|
ImgLoader.displayAvatar(mContext, mVideoBean.getUser_avatar(), mAvatar);
|
||||||
}
|
}
|
||||||
if (mName != null) {
|
if (mName != null) {
|
||||||
mName.setText("@" + u.getUserNiceName());
|
mName.setText("@" + mVideoBean.getUser_name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mBtnLike != null) {
|
if (mBtnLike != null) {
|
||||||
if (bean.getLike() == 1) {
|
if (bean.getIs_love().equals("1")) {
|
||||||
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new02);
|
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new02);
|
||||||
} else {
|
} else {
|
||||||
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new01);
|
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new01);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mLikeNum != null) {
|
if (mLikeNum != null) {
|
||||||
mLikeNum.setText(bean.getLikeNum());
|
mLikeNum.setText(String.valueOf(bean.getLove_num()));
|
||||||
}
|
}
|
||||||
if (mCommentNum != null) {
|
if (mCommentNum != null) {
|
||||||
mCommentNum.setText(bean.getCommentNum());
|
mCommentNum.setText(String.valueOf(bean.getComment_num()));
|
||||||
}
|
}
|
||||||
if (mShareNum != null) {
|
if (mShareNum != null) {
|
||||||
mShareNum.setText(bean.getShareNum());
|
mShareNum.setText(String.valueOf(bean.getShare_num()));
|
||||||
}
|
}
|
||||||
if (u != null && mBtnFollow != null) {
|
if (mVideoBean != null && mBtnFollow != null) {
|
||||||
String toUid = u.getId();
|
String toUid = mVideoBean.getUser_id();
|
||||||
if (!TextUtils.isEmpty(toUid) && !toUid.equals(CommonAppConfig.getInstance().getUid())) {
|
if (!TextUtils.isEmpty(toUid) && !toUid.equals(CommonAppConfig.getInstance().getUid())) {
|
||||||
if (mBtnFollow.getVisibility() != View.VISIBLE) {
|
if (mBtnFollow.getVisibility() != View.VISIBLE) {
|
||||||
mBtnFollow.setVisibility(View.VISIBLE);
|
mBtnFollow.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
if (bean.getAttent() == 1) {
|
if (bean.getIs_attention().equals("1")) {
|
||||||
mBtnFollow.setImageDrawable(mFollowDrawable);
|
mBtnFollow.setImageDrawable(mFollowDrawable);
|
||||||
} else {
|
} else {
|
||||||
mBtnFollow.setImageDrawable(mUnFollowDrawable);
|
mBtnFollow.setImageDrawable(mUnFollowDrawable);
|
||||||
@ -245,10 +249,10 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!Constants.myUid.endsWith(bean.getUid())) {
|
if (!Constants.myUid.endsWith(bean.getUser_id())) {
|
||||||
if (bean.getAttent() == 2) {
|
if (bean.getIs_attention().equals("2")) {
|
||||||
mBtnFollow.setVisibility(View.VISIBLE);
|
mBtnFollow.setVisibility(View.VISIBLE);
|
||||||
if (bean.getAttent() == 1) {
|
if (bean.getIs_attention().equals("1")) {
|
||||||
mBtnFollow.setImageDrawable(mFollowDrawable);
|
mBtnFollow.setImageDrawable(mFollowDrawable);
|
||||||
} else {
|
} else {
|
||||||
mBtnFollow.setImageDrawable(mUnFollowDrawable);
|
mBtnFollow.setImageDrawable(mUnFollowDrawable);
|
||||||
@ -259,10 +263,18 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
} else {
|
} else {
|
||||||
mBtnFollow.setVisibility(View.GONE);
|
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() {
|
private void setCoverImage() {
|
||||||
ImgLoader.displayDrawable(mContext, mVideoBean.getThumb(), new ImgLoader.DrawableCallback() {
|
ImgLoader.displayDrawable(mContext, mVideoBean.getVideo() + "?vframe/jpg/offset/0", new ImgLoader.DrawableCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onLoadSuccess(Drawable drawable) {
|
public void onLoadSuccess(Drawable drawable) {
|
||||||
if (mCover != null && drawable != null) {
|
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;
|
return mVideoBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -376,7 +388,10 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
clickLike();
|
clickLike();
|
||||||
} else if (i == R.id.avatar2) {
|
} else if (i == R.id.avatar2) {
|
||||||
clickAvatar();
|
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) {
|
if (mVideoBean == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -390,7 +405,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
*/
|
*/
|
||||||
public void clickAvatar() {
|
public void clickAvatar() {
|
||||||
if (mVideoBean != null) {
|
if (mVideoBean != null) {
|
||||||
RouteUtil.forwardUserHome(mContext, mVideoBean.getUid(), 2);
|
RouteUtil.forwardUserHome(mVideoBean.getUser_id());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -401,28 +416,26 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
if (mVideoBean == null) {
|
if (mVideoBean == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
VideoHttpUtil.setVideoLike(mTag, mVideoBean.getId(), new HttpCallback() {
|
CommonHttpUtil.dynamicLove(mVideoBean.getId(), new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
if (code == 0 && info.length > 0) {
|
if (code == 0) {
|
||||||
JSONObject obj = JSON.parseObject(info[0]);
|
ToastUtil.show(msg);
|
||||||
String likeNum = obj.getString("likes");
|
if (mVideoBean.getIs_love().equals("1")) {
|
||||||
int like = obj.getIntValue("islike");
|
int loveNum = Integer.parseInt(mVideoBean.getLove_num());
|
||||||
if (mVideoBean != null) {
|
mVideoBean.setIs_love(String.valueOf(loveNum - 1));
|
||||||
mVideoBean.setLikeNum(likeNum);
|
} else {
|
||||||
mVideoBean.setLike(like);
|
int loveNum = Integer.parseInt(mVideoBean.getLove_num());
|
||||||
EventBus.getDefault().post(new VideoLikeEvent(mVideoBean.getId(), like, likeNum));
|
mVideoBean.setIs_love(String.valueOf(loveNum + 1));
|
||||||
}
|
}
|
||||||
if (mLikeNum != null) {
|
String isLike = mVideoBean.getIs_love().equals("1") ? "0" : "1";
|
||||||
mLikeNum.setText(likeNum);
|
mVideoBean.setIs_love(isLike);
|
||||||
}
|
EventBus.getDefault().post(new VideoLikeEvent(mVideoBean.getId(), Integer.parseInt(mVideoBean.getLove_num()), mVideoBean.getLove_num()));
|
||||||
if (mBtnLike != null) {
|
if (mVideoBean.getIs_love().equals("1")) {
|
||||||
if (like == 1) {
|
|
||||||
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new02);
|
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new02);
|
||||||
} else {
|
} else {
|
||||||
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new01);
|
mBtnLike.setImageResource(R.mipmap.icon_video_zan_new01);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
ToastUtil.show(msg);
|
ToastUtil.show(msg);
|
||||||
}
|
}
|
||||||
@ -437,14 +450,10 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
if (mVideoBean == null) {
|
if (mVideoBean == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final UserBean u = mVideoBean.getUserBean();
|
CommonHttpUtil.setAttention(mTag, mVideoBean.getUser_id(), new CommonCallback<Integer>() {
|
||||||
if (u == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
CommonHttpUtil.setAttention(mTag, u.getId(), new CommonCallback<Integer>() {
|
|
||||||
@Override
|
@Override
|
||||||
public void callback(Integer attent) {
|
public void callback(Integer attent) {
|
||||||
mVideoBean.setAttent(attent);
|
mVideoBean.setIs_attention(String.valueOf(attent));
|
||||||
if (attent == 1) {
|
if (attent == 1) {
|
||||||
mBtnFollow.setImageDrawable(mFollowDrawable);
|
mBtnFollow.setImageDrawable(mFollowDrawable);
|
||||||
} else {
|
} else {
|
||||||
@ -470,7 +479,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
* 点击评论按钮
|
* 点击评论按钮
|
||||||
*/
|
*/
|
||||||
private void clickComment() {
|
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 android.view.ViewGroup;
|
||||||
|
|
||||||
import com.umeng.analytics.MobclickAgent;
|
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.event.FollowEvent;
|
||||||
import com.yunbao.common.views.AbsViewHolder;
|
import com.yunbao.common.views.AbsViewHolder;
|
||||||
import com.yunbao.video.R;
|
import com.yunbao.video.R;
|
||||||
import com.yunbao.video.activity.AbsVideoPlayActivity;
|
import com.yunbao.video.activity.AbsVideoPlayActivity;
|
||||||
import com.yunbao.video.adapter.VideoScrollAdapter;
|
import com.yunbao.video.adapter.VideoScrollAdapter;
|
||||||
import com.yunbao.common.bean.VideoBean;
|
import com.yunbao.common.bean.VideoBean;
|
||||||
|
import com.yunbao.video.bean.VideoCommentBean;
|
||||||
import com.yunbao.video.custom.VideoLoadingBar;
|
import com.yunbao.video.custom.VideoLoadingBar;
|
||||||
import com.yunbao.video.event.VideoCommentEvent;
|
import com.yunbao.video.event.VideoCommentEvent;
|
||||||
import com.yunbao.video.event.VideoLikeEvent;
|
import com.yunbao.video.event.VideoLikeEvent;
|
||||||
@ -51,7 +54,7 @@ public class VideoScrollViewHolder extends AbsViewHolder implements VideoScrollA
|
|||||||
// private HttpCallback mRefreshCallback;//下拉刷新回调
|
// private HttpCallback mRefreshCallback;//下拉刷新回调
|
||||||
// private HttpCallback mLoadMoreCallback;//上拉加载更多回调
|
// private HttpCallback mLoadMoreCallback;//上拉加载更多回调
|
||||||
private VideoScrollDataHelper mVideoDataHelper;
|
private VideoScrollDataHelper mVideoDataHelper;
|
||||||
private VideoBean mVideoBean;
|
private ActiveBean mVideoBean;
|
||||||
private boolean mPaused;//生命周期暂停
|
private boolean mPaused;//生命周期暂停
|
||||||
|
|
||||||
public VideoScrollViewHolder(Context context, ViewGroup parentView, int position, String videoKey, int page) {
|
public VideoScrollViewHolder(Context context, ViewGroup parentView, int position, String videoKey, int page) {
|
||||||
@ -72,7 +75,7 @@ public class VideoScrollViewHolder extends AbsViewHolder implements VideoScrollA
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
List<VideoBean> list = VideoStorge.getInstance().get(mVideoKey);
|
List<ActiveBean> list = VideoStorge.getInstance().get(mVideoKey);
|
||||||
if (list == null || list.size() == 0) {
|
if (list == null || list.size() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -143,7 +146,7 @@ public class VideoScrollViewHolder extends AbsViewHolder implements VideoScrollA
|
|||||||
public void onPageSelected(VideoPlayWrapViewHolder videoPlayWrapViewHolder, boolean needLoadMore) {
|
public void onPageSelected(VideoPlayWrapViewHolder videoPlayWrapViewHolder, boolean needLoadMore) {
|
||||||
if (videoPlayWrapViewHolder != null) {
|
if (videoPlayWrapViewHolder != null) {
|
||||||
MobclickAgent.onEvent(mContext, "community_video_slide", "社区视频上下滑动");
|
MobclickAgent.onEvent(mContext, "community_video_slide", "社区视频上下滑动");
|
||||||
VideoBean videoBean = videoPlayWrapViewHolder.getVideoBean();
|
ActiveBean videoBean = videoPlayWrapViewHolder.getVideoBean();
|
||||||
if (videoBean != null) {
|
if (videoBean != null) {
|
||||||
mVideoBean = videoBean;
|
mVideoBean = videoBean;
|
||||||
mVideoPlayWrapViewHolder = videoPlayWrapViewHolder;
|
mVideoPlayWrapViewHolder = videoPlayWrapViewHolder;
|
||||||
@ -252,7 +255,7 @@ public class VideoScrollViewHolder extends AbsViewHolder implements VideoScrollA
|
|||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onFollowEvent(FollowEvent e) {
|
public void onFollowEvent(FollowEvent e) {
|
||||||
if (mVideoScrollAdapter != null && mVideoPlayWrapViewHolder != null) {
|
if (mVideoScrollAdapter != null && mVideoPlayWrapViewHolder != null) {
|
||||||
VideoBean videoBean = mVideoPlayWrapViewHolder.getVideoBean();
|
ActiveBean videoBean = mVideoPlayWrapViewHolder.getVideoBean();
|
||||||
if (videoBean != null) {
|
if (videoBean != null) {
|
||||||
mVideoScrollAdapter.onFollowChanged(!mPaused, videoBean.getId(), e.getToUid(), e.getIsAttention());
|
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) {
|
private void openCommentInputWindow(boolean openFace) {
|
||||||
if (mVideoBean != null) {
|
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:layout_height="36dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
android:paddingRight="5dp">
|
android:paddingRight="5dp"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/comment_num"
|
android:id="@+id/comment_num"
|
||||||
@ -36,7 +37,7 @@
|
|||||||
android:layout_height="36dp"
|
android:layout_height="36dp"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:src="@mipmap/icon_video_comment_close"
|
android:src="@mipmap/icon_video_comment_close"
|
||||||
android:tint="@color/gray1" />
|
app:tint="@color/gray1" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -54,6 +55,13 @@
|
|||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
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
|
<TextView
|
||||||
android:id="@+id/input"
|
android:id="@+id/input"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@ -77,7 +85,7 @@
|
|||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:paddingRight="10dp"
|
android:paddingRight="10dp"
|
||||||
android:src="@mipmap/icon_chat_face"
|
android:src="@mipmap/icon_chat_face"
|
||||||
android:tint="@color/gray1" />
|
app:tint="@color/gray1" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</com.yunbao.common.custom.MyLinearLayout3>
|
</com.yunbao.common.custom.MyLinearLayout3>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
@ -17,27 +17,13 @@
|
|||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:scaleType="centerCrop" />
|
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
|
<RelativeLayout
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:layout_marginBottom="120dp"
|
android:layout_marginBottom="100dp"
|
||||||
android:visibility="visible">
|
android:visibility="visible">
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
@ -141,7 +127,7 @@
|
|||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="9dp"
|
android:layout_marginLeft="9dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
@ -164,6 +150,12 @@
|
|||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:visibility="visible" />
|
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>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -203,7 +195,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:max="100"
|
android:max="100"
|
||||||
android:min="0" />
|
android:min="0"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|