From aa1db981e84cad75ef8d5346831c072437e73da0 Mon Sep 17 00:00:00 2001 From: hch <16607480311@163.com> Date: Tue, 12 Mar 2024 18:30:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BEUI=20?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E9=A1=B5=E9=9D=A2UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/build.gradle | 6 + common/src/main/AndroidManifest.xml | 3 +- .../activity/CommunityDetailsActivity.java | 172 ++++++- .../activity/CommunitySendActivity.java | 314 +++++++++++- .../yunbao/common/adapter/CommentAdapter.java | 117 +++++ .../common/adapter/CommentReplyAdapter.java | 69 +++ .../com/yunbao/common/bean/ActiveBean.java | 281 +++++++++++ .../yunbao/common/bean/ActiveImageBean.java | 23 + .../com/yunbao/common/bean/CommentBean.java | 229 +++++++++ .../common/bean/MessageChatUserBean.java | 93 ++++ .../common/bean/MessageUserInfoBean.java | 449 ++++++++++++++++++ .../yunbao/common/http/CommonHttpUtil.java | 60 ++- .../com/yunbao/common/http/LiveHttpUtil.java | 9 +- .../com/yunbao/common/http/PDLiveApi.java | 16 + .../common/http/live/LiveNetManager.java | 125 ++++- .../common/utils/ActiveImageAdapter.java | 208 ++++++++ .../yunbao/common/utils/DateFormatUtil.java | 9 +- .../yunbao/common/views/NineGridLayout.java | 216 +++++++++ .../src/main/res/drawable/bg_item_comment.xml | 12 + .../main/res/drawable/bg_main_com_author.xml | 12 + .../main/res/drawable/bg_main_com_type_1.xml | 12 + .../res/layout/activity_community_details.xml | 81 +++- .../res/layout/activity_community_send.xml | 381 ++++++++------- .../src/main/res/layout/item_active_image.xml | 41 ++ .../res/layout/item_comment_reply_view.xml | 87 ++++ .../src/main/res/layout/item_comment_view.xml | 167 +++++++ .../main/res/mipmap-mdpi/icon_active_add.png | Bin 0 -> 254 bytes .../src/main/res/mipmap-mdpi/icon_like01.png | Bin 0 -> 2435 bytes .../res/mipmap-mdpi/icon_like_followed.png | Bin 0 -> 2337 bytes common/src/main/res/values/attrs.xml | 7 + live/src/main/res/layout/item_main_com.xml | 1 + .../main/adapter/MainHomeComAdapter.java | 56 ++- .../main/views/MainHomeComViewHolder.java | 1 - .../main/views/MainHomeNewViewHolder.java | 228 +++------ .../main/res/layout/view_main_home_com.xml | 2 +- .../video/views/VideoPlayViewHolder.java | 19 +- .../video/views/VideoPlayWrapViewHolder.java | 141 ++++-- .../video/views/VideoScrollViewHolder.java | 16 +- .../main/res/layout/view_video_play_wrap.xml | 148 +++--- .../main/res/mipmap-mdpi/icon_video_back.png | Bin 0 -> 2047 bytes .../mipmap-mdpi/icon_video_comment_new.png | Bin 0 -> 2440 bytes .../res/mipmap-mdpi/icon_video_share_new.png | Bin 0 -> 2712 bytes .../res/mipmap-mdpi/icon_video_zan_new01.png | Bin 0 -> 2038 bytes .../res/mipmap-mdpi/icon_video_zan_new02.png | Bin 0 -> 10693 bytes 44 files changed, 3271 insertions(+), 540 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/adapter/CommentAdapter.java create mode 100644 common/src/main/java/com/yunbao/common/adapter/CommentReplyAdapter.java create mode 100644 common/src/main/java/com/yunbao/common/bean/ActiveBean.java create mode 100644 common/src/main/java/com/yunbao/common/bean/ActiveImageBean.java create mode 100644 common/src/main/java/com/yunbao/common/bean/CommentBean.java create mode 100644 common/src/main/java/com/yunbao/common/bean/MessageChatUserBean.java create mode 100644 common/src/main/java/com/yunbao/common/bean/MessageUserInfoBean.java create mode 100644 common/src/main/java/com/yunbao/common/utils/ActiveImageAdapter.java create mode 100644 common/src/main/java/com/yunbao/common/views/NineGridLayout.java create mode 100644 common/src/main/res/drawable/bg_item_comment.xml create mode 100644 common/src/main/res/drawable/bg_main_com_author.xml create mode 100644 common/src/main/res/drawable/bg_main_com_type_1.xml create mode 100644 common/src/main/res/layout/item_active_image.xml create mode 100644 common/src/main/res/layout/item_comment_reply_view.xml create mode 100644 common/src/main/res/layout/item_comment_view.xml create mode 100644 common/src/main/res/mipmap-mdpi/icon_active_add.png create mode 100644 common/src/main/res/mipmap-mdpi/icon_like01.png create mode 100644 common/src/main/res/mipmap-mdpi/icon_like_followed.png create mode 100644 video/src/main/res/mipmap-mdpi/icon_video_back.png create mode 100644 video/src/main/res/mipmap-mdpi/icon_video_comment_new.png create mode 100644 video/src/main/res/mipmap-mdpi/icon_video_share_new.png create mode 100644 video/src/main/res/mipmap-mdpi/icon_video_zan_new01.png create mode 100644 video/src/main/res/mipmap-mdpi/icon_video_zan_new02.png diff --git a/common/build.gradle b/common/build.gradle index 7124a67a2..abf5d8c5e 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -223,5 +223,11 @@ dependencies { //瀑布流 api 'com.wuxiaolong.pullloadmorerecyclerview:library:1.1.2' + //时间选择器 + api 'com.contrarywind:Android-PickerView:4.1.9' + //播放器-https://github.com/yangchong211/YCVideoPlayer + api 'cn.yc:VideoPlayer:3.1.0' + api 'cn.yc:VideoCache:3.0.5' + api 'cn.yc:VideoKernel:3.0.6' } diff --git a/common/src/main/AndroidManifest.xml b/common/src/main/AndroidManifest.xml index b30402cd7..2b3794711 100644 --- a/common/src/main/AndroidManifest.xml +++ b/common/src/main/AndroidManifest.xml @@ -71,7 +71,8 @@ + android:screenOrientation="portrait" + android:windowSoftInputMode="adjustResize" /> diff --git a/common/src/main/java/com/yunbao/common/activity/CommunityDetailsActivity.java b/common/src/main/java/com/yunbao/common/activity/CommunityDetailsActivity.java index 3e8eb168f..d7f50e226 100644 --- a/common/src/main/java/com/yunbao/common/activity/CommunityDetailsActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/CommunityDetailsActivity.java @@ -1,22 +1,58 @@ package com.yunbao.common.activity; +import android.annotation.SuppressLint; import android.content.Intent; +import android.graphics.Color; +import android.view.View; +import android.view.WindowManager; +import android.widget.ImageView; import android.widget.LinearLayout; +import android.widget.TextView; -import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.yunbao.common.CommonAppConfig; import com.yunbao.common.R; -import com.yunbao.common.custom.ItemDecoration; +import com.yunbao.common.adapter.CommentAdapter; +import com.yunbao.common.bean.ActiveBean; +import com.yunbao.common.bean.CommentBean; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.http.CommonHttpUtil; +import com.yunbao.common.http.HttpCallback; +import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.manager.OpenAdManager; +import com.yunbao.common.views.NineGridLayout; +import com.yunbao.common.views.TopGradual; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; public class CommunityDetailsActivity extends AbsActivity { - private RecyclerView mRecyclerViewImage; - private LinearLayout imgTextLayout; - private LinearLayout videoLayout; + ActiveBean activeBean; + private ImageView avatar; + private TextView name; + private TextView time; + private TextView content; + private LinearLayout followLayout; + private ImageView followIcon; + private TextView followName; + private NineGridLayout mNineGridLayout; + private ImageView videoImage; + private RecyclerView commentRecyclerView; + private CommentAdapter commentAdapter; + private TextView likeCount; + private ImageView userAvatar; + private ImageView like; + private TextView replyCount; @Override protected int getLayoutId() { + getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); return R.layout.activity_community_details; } @@ -33,13 +69,129 @@ public class CommunityDetailsActivity extends AbsActivity { @Override protected void main() { + activeBean = getIntent().getParcelableExtra("active"); + initView(); + initData(); + getReply(); + } - mRecyclerViewImage = findViewById(R.id.recyclerView); - mRecyclerViewImage.setLayoutManager(new GridLayoutManager(mContext, 3, GridLayoutManager.VERTICAL, false)); - ItemDecoration decoration = new ItemDecoration(mContext, 0x00000000, 15, 15); - decoration.setOnlySetItemOffsetsButNoDraw(true); - mRecyclerViewImage.addItemDecoration(decoration); + private void initView() { + replyCount = findViewById(R.id.replyCount); + like = findViewById(R.id.like); + userAvatar = findViewById(R.id.userAvatar); + likeCount = findViewById(R.id.likeCount); + avatar = findViewById(R.id.avatar); + name = findViewById(R.id.name); + time = findViewById(R.id.time); + content = findViewById(R.id.content); + followLayout = findViewById(R.id.followLayout); + followIcon = findViewById(R.id.followIcon); + followName = findViewById(R.id.followName); + videoImage = findViewById(R.id.videoImage); + mNineGridLayout = findViewById(R.id.nine_grid_layout); + commentRecyclerView = findViewById(R.id.commentListView); + commentRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); + commentRecyclerView.addItemDecoration(new TopGradual()); + commentRecyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER); + mNineGridLayout.setActionListener(new NineGridLayout.ActionListener() { + @Override + public void onItemClick(List dataList, int position) { + } + + @Override + public void displayImage(Object path, ImageView imageView) { + ImgLoader.display(CommunityDetailsActivity.this, String.valueOf(path), imageView); + } + }); + followLayout.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + CommonHttpUtil.setAttention(activeBean.getUser_id(), new CommonCallback() { + @Override + public void callback(Integer isAttention) { + if (isAttention == 1) { + ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_followed, followIcon); + followName.setText("已关注"); + followName.setTextColor(Color.parseColor("#777777")); + followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type_1)); + } else { + ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_follow, followIcon); + followName.setText("关注"); + followName.setTextColor(getResources().getColor(R.color.white)); + followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type)); + } + } + }); + } + }); + like.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (activeBean.getIs_love().equals("1")) { + + } else { + + } + } + }); + findViewById(R.id.setting).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + } + }); + } + + private void getReply() { + CommonHttpUtil.getCommunityComment(activeBean.getId(), activeBean.getUser_id(), new HttpCallback() { + @SuppressLint("SetTextI18n") + @Override + public void onSuccess(int code, String msg, String[] info) { + List list = JSON.parseArray(Arrays.toString(info), CommentBean.class); + if (list != null) { + commentAdapter = new CommentAdapter(mContext, list); + commentRecyclerView.setAdapter(commentAdapter); + replyCount.setText("评论 " + list.size()); + } + } + }); + } + + @SuppressLint("UseCompatLoadingForDrawables") + private void initData() { + ImgLoader.display(CommunityDetailsActivity.this, CommonAppConfig.getInstance().getUserBean().getAvatarThumb(), userAvatar); + ImgLoader.display(CommunityDetailsActivity.this, activeBean.getUser_avatar(), avatar); + name.setText(activeBean.getUser_name()); + time.setText(activeBean.getCreate_time()); + likeCount.setText(activeBean.getLove_num() + "人觉得很赞"); + content.setText(String.valueOf(JSONObject.parseObject(activeBean.getContent()).get("msg"))); + if (activeBean.getIs_attention().equals("1")) {//关注 + ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_followed, followIcon); + followName.setText("已关注"); + followName.setTextColor(Color.parseColor("#777777")); + followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type_1)); + } else { + ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_follow, followIcon); + followName.setText("关注"); + followName.setTextColor(getResources().getColor(R.color.white)); + followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type)); + } + if (activeBean.getImg_or_video().equals("1")) {//图片 + JSONArray jsonArray = (JSONArray) JSONArray.parse(activeBean.getImg_json()); + List tempList = new ArrayList<>(); + for (int i = 0; i < jsonArray.size(); i++) { + tempList.add(String.valueOf(jsonArray.get(i))); + } + mNineGridLayout.setData(tempList); + } else { + ImgLoader.display(CommunityDetailsActivity.this, activeBean.getUser_avatar(), videoImage); + } + if (activeBean.getIs_love().equals("1")) { + ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like, like); + } else { + ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like01, like); + } } @Override diff --git a/common/src/main/java/com/yunbao/common/activity/CommunitySendActivity.java b/common/src/main/java/com/yunbao/common/activity/CommunitySendActivity.java index ff8438f43..a61f18b09 100644 --- a/common/src/main/java/com/yunbao/common/activity/CommunitySendActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/CommunitySendActivity.java @@ -1,52 +1,171 @@ package com.yunbao.common.activity; +import android.Manifest; +import android.annotation.SuppressLint; +import android.content.ClipData; +import android.content.ContentResolver; import android.content.Intent; +import android.content.pm.PackageManager; +import android.database.Cursor; +import android.net.Uri; +import android.os.Build; +import android.provider.MediaStore; import android.view.View; +import android.widget.EditText; +import android.widget.ImageView; import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; +import android.widget.VideoView; +import androidx.annotation.NonNull; +import androidx.annotation.RequiresApi; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; +import androidx.fragment.app.FragmentActivity; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.bigkoo.pickerview.builder.OptionsPickerBuilder; +import com.bigkoo.pickerview.builder.TimePickerBuilder; +import com.bigkoo.pickerview.listener.OnDismissListener; +import com.bigkoo.pickerview.listener.OnOptionsSelectListener; +import com.bigkoo.pickerview.listener.OnTimeSelectListener; +import com.bigkoo.pickerview.view.OptionsPickerView; +import com.bigkoo.pickerview.view.TimePickerView; +import com.lzy.okgo.utils.HttpUtils; import com.yunbao.common.R; import com.yunbao.common.custom.ItemDecoration; +import com.yunbao.common.http.CommonHttpUtil; +import com.yunbao.common.http.HttpCallback; import com.yunbao.common.manager.OpenAdManager; -import com.yunbao.common.utils.ToastUtil; -import com.yunbao.common.utils.WordUtil; +import com.yunbao.common.utils.ActiveImageAdapter; +import com.yunbao.common.utils.DateFormatUtil; +import com.yunbao.common.utils.L; +import com.yunbao.common.utils.ProcessImageUtil; +import com.yunbao.common.utils.ProcessResultUtil; + +import java.io.File; +import java.net.URI; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; public class CommunitySendActivity extends AbsActivity { + public static final int PERMISSION_REQUEST_CODE_IMG = 0; + public static final int PERMISSION_REQUEST_CODE_VIDEO = 1; private RecyclerView mRecyclerViewImage; private LinearLayout imgTextLayout; private LinearLayout videoLayout; + private LinearLayout talkLayout; + private LinearLayout timeLayout; + private EditText content; + private TextView chooseTime; + private final int CHOOSE_IMG = 100;//Android 5.0以下的 + private final int CHOOSE_VIDEO = 200;//Android 5.0以上的 + private List uriList = new ArrayList<>(); + private Uri videoUri; + private ActiveImageAdapter activeImageAdapter; + private VideoView videoView; + private RelativeLayout videoViewLayout; + private ImageView delVideo; + private TextView talkContent; + private List talkList = new ArrayList<>(); + private TextView submit; + private boolean isImage; @Override protected int getLayoutId() { return R.layout.activity_community_send; } - @Override - protected void create() { - super.create(); - } - - @Override - protected void onPause() { - super.onPause(); - OpenAdManager.getInstance().dismiss(); - } - @Override protected void main() { + talkList.add("热门"); + talkList.add("新秀"); + talkList.add("颜值"); + talkList.add("舞蹈"); + talkList.add("男神"); + talkList.add("音乐"); + talkList.add("英语"); + + content = findViewById(R.id.content); + submit = findViewById(R.id.submit); + submit.setVisibility(View.VISIBLE); + talkContent = findViewById(R.id.talkContent); + delVideo = findViewById(R.id.delVideo); + videoViewLayout = findViewById(R.id.videoViewLayout); + videoView = findViewById(R.id.videoView); imgTextLayout = findViewById(R.id.imgTextLayout); videoLayout = findViewById(R.id.videoLayout); + talkLayout = findViewById(R.id.talkLayout); + timeLayout = findViewById(R.id.timeLayout); + chooseTime = findViewById(R.id.chooseTime); - imgTextLayout.setOnClickListener(new View.OnClickListener() { + submit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + submit(); + } + }); + delVideo.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + videoUri = null; + videoView.stopPlayback(); + videoViewLayout.setVisibility(View.GONE); + } + }); + talkLayout.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + showTalkChooseDialog(); + } + }); + timeLayout.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + showTimeChooseDialog(); + } + }); + imgTextLayout.setOnClickListener(new View.OnClickListener() { + @RequiresApi(api = Build.VERSION_CODES.TIRAMISU) + @Override + public void onClick(View v) { + 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(CommunitySendActivity.this, new String[]{permission1, permission2}, PERMISSION_REQUEST_CODE_IMG); + } } }); videoLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + 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) { + openVideoChooserActivity(); + } else { + //申请权限 + ActivityCompat.requestPermissions(CommunitySendActivity.this, new String[]{permission1, permission2}, PERMISSION_REQUEST_CODE_VIDEO); + } } }); @@ -55,11 +174,174 @@ public class CommunitySendActivity extends AbsActivity { ItemDecoration decoration = new ItemDecoration(mContext, 0x00000000, 15, 15); decoration.setOnlySetItemOffsetsButNoDraw(true); mRecyclerViewImage.addItemDecoration(decoration); + activeImageAdapter = new ActiveImageAdapter(CommunitySendActivity.this); + mRecyclerViewImage.setAdapter(activeImageAdapter); + mRecyclerViewImage.setVisibility(View.VISIBLE); + activeImageAdapter.setActionListener(new ActiveImageAdapter.ActionListener() { + @Override + public void onAddClick() { + } + + @Override + public void onItemClick(int position) { + + } + + @Override + public void onDeleteAll() { + + } + + @Override + public void onDel(int position) { + + } + }); + } + + private void submit() { + StringBuffer files = new StringBuffer(); + if (isImage) { + for (int i = 0; i < uriList.size(); i++) { + if (i == 0) { + files.append(uri2File(uriList.get(i)).getPath()); + } else { + files.append("," + uri2File(uriList.get(i)).getPath()); + } + } + } else { + files.append(uri2File(videoUri).getPath()); + } + CommonHttpUtil.pushCommunity(isImage, content.getText().toString(), "1", files.toString(), chooseTime.getText().toString(), new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + + } + }); + } + + private void showTalkChooseDialog() { + OptionsPickerView pickerView = new OptionsPickerBuilder(CommunitySendActivity.this, new OnOptionsSelectListener() { + @Override + public void onOptionsSelect(int options1, int options2, int options3, View v) { + talkContent.setText(talkList.get(options1)); + } + }).setTitleText("选择话题").setContentTextSize(16).build(); + pickerView.setPicker(talkList, null, null); + pickerView.show(); } @Override - protected void onActivityResult(int requestCode, int resultCode, Intent intent) { - super.onActivityResult(requestCode, resultCode, intent); + 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); + } + } + if (requestCode == PERMISSION_REQUEST_CODE_VIDEO) { + if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { + openVideoChooserActivity(); + } else { + ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE_VIDEO); + } + } + } + + public void showTimeChooseDialog() { + TimePickerView timePickerView = new TimePickerBuilder(CommunitySendActivity.this, new OnTimeSelectListener() { + @SuppressLint("SetTextI18n") + @Override + public void onTimeSelect(Date date, View v) { + chooseTime.setText(DateFormatUtil.getTimeStrings(date.getTime())); + } + }).setType(new boolean[]{true, true, true, true, true, false})// 默认全部显示 + .setCancelText("Cancel")//取消按钮文字 + .setSubmitText("Sure")//确认按钮文字 + .setTitleSize(20)//标题文字大小 + .setTitleText("Title")//标题文字 + .setOutSideCancelable(false)//点击屏幕,点在控件外部范围时,是否取消显示 + .isCyclic(true)//是否循环滚动 + .setLabel("年", "月", "日", "时", "分", "")//默认设置为年月日时分秒 + .isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。 + .build(); + timePickerView.show(); + timePickerView.setOnDismissListener(new OnDismissListener() { + @Override + public void onDismiss(Object o) { + + } + }); + } + + private void openImageChooserActivity() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.setType("image/*"); + intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); + startActivityForResult(intent, CHOOSE_IMG); + } + + private void openVideoChooserActivity() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.setType("video/*"); + startActivityForResult(intent, CHOOSE_VIDEO); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (resultCode == RESULT_OK && requestCode == CHOOSE_IMG) { + // 获取用户选择的图片 URI + Uri[] imageUris = null; + if (data != null) { + ClipData clipData = data.getClipData(); + if (clipData != null) { + // 如果支持多选,则通过 getItemAt() 方法获取每个被选中的图片 URI + imageUris = new Uri[clipData.getItemCount()]; + List tempList = new ArrayList<>(); + for (int i = 0; i < clipData.getItemCount(); i++) { + imageUris[i] = clipData.getItemAt(i).getUri(); + File file = new File(uri2File(imageUris[i]).getPath()); + tempList.add(file.getPath()); + L.e("imageUris:" + imageUris[i].getPath() + "_" + imageUris[i].getEncodedPath()); + } + activeImageAdapter.insertList(tempList); + } else { + // 单选情况下直接获取图片 URI + imageUris = new Uri[]{data.getData()}; + uriList.add(imageUris[0]); + List tempList = new ArrayList<>(); + File file = new File(uri2File(imageUris[0]).getPath()); + tempList.add(file.getPath()); + activeImageAdapter.insertList(tempList); + } + } + isImage = true; + } else if (requestCode == CHOOSE_VIDEO && resultCode == RESULT_OK && data != null) { + Uri uri = data.getData(); + videoUri = uri; + videoView.setVideoURI(videoUri); + videoView.start(); + videoViewLayout.setVisibility(View.VISIBLE); + isImage = false; + } + } + + 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; } } diff --git a/common/src/main/java/com/yunbao/common/adapter/CommentAdapter.java b/common/src/main/java/com/yunbao/common/adapter/CommentAdapter.java new file mode 100644 index 000000000..a5054e2a5 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/adapter/CommentAdapter.java @@ -0,0 +1,117 @@ +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.R; +import com.yunbao.common.bean.CommentBean; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.views.TopGradual; + +import java.util.List; + +public class CommentAdapter extends RecyclerView.Adapter { + private List commentBeanList; + private Context mContext; + + public CommentAdapter(Context content, List commentBeanList) { + this.mContext = content; + this.commentBeanList = commentBeanList; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_comment_view, parent, false); + return new CommentViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + CommentViewHolder commentViewHolder = (CommentViewHolder) holder; + commentViewHolder.setData(commentBeanList.get(position)); + } + + @Override + public int getItemCount() { + return commentBeanList.size(); + } + + class CommentViewHolder extends RecyclerView.ViewHolder { + private RoundedImageView mAvatar; + private TextView name; + private TextView content; + private TextView report; + private RoundedImageView mAvatar01; + private RoundedImageView mAvatar02; + private TextView replyContent; + private TextView replyCount; + private RecyclerView recyclerView; + private LinearLayout replyLayout; + + public CommentViewHolder(@NonNull View itemView) { + super(itemView); + mAvatar = itemView.findViewById(R.id.avatar); + name = itemView.findViewById(R.id.name); + content = itemView.findViewById(R.id.content); + report = itemView.findViewById(R.id.report); + mAvatar01 = itemView.findViewById(R.id.avatar01); + mAvatar02 = itemView.findViewById(R.id.avatar02); + replyContent = itemView.findViewById(R.id.replyContent); + replyCount = itemView.findViewById(R.id.expand); + replyLayout = itemView.findViewById(R.id.replyLayout); + recyclerView = itemView.findViewById(R.id.recyclerView); + } + + @SuppressLint("SetTextI18n") + public void setData(CommentBean bean) { + ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar); + name.setText(bean.getUser_name()); + content.setText(bean.getContent()); + if (bean.getReplyCommentList() != null) { + replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>"); + if (bean.getReplyCommentList().size() > 0) { + 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(), mAvatar02); + replyLayout.setVisibility(View.VISIBLE); + } else if (bean.getReplyCommentList().size() > 1) { + replyCount.setVisibility(View.VISIBLE); + replyLayout.setVisibility(View.VISIBLE); + } else { + replyLayout.setVisibility(View.GONE); + replyCount.setVisibility(View.GONE); + } + recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); + recyclerView.addItemDecoration(new TopGradual()); + CommentReplyAdapter commentReplyAdapter = new CommentReplyAdapter(mContext, bean.getReplyCommentList()); + 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()); + } + }); + } + } + } + +} diff --git a/common/src/main/java/com/yunbao/common/adapter/CommentReplyAdapter.java b/common/src/main/java/com/yunbao/common/adapter/CommentReplyAdapter.java new file mode 100644 index 000000000..dc0527fa0 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/adapter/CommentReplyAdapter.java @@ -0,0 +1,69 @@ +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.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.makeramen.roundedimageview.RoundedImageView; +import com.yunbao.common.R; +import com.yunbao.common.bean.CommentBean; +import com.yunbao.common.glide.ImgLoader; + +import java.util.List; + +public class CommentReplyAdapter extends RecyclerView.Adapter { + private List commentBeanList; + private Context mContext; + + public CommentReplyAdapter(Context content, List commentBeanList) { + this.mContext = content; + this.commentBeanList = commentBeanList; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_comment_reply_view, parent, false); + return new CommentViewHolder(runGamesView); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + CommentViewHolder commentViewHolder = (CommentViewHolder) holder; + commentViewHolder.setData(commentBeanList.get(position)); + } + + @Override + public int getItemCount() { + return commentBeanList.size(); + } + + class CommentViewHolder extends RecyclerView.ViewHolder { + private TextView name; + private RoundedImageView mAvatar01; + private RoundedImageView mAvatar02; + private TextView replyContent; + + public CommentViewHolder(@NonNull View itemView) { + super(itemView); + name = itemView.findViewById(R.id.name); + mAvatar01 = itemView.findViewById(R.id.avatar01); + mAvatar02 = itemView.findViewById(R.id.avatar02); + replyContent = itemView.findViewById(R.id.replyContent); + } + + @SuppressLint("SetTextI18n") + public void setData(CommentBean.ReplyComment bean) { + ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar01); + ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar02); + name.setText(bean.getUser_name()); + replyContent.setText(bean.getContent()); + } + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/ActiveBean.java b/common/src/main/java/com/yunbao/common/bean/ActiveBean.java new file mode 100644 index 000000000..dbae4db35 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/ActiveBean.java @@ -0,0 +1,281 @@ +package com.yunbao.common.bean; + +import android.os.Parcel; +import android.os.Parcelable; + +import androidx.annotation.NonNull; + +/** + * 社區动态 + */ +public class ActiveBean extends BaseModel implements Parcelable { + private String id; + private String img_or_video; + private String img_json; + private String video; + private String content; + private String talk_id; + private String love_num; + private String comment_num; + private String share_num; + private String gift_num; + private String hot_num; + private String create_time; + private String ai_content; + private String is_delete; + private String user_name; + private String user_avatar; + private String is_anchor; + private String is_live; + private String is_attention; + private String user_id; + private String talk_name; + private String is_love; + + public ActiveBean() { + } + + protected ActiveBean(Parcel in) { + id = in.readString(); + img_or_video = in.readString(); + img_json = in.readString(); + video = in.readString(); + content = in.readString(); + talk_id = in.readString(); + love_num = in.readString(); + comment_num = in.readString(); + share_num = in.readString(); + gift_num = in.readString(); + hot_num = in.readString(); + create_time = in.readString(); + ai_content = in.readString(); + is_delete = in.readString(); + user_name = in.readString(); + user_avatar = in.readString(); + is_anchor = in.readString(); + is_live = in.readString(); + is_attention = in.readString(); + user_id = in.readString(); + talk_name = in.readString(); + is_love = in.readString(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public ActiveBean createFromParcel(Parcel in) { + return new ActiveBean(in); + } + + @Override + public ActiveBean[] newArray(int size) { + return new ActiveBean[size]; + } + }; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getImg_or_video() { + return img_or_video; + } + + public void setImg_or_video(String img_or_video) { + this.img_or_video = img_or_video; + } + + public String getImg_json() { + return img_json; + } + + public void setImg_json(String img_json) { + this.img_json = img_json; + } + + public String getVideo() { + return video; + } + + public void setVideo(String video) { + this.video = video; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getTalk_id() { + return talk_id; + } + + public void setTalk_id(String talk_id) { + this.talk_id = talk_id; + } + + public String getLove_num() { + return love_num; + } + + public void setLove_num(String love_num) { + this.love_num = love_num; + } + + public String getComment_num() { + return comment_num; + } + + public void setComment_num(String comment_num) { + this.comment_num = comment_num; + } + + public String getShare_num() { + return share_num; + } + + public void setShare_num(String share_num) { + this.share_num = share_num; + } + + public String getGift_num() { + return gift_num; + } + + public void setGift_num(String gift_num) { + this.gift_num = gift_num; + } + + public String getHot_num() { + return hot_num; + } + + public void setHot_num(String hot_num) { + this.hot_num = hot_num; + } + + public String getCreate_time() { + return create_time; + } + + public void setCreate_time(String create_time) { + this.create_time = create_time; + } + + public String getAi_content() { + return ai_content; + } + + public void setAi_content(String ai_content) { + this.ai_content = ai_content; + } + + public String getIs_delete() { + return is_delete; + } + + public void setIs_delete(String is_delete) { + this.is_delete = is_delete; + } + + public String getUser_name() { + return user_name; + } + + public void setUser_name(String user_name) { + this.user_name = user_name; + } + + public String getUser_avatar() { + return user_avatar; + } + + public void setUser_avatar(String user_avatar) { + this.user_avatar = user_avatar; + } + + public String getIs_anchor() { + return is_anchor; + } + + public void setIs_anchor(String is_anchor) { + this.is_anchor = is_anchor; + } + + public String getIs_live() { + return is_live; + } + + public void setIs_live(String is_live) { + this.is_live = is_live; + } + + public String getIs_attention() { + return is_attention; + } + + public void setIs_attention(String is_attention) { + this.is_attention = is_attention; + } + + public String getUser_id() { + return user_id; + } + + public void setUser_id(String user_id) { + this.user_id = user_id; + } + + public String getTalk_name() { + return talk_name; + } + + public void setTalk_name(String talk_name) { + this.talk_name = talk_name; + } + + public String getIs_love() { + return is_love; + } + + public void setIs_love(String is_love) { + this.is_love = is_love; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(@NonNull Parcel dest, int flags) { + dest.writeString(id); + dest.writeString(img_or_video); + dest.writeString(img_json); + dest.writeString(video); + dest.writeString(content); + dest.writeString(talk_id); + dest.writeString(love_num); + dest.writeString(comment_num); + dest.writeString(share_num); + dest.writeString(gift_num); + dest.writeString(hot_num); + dest.writeString(create_time); + dest.writeString(ai_content); + dest.writeString(is_delete); + dest.writeString(user_name); + dest.writeString(user_avatar); + dest.writeString(is_anchor); + dest.writeString(is_live); + dest.writeString(is_attention); + dest.writeString(user_id); + dest.writeString(talk_name); + dest.writeString(is_love); + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/ActiveImageBean.java b/common/src/main/java/com/yunbao/common/bean/ActiveImageBean.java new file mode 100644 index 000000000..1eb0d079c --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/ActiveImageBean.java @@ -0,0 +1,23 @@ +package com.yunbao.common.bean; + +import java.io.File; + +public class ActiveImageBean { + private File mImageFile; + + public ActiveImageBean() { + + } + + public ActiveImageBean(File imageFile) { + mImageFile = imageFile; + } + + public File getImageFile() { + return mImageFile; + } + + public void setImageFile(File imageFile) { + mImageFile = imageFile; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/CommentBean.java b/common/src/main/java/com/yunbao/common/bean/CommentBean.java new file mode 100644 index 000000000..49e4c522b --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/CommentBean.java @@ -0,0 +1,229 @@ +package com.yunbao.common.bean; + +import java.util.List; + +/** + * 社區动态 + */ +public class CommentBean extends BaseModel { + private String id; + private String dynamic_id; + private String uid; + private String to_comment_id; + private String content; + private String create_time; + private String status; + private String is_dynamic_user; + private String user_name; + private String user_id; + private String user_avatar; + private List child; + private boolean isShow; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDynamic_id() { + return dynamic_id; + } + + public void setDynamic_id(String dynamic_id) { + this.dynamic_id = dynamic_id; + } + + public String getUid() { + return uid; + } + + public void setUid(String uid) { + this.uid = uid; + } + + public String getTo_comment_id() { + return to_comment_id; + } + + public void setTo_comment_id(String to_comment_id) { + this.to_comment_id = to_comment_id; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getCreate_time() { + return create_time; + } + + public void setCreate_time(String create_time) { + this.create_time = create_time; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getIs_dynamic_user() { + return is_dynamic_user; + } + + public void setIs_dynamic_user(String is_dynamic_user) { + this.is_dynamic_user = is_dynamic_user; + } + + public String getUser_name() { + return user_name; + } + + public void setUser_name(String user_name) { + this.user_name = user_name; + } + + public String getUser_id() { + return user_id; + } + + public void setUser_id(String user_id) { + this.user_id = user_id; + } + + public String getUser_avatar() { + return user_avatar; + } + + public void setUser_avatar(String user_avatar) { + this.user_avatar = user_avatar; + } + + public List getReplyCommentList() { + return child; + } + + public void setReplyCommentList(List replyCommentList) { + this.child = replyCommentList; + } + + public boolean isShow() { + return isShow; + } + + public void setShow(boolean show) { + isShow = show; + } + + public static class ReplyComment { + private String id; + private String dynamic_id; + private String uid; + private String to_comment_id; + private String content; + private String create_time; + private String status; + private String is_dynamic_user; + private String user_name; + private String user_id; + private String user_avatar; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDynamic_id() { + return dynamic_id; + } + + public void setDynamic_id(String dynamic_id) { + this.dynamic_id = dynamic_id; + } + + public String getUid() { + return uid; + } + + public void setUid(String uid) { + this.uid = uid; + } + + public String getTo_comment_id() { + return to_comment_id; + } + + public void setTo_comment_id(String to_comment_id) { + this.to_comment_id = to_comment_id; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getCreate_time() { + return create_time; + } + + public void setCreate_time(String create_time) { + this.create_time = create_time; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getIs_dynamic_user() { + return is_dynamic_user; + } + + public void setIs_dynamic_user(String is_dynamic_user) { + this.is_dynamic_user = is_dynamic_user; + } + + public String getUser_name() { + return user_name; + } + + public void setUser_name(String user_name) { + this.user_name = user_name; + } + + public String getUser_id() { + return user_id; + } + + public void setUser_id(String user_id) { + this.user_id = user_id; + } + + public String getUser_avatar() { + return user_avatar; + } + + public void setUser_avatar(String user_avatar) { + this.user_avatar = user_avatar; + } + } + +} diff --git a/common/src/main/java/com/yunbao/common/bean/MessageChatUserBean.java b/common/src/main/java/com/yunbao/common/bean/MessageChatUserBean.java new file mode 100644 index 000000000..c56507b7e --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/MessageChatUserBean.java @@ -0,0 +1,93 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; +import com.yunbao.common.utils.StringUtil; + +public class MessageChatUserBean extends UserBean{ + private String type; + private int modelType; + @SerializedName("user_nicename") + protected String userNiceName; + @SerializedName("isAttention") + private int attention;//isAttention 1被关注 2已关注 3互相关注 + + + public String getType() { + return type; + } + + public void setType(int type){ + this.type=type+""; + } + public int getTypeInt(){ + if(StringUtil.isEmpty(type)){ + return 0; + } + return Integer.parseInt(type); + } + + + @Override + public String getUserNiceName() { + return userNiceName; + } + + public int getModelType() { + return modelType; + } + + public void setModelType(int modelType) { + this.modelType = modelType; + } + + @Override + public void setUserNiceName(String userNiceName) { + this.userNiceName = userNiceName; + } + + public int getAttention() { + return attention; + } + + public void setAttention(int attention) { + this.attention = attention; + } + + @Override + public String toString() { + return "MessageChatUserBean{" + + "type='" + type + '\'' + + ", modelType='" + modelType + '\'' + + ", userNiceName='" + userNiceName + '\'' + + ", id='" + id + '\'' + + ", userNiceName='" + userNiceName + '\'' + + ", avatar='" + avatar + '\'' + + ", avatarThumb='" + avatarThumb + '\'' + + ", sex=" + sex + + ", signature='" + signature + '\'' + + ", coin='" + coin + '\'' + + ", gold='" + gold + '\'' + + ", votes='" + votes + '\'' + + ", consumption='" + consumption + '\'' + + ", votestotal='" + votestotal + '\'' + + ", province='" + province + '\'' + + ", city='" + city + '\'' + + ", location='" + location + '\'' + + ", birthday='" + birthday + '\'' + + ", level=" + level + + ", levelAnchor=" + levelAnchor + + ", lives=" + lives + + ", follows=" + follows + + ", fans=" + fans + + ", vip=" + vip + + ", liang=" + liang + + ", car=" + car + + ", medal_level=" + medal_level + + ", medal_name='" + medal_name + '\'' + + ", Dress=" + Dress + + ", noble_id='" + noble_id + '\'' + + ", yuanbao='" + yuanbao + '\'' + + ", typeMic=" + typeMic + + '}'; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/MessageUserInfoBean.java b/common/src/main/java/com/yunbao/common/bean/MessageUserInfoBean.java new file mode 100644 index 000000000..976191284 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/MessageUserInfoBean.java @@ -0,0 +1,449 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; +import com.yunbao.common.utils.StringUtil; + +import java.util.List; + +public class MessageUserInfoBean extends BaseModel{ + IMLoginModel user; + UserInfo info; + UserLevel level; + @SerializedName("gift_num") + int giftNum; + + int status; //0 需要跳转到 编辑资料页面 + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public MessageUserInfoBean() { + } + + public IMLoginModel getUser() { + return user; + } + + public void setUser(IMLoginModel user) { + this.user = user; + } + + public UserInfo getInfo() { + return info; + } + + public void setInfo(UserInfo info) { + this.info = info; + } + + public UserLevel getLevel() { + return level; + } + + public void setLevel(UserLevel level) { + this.level = level; + } + + public int getGiftNum() { + return giftNum; + } + + public void setGiftNum(int giftNum) { + this.giftNum = giftNum; + } + + public static class UserInfo { + private int id; + private String label_id; + private List cn_label; + private List en_label; + private int first_mate; + private long create_time; + private long update_time; + private int sex; + private int b_y; + private int b_ym; + private String b_ymd; + private int name_auth;//1 未提交 2 已认证 3已提交 4被驳回 + private long name_auth_time; + private String auth_front; + private String auth_back; + private String auth_remark; + private int sage_auth;//1 未提交 2 已认证 3已提交 4被驳回 + private long sage_auth_time; + private int is_hot; + private String vodie_price; + private String price; + private int star; + private String area; + private int is_hello; + private String star_name; + + public UserInfo() { + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getLabel_id() { + return label_id; + } + + public void setLabel_id(String label_id) { + this.label_id = label_id; + } + + public List getCn_label() { + return cn_label; + } + + public void setCn_label(List cn_label) { + this.cn_label = cn_label; + } + + public List getEn_label() { + return en_label; + } + + public void setEn_label(List en_label) { + this.en_label = en_label; + } + + public int getFirst_mate() { + return first_mate; + } + + public void setFirst_mate(int first_mate) { + this.first_mate = first_mate; + } + + public long getCreate_time() { + return create_time; + } + + public void setCreate_time(long create_time) { + this.create_time = create_time; + } + + public long getUpdate_time() { + return update_time; + } + + public void setUpdate_time(long update_time) { + this.update_time = update_time; + } + + public int getSex() { + return sex; + } + + public void setSex(int sex) { + this.sex = sex; + } + + public int getB_y() { + return b_y; + } + + public void setB_y(int b_y) { + this.b_y = b_y; + } + + public int getB_ym() { + return b_ym; + } + + public void setB_ym(int b_ym) { + this.b_ym = b_ym; + } + + public String getB_ymd() { + return b_ymd; + } + + public void setB_ymd(String b_ymd) { + this.b_ymd = b_ymd; + } + + public int getName_auth() { + return name_auth; + } + + public void setName_auth(int name_auth) { + this.name_auth = name_auth; + } + + public long getName_auth_time() { + return name_auth_time; + } + + public void setName_auth_time(long name_auth_time) { + this.name_auth_time = name_auth_time; + } + + public String getAuth_front() { + return auth_front; + } + + public void setAuth_front(String auth_front) { + this.auth_front = auth_front; + } + + public String getAuth_back() { + return auth_back; + } + + public void setAuth_back(String auth_back) { + this.auth_back = auth_back; + } + + public String getAuth_remark() { + return auth_remark; + } + + public void setAuth_remark(String auth_remark) { + this.auth_remark = auth_remark; + } + + public int getSage_auth() { + return sage_auth; + } + + public void setSage_auth(int sage_auth) { + this.sage_auth = sage_auth; + } + + public long getSage_auth_time() { + return sage_auth_time; + } + + public void setSage_auth_time(long sage_auth_time) { + this.sage_auth_time = sage_auth_time; + } + + public int getIs_hot() { + return is_hot; + } + + public void setIs_hot(int is_hot) { + this.is_hot = is_hot; + } + + public String getVodie_price() { + return vodie_price; + } + + public void setVodie_price(String vodie_price) { + this.vodie_price = vodie_price; + } + + public String getPrice() { + return price; + } + + public void setPrice(String price) { + this.price = price; + } + + public int getStar() { + return star; + } + + public void setStar(int star) { + this.star = star; + } + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public int getIs_hello() { + return is_hello; + } + + public void setIs_hello(int is_hello) { + this.is_hello = is_hello; + } + + public String getStar_name() { + return star_name; + } + + public void setStar_name(String star_name) { + this.star_name = star_name; + } + } + + public static class UserLevel { + private int id; + private int wealth; + private int wealth_level; + private int charm; + private int charm_level; + private int level; + private int exp; + private long wealth_update; + private long wealth_level_update; + private long charm_update; + private long charm_level_update; + private long exp_update; + private long level_update; + private long create_time; + private String icon; + private String charm_icon; + private String wealth_icon; + + public UserLevel() { + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getWealth() { + return wealth; + } + + public void setWealth(int wealth) { + this.wealth = wealth; + } + + public int getWealth_level() { + return wealth_level; + } + + public void setWealth_level(int wealth_level) { + this.wealth_level = wealth_level; + } + + public int getCharm() { + return charm; + } + + public void setCharm(int charm) { + this.charm = charm; + } + + public int getCharm_level() { + return charm_level; + } + + public void setCharm_level(int charm_level) { + this.charm_level = charm_level; + } + + public int getLevel() { + return level; + } + + public void setLevel(int level) { + this.level = level; + } + + public int getExp() { + return exp; + } + + public void setExp(int exp) { + this.exp = exp; + } + + public long getWealth_update() { + return wealth_update; + } + + public void setWealth_update(long wealth_update) { + this.wealth_update = wealth_update; + } + + public long getWealth_level_update() { + return wealth_level_update; + } + + public void setWealth_level_update(long wealth_level_update) { + this.wealth_level_update = wealth_level_update; + } + + public long getCharm_update() { + return charm_update; + } + + public void setCharm_update(long charm_update) { + this.charm_update = charm_update; + } + + public long getCharm_level_update() { + return charm_level_update; + } + + public void setCharm_level_update(long charm_level_update) { + this.charm_level_update = charm_level_update; + } + + public long getExp_update() { + return exp_update; + } + + public void setExp_update(long exp_update) { + this.exp_update = exp_update; + } + + public long getLevel_update() { + return level_update; + } + + public void setLevel_update(long level_update) { + this.level_update = level_update; + } + + public long getCreate_time() { + return create_time; + } + + public void setCreate_time(long create_time) { + this.create_time = create_time; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getCharm_icon() { + return charm_icon; + } + + public void setCharm_icon(String charm_icon) { + this.charm_icon = charm_icon; + } + + public String getWealth_icon() { + return wealth_icon; + } + + public void setWealth_icon(String wealth_icon) { + this.wealth_icon = wealth_icon; + } + } +} diff --git a/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java b/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java index 2e28c2a88..b9de3c2d7 100644 --- a/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java +++ b/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java @@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.lzy.okgo.OkGo; +import com.lzy.okgo.callback.Callback; import com.lzy.okgo.callback.StringCallback; import com.lzy.okgo.model.Response; import com.lzy.okgo.request.PostRequest; @@ -338,7 +339,7 @@ public class CommonHttpUtil { */ public static void getBalance(HttpCallback callback) { String isGoogle; - if (CommonAppConfig.IS_GOOGLE_PLAY==1) { + if (CommonAppConfig.IS_GOOGLE_PLAY == 1) { isGoogle = "1"; } else { isGoogle = "-1"; @@ -495,6 +496,63 @@ public class CommonHttpUtil { // .execute(callback); // } + /** + * 发送动态 + * + * @param isImgOrVideo + * @param content + * @param talkId + * @param fileAry + * @param createAt + * @param callback + */ + public static void pushCommunity(boolean isImgOrVideo, String content, String talkId, String fileAry, String createAt, HttpCallback callback) { + HttpClient.getInstance().get("Pdlcommunity.sendDynamic", CommonHttpConsts.GET_USER_BASEINFO) + .params("img_or_video", isImgOrVideo ? 1 : 2) + .params("content", content) + .params("talk_id", talkId) + .params("file_name_ary", fileAry) + .params("created_at", createAt) + .execute(callback); + } + + /** + * 获取动态列表-热门 + * + * @param callback + */ + public static void getCommunityHotList(int p, HttpCallback callback) { + HttpClient.getInstance().get("Pdlcommunity.getFindDynamicList", "Pdlcommunity.getFindDynamicList") + .params("p", p) + .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 + */ + public static void getCommunityComment(String dynamic_id, String dynamic_uid, HttpCallback callback) { + HttpClient.getInstance().get("Pdlcommunity.getDynamicCommentList", "Pdlcommunity.getDynamicCommentList") + .params("dynamic_id", dynamic_id) + .params("dynamic_uid", dynamic_uid) + .execute(callback); + } + + + } diff --git a/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java b/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java index 616a2d0f7..fa01db24f 100644 --- a/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java +++ b/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java @@ -351,6 +351,7 @@ public class LiveHttpUtil { .params("p", p) .execute(callback); } + public static void getContactMsg(int page, HttpCallback callback) { HttpClient.getInstance().get("Live.getContactMsg", "getContactMsg") .params("p", page) @@ -645,6 +646,7 @@ public class LiveHttpUtil { .params("appVersion", CommonAppConfig.getInstance().getVersion()) .execute(callback); } + /** * 观众给主播送礼物 - 包裹 * @@ -662,6 +664,7 @@ public class LiveHttpUtil { .params("appVersion", CommonAppConfig.getInstance().getVersion()) .execute(callback); } + /** * 观众给主播送礼物 - 粉丝团 * @@ -679,6 +682,7 @@ public class LiveHttpUtil { .params("appVersion", CommonAppConfig.getInstance().getVersion()) .execute(callback); } + public static void sendBlindBoxTicket(String by, String liveUid, String stream, int giftId, HttpCallback callback) { HttpClient.getInstance().get("Live.sendBlindBoxTicket", LiveHttpConsts.SEND_GIFT) .params("liveuid", liveUid) @@ -1040,10 +1044,9 @@ public class LiveHttpUtil { /** * 获取短剧Url */ - public static void getCoolydrama(HttpCallback callback){ + public static void getCoolydrama(HttpCallback callback) { HttpClient.getInstance().get("cool.register", "Home.getFollow") - .params("lang", WordUtil.isNewZh()?"zh_CN":"en") + .params("lang", WordUtil.isNewZh() ? "zh_CN" : "en") .execute(callback); } - } diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 537b97f59..69a6b4f98 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -43,6 +43,8 @@ import com.yunbao.common.bean.LiveStetUpStatusModel; import com.yunbao.common.bean.LiveTaskModel; import com.yunbao.common.bean.LiveUserMailBoxModel; import com.yunbao.common.bean.MedalAchievementModel; +import com.yunbao.common.bean.MessageChatUserBean; +import com.yunbao.common.bean.MessageUserInfoBean; import com.yunbao.common.bean.MsgSwitchDetailModel; import com.yunbao.common.bean.NewPeopleInfo; import com.yunbao.common.bean.NobleRankHideUserListModel; @@ -68,6 +70,7 @@ import com.yunbao.common.bean.SudRoomListModel; import com.yunbao.common.bean.SudgameCodeModel; import com.yunbao.common.bean.UserAreaBean; import com.yunbao.common.bean.UserAvatarSelectBean; +import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.VipModel; import com.yunbao.common.bean.WishListGiftConfModel; import com.yunbao.common.bean.WishListModel; @@ -1162,4 +1165,17 @@ public interface PDLiveApi { @GET("/api/public/?service=Sudgameserver.getRoomMicStatus") Observable> getRoomMicStatus(); + + @GET("/api/public/?service=Pdluser.friend") + Observable>> getPdluserFriend(@Query("p") int p); + @GET("/api/public/?service=Pdluser.follow") + Observable>> getPdluserFollow(@Query("p") int p); + @GET("/api/public/?service=Pdluser.fans") + Observable>> getPdluserFans(@Query("p") int p); + @GET("/api/public/?service=Pdluser.search") + Observable>> addressBookSearch(@Query("user_nicename") String key); + @GET("/api/public/?service=Pdlinfos.getOtherInfo") + Observable> getOtherInfo(@Query("tuid") String tuid); + @GET("/api/public/?service=Userhome.getUserHomeBanner") + Observable>> getUserHomeBanner(@Query("select_uid") String tuid); } diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 9b4321c7a..e799ca09f 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -43,6 +43,8 @@ import com.yunbao.common.bean.LiveStetUpStatusModel; import com.yunbao.common.bean.LiveTaskModel; import com.yunbao.common.bean.LiveUserMailBoxModel; import com.yunbao.common.bean.MedalAchievementModel; +import com.yunbao.common.bean.MessageChatUserBean; +import com.yunbao.common.bean.MessageUserInfoBean; import com.yunbao.common.bean.NobleRankHideUserListModel; import com.yunbao.common.bean.NobleTrumpetModel; import com.yunbao.common.bean.OpenAdModel; @@ -64,6 +66,7 @@ import com.yunbao.common.bean.SudRoomListModel; import com.yunbao.common.bean.SudgameCodeModel; import com.yunbao.common.bean.UserAreaBean; import com.yunbao.common.bean.UserAvatarSelectBean; +import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.VipModel; import com.yunbao.common.bean.WishListGiftConfModel; import com.yunbao.common.bean.WishListModel; @@ -2770,7 +2773,7 @@ public class LiveNetManager { }).isDisposed(); } - public void addChatCount(String stream,HttpCallback callback) { + public void addChatCount(String stream, HttpCallback callback) { API.get().pdLiveApi(mContext) .addChatCount(stream) .subscribeOn(Schedulers.io()) @@ -2931,6 +2934,126 @@ public class LiveNetManager { } + public void getPdluserFollow(int p, HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .getPdluserFollow(p) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(roomMicStatusModelResponseModel -> { + if (callback != null) { + callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getOtherInfo(String touid, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .getOtherInfo(touid) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(roomMicStatusModelResponseModel -> { + if (callback != null) { + callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getPdluserFriend(int p, HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .getPdluserFriend(p) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(roomMicStatusModelResponseModel -> { + if (callback != null) { + callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getPdluserFans(int p, HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .getPdluserFans(p) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(roomMicStatusModelResponseModel -> { + if (callback != null) { + callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void addressBookSearch(String search, HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .addressBookSearch(search) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(roomMicStatusModelResponseModel -> { + if (callback != null) { + callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getUserHomeBanner(String search,HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .getUserHomeBanner(search) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(roomMicStatusModelResponseModel -> { + if (callback != null) { + callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + /** * 直播间取消网络请求 */ diff --git a/common/src/main/java/com/yunbao/common/utils/ActiveImageAdapter.java b/common/src/main/java/com/yunbao/common/utils/ActiveImageAdapter.java new file mode 100644 index 000000000..a802b8994 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/utils/ActiveImageAdapter.java @@ -0,0 +1,208 @@ +package com.yunbao.common.utils; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.ActiveImageBean; +import com.yunbao.common.glide.ImgLoader; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +public class ActiveImageAdapter extends RecyclerView.Adapter { + + private Context mContext; + private List mList; + private LayoutInflater mInflater; + private View.OnClickListener mOnClickListener; + private View.OnClickListener mODelListener; + private ActionListener mActionListener; + + public ActiveImageAdapter(Context context) { + mContext = context; + mList = new ArrayList<>(); + mInflater = LayoutInflater.from(context); + mOnClickListener = new View.OnClickListener() { + @Override + public void onClick(View v) { + Object tag = v.getTag(); + if (tag == null) { + return; + } + int position = (int) tag; + ActiveImageBean bean = mList.get(position); + if (bean.getImageFile() == null) { + if (mActionListener != null) { + mActionListener.onAddClick(); + } + } else { + if (mActionListener != null) { + mActionListener.onItemClick(position); + } + } + } + }; + mODelListener = new View.OnClickListener() { + @Override + public void onClick(View v) { + Object tag = v.getTag(); + if (tag == null) { + return; + } + int position = (int) tag; + ActiveImageBean bean = mList.get(position); + if (bean.getImageFile() == null) { + if (mActionListener != null) { + mActionListener.onAddClick(); + } + } else { + if (mActionListener != null) { + mActionListener.onDel(position); + } + } + } + }; + } + + public void setActionListener(ActionListener actionListener) { + mActionListener = actionListener; + } + + public void insertList(List imagePathList) { + int index = 0; + for (ActiveImageBean bean : mList) { + if (bean.getImageFile() == null) { + bean.setImageFile(new File(imagePathList.get(index))); + index++; + } + } + int moreCount = 9 - mList.size(); + if (moreCount > 0) { + moreCount = Math.min(moreCount, imagePathList.size() - index); + for (int i = 0; i < moreCount; i++) { + mList.add(new ActiveImageBean(new File(imagePathList.get(index + i)))); + } + } + if (mList.size() < 9) { + mList.add(new ActiveImageBean()); + } + notifyDataSetChanged(); + } + + public void deleteItem(int position) { + if (mList == null) { + return; + } + if (position >= 0 && position < mList.size()) { + mList.remove(position); + } + int size = mList.size(); + ActiveImageBean bean = mList.get(size - 1); + if (bean.getImageFile() != null) { + mList.add(new ActiveImageBean()); + } else { + if (size == 1) { + mList.clear(); + } + } + notifyDataSetChanged(); + if (mList.size() == 0 && mActionListener != null) { + mActionListener.onDeleteAll(); + } + } + + public List getImageFileList() { + List list = null; + for (ActiveImageBean bean : mList) { + File file = bean.getImageFile(); + if (file != null && file.exists()) { + if (list == null) { + list = new ArrayList<>(); + } + list.add(file); + } + } + return list; + } + + public int getImageFileCount() { + int count = 0; + for (ActiveImageBean bean : mList) { + File file = bean.getImageFile(); + if (file != null && file.exists()) { + count++; + } + } + return count; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int position) { + return new Vh(mInflater.inflate(R.layout.item_active_image, viewGroup, false)); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position) { + ((Vh) vh).setData(mList.get(position), position); + } + + @Override + public int getItemCount() { + return mList.size(); + } + + + class Vh extends RecyclerView.ViewHolder { + + View mIconAdd; + ImageView mImg; + ImageView del; + + public Vh(@NonNull View itemView) { + super(itemView); + mIconAdd = itemView.findViewById(R.id.icon_add); + mImg = itemView.findViewById(R.id.img); + del = itemView.findViewById(R.id.del); + itemView.setOnClickListener(mOnClickListener); + del.setOnClickListener(mODelListener); + } + + void setData(ActiveImageBean bean, int position) { + itemView.setTag(position); + if (bean.getImageFile() == null) { + mImg.setImageDrawable(null); + if (mIconAdd.getVisibility() != View.VISIBLE) { + mIconAdd.setVisibility(View.VISIBLE); + } + if (del.getVisibility() != View.VISIBLE) { + del.setVisibility(View.VISIBLE); + } + } else { + if (mIconAdd.getVisibility() == View.VISIBLE) { + mIconAdd.setVisibility(View.INVISIBLE); + } + if (del.getVisibility() == View.VISIBLE) { + del.setVisibility(View.GONE); + } + ImgLoader.display(mContext, bean.getImageFile(), mImg); + } + } + } + + + public interface ActionListener { + void onAddClick(); + void onItemClick(int position); + void onDeleteAll(); + void onDel(int position); + } +} diff --git a/common/src/main/java/com/yunbao/common/utils/DateFormatUtil.java b/common/src/main/java/com/yunbao/common/utils/DateFormatUtil.java index 853e0e0ef..8b5bb110c 100644 --- a/common/src/main/java/com/yunbao/common/utils/DateFormatUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/DateFormatUtil.java @@ -1,7 +1,5 @@ package com.yunbao.common.utils; -import com.yunbao.common.http.Data; - import java.text.SimpleDateFormat; import java.util.Date; @@ -36,6 +34,13 @@ public class DateFormatUtil { return formattedDate; } + public static String getTimeStrings(long time) { + Date date = new Date(time); // 创建Date对象并传入时间戳参数 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); // 设置日期格式 + String formattedDate = sdf.format(date); // 格式化日期字符串 + return formattedDate; + } + public static String getVideoCurTimeString() { return sFormat2.format(new Date()); diff --git a/common/src/main/java/com/yunbao/common/views/NineGridLayout.java b/common/src/main/java/com/yunbao/common/views/NineGridLayout.java new file mode 100644 index 000000000..b303cbce4 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/NineGridLayout.java @@ -0,0 +1,216 @@ +package com.yunbao.common.views; + +import android.content.Context; +import android.content.res.TypedArray; +import android.util.AttributeSet; +import android.util.DisplayMetrics; +import android.view.Gravity; +import android.view.View; +import android.view.ViewGroup; +import android.widget.FrameLayout; +import android.widget.ImageView; + +import com.makeramen.roundedimageview.RoundedImageView; +import com.yunbao.common.R; + +import java.util.ArrayList; +import java.util.List; + +public class NineGridLayout extends FrameLayout { + + private Context mContext; + private int mWidth1; + private int mWidth2; + private int mWidth3; + private int mDividerWidth; + private int mCornerRadius; + private List mViewList; + private ActionListener mActionListener; + private LayoutParams mLayoutParams00; + private LayoutParams mLayoutParams10; + private LayoutParams mLayoutParams11; + private LayoutParams[] mLayoutParamsArray; + private OnClickListener mOnClickListener; + private List mDataList; + + + public NineGridLayout(Context context) { + this(context, null); + } + + public NineGridLayout(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public NineGridLayout(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + int space = 0; + int dividerWidth = 0; + TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.NineGridLayout); + space = (int) ta.getDimension(R.styleable.NineGridLayout_ngl_space, 0); + dividerWidth = (int) ta.getDimension(R.styleable.NineGridLayout_ngl_divider_width, 0); + mCornerRadius = (int) ta.getDimension(R.styleable.NineGridLayout_ngl_corner_radius, 0); + ta.recycle(); + mContext = context; + mViewList = new ArrayList<>(); + DisplayMetrics dm = context.getResources().getDisplayMetrics(); + float scale = dm.density; + int width = dm.widthPixels - space; + mDividerWidth = dividerWidth; + mWidth1 = (int) (scale * 220 + 0.5f); + mWidth2 = (width - dividerWidth) / 2; + mWidth3 = (width - dividerWidth * 2) / 3; + mOnClickListener = new OnClickListener() { + @Override + public void onClick(View v) { + if (mActionListener != null) { + for (int i = 0, size = mViewList.size(); i < size; i++) { + if (v == mViewList.get(i)) { + mActionListener.onItemClick(mDataList, i); + break; + } + } + } + } + }; + } + + + public void setData(List list) { + if (list == null) { + hideItem(0); + return; + } + int dataSize = list.size(); + if (dataSize == 0) { + hideItem(0); + return; + } + mDataList = list; + int viewSize = mViewList.size(); + if (viewSize < dataSize) { + for (int i = 0, size = dataSize - viewSize; i < size; i++) { + addItem(); + } + } else if (viewSize > dataSize) { + hideItem(dataSize); + } + if (dataSize == 1) { + RoundedImageView imageView = mViewList.get(0); + if (mLayoutParams00 == null) { + mLayoutParams00 = new LayoutParams(mWidth1, mWidth1); + } + if (imageView.getLayoutParams() != mLayoutParams00) { + imageView.setLayoutParams(mLayoutParams00); + } + if (imageView.getVisibility() != VISIBLE) { + imageView.setVisibility(VISIBLE); + } + setHeight(mWidth1); + if (mActionListener != null) { + mActionListener.displayImage(list.get(0), imageView); + } + } else if (dataSize == 2) { + RoundedImageView imageView0 = mViewList.get(0); + RoundedImageView imageView1 = mViewList.get(1); + if (mLayoutParams10 == null) { + mLayoutParams10 = new LayoutParams(mWidth2, mWidth2); + } + if (mLayoutParams11 == null) { + mLayoutParams11 = new LayoutParams(mWidth2, mWidth2); + mLayoutParams11.gravity = Gravity.RIGHT; + } + if (imageView0.getLayoutParams() != mLayoutParams10) { + imageView0.setLayoutParams(mLayoutParams10); + } + if (imageView1.getLayoutParams() != mLayoutParams11) { + imageView1.setLayoutParams(mLayoutParams11); + } + if (imageView0.getVisibility() != VISIBLE) { + imageView0.setVisibility(VISIBLE); + } + if (imageView1.getVisibility() != VISIBLE) { + imageView1.setVisibility(VISIBLE); + } + setHeight(mWidth2); + if (mActionListener != null) { + mActionListener.displayImage(list.get(0), imageView0); + mActionListener.displayImage(list.get(1), imageView1); + } + } else { + if (mLayoutParamsArray == null) { + mLayoutParamsArray = new LayoutParams[9]; + } + int rowCount = dataSize / 3; + if (dataSize % 3 != 0) { + rowCount++; + } + setHeight(mWidth3 * rowCount + mDividerWidth * (rowCount - 1)); + for (int i = 0; i < dataSize; i++) { + RoundedImageView imageView = mViewList.get(i); + if (mLayoutParamsArray[i] == null) { + mLayoutParamsArray[i] = new LayoutParams(mWidth3, mWidth3); + int row = i / 3;//行 + int col = i % 3;//列 + int margin = mWidth3 + mDividerWidth; + mLayoutParamsArray[i].leftMargin = margin * col; + mLayoutParamsArray[i].topMargin = margin * row; + } + if (imageView.getLayoutParams() != mLayoutParamsArray[i]) { + imageView.setLayoutParams(mLayoutParamsArray[i]); + } + if (imageView.getVisibility() != VISIBLE) { + imageView.setVisibility(VISIBLE); + } + if (mActionListener != null) { + mActionListener.displayImage(list.get(i), imageView); + } + } + } + } + + + private void setHeight(int height) { + ViewGroup.LayoutParams layoutParams = getLayoutParams(); + if (height != layoutParams.height) { + layoutParams.height = height; + requestLayout(); + } + } + + + private void hideItem(int fromIndex) { + for (int i = 0, size = mViewList.size(); i < size; i++) { + if (i >= fromIndex) { + RoundedImageView imageView = mViewList.get(i); + imageView.setImageDrawable(null); + if (imageView.getVisibility() == VISIBLE) { + imageView.setVisibility(INVISIBLE); + } + } + } + } + + private void addItem() { + RoundedImageView imageView = new RoundedImageView(mContext); + imageView.setCornerRadius(mCornerRadius); + imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); + imageView.setOnClickListener(mOnClickListener); + mViewList.add(imageView); + addView(imageView); + } + + + public void setActionListener(ActionListener actionListener) { + mActionListener = actionListener; + } + + public interface ActionListener { + + void onItemClick(List dataList, int position); + + void displayImage(Object path, ImageView imageView); + } + + +} diff --git a/common/src/main/res/drawable/bg_item_comment.xml b/common/src/main/res/drawable/bg_item_comment.xml new file mode 100644 index 000000000..84fe7184e --- /dev/null +++ b/common/src/main/res/drawable/bg_item_comment.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/bg_main_com_author.xml b/common/src/main/res/drawable/bg_main_com_author.xml new file mode 100644 index 000000000..ce80fef56 --- /dev/null +++ b/common/src/main/res/drawable/bg_main_com_author.xml @@ -0,0 +1,12 @@ + + + + + diff --git a/common/src/main/res/drawable/bg_main_com_type_1.xml b/common/src/main/res/drawable/bg_main_com_type_1.xml new file mode 100644 index 000000000..17ffb4350 --- /dev/null +++ b/common/src/main/res/drawable/bg_main_com_type_1.xml @@ -0,0 +1,12 @@ + + + + + diff --git a/common/src/main/res/layout/activity_community_details.xml b/common/src/main/res/layout/activity_community_details.xml index a5e7cee5d..99a9973dc 100644 --- a/common/src/main/res/layout/activity_community_details.xml +++ b/common/src/main/res/layout/activity_community_details.xml @@ -1,9 +1,11 @@ + android:orientation="vertical" + android:paddingTop="15dp"> @@ -14,7 +16,7 @@ @@ -22,14 +24,15 @@ + android:id="@+id/avatar" + android:layout_width="68dp" + android:layout_height="68dp" + android:src="@mipmap/icon_data_empty" + app:riv_corner_radius="20dp" /> + android:textColor="#AAAAAA" + android:textSize="12dp" /> - + android:layout_marginTop="15dp" + app:ngl_corner_radius="5dp" + app:ngl_divider_width="6dp" + app:ngl_space="30dp" /> + + + + + + + + @@ -129,6 +165,7 @@ android:gravity="center_vertical"> @@ -155,22 +193,24 @@ + android:paddingRight="20dp"> - + android:layout_marginBottom="10dp" + android:src="@mipmap/icon_data_empty" + app:riv_corner_radius="20dp" /> diff --git a/common/src/main/res/layout/activity_community_send.xml b/common/src/main/res/layout/activity_community_send.xml index 91781ac1d..8195f4133 100644 --- a/common/src/main/res/layout/activity_community_send.xml +++ b/common/src/main/res/layout/activity_community_send.xml @@ -6,196 +6,245 @@ - + android:layout_height="wrap_content"> - - - - - - - - - - - - + android:orientation="vertical"> - + - + + + + + + + + + + + android:layout_marginLeft="15dp" + android:layout_marginBottom="20dp" + android:visibility="visible"> + + + + + + + + + + + + + + + + + + + + + + + + + android:layout_marginStart="15dp" + android:layout_marginTop="5dp" + android:layout_marginEnd="15dp" + android:background="@drawable/main_community_send_edit_bg" + android:orientation="vertical" + android:paddingLeft="15dp" + android:paddingTop="10dp" + android:paddingEnd="15dp" + android:paddingBottom="10dp"> - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/common/src/main/res/layout/item_active_image.xml b/common/src/main/res/layout/item_active_image.xml new file mode 100644 index 000000000..2ed7c3fe5 --- /dev/null +++ b/common/src/main/res/layout/item_active_image.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/item_comment_reply_view.xml b/common/src/main/res/layout/item_comment_reply_view.xml new file mode 100644 index 000000000..e6c175e78 --- /dev/null +++ b/common/src/main/res/layout/item_comment_reply_view.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/item_comment_view.xml b/common/src/main/res/layout/item_comment_view.xml new file mode 100644 index 000000000..172889a0c --- /dev/null +++ b/common/src/main/res/layout/item_comment_view.xml @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/mipmap-mdpi/icon_active_add.png b/common/src/main/res/mipmap-mdpi/icon_active_add.png new file mode 100644 index 0000000000000000000000000000000000000000..0597a7a399f00ca4e7abbcdfa3c89efc74f0af95 GIT binary patch literal 254 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpUtqn<8~AsLNtZ!~f?1xUC)T)d?v z_leBbu}XM`SHt=6XkAPU21;7abvGh0?V!{ zJI3szYHO1&uBtBFr;&OfT;+f+V;*OLcSAJO9ia!)7`C(QP(84A?d9fA%yqFpW<*#0 zEjnL2)2oN0e%H}u_4O^Ygf_71*%uhkmpXMIhxLtX|Ajxc87$RLjI*Xg^r9HoV7_d* o_oju7Mh^_%?(pYVv1Ty;^3CBT&(n%>pobVdUHx3vIVCg!0DZt^3jhEB literal 0 HcmV?d00001 diff --git a/common/src/main/res/mipmap-mdpi/icon_like01.png b/common/src/main/res/mipmap-mdpi/icon_like01.png new file mode 100644 index 0000000000000000000000000000000000000000..e38de99f4b62aa41962775cafe0881262dc4802a GIT binary patch literal 2435 zcmV-}34Hd6P)Px;JxN4CRA@u(Sq+R_RTVzx-ZwLEcBV^#YG`U3j1&s=$HWRnu_mpuKkYg@_q`o4 zG=v33eu4z37^6v75=bP{s!0*BS}B#9=e#>JZPUM`Di|#r#n`27iujY5LR=H5-MX_o zGw!0@baWIv&wC93o;M6*Zz7QxoQWY^*PY8bU+Me)BZ#;p9*?)= z^LbE8y#)XV5it{qL|*IY=s1mtx)#|rg<>w3o8|lddadefO5}36>wMoo!Wc6G zuloS-Cqi9}xP?CdPie8+KaG7O_vYu$y2^D2O~)-=Cc2(f!QaMJ?I<#KC$-~Txx zUKS|%E&y!sJnzNnLcwvIa3~bI9{`?YjKzYmdQT}up6e$i(&_ZgjIlk4cm;Xf_x-%q z`eDnmwoIqwwr$&Du~>}G-@}~qIf2|EL=?$n^59hKrUa(7X4!0(tWq9Y>p`vcr!33* zd$rgOEPVs#{2*iOsvs&6r3xvqPcX_{M!?TDrg!@yFhRGD(W5aPKy<$e+oe+2+>0Pqm8H9%w`Xx&xI`ba~$p$a&o`jFl6W zs7Jn(axnn>mO>o>PJ5nreJYiDdrDwZ%G;yS=nk^3Q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<@^-w);U z`IqZK_w@8E&15pvH(uV(?IV0IP#NpG?rf*B?H;a72+p*5Ds&<+teG0P_ABXhdV}LQ z)yF0ZR0k1pPp7mStn-ypkDot(-mQ+zp#f84esXg1O+@@y*Z|f@c&e<*EhixGoOBfnwiEr_;B!x{Gd`hc|87q^(-D>fe`&|K**64utUvg~AO(LqjvQ zvt?N)HBE~pPzCh=Gd4DMeKX5el-d?>Al%&m@FF5E?G$uy5dX21@++M4uclI|XTqM$ zT6sVKmYza1xpiBJLd>9X-@8NOio28|>+=hhWow~Emg0v zZF`kc>Lg?A=J^60fIUYq|6JD{n~ThyTDXSiv17-K(b3W0AmZA&l%Xwv{4$+RZ*2Ay zDT)GO0bG@~=>3(WY1)#x9`ypN(sM#b2yrk9s8(}h1x$=A%c8pbcp{Nl+v#0%&^&lc zDRsY;@T2vv(VY;WEbV zYUkoX5BUWEI3%T{{@A>Xc?C=obI$33+h)et)AYOE+QAJZRZZJH&wIAjJyjeUn0LSx zA*n)JxpL*Jh`0t36ZCiA_o-Qb%JaM}gM)+b!~v)sjRgZ-5yUjj2N`480Pul + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/item_main_com.xml b/live/src/main/res/layout/item_main_com.xml index afbeebebe..9be3fefdf 100644 --- a/live/src/main/res/layout/item_main_com.xml +++ b/live/src/main/res/layout/item_main_com.xml @@ -94,6 +94,7 @@ { - +public class MainHomeComAdapter extends RefreshAdapter { private Context mContext; + private View.OnClickListener mOnClickListener; - public void setmOnClickListener(View.OnClickListener mOnClickListener) { - this.mOnClickListener = mOnClickListener; - } - - private List heightList = new ArrayList<>(); - public MainHomeComAdapter(Context context) { super(context); this.mContext = context; + mOnClickListener = new View.OnClickListener() { + @Override + public void onClick(View v) { + Object tag = v.getTag(); + if (tag != null && mOnItemClickListener != null) { + mOnItemClickListener.onItemClick((ActiveBean) tag, 0); + } + } + }; } @NonNull @@ -60,13 +62,13 @@ public class MainHomeComAdapter extends RefreshAdapter { } class Vh extends RecyclerView.ViewHolder { - TextView name; TextView title; TextView likeCount; ImageView img; ImageView author; LinearLayout heightLayout; + ImageView isVideo; public Vh(View itemView) { super(itemView); @@ -76,16 +78,30 @@ public class MainHomeComAdapter extends RefreshAdapter { author = itemView.findViewById(R.id.author); likeCount = itemView.findViewById(R.id.like_count); heightLayout = itemView.findViewById(R.id.imgLayout); + isVideo = itemView.findViewById(R.id.isVideo); itemView.setOnClickListener(mOnClickListener); } - void setData(LiveBean bean, int position) { + void setData(ActiveBean bean, int position) { itemView.setTag(bean); - //name.setText(bean.getCity()); - //title.setText(bean.getCity()); - likeCount.setText(bean.getNums()); - ImgLoader.display(mContext, "https://img2.baidu.com/it/u=1540900496,2036305732&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", img); - ImgLoader.display(mContext, bean.getAvatar(), author); + if (bean.getImg_or_video().equals("1")) { + JSONArray jsonArray = (JSONArray) JSONArray.parse(bean.getImg_json()); + if (jsonArray.size() != 0) { + ImgLoader.display(mContext, String.valueOf(jsonArray.get(0)), img); + } + isVideo.setVisibility(View.GONE); + } else { + ImgLoader.display(mContext, bean.getUser_avatar(), img); + isVideo.setVisibility(View.VISIBLE); + } + name.setText(bean.getUser_name()); + JSONObject json = JSONObject.parseObject(bean.getContent()); + if (json != null) { + String content = (String) json.get("msg"); + title.setText(content); + } + likeCount.setText(bean.getLove_num()); + ImgLoader.display(mContext, bean.getUser_avatar(), author); if (position == 0) { RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) heightLayout.getLayoutParams(); diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeComViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeComViewHolder.java index 496a0ab3a..cfe963061 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeComViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeComViewHolder.java @@ -8,7 +8,6 @@ import android.widget.FrameLayout; import android.widget.ImageView; import com.umeng.analytics.MobclickAgent; -import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.activity.CommunitySendActivity; import com.yunbao.common.event.FloatWarOrderEvent; import com.yunbao.common.utils.RouteUtil; diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeNewViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeNewViewHolder.java index 1c81c60f1..dd16b3dcc 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeNewViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeNewViewHolder.java @@ -4,6 +4,7 @@ import android.animation.ObjectAnimator; import android.app.Dialog; import android.content.Context; import android.content.Intent; +import android.os.Parcelable; import android.text.TextUtils; import android.util.Log; import android.view.View; @@ -14,36 +15,36 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.umeng.analytics.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.activity.CommunityDetailsActivity; import com.yunbao.common.adapter.RefreshAdapter; -import com.yunbao.common.bean.AnchorRecommendModel; +import com.yunbao.common.bean.ActiveBean; import com.yunbao.common.bean.BannerBean; -import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveClassBean; -import com.yunbao.common.bean.WeekListBean; +import com.yunbao.common.bean.VideoBean; import com.yunbao.common.custom.CommonRefreshWaterfallView; -import com.yunbao.common.event.LiveRoomChangeEvent; +import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; -import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.manager.LiveClassManager; import com.yunbao.common.manager.OpenAdManager; import com.yunbao.common.utils.DialogUitl; -import com.yunbao.common.utils.LiveRoomCheckLivePresenter; -import com.yunbao.common.utils.MicStatusManager; -import com.yunbao.common.utils.RouteUtil; -import com.yunbao.common.utils.ToastUtil; -import com.yunbao.live.utils.LiveStorge; -import com.yunbao.live.views.LiveRoomViewHolder; +import com.yunbao.live.adapter.LiveAdminRoomAdapter; +import com.yunbao.live.bean.LiveAdminRoomBean; +import com.yunbao.live.views.LiveMyRoomViewHolder; import com.yunbao.main.R; import com.yunbao.main.adapter.MainHomeComAdapter; import com.yunbao.main.adapter.MainHomeComClassAdapter; import com.yunbao.main.http.MainHttpConsts; import com.yunbao.main.http.MainHttpUtil; +import com.yunbao.video.activity.VideoPlayActivity; +import com.yunbao.video.http.VideoHttpUtil; +import com.yunbao.video.interfaces.VideoScrollDataHelper; +import com.yunbao.video.utils.VideoStorge; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; @@ -60,23 +61,18 @@ import java.util.Map; * MainActivity 社区-热门 */ -public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements OnItemClickListener { - private View mShadow; +public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements OnItemClickListener { private View mBtnDismiss; public static CommonRefreshWaterfallView mRefreshView; private RecyclerView mClassRecyclerViewTop; private MainHomeComAdapter mAdapter; private ObjectAnimator mShowAnimator; private ObjectAnimator mHideAnimator; - private boolean mBannerShowed; - private List mBannerList; - private List mWeekListBean; public static ImageView btnUseIco; private int select = 0; //是否是首頁 private int intoIndex = 0; - private List new_data; - private boolean isHave = false; + private List new_data; private Map gotoRoomKey = new HashMap<>(); private Dialog mShowLoadingDialog; private String typeHot; @@ -114,7 +110,6 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements typeHot = list.get(0).getEnglish(); select = list.get(0).getId(); } - mShadow = findViewById(R.id.shadow); mBtnDismiss = findViewById(R.id.btn_dismiss); mBtnDismiss.setOnClickListener(new View.OnClickListener() { @Override @@ -134,22 +129,16 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements mRefreshView.setEmptyLayoutId(R.layout.view_no_data_live); EventBus.getDefault().register(this); - mAdapter = new MainHomeComAdapter(mContext); - mAdapter.setmOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(mContext, CommunityDetailsActivity.class); - mContext.startActivity(intent); - } - }); - mAdapter.setOnItemClickListener(MainHomeNewViewHolder.this); - mAdapter.setHasStableIds(true);// mRefreshView.setLoadMoreEnable(true); mRefreshView.setRecyclerViewAdapter(mAdapter); - mRefreshView.setDataHelper(new CommonRefreshWaterfallView.DataHelper() { + mRefreshView.setDataHelper(new CommonRefreshWaterfallView.DataHelper() { @Override - public RefreshAdapter getAdapter() { - return null; + public RefreshAdapter getAdapter() { + if (mAdapter == null) { + mAdapter = new MainHomeComAdapter(mContext); + mAdapter.setOnItemClickListener(MainHomeNewViewHolder.this); + } + return mAdapter; } @Override @@ -157,26 +146,7 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements Log.i("t2", "aaa" + p); if (TextUtils.equals(typeHot, "Hot") || TextUtils.equals(typeHot, "hot") || TextUtils.equals(typeHot, "熱門")) { pp = 1; - LiveHttpUtil.getAnchorLastWeekList(new HttpCallback() { - @Override - public void onSuccess(int code, String msg, String[] info) { - if (mWeekListBean != null) { - mWeekListBean.clear(); - } - if (code == 0 && info.length > 0) { - mWeekListBean = JSON.parseArray(Arrays.toString(info), WeekListBean.class); - } else { - mWeekListBean = null; - } - if (mWeekListBean != null && mWeekListBean.size() > 0) { - isHave = true; - } else { - isHave = false; - } - Constants.getWeekIntIndex = Constants.getWeekIntIndex + 1; - MainHttpUtil.getHot(p, callback); - } - }); + CommonHttpUtil.getCommunityHotList(p, callback); } else { pp = 0; MainHttpUtil.getClassLive(select, p, callback); @@ -184,46 +154,15 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements } @Override - public List processData(String[] info) { + public List processData(String[] info) { new_data = new ArrayList<>(); - if (info.length > 0) { - JSONObject obj = JSON.parseObject(info[0]); - - mBannerList = JSON.parseArray(obj.getString("slide"), BannerBean.class); - if (!obj.containsKey("list")) { - return new_data; - } - List old_data = JSON.parseArray(obj.getString("list"), LiveBean.class); - LiveBean liveModel = null; - if (old_data == null) { - return new_data; - } - for (LiveBean model : old_data) { - //判断周星榜数据 - if (TextUtils.equals(model.getIs_week(), "1")) { - if (mWeekListBean != null && mWeekListBean.size() > 0) { - model.setmWeekList(mWeekListBean); - } else { - liveModel = model; - } - } - } - //满足有周星榜字段但是没有周星榜数据的删掉 - if (liveModel != null) { - old_data.remove(liveModel); - } - new_data.addAll(old_data); - - } + new_data = JSON.parseArray(Arrays.toString(info), ActiveBean.class); return new_data; } @Override - public void onRefreshSuccess(List list, int count) { - if (CommonAppConfig.LIVE_ROOM_SCROLL) { - LiveStorge.getInstance().put(Constants.LIVE_HOME, list); - } - EventBus.getDefault().post(new AnchorRecommendModel()); + public void onRefreshSuccess(List list, int count) { + } @Override @@ -232,12 +171,10 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements } @Override - public void onLoadMoreSuccess(List loadItemList, int loadItemCount) { + public void onLoadMoreSuccess(List loadItemList, int loadItemCount) { new_data = new ArrayList<>(); for (int j = 0; j < loadItemList.size(); j++) { - if (loadItemList.get(j).getUserNiceName() != null) { - new_data.add(loadItemList.get(j)); - } + new_data.add(loadItemList.get(j)); } if (loadItemList.size() > 0) { mAdapter.insertList(new_data); @@ -295,7 +232,6 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements mRefreshView.initData(); topAdapter.choice = position; topAdapter.notifyDataSetChanged(); - } }); if (mClassRecyclerViewTop != null) { @@ -305,39 +241,40 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements mRefreshView.initData(); } + private VideoScrollDataHelper mVideoScrollDataHelper; - private void gotoLive(final String live_id) { - LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() { + @Override + public void onItemClick(ActiveBean bean, int position) { + Intent intent = new Intent(mContext, CommunityDetailsActivity.class); + intent.putExtra("active", (Parcelable) bean); + mContext.startActivity(intent); + + /*if (bean.getImg_or_video().equals("2")) { + if (mVideoScrollDataHelper == null) { + mVideoScrollDataHelper = new VideoScrollDataHelper() { + @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 && info.length > 0) { - LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); - if (liveBean == null) { - return; + if (code == 0) { + List tempList = new ArrayList<>(); + for (String s : info) { + VideoBean videoBean = JSONObject.parseObject(s, VideoBean.class); + tempList.add(videoBean); } - intoIndex = 1; - if (gotoRoomKey != null && gotoRoomKey.isEmpty()) { - gotoRoomKey = null; - } - liveBean.setParams(gotoRoomKey); - new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() { - @Override - public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) { - RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal)); - } - - @Override - public void onCheckError(String contextError) { - - } - }); - - } else { - intoIndex = 1; - RouteUtil.forwardUserHome(mContext, live_id, 0); + VideoStorge.getInstance().put(Constants.VIDEO_HOME, tempList); + VideoPlayActivity.forward(mContext, position, Constants.VIDEO_HOME, 1); } } - }); + });*/ } /** @@ -348,58 +285,6 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements mShowLoadingDialog.show(); } - @Override - public void onItemClick(LiveBean bean, int position) { - if ("1".equals(bean.getIslive())) { - intoIndex = 1; - watchLive(bean, Constants.LIVE_HOME, position); - } else if (bean.getIs_week() != null && bean.getIs_week().equals("1")) { - String url = CommonAppConfig.HOST + bean.getUrl() + "?a=1"; - LiveHttpUtil.getLiveInfo(bean.getUid(), new HttpCallback() { - @Override - public void onSuccess(int code, String msg, String[] info) { - if (code == 0 && info.length > 0) { - LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); - - if (liveBean == null) { - return; - } - new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() { - @Override - public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) { - - if (LiveRoomViewHolder.mHandler != null) { - LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null); - } - if (!"".endsWith(Constants.mStream)) { - if (MicStatusManager.getInstance().isMic(liveUid)) { - MicStatusManager.getInstance().showDownMicDialog(mContext); - return; - } - EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal))); - } else { - RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk)); - } - } - - @Override - public void onCheckError(String contextError) { - - } - }); - - } else { - ToastUtil.show(msg); - } - } - }); - } else { - intoIndex = 1; - RouteUtil.forwardUserHome(mContext, bean.getUid(), 0); - } - } - - @Override public void loadData() { } @@ -437,4 +322,5 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements mShowLoadingDialog = null; } } + } diff --git a/main/src/main/res/layout/view_main_home_com.xml b/main/src/main/res/layout/view_main_home_com.xml index 695ad2f37..8ffe7c2d1 100644 --- a/main/src/main/res/layout/view_main_home_com.xml +++ b/main/src/main/res/layout/view_main_home_com.xml @@ -11,7 +11,7 @@ android:id="@+id/appBarLayout" android:layout_width="match_parent" android:layout_height="70dp" - android:layout_marginTop="10dp" + android:layout_marginTop="20dp" android:background="@android:color/transparent" android:fadingEdge="none" app:elevation="0dp" diff --git a/video/src/main/java/com/yunbao/video/views/VideoPlayViewHolder.java b/video/src/main/java/com/yunbao/video/views/VideoPlayViewHolder.java index 1750df210..d25d51daf 100644 --- a/video/src/main/java/com/yunbao/video/views/VideoPlayViewHolder.java +++ b/video/src/main/java/com/yunbao/video/views/VideoPlayViewHolder.java @@ -70,10 +70,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList mVideoCover = findViewById(R.id.video_cover); mPlayBtn = findViewById(R.id.btn_play); //暂停按钮动画 - mPlayBtnAnimator = ObjectAnimator.ofPropertyValuesHolder(mPlayBtn, - PropertyValuesHolder.ofFloat("scaleX", 4f, 0.8f, 1f), - PropertyValuesHolder.ofFloat("scaleY", 4f, 0.8f, 1f), - PropertyValuesHolder.ofFloat("alpha", 0f, 1f)); + mPlayBtnAnimator = ObjectAnimator.ofPropertyValuesHolder(mPlayBtn, PropertyValuesHolder.ofFloat("scaleX", 4f, 0.8f, 1f), PropertyValuesHolder.ofFloat("scaleY", 4f, 0.8f, 1f), PropertyValuesHolder.ofFloat("alpha", 0f, 1f)); mPlayBtnAnimator.setDuration(150); mPlayBtnAnimator.setInterpolator(new AccelerateInterpolator()); } @@ -87,9 +84,8 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList case TXLiveConstants.PLAY_EVT_PLAY_BEGIN://加载完成,开始播放的回调 mStartPlay = true; if (mActionListener != null) { - mActionListener.onPlayBegin(); + mActionListener.onPlayBegin(txVodPlayer.getDuration()); } - break; case TXLiveConstants.PLAY_EVT_PLAY_LOADING: //开始加载的回调 if (mActionListener != null) { @@ -116,6 +112,13 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList case TXLiveConstants.PLAY_EVT_CHANGE_RESOLUTION://获取到视频宽高回调 onVideoSizeChanged(bundle.getInt("EVT_PARAM1", 0), bundle.getInt("EVT_PARAM2", 0)); break; + case TXLiveConstants.PLAY_EVT_PLAY_PROGRESS: + if (mActionListener != null) { + int progress = bundle.getInt(TXLiveConstants.EVT_PLAY_PROGRESS_MS); + int duration = bundle.getInt(TXLiveConstants.EVT_PLAY_DURATION_MS); + mActionListener.onProgress(progress, duration); + } + break; } } @@ -289,11 +292,13 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList public interface ActionListener { - void onPlayBegin(); + void onPlayBegin(float duration); void onPlayLoading(); void onFirstFrame(); + + void onProgress(int progress, int duration); } diff --git a/video/src/main/java/com/yunbao/video/views/VideoPlayWrapViewHolder.java b/video/src/main/java/com/yunbao/video/views/VideoPlayWrapViewHolder.java index 231aea3ed..fbc8a5b43 100644 --- a/video/src/main/java/com/yunbao/video/views/VideoPlayWrapViewHolder.java +++ b/video/src/main/java/com/yunbao/video/views/VideoPlayWrapViewHolder.java @@ -4,18 +4,24 @@ import android.animation.ValueAnimator; import android.content.Context; import android.graphics.drawable.Drawable; import android.os.Bundle; + import androidx.core.content.ContextCompat; + import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.RelativeLayout; +import android.widget.SeekBar; import android.widget.TextView; +import com.alibaba.android.arouter.utils.TextUtils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.bean.UserBean; import com.yunbao.common.glide.ImgLoader; @@ -61,7 +67,10 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli private Drawable[] mLikeAnimDrawables;//点赞帧动画 private int mLikeAnimIndex; private String mTag; - private TextView tv_video_report; + private SeekBar seekbar; + private LinearLayout progressTextLayout; + private TextView progressTextView; + private TextView progressCount; public VideoPlayWrapViewHolder(Context context, ViewGroup parentView) { super(context, parentView); @@ -75,27 +84,51 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli @Override public void init() { mTag = this.toString(); + + seekbar = (SeekBar) findViewById(R.id.seekbar); + progressTextLayout = (LinearLayout) findViewById(R.id.progressTextLayout); + progressTextView = (TextView) findViewById(R.id.progress); + progressCount = (TextView) findViewById(R.id.progressCount); + mVideoContainer = (ViewGroup) findViewById(R.id.video_container); mCover = (ImageView) findViewById(R.id.cover); - mAvatar = (ImageView) findViewById(R.id.avatar2); + mAvatar = (ImageView) findViewById(R.id.avatar); mName = (TextView) findViewById(R.id.name); mTitle = (TextView) findViewById(R.id.title); mBtnLike = (ImageView) findViewById(R.id.btn_like); mLikeNum = (TextView) findViewById(R.id.like_num); mCommentNum = (TextView) findViewById(R.id.comment_num); mShareNum = (TextView) findViewById(R.id.share_num); - mBtnFollow = (ImageView) findViewById(R.id.btn_follow2); + mBtnFollow = (ImageView) findViewById(R.id.btn_follow); - tv_video_report = (TextView) findViewById(R.id.tv_video_report); - -// mFollowDrawable = ContextCompat.getDrawable(mContext, R.mipmap.icon_video_follow_1); + mFollowDrawable = ContextCompat.getDrawable(mContext, R.mipmap.icon_video_follow_1); mUnFollowDrawable = ContextCompat.getDrawable(mContext, R.mipmap.icon_video_follow_0); mAvatar.setOnClickListener(this); mBtnFollow.setOnClickListener(this); mBtnLike.setOnClickListener(this); findViewById(R.id.btn_comment).setOnClickListener(this); findViewById(R.id.btn_share).setOnClickListener(this); - findViewById(R.id.tv_video_report).setOnClickListener(this); + seekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { + @Override + public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { + if (fromUser) { + progressTextLayout.setVisibility(View.VISIBLE); + } else { + progressTextLayout.setVisibility(View.GONE); + } + progressTextView.setText(String.valueOf(progress)); + } + + @Override + public void onStartTrackingTouch(SeekBar seekBar) { + + } + + @Override + public void onStopTrackingTouch(SeekBar seekBar) { + + } + }); } /** @@ -181,11 +214,9 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli } if (mBtnLike != null) { if (bean.getLike() == 1) { - if (mLikeAnimDrawables != null && mLikeAnimDrawables.length > 0) { - mBtnLike.setImageDrawable(mLikeAnimDrawables[mLikeAnimDrawables.length - 1]); - } + mBtnLike.setImageResource(R.mipmap.icon_video_zan_new02); } else { - mBtnLike.setImageResource(R.mipmap.icon_video_zan_01); + mBtnLike.setImageResource(R.mipmap.icon_video_zan_new01); } } if (mLikeNum != null) { @@ -197,36 +228,36 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli if (mShareNum != null) { mShareNum.setText(bean.getShareNum()); } -// if (u != null && mBtnFollow != null) { -// String toUid = u.getId(); -// if (!TextUtils.isEmpty(toUid) && !toUid.equals(CommonAppConfig.getInstance().getUid())) { -// if (mBtnFollow.getVisibility() != View.VISIBLE) { -// mBtnFollow.setVisibility(View.VISIBLE); -// } -// if (bean.getAttent() == 1) { -// mBtnFollow.setImageDrawable(mFollowDrawable); -// } else { -// mBtnFollow.setImageDrawable(mUnFollowDrawable); -// } -// } else { -// if (mBtnFollow.getVisibility() == View.VISIBLE) { -// mBtnFollow.setVisibility(View.INVISIBLE); -// } -// } -// } + if (u != null && mBtnFollow != null) { + String toUid = u.getId(); + if (!TextUtils.isEmpty(toUid) && !toUid.equals(CommonAppConfig.getInstance().getUid())) { + if (mBtnFollow.getVisibility() != View.VISIBLE) { + mBtnFollow.setVisibility(View.VISIBLE); + } + if (bean.getAttent() == 1) { + mBtnFollow.setImageDrawable(mFollowDrawable); + } else { + mBtnFollow.setImageDrawable(mUnFollowDrawable); + } + } else { + if (mBtnFollow.getVisibility() == View.VISIBLE) { + mBtnFollow.setVisibility(View.INVISIBLE); + } + } + } if (!Constants.myUid.endsWith(bean.getUid())) { -// if (bean.getAttent() == 2) { -// mBtnFollow.setVisibility(View.VISIBLE); -// if (bean.getAttent() == 1) { -// mBtnFollow.setImageDrawable(mFollowDrawable); -// } else { -// mBtnFollow.setImageDrawable(mUnFollowDrawable); -// } -// } else { -// mBtnFollow.setVisibility(View.GONE); -// } + if (bean.getAttent() == 2) { + mBtnFollow.setVisibility(View.VISIBLE); + if (bean.getAttent() == 1) { + mBtnFollow.setImageDrawable(mFollowDrawable); + } else { + mBtnFollow.setImageDrawable(mUnFollowDrawable); + } + } else { + mBtnFollow.setVisibility(View.GONE); + } } else { -// mBtnFollow.setVisibility(View.GONE); + mBtnFollow.setVisibility(View.GONE); } } @@ -278,6 +309,17 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli return mVideoBean; } + public void setProgress(int progresss) { + if (progressTextView != null) { + progressTextView.setText(String.valueOf(progresss)); + } + } + + public void setDuration(int duration) { + if (progressCount != null) { + progressCount.setText(String.valueOf(duration)); + } + } /** * 获取到视频首帧回调 @@ -324,7 +366,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli return; } int i = v.getId(); - if (i == R.id.btn_follow2) { + if (i == R.id.btn_follow) { clickFollow(); } else if (i == R.id.btn_comment) { clickComment(); @@ -334,12 +376,12 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli clickLike(); } else if (i == R.id.avatar2) { clickAvatar(); - } else if (i == R.id.tv_video_report) { + } /*else if (i == R.id.tv_video_report) { if (mVideoBean == null) { return; } LiveReportActivity.forward2(mContext, mVideoBean.getId()); - } + }*/ } @@ -376,15 +418,9 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli } if (mBtnLike != null) { if (like == 1) { - if (mLikeAnimtor == null) { - initLikeAnimtor(); - } - mLikeAnimIndex = -1; - if (mLikeAnimtor != null) { - mLikeAnimtor.start(); - } + mBtnLike.setImageResource(R.mipmap.icon_video_zan_new02); } else { - mBtnLike.setImageResource(R.mipmap.icon_video_zan_01); + mBtnLike.setImageResource(R.mipmap.icon_video_zan_new01); } } } else { @@ -409,6 +445,11 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli @Override public void callback(Integer attent) { mVideoBean.setAttent(attent); + if (attent == 1) { + mBtnFollow.setImageDrawable(mFollowDrawable); + } else { + mBtnFollow.setImageDrawable(mUnFollowDrawable); + } if (mCurPageShowed) { if (mFollowAnimation == null) { initFollowAnimation(); diff --git a/video/src/main/java/com/yunbao/video/views/VideoScrollViewHolder.java b/video/src/main/java/com/yunbao/video/views/VideoScrollViewHolder.java index 1bc5445a4..6025aed8f 100644 --- a/video/src/main/java/com/yunbao/video/views/VideoScrollViewHolder.java +++ b/video/src/main/java/com/yunbao/video/views/VideoScrollViewHolder.java @@ -1,9 +1,11 @@ package com.yunbao.video.views; import android.content.Context; + import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; + import android.view.View; import android.view.ViewGroup; @@ -34,9 +36,7 @@ import java.util.List; * 视频滑动 */ -public class VideoScrollViewHolder extends AbsViewHolder implements - VideoScrollAdapter.ActionListener, SwipeRefreshLayout.OnRefreshListener, - VideoPlayViewHolder.ActionListener, View.OnClickListener { +public class VideoScrollViewHolder extends AbsViewHolder implements VideoScrollAdapter.ActionListener, SwipeRefreshLayout.OnRefreshListener, VideoPlayViewHolder.ActionListener, View.OnClickListener { private VideoPlayViewHolder mVideoPlayViewHolder; private View mPlayView; @@ -218,7 +218,7 @@ public class VideoScrollViewHolder extends AbsViewHolder implements } @Override - public void onPlayBegin() { + public void onPlayBegin(float duration) { if (mVideoLoadingBar != null) { mVideoLoadingBar.setLoading(false); } @@ -238,6 +238,14 @@ public class VideoScrollViewHolder extends AbsViewHolder implements } } + @Override + public void onProgress(int progress, int duration) { + if (mVideoPlayWrapViewHolder != null) { + mVideoPlayWrapViewHolder.setProgress(progress); + mVideoPlayWrapViewHolder.setDuration(duration); + } + } + /** * 关注发生变化 */ diff --git a/video/src/main/res/layout/view_video_play_wrap.xml b/video/src/main/res/layout/view_video_play_wrap.xml index f6f0f2b22..fc485b867 100644 --- a/video/src/main/res/layout/view_video_play_wrap.xml +++ b/video/src/main/res/layout/view_video_play_wrap.xml @@ -10,7 +10,6 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> - - + android:visibility="visible"> - + android:src="@mipmap/icon_video_back" /> + android:layout_marginBottom="120dp" + android:visibility="visible"> + android:layout_centerHorizontal="true" + android:layout_marginTop="25dp" + android:padding="4dp" + android:visibility="visible" /> + android:textSize="10sp" + android:visibility="visible" /> + android:src="@mipmap/icon_video_comment_new" + android:visibility="visible" /> + android:textSize="10sp" /> + android:layout_centerHorizontal="true" + android:layout_marginTop="30dp" + android:padding="4dp" + android:src="@mipmap/icon_video_share_new" + android:visibility="visible" /> + android:textSize="10sp" + android:visibility="visible" /> @@ -135,34 +134,11 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" - android:layout_marginLeft="18dp" + android:layout_marginLeft="10dp" android:layout_marginRight="120dp" android:layout_marginBottom="30dp" android:orientation="horizontal"> - - - - - - - + + + + + + + + + + + + + diff --git a/video/src/main/res/mipmap-mdpi/icon_video_back.png b/video/src/main/res/mipmap-mdpi/icon_video_back.png new file mode 100644 index 0000000000000000000000000000000000000000..fae8ff4daec3a262b175086d67e88ba147c1194a GIT binary patch literal 2047 zcmVPx+xk*GpRCr$Pom*@hMHGhrwx*a8QLc&th8Ue2&0a|cE3PM~PNbHifCcl}D9LM%v zypCtqJ5mxWnw{PK_V}NfGdt%jLV1b@z)}Fq09*#(0syrD&Jq7Vy*#Hi-0DdHe*u^T z@CSedfN=mx0RIA*Hr$fIii-@^Gg_?cvQSJo)fGDJ{DI{Au+*t%9cJb^vGquowU}&&h?b`3)Tc@EL&L&EBjP(ANUE5x^M= z%Y#`?T7B|jheiX8GXYbZo#=%tnVf|N zD8p|7i04}LqrzG5&i*V=EpQ0Ed@p5#reArJaN65<8n-15kGFB9M$_mUgzM9_X8Vof z698Wj^l39XvVKNSu5^cVwo@iwu06iP4`%{+QaJK$Ka<-a{-Jk|pw9>JwCl_-n@Mn5 z{vtusud$(!*Qso$ubze}&ASNtZU9a0B&BRmp5y5+3Hm|dbLNXKDiU0q$>(oiVW*4^FBg=6g9yEoj^)3ZO7O37e6WIVxN&r0<4O&$6Bp$1;ujiXmbIRo8 za-j-n<>f+p z&`yyHsX;qQE@TGnD7lalv=ik*I?%PXwM+Z@`qt;VI9@=cszNRo`#2qj|79k?XvkUR0aLK$K&BT-<*<8rxA@t zN7~!l-)4AOCO_wL=db#--dzf9gTIy!pP@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map-mdpi/icon_video_comment_new.png new file mode 100644 index 0000000000000000000000000000000000000000..40018fc9105955bb56a36059bf194bdf2170ec04 GIT binary patch literal 2440 zcmV;333v91P)Px;LPRkA{s>?;vG>@QB*EN zM2%5`F(xVkLhvF+MMcnv2P)o)1O$yjJc&0(6x8zlCOzZZ+1Z)bZ+d2TW?m(m|0dhr z)$e=ts=KSc>c7>=ToCYFv~)_;0X-)p=z#8ko)ZFdQqx)VG5{SBw~=%wNw=5ua7mAs z^ax42NxHA3yUgi1|0wBCl71oSDoNj!^est$k#wW&TV_3vnOJm0JW$dT($6CkxVN44 z!?YOxXOg}x=?X~~+rFm77>&9V1v(-gD(O{{o-OIllC~naqk#FZq`ykKQqmi3f1?q4 z8I7g}IwEc@>A{jtt3J!aGIVd{rq@e4O48-FZz?g-seq1%?J7TaZ2GxXi3x47F)pp< zbCT_EPCKvGKu5&UlHQ#bwASNH`v7z3f1{+2OL~#*Xsa(9poq9@wTpPWq?fi;x}g0o zmvoG6{CKux0UZ&$NcwQKLhqfeX*oLlIa&6nav!HL&=Ij`wg0_P(gSjpELnTp$H}%& z&UvmzKu5$wsy*>#lJ1u?_>#9}k!%e1M4%&LcS&FDKptr}C)j3NJ5k00oqX~ok{&d1 zq}6S3m~D0?V`W32)9wOGUe$$f5_a{!?>y=FJ`U*jOL|F;wiRysTS@iPKDolcwR!XpVVJi6J*x9Mpd;dLl71;^+cw%(yw5(i3BRtBH9$uM@rpAfy?n(1 zYy0@uN!r0S(ZDq_4D>xE(U@R;C+!e8!#1Jfu|U78$~e5X-S}OvgaBEa-E9+U9mv3< zBZ5;Ot7j+EBk&g6Z`%my^CUfYdL7*elD;G9Alrmkd(yM$h`3iuTJmovWe|9@?H>#S z{d`I6154%j*y51%e2OGOtE(udRoV3u20*7R-Fqdyq7WL_RvC$1*|?`Kh0OBZ3yr-< z!`x*1j&-2nR$N>#rg3SNV>_s?AO)td@Krnj?PVK(Ek^`ImS0JN>{3ehv;DOi*w2x4 zet%6UrDO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p3YVS&|Wh()^^S=BG7hxAJz*uI58S*+P)^K`xg;thZLXD1G?5Kzi2?)6zqi0 z%WH>(EgH}c_SxPAvHGJ)eKg)b_3pR4zGy(7OLEB{+YfY&bhkwV+EM>@6)xXCNpj|A zmsJ*hV0kvlvH6RVoLjvjC#B`vRQvYpNxFFL5)DTDzbN<*$J!wZNc)OlL-t{0C`qyb z$a`q}_vV?r2-=oD6lfdKzuU2w*g-NjlX@CiL6Yn!c1Z3te0!xHtTEi!@7*7kXZYF> zo9{Zjd%)tY_@fIx|93k2ZsS|Z?T_9(nZvA5DqB!LCL`^HXc0> zz>6z8AzBV$=BzGFt!MHLKKD_u4vqt#{xB#JZ(pS(ppsmfeJav6q%pb;Vx3t&j@KH5PQ>A{K z`Dx!>*9+rpLztG%@ry3?vs783kw*6|j5U3V=^@Q#i@j{28z)-UUO9ZmW33$9XcS#C z;^frx&js2wqJ5%U?d6M8cnw~6V$(BnGRLxjHuqR7+DGHHl9~U9`v;+{^M>4-(%C>q zuw66SS*NvNM|Y|JJCx^EhBfaE-zGqW`^R#Na@d7?W169XN=b`YYyB^#PZJcn&v()o}{ zL2jkdeFqxX$8&zjJe6>3@~oYpd~&r@N-al`X`Y%Lyp;>*RS z)zmTANi2i>##K7);$ zbD-mNV&|*1+Mhyop{!|Fi?s9Ep;``dX;lm>7x*eb4_P!_HPWxC^Sk|t>aNScIWhnD z(Yx;tA9yaVN>c&4Z(4EIlx-*eXoG(xKUeLljkZfT;@(~&=OY$f;F>(CsRG?E=)ecq z{cUh-yG^oAW%CKt)y!O*qnA$Y8Xx{S?aeME+aFwA%wIq9|JLFgNjisQ>hwQ9;yB_& S*!?#E0000og?* literal 0 HcmV?d00001 diff --git a/video/src/main/res/mipmap-mdpi/icon_video_zan_new01.png b/video/src/main/res/mipmap-mdpi/icon_video_zan_new01.png new file mode 100644 index 0000000000000000000000000000000000000000..8c444972716864ea43f2b9026acbc96072d032ed GIT binary patch literal 2038 zcmVPx+ut`KgRCr$Pop-D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UQ50E(S2O1g5v8^f)h~6b#IbNpK zvm6#B$SX^>6#oR~liaCZ^Jbv;0PvcZ|Gc_?JB4of%d#^Ka(*DtYHViX0VwfBnX{!d zCZL>}vq&nCs4IRlXO$*AprqWCz$}tVk8UU}LA#l)(h0*#*mViaBzasbHhw{?ddsce zW~QaWRt7ul{}nGQU%h473tyn!tk#dBa_4sGFj!&T(OaqAls4fbRQM63#?Hzx98pQd)pdDBvY^@8br8G5+U!g%e*ovTNnRQSviimXx`UUI(IjIjh!q>?4qHaFTuh2% zCRd(>SV4EtGIBxGHMw@Fi5+wYEF+Pki$-gCBA^}Y5dd^Pt7^CHAli(a9X3vGC$>h{8g|urRfQ$5r+&)eQGL-@{6Y)UF3}lX8IX4a zN|2ufpwquR$=9lkPV(KP2bBtFw~XkGx{7A2GI<_EaEFmhCEFo2&xDEa*_(c zXfyIdT7U6WL02s$dM$QhM&~1fJjhSY=Q#fenSge)dx(1vsV_;SA*$1_8vT>gFji|L zGtdsUDn~xx-5pssVdu4_R()q(w$DT|1?^xfZ${rfNh`x8gV1HeP~UI~Vkl_aT!MD6bu&sI4!h5% zQ@R46FI=SZku#rT>S~r-&{ga9LGB|qjp|x|=VtM}L7h*teeOZK*}bJp^%zt0)u3rQ zKOw2?gj`EofOfDIZ);Yc>#g5PrJe#{UfNsfuz$_A0Ug%Cy!0zUr}UR7L8k=zKOqnm UBn@{wmH+?%07*qoM6N<$f<|?}$N&HU literal 0 HcmV?d00001 diff --git a/video/src/main/res/mipmap-mdpi/icon_video_zan_new02.png b/video/src/main/res/mipmap-mdpi/icon_video_zan_new02.png new file mode 100644 index 0000000000000000000000000000000000000000..76ed0f180ecf7c27b8b3cab10d6b2752087be451 GIT binary patch literal 10693 zcmV;$DLU4PP)PyA07*naRCr$Poe8vMRek1v`waKKu_mZ0C}xm?vce=tB*EEen>e&F3k{8FO=2{O z#w14V#H6J)(IhK&V$x}2G;Lz+)&(&}8AK8U5k*u)nU#WKD2ghms#kBk(>Z51-~a4=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