fix [修复-bug]
This commit is contained in:
@@ -35,6 +35,7 @@ import com.google.gson.Gson;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.activity.VideoPlayActivity;
|
||||
import com.yunbao.common.bean.NewCommunityType;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
@@ -74,21 +75,20 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
private List<Uri> uriList = new ArrayList<>();
|
||||
private File videoFile;
|
||||
private ActiveImageAdapter activeImageAdapter;
|
||||
private VideoView videoView;
|
||||
private ImageView videoView;
|
||||
private RelativeLayout videoViewLayout;
|
||||
private ImageView delVideo;
|
||||
private TextView talkContent;
|
||||
private List<String> talkList = new ArrayList<>();
|
||||
private TextView submit;
|
||||
private boolean isImage;
|
||||
UploadQnImpl mUploadStrategy;
|
||||
|
||||
private List<String> imgUrlList = new ArrayList<>();
|
||||
private String videoUrl;
|
||||
List<NewCommunityType> newCommunityTypeList = new ArrayList<>();
|
||||
int talkId;
|
||||
|
||||
Dialog dialog;
|
||||
private Uri videoUri;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -150,7 +150,6 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
videoFile = null;
|
||||
videoView.stopPlayback();
|
||||
videoViewLayout.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
@@ -242,6 +241,14 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
activeImageAdapter.deleteItem(position);
|
||||
}
|
||||
});
|
||||
videoView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(CommunitySendActivity.this, VideoPlayActivity.class);
|
||||
intent.putExtra("videoUri", videoUri);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void submit() {
|
||||
@@ -388,40 +395,68 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
}
|
||||
isImage = true;
|
||||
} else if (requestCode == CHOOSE_VIDEO && resultCode == RESULT_OK && data != null) {
|
||||
Uri uri = data.getData();
|
||||
videoFile = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, uri)));
|
||||
videoView.setVideoURI(uri);
|
||||
videoView.start();
|
||||
videoUri = data.getData();
|
||||
videoFile = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, videoUri)));
|
||||
videoView.setImageBitmap(FilesUtils.getVideoThumbnail(videoFile.getPath()));
|
||||
videoViewLayout.setVisibility(View.VISIBLE);
|
||||
isImage = false;
|
||||
}
|
||||
}
|
||||
|
||||
int uplaodIndex = 0;
|
||||
|
||||
List<UploadBean> uploadBeans;
|
||||
|
||||
private void uploadFile(List<UploadBean> uploadBeans, boolean isImg) {
|
||||
if (mUploadStrategy == null) {
|
||||
mUploadStrategy = new UploadQnImpl(mContext);
|
||||
}
|
||||
dialog = DialogUitl.loadingDialog(mContext, mContext.getResources().getString(com.yunbao.main.R.string.uploading));
|
||||
dialog.show();
|
||||
mUploadStrategy.upload(uploadBeans, true, new UploadCallback() {
|
||||
@Override
|
||||
public void onFinish(List<UploadBean> list, boolean success) {
|
||||
if (!success) {
|
||||
dialog.dismiss();
|
||||
ToastUtil.show(mContext.getResources().getString(com.yunbao.main.R.string.upload_fail));
|
||||
return;
|
||||
}
|
||||
if (isImage) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
imgUrlList.add(list.get(i).getRemoteAccessUrl());
|
||||
this.uploadBeans = uploadBeans;
|
||||
if (uploadBeans != null && !uploadBeans.isEmpty()) {
|
||||
uploadFile(uploadBeans.get(0), isImg);
|
||||
}
|
||||
}
|
||||
|
||||
private void uploadFile(UploadBean uploadBean, boolean isImg) {
|
||||
if (isImg) {
|
||||
UploadQnImpl mUploadStrategy = new UploadQnImpl(mContext);
|
||||
List<UploadBean> tempList = new ArrayList<>();
|
||||
tempList.add(uploadBean);
|
||||
mUploadStrategy.upload(tempList, true, new UploadCallback() {
|
||||
@Override
|
||||
public void onFinish(List<UploadBean> list, boolean success) {
|
||||
if (!success) {
|
||||
dialog.dismiss();
|
||||
ToastUtil.show(mContext.getResources().getString(com.yunbao.main.R.string.upload_fail));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
videoUrl = list.get(0).getRemoteAccessUrl();
|
||||
uplaodIndex++;
|
||||
imgUrlList.add(list.get(0).getRemoteAccessUrl());
|
||||
if (uplaodIndex != uploadBeans.size()) {
|
||||
uploadFile(uploadBeans.get(uplaodIndex), isImg);
|
||||
} else {
|
||||
submit();
|
||||
}
|
||||
L.e(new Gson().toJson(list));
|
||||
}
|
||||
submit();
|
||||
L.e(new Gson().toJson(list));
|
||||
}
|
||||
}, isImg);
|
||||
}, isImg);
|
||||
} else {
|
||||
UploadQnImpl mUploadStrategy = new UploadQnImpl(mContext);
|
||||
List<UploadBean> tempList = new ArrayList<>();
|
||||
tempList.add(uploadBeans.get(uplaodIndex));
|
||||
mUploadStrategy.upload(tempList, true, new UploadCallback() {
|
||||
@Override
|
||||
public void onFinish(List<UploadBean> list, boolean success) {
|
||||
if (!success) {
|
||||
dialog.dismiss();
|
||||
ToastUtil.show(mContext.getResources().getString(com.yunbao.main.R.string.upload_fail));
|
||||
return;
|
||||
}
|
||||
videoUrl = list.get(0).getRemoteAccessUrl();
|
||||
submit();
|
||||
L.e(new Gson().toJson(list));
|
||||
}
|
||||
}, isImg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,6 +48,7 @@ import com.yunbao.common.bean.HomeUserExhibitInfoBean;
|
||||
import com.yunbao.common.bean.HomeUserInfoBean;
|
||||
import com.yunbao.common.bean.LabelBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.bean.UserHomeImgBean;
|
||||
import com.yunbao.common.dialog.ImagePreviewDialog;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
@@ -56,6 +57,7 @@ import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.upload.UploadBean;
|
||||
import com.yunbao.common.upload.UploadCallback;
|
||||
import com.yunbao.common.upload.UploadQnImpl;
|
||||
@@ -74,6 +76,8 @@ import com.yunbao.live.views.ShowBigPhoto;
|
||||
import com.yunbao.video.activity.VideoPlayActivity;
|
||||
import com.yunbao.video.utils.VideoStorge;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -157,6 +161,8 @@ public class UserHomeActivity extends AbsActivity {
|
||||
List<ActiveBean> beanList = new ArrayList<>();
|
||||
private UserHomeImgsViewHolder userHomeImgsViewHolder;
|
||||
private Map<String, String> gotoRoomKey = new HashMap<>();
|
||||
private TextView authorNum;
|
||||
private TextView levelNum;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -272,8 +278,31 @@ public class UserHomeActivity extends AbsActivity {
|
||||
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, userInfo.getUserHomeTopInfo().getUser_level_anchor_img(), authorIcon);
|
||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_img(), levelIcon);
|
||||
|
||||
//主播等级
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
|
||||
int anchorLevel = 0;
|
||||
anchorLevel = Integer.parseInt(userInfo.getUserHomeTopInfo().getUser_level_anchor());
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getThumb();
|
||||
}
|
||||
}
|
||||
ImgLoader.display(UserHomeActivity.this, imgUrl, authorIcon);
|
||||
//用户等级
|
||||
List<NewLevelModel> models1 = new NewLevelManager(mContext).getNewLevelModels();
|
||||
int anchorLevel1 = 0;
|
||||
anchorLevel1 = Integer.parseInt(userInfo.getUserHomeTopInfo().getUser_level());
|
||||
String imgUrl1 = "";
|
||||
for (NewLevelModel newLevelModel : models1) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel1 && anchorLevel1 <= newLevelModel.getLeveMax()) {
|
||||
imgUrl1 = newLevelModel.getThumb();
|
||||
}
|
||||
}
|
||||
authorNum.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_level_anchor()));
|
||||
levelNum.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_level()));
|
||||
ImgLoader.display(UserHomeActivity.this, imgUrl1, levelIcon);
|
||||
|
||||
if (isAnchor) {//是否是主播
|
||||
authorIcon.setVisibility(View.VISIBLE);
|
||||
@@ -311,18 +340,35 @@ public class UserHomeActivity extends AbsActivity {
|
||||
tagList.add(userInfo.getUserHomeTopInfo().getHeight() + "cm");
|
||||
}
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getCareer())) {
|
||||
tagList.add(userInfo.getUserHomeTopInfo().getCareer());
|
||||
if (WordUtil.isNewZh()) {
|
||||
tagList.add(userInfo.getUserHomeTopInfo().getCareer());
|
||||
} else {
|
||||
tagList.add(userInfo.getUserHomeTopInfo().getEn_career());
|
||||
}
|
||||
}
|
||||
if (userInfo.getUserHomeTopInfo().getCn_label() != null) {
|
||||
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));
|
||||
if (WordUtil.isNewZh()) {
|
||||
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.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE);
|
||||
myAdapter.setData(tagList);
|
||||
}
|
||||
}else{
|
||||
if (userInfo.getUserHomeTopInfo().getCn_label().size() > 0) {
|
||||
for (int i = 0; i < userInfo.getUserHomeTopInfo().getEn_label().size(); i++) {
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getEn_label().get(i))) {
|
||||
tagList.add(userInfo.getUserHomeTopInfo().getEn_label().get(i));
|
||||
}
|
||||
}
|
||||
myFlowTag.setAdapter(myAdapter);
|
||||
myFlowTag.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE);
|
||||
myAdapter.setData(tagList);
|
||||
}
|
||||
myFlowTag.setAdapter(myAdapter);
|
||||
myFlowTag.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE);
|
||||
myAdapter.setData(tagList);
|
||||
}
|
||||
}
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getFans_name())) {
|
||||
@@ -450,6 +496,8 @@ public class UserHomeActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
authorNum = findViewById(R.id.authorlNum);
|
||||
levelNum = findViewById(R.id.levelNum);
|
||||
fanName = findViewById(R.id.fanName);
|
||||
bottomEditLayout = findViewById(R.id.bottomEditLayout);
|
||||
imgUp = findViewById(R.id.imgUp);
|
||||
@@ -554,6 +602,7 @@ public class UserHomeActivity extends AbsActivity {
|
||||
followName.setTextColor(getResources().getColor(R.color.white));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type));
|
||||
}
|
||||
EventBus.getDefault().post("");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
||||
VideoPlayActivity.forward(mContext, playPosition, Constants.VIDEO_HOME, 1);
|
||||
}
|
||||
|
||||
/*Intent intent = new Intent(mContext, com.yunbao.live.activity.VideoPlayActivity.class);
|
||||
/*Intent intent = new Intent(mContext, com.yunbao.common.activity.VideoPlayActivity.class);
|
||||
mContext.startActivity(intent);*/
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
android:id="@+id/tab_group"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="5dp">
|
||||
|
||||
<com.yunbao.common.custom.TabButton
|
||||
android:layout_width="0dp"
|
||||
@@ -110,19 +111,20 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="right">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v_table_redpoint"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:background="@drawable/background_ff5075"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10dp"
|
||||
android:visibility="gone" />
|
||||
android:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
||||
Reference in New Issue
Block a user