Commit 4f93c399 authored by linfeng's avatar linfeng

短视频

parent ffa7a1c7
...@@ -8,8 +8,8 @@ android { ...@@ -8,8 +8,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
flavorDimensions "default" flavorDimensions "default"
versionCode 142 versionCode 143
versionName "1.4.2" versionName "1.4.3"
multiDexEnabled true multiDexEnabled true
ndk { ndk {
......
package com.ruiwenliu.wrapper.http;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.ruiwenliu.wrapper.inter.UploadCallbacks;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okio.Buffer;
import okio.BufferedSink;
public class ProgressRequestBody extends RequestBody {
private File mFile;
private String mPath;
private String mMediaType;
private UploadCallbacks mListener;
private int s = -1;
private int mEachBufferSize = 1024;
public ProgressRequestBody(final File file, String mediaType, UploadCallbacks listener) {
mFile = file;
mMediaType = mediaType;
mListener = listener;
}
@Override
public MediaType contentType() {
return MediaType.parse(mMediaType);
}
@Override
public void writeTo(BufferedSink sink)
throws IOException {
if (sink instanceof Buffer) {
return;
}
long fileLength = mFile.length();
byte[] buffer = new byte[mEachBufferSize];
FileInputStream in = new FileInputStream(mFile);
long uploaded = 0;
try {
int read;
Handler handler = new Handler(Looper.getMainLooper());
while ((read = in.read(buffer)) != -1) {
// update progress on UI thread
handler.post(new ProgressUpdater(uploaded, fileLength));
uploaded += read;
sink.write(buffer, 0, read);
}
} finally {
in.close();
}
}
private class ProgressUpdater implements Runnable {
private long mUploaded;
private long mTotal;
public ProgressUpdater(long uploaded, long total) {
mUploaded = uploaded;
mTotal = total;
}
@Override
public void run() {
int i = (int) (100 * mUploaded / mTotal);
if (s != i) {
Log.i("progressrequestbody", "run:++ " + i);
mListener.onProgressUpdate(i+ 1);
s = i;
}
}
}
public interface UploadCallbacks {
void onProgressUpdate(int percentage);
}
}
\ No newline at end of file
package com.ruiwenliu.wrapper.inter;
public interface UploadCallbacks {
void onProgressUpdate(int percentage);
void onError();
void onFinish();
}
...@@ -8,6 +8,7 @@ import com.umeng.socialize.ShareAction; ...@@ -8,6 +8,7 @@ import com.umeng.socialize.ShareAction;
import com.umeng.socialize.UMShareListener; import com.umeng.socialize.UMShareListener;
import com.umeng.socialize.bean.SHARE_MEDIA; import com.umeng.socialize.bean.SHARE_MEDIA;
import com.umeng.socialize.media.UMImage; import com.umeng.socialize.media.UMImage;
import com.umeng.socialize.media.UMVideo;
import com.umeng.socialize.media.UMWeb; import com.umeng.socialize.media.UMWeb;
import com.umeng.socialize.utils.ShareBoardlistener; import com.umeng.socialize.utils.ShareBoardlistener;
...@@ -53,15 +54,15 @@ public class ShareManager extends ShareAction { ...@@ -53,15 +54,15 @@ public class ShareManager extends ShareAction {
/** /**
* @param activity * @param activity
* @param boardListener * @param boardListener
* @param copy * @param download
*/ */
public ShareManager(Activity activity, ShareBoardlistener boardListener, String copy) { public ShareManager(Activity activity, ShareBoardlistener boardListener, String copy, String download, String type) {
super(activity); super(activity);
mActivity = activity; mActivity = activity;
this.setDisplayList( this.setDisplayList(
SHARE_MEDIA.WEIXIN, SHARE_MEDIA.WEIXIN_CIRCLE, SHARE_MEDIA.WEIXIN_FAVORITE, SHARE_MEDIA.WEIXIN, SHARE_MEDIA.WEIXIN_CIRCLE, SHARE_MEDIA.QQ)
SHARE_MEDIA.QQ, SHARE_MEDIA.QZONE)
.addButton("复制链接", copy, "rv_share_copy", "rv_share_copy") .addButton("复制链接", copy, "rv_share_copy", "rv_share_copy")
.addButton("下载视频", download, "rv_share_download_video", "rv_share_download_video")
.setShareboardclickCallback(boardListener); .setShareboardclickCallback(boardListener);
} }
...@@ -103,6 +104,24 @@ public class ShareManager extends ShareAction { ...@@ -103,6 +104,24 @@ public class ShareManager extends ShareAction {
shareWebContent(share_media, web, umShareListener); shareWebContent(share_media, web, umShareListener);
} }
/**
*
* @param share_media
* @param videoUrl
* @param title
* @param content
* @param imgUrl
* @param umShareListener
* @param <T>
*/
public <T extends UMShareListener> void showShareVideo(SHARE_MEDIA share_media, String videoUrl, String title, String content, String imgUrl, T umShareListener) {
UMVideo video = new UMVideo(videoUrl);
video.setTitle(title);//视频的标题
video.setThumb(new UMImage(mActivity, imgUrl));//视频的缩略图
video.setDescription(content);//视频的描述
shareWebContent(share_media, video, umShareListener);
}
/** /**
* 分享图片 * 分享图片
* *
...@@ -132,6 +151,13 @@ public class ShareManager extends ShareAction { ...@@ -132,6 +151,13 @@ public class ShareManager extends ShareAction {
.share(); .share();
} }
public void shareWebContent(SHARE_MEDIA share_media, UMVideo umVideo, UMShareListener umShareListener) {
new ShareAction(mActivity).withMedia(umVideo)
.setPlatform(share_media)
.setCallback(umShareListener)
.share();
}
public void shareWebContent(SHARE_MEDIA share_media, UMImage image, UMShareListener umShareListener) { public void shareWebContent(SHARE_MEDIA share_media, UMImage image, UMShareListener umShareListener) {
new ShareAction(mActivity).withMedia(image) new ShareAction(mActivity).withMedia(image)
.setPlatform(share_media) .setPlatform(share_media)
......
package com.rv.component.dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.ViewGroup;
import com.ruiwenliu.wrapper.dialog.BaseDialog;
/**
* 删除dialog
*/
public class BottomDeleteDialog extends BaseDialog {
public BottomDeleteDialog(@NonNull Context context) {
super(context);
setDialogParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
}
@Override
public int getViewLayout() {
return R.layout.dialog_prompt_bottom;
}
}
package com.rv.component.dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import com.ruiwenliu.wrapper.dialog.BaseDialog;
import com.ruiwenliu.wrapper.util.ViewHolder;
/**
* 温馨提示
*/
public class ProgressBarDialog extends BaseDialog {
ProgressBar progressBar;
public ProgressBarDialog(@NonNull Context context) {
super(context);
setDialogParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER);
}
@Override
public void helper(ViewHolder helper) {
super.helper(helper);
progressBar = (ProgressBar) helper.getView(R.id.pb_show);
}
@Override
public int getViewLayout() {
return R.layout.dialog_progress_bar;
}
public void setContent(int percentage) {
if (progressBar != null) {
progressBar.setProgress(percentage);
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置背景色 -->
<item android:id="@android:id/background"
android:drawable="@color/text_Gray">
</item>
<!-- 设置进度条颜色 -->
<item android:id="@android:id/progress">
<clip>
<shape>
<gradient
android:endColor="#fff000"
android:startColor="#fff000" />
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<LinearLayout
android:id="@+id/ll_item_delete"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:background="@color/gray_F64747"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="删除"
android:textColor="@color/colorWrite"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_40"
android:layout_marginRight="@dimen/size_40"
android:background="@color/colorWrite"
android:orientation="vertical">
<ProgressBar
android:id="@+id/pb_show"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="@dimen/size_20"
android:layout_gravity="center"
android:max="100"
android:progressDrawable="@drawable/progressbar_bg"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
package com.rv.component.utils;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
import android.util.Log;
import java.io.File;
public class AlbumNotifyHelper {
public static final String TAG = AlbumNotifyHelper.class.getSimpleName();
public static void notifyScanDcim(Context context, String filePath) {
scanFile(context, filePath);
}
public static void insertVideoToMediaStore(Context context, String filePath, long dateTaken, long duration) {
insertVideoToMediaStore(context, filePath, dateTaken, 0, 0, duration);
}
public static void insertImageToMediaStore(Context context, String filePath, long createTime) {
insertImageToMediaStore(context, filePath, createTime, 0, 0);
}
///////////////////////////////////////////////////////////////////////////
// 扫描系统相册核心方法
///////////////////////////////////////////////////////////////////////////
/**
* 针对系统文夹只需要扫描,不用插入内容提供者,不然会重复
*
* @param context 上下文
* @param filePath 文件路径
*/
public static void scanFile(Context context, String filePath) {
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
intent.setData(Uri.fromFile(new File(filePath)));
context.sendBroadcast(intent);
}
///////////////////////////////////////////////////////////////////////////
// 非系统相册像MediaContent中插入数据,核心方法
///////////////////////////////////////////////////////////////////////////
/**
* 针对非系统文件夹下的文件,使用该方法
* 插入时初始化公共字段
*
* @param filePath 文件
* @param time ms
* @return ContentValues
*/
private static ContentValues initCommonContentValues(String filePath, long time) {
ContentValues values = new ContentValues();
File saveFile = new File(filePath);
long timeMillis = getTimeWrap(time);
values.put(MediaStore.MediaColumns.TITLE, saveFile.getName());
values.put(MediaStore.MediaColumns.DISPLAY_NAME, saveFile.getName());
values.put(MediaStore.MediaColumns.DATE_MODIFIED, timeMillis);
values.put(MediaStore.MediaColumns.DATE_ADDED, timeMillis);
values.put(MediaStore.MediaColumns.DATA, saveFile.getAbsolutePath());
values.put(MediaStore.MediaColumns.SIZE, saveFile.length());
return values;
}
/**
* 保存到照片到本地,并插入MediaStore以保证相册可以查看到,这是更优化的方法,防止读取的照片获取不到宽高
*
* @param context 上下文
* @param filePath 文件路径
* @param createTime 创建时间 <=0时为当前时间 ms
* @param width 宽度
* @param height 高度
*/
public static void insertImageToMediaStore(Context context, String filePath, long createTime, int width, int height) {
createTime = getTimeWrap(createTime);
ContentValues values = initCommonContentValues(filePath, createTime);
values.put(MediaStore.Images.ImageColumns.DATE_TAKEN, createTime);
values.put(MediaStore.Images.ImageColumns.ORIENTATION, 0);
values.put(MediaStore.Images.ImageColumns.ORIENTATION, 0);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN) {
if (width > 0) values.put(MediaStore.Images.ImageColumns.WIDTH, 0);
if (height > 0) values.put(MediaStore.Images.ImageColumns.HEIGHT, 0);
}
values.put(MediaStore.MediaColumns.MIME_TYPE, getPhotoMimeType(filePath));
context.getApplicationContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
}
/**
* 保存到视频到本地,并插入MediaStore以保证相册可以查看到,这是更优化的方法,防止读取的视频获取不到宽高
*
* @param context 上下文
* @param filePath 文件路径
* @param createTime 创建时间 <=0时为当前时间 ms
* @param duration 视频长度 ms
* @param width 宽度
* @param height 高度
*/
public static void insertVideoToMediaStore(Context context, String filePath, long createTime, int width, int height, long duration) {
createTime = getTimeWrap(createTime);
ContentValues values = initCommonContentValues(filePath, createTime);
values.put(MediaStore.Video.VideoColumns.DATE_TAKEN, createTime);
if (duration > 0)
values.put(MediaStore.Video.VideoColumns.DURATION, duration);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN) {
if (width > 0) values.put(MediaStore.Video.VideoColumns.WIDTH, width);
if (height > 0) values.put(MediaStore.Video.VideoColumns.HEIGHT, height);
}
values.put(MediaStore.MediaColumns.MIME_TYPE, getVideoMimeType(filePath));
context.getContentResolver().insert(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, values);
}
// 是不是系统相册
private static boolean isSystemDcim(String path) {
return path.toLowerCase().contains("dcim") || path.toLowerCase().contains("camera");
}
// 获取照片的mine_type
private static String getPhotoMimeType(String path) {
String lowerPath = path.toLowerCase();
if (lowerPath.endsWith("jpg") || lowerPath.endsWith("jpeg")) {
return "image/jpeg";
} else if (lowerPath.endsWith("png")) {
return "image/png";
} else if (lowerPath.endsWith("gif")) {
return "image/gif";
}
return "image/jpeg";
}
// 获取video的mine_type,暂时只支持mp4,3gp
private static String getVideoMimeType(String path) {
String lowerPath = path.toLowerCase();
if (lowerPath.endsWith("mp4") || lowerPath.endsWith("mpeg4")) {
return "video/mp4";
} else if (lowerPath.endsWith("3gp")) {
return "video/3gp";
}
return "video/mp4";
}
// 获得转化后的时间
private static long getTimeWrap(long time) {
if (time <= 0) {
return System.currentTimeMillis();
}
return time;
}
}
...@@ -189,6 +189,19 @@ public class DateUtils { ...@@ -189,6 +189,19 @@ public class DateUtils {
} }
/**
* 将时间秒转换成yyyy-MM-dd HH:mm字符串
*
* @param time 时间戳
* @return yyyy-MM-dd HH:mm
*/
public static String timestampToString3(long time) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(time * 1000);//转换为毫秒
Date date = calendar.getTime();
return sdf7.format(date);
}
/** /**
* 获取手机当前时间戳毫秒 * 获取手机当前时间戳毫秒
* *
......
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
<uses-permission android:name="android.permission.WRITE_SETTINGS" /> <uses-permission android:name="android.permission.WRITE_SETTINGS" />
<application> <application>
<activity android:name=".other.ShortVideoActivity"></activity> <activity android:name=".other.SelectVideoActivity"></activity>
<activity
android:name=".other.ShortVideoActivity"
android:screenOrientation="portrait" />
<activity <activity
android:name=".other.PatGeneratePosterActivity" android:name=".other.PatGeneratePosterActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
......
...@@ -129,8 +129,8 @@ public class DiscoveryFragment extends BaseFragment<DiscoveryPresenter> { ...@@ -129,8 +129,8 @@ public class DiscoveryFragment extends BaseFragment<DiscoveryPresenter> {
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
list.add(_mActivity.getString(R.string.discovery_recommend)); list.add(_mActivity.getString(R.string.discovery_recommend));
list.add(_mActivity.getString(R.string.discovery_pat)); list.add(_mActivity.getString(R.string.discovery_pat));
// list.add(_mActivity.getString(R.string.discovery_short_video)); list.add(_mActivity.getString(R.string.discovery_short_video));
// list.add(_mActivity.getString(R.string.discovery_question_and_answer)); list.add(_mActivity.getString(R.string.discovery_question_and_answer));
menuAdapter.setNewData(list); menuAdapter.setNewData(list);
menuAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { menuAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override @Override
...@@ -174,8 +174,8 @@ public class DiscoveryFragment extends BaseFragment<DiscoveryPresenter> { ...@@ -174,8 +174,8 @@ public class DiscoveryFragment extends BaseFragment<DiscoveryPresenter> {
List<BaseFragment> list = new ArrayList<>(); List<BaseFragment> list = new ArrayList<>();
list.add(RecommendFragment.getInstance(TYPE_RECOMMEND)); list.add(RecommendFragment.getInstance(TYPE_RECOMMEND));
list.add(PatFragment.getInstance(TYPE_PAT)); list.add(PatFragment.getInstance(TYPE_PAT));
// list.add(ShortVideoFragment.getInstance(TYPE_SHORT_VIDEO)); list.add(ShortVideoFragment.getInstance(TYPE_SHORT_VIDEO));
// list.add(QuestionAndAnswerFragment.getInstance(TYPE_QUESTION_AND_ANSWER)); list.add(QuestionAndAnswerFragment.getInstance(TYPE_QUESTION_AND_ANSWER));
return list; return list;
} }
...@@ -201,7 +201,7 @@ public class DiscoveryFragment extends BaseFragment<DiscoveryPresenter> { ...@@ -201,7 +201,7 @@ public class DiscoveryFragment extends BaseFragment<DiscoveryPresenter> {
int id = view.getId(); int id = view.getId();
if (id == R.id.iv_discovery_content_add) { if (id == R.id.iv_discovery_content_add) {
//添加 //添加
// showPopupWindow(ivDiscoveryContentAdd); showPopupWindow(ivDiscoveryContentAdd);
//判断是否已经登录 //判断是否已经登录
// if (TextUtils.isEmpty(OkGoUtil.getToken())) { // if (TextUtils.isEmpty(OkGoUtil.getToken())) {
...@@ -213,7 +213,6 @@ public class DiscoveryFragment extends BaseFragment<DiscoveryPresenter> { ...@@ -213,7 +213,6 @@ public class DiscoveryFragment extends BaseFragment<DiscoveryPresenter> {
// .build(Constance.ACTIVITY_URL_POSTPAT) // .build(Constance.ACTIVITY_URL_POSTPAT)
// .navigation(); // .navigation();
startActivity(ShortVideoActivity.getIntent(_mActivity));
} }
} }
......
package com.xxfc.discovery.adapter; package com.xxfc.discovery.adapter;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.ruiwenliu.wrapper.util.TransformationUtil;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.util.glide.GlideOptions;
import com.xxfc.discovery.R; import com.xxfc.discovery.R;
import com.xxfc.discovery.bean.DiscoveryRecommendBean;
/** /**
* 拍拍 * 短视频
*/ */
public class DiscoveryShortVideoAdapter extends BaseQuickAdapter<String, BaseViewHolder> { public class DiscoveryShortVideoAdapter extends BaseQuickAdapter<DiscoveryRecommendBean.DataBeanX.DataBean, BaseViewHolder> {
public DiscoveryShortVideoAdapter() { public DiscoveryShortVideoAdapter() {
super(R.layout.rv_item_discovery_short_video); super(R.layout.rv_item_discovery_short_video);
} }
private int selectPosition;
@Override @Override
protected void convert(BaseViewHolder helper, String item) { protected void convert(BaseViewHolder helper, DiscoveryRecommendBean.DataBeanX.DataBean item) {
if (item == null) {
return;
}
DiscoveryRecommendBean.DataBeanX.DataBean.Body body = item.getBody();
if (body != null) {
if (body.getVideos() != null && body.getVideos().size() > 0) {
ImageView image = helper.getView(R.id.iv_icon_video);
GlideOptions options = GlideOptions.placeholderOf(com.ruiwenliu.wrapper.R.drawable.glide_icon_placeholder).
error(com.ruiwenliu.wrapper.R.drawable.glide_icon_error);
TransformationUtil utils = new TransformationUtil(image);
Glide.with(mContext)
.asBitmap()
.load(body.getVideos().get(0).getOurl())
.apply(options)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(12)).override(image.getWidth(), image.getHeight()))
.into(utils);
}
helper.setText(R.id.tv_title, body.getText());
if ("4".equals(body.getType())) { //消息类型 基础属性 1=文字消息、2=图文消息、3=语音消息、4=视频消息、 5=文件消
helper.setGone(R.id.iv_isvideo, true);
} else {
helper.setGone(R.id.iv_isvideo, false);
}
}
helper.setText(R.id.tv_user_name, item.getNickname());
GlideManager.getInstance(mContext).loadImage(item.getPicUrl(), (ImageView) helper.getView(R.id.iv_user_icon));
if (item.getCount() != null) {
helper.setText(R.id.iv_like_number, item.getCount().getPraise());
}
if ("1".equals(item.getIsPraise())) { //0:未点赞 1:已点赞
helper.setImageResource(R.id.iv_like, R.drawable.icon_discovery_ask_like);
} else {
helper.setImageResource(R.id.iv_like, R.drawable.icon_discovery_ask_unlike);
}
helper.addOnClickListener(R.id.ll_item_islike);
} }
} }
...@@ -2,33 +2,46 @@ package com.xxfc.discovery.adapter; ...@@ -2,33 +2,46 @@ package com.xxfc.discovery.adapter;
import android.widget.ImageView; import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.ruiwenliu.wrapper.util.glide.GlideApp; import com.ruiwenliu.wrapper.util.glide.GlideApp;
import com.ruiwenliu.wrapper.util.glide.GlideManager; import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.xxfc.discovery.R; import com.xxfc.discovery.R;
import com.xxfc.discovery.bean.beam.VideoBean; import com.xxfc.discovery.bean.DiscoveryRecommendBean;
/** /**
* 短视频 * 短视频
*/ */
public class DiscoveryVideoAdapter extends BaseQuickAdapter<VideoBean, BaseViewHolder> { public class DiscoveryVideoAdapter extends BaseQuickAdapter<DiscoveryRecommendBean.DataBeanX.DataBean, BaseViewHolder> {
public DiscoveryVideoAdapter() { public DiscoveryVideoAdapter() {
super(R.layout.rv_item_discovery_video); super(R.layout.rv_item_discovery_video);
} }
@Override @Override
protected void convert(BaseViewHolder helper, VideoBean item) { protected void convert(BaseViewHolder helper, DiscoveryRecommendBean.DataBeanX.DataBean item) {
if (item == null) { if (item == null) {
return; return;
} }
if (item.getBody() != null && item.getBody().getImages() != null && item.getBody().getImages().size() > 0) {
GlideApp.with(mContext) GlideApp.with(mContext)
.load(item.getThumb()) .load(item.getBody().getImages().get(0).getOurl())
.placeholder(android.R.color.white) .placeholder(android.R.color.white)
.into((ImageView) helper.getView(R.id.thumb)); .into((ImageView) helper.getView(R.id.thumb));
}
GlideManager.getInstance(mContext).loadImage(item.getPicUrl(), (ImageView) helper.getView(R.id.iv_video_avatar));
if (item.getCount() != null) {
helper.setText(R.id.tv_video_islike_number, item.getCount().getPraise());
helper.setText(R.id.tv_video_comment_number, item.getCount().getComment());
helper.setText(R.id.tv_video_share_number, item.getCount().getShare());
}
if ("1".equals(item.getIsPraise())) { //0:未点赞 1:已点赞
helper.setImageResource(R.id.iv_video_islike, R.drawable.icon_discover_video_like);
} else {
helper.setImageResource(R.id.iv_video_islike, R.drawable.icon_discover_video_likeun);
}
helper.addOnClickListener(R.id.ll_item_video_comment); helper.addOnClickListener(R.id.ll_item_video_comment);
helper.addOnClickListener(R.id.ll_item_video_share); helper.addOnClickListener(R.id.ll_item_video_share);
......
package com.xxfc.discovery.adapter; package com.xxfc.discovery.adapter;
import android.widget.ImageView;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.ruiwenliu.wrapper.util.glide.GlideApp; import com.rv.component.utils.DateUtils;
import com.xxfc.discovery.R; import com.xxfc.discovery.R;
import com.xxfc.discovery.bean.beam.VideoBean; import com.xxfc.discovery.bean.DiscoveryCommentBean;
/** /**
* 短视频评论 * 短视频评论
*/ */
public class DiscoveryVideoCommentAdapter extends BaseQuickAdapter<String, BaseViewHolder> { public class DiscoveryVideoCommentAdapter extends BaseQuickAdapter<DiscoveryCommentBean.DataBean, BaseViewHolder> {
public DiscoveryVideoCommentAdapter() { public DiscoveryVideoCommentAdapter() {
super(R.layout.rv_item_discovery_video_comment); super(R.layout.rv_item_discovery_video_comment);
} }
@Override @Override
protected void convert(BaseViewHolder helper, String item) { protected void convert(BaseViewHolder helper, DiscoveryCommentBean.DataBean item) {
if (item == null) { if (item == null) {
return; return;
} }
helper.setText(R.id.iv_video_comment_name,item.getNickname());
helper.setText(R.id.tv_video_comment_time, DateUtils.timestampToString3(item.getTime()));
helper.setText(R.id.tv_video_comment_content,item.getBody());
} }
} }
package com.xxfc.discovery.adapter;
import android.widget.ImageView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.rv.component.utils.DateUtils;
import com.xxfc.discovery.R;
import com.xxfc.discovery.bean.DiscoveryCommentBean;
import com.xxfc.discovery.bean.VideoFile;
/**
* 短视频选择
*/
public class DiscoveryVideoSelectAdapter extends BaseQuickAdapter<VideoFile, BaseViewHolder> {
public DiscoveryVideoSelectAdapter() {
super(R.layout.rv_item_discovery_video_select);
}
@Override
protected void convert(BaseViewHolder helper, VideoFile item) {
if (item == null) {
return;
}
GlideManager.getInstance(mContext).loadImage(item.getFilePath(), (ImageView) helper.getView(R.id.iv_video_icon));
helper.setText(R.id.tv_video_date, DateUtils.timestampToString1(item.getCreateTime()));
helper.setText(R.id.tv_video_duration, item.getFileLength() + "秒");
helper.setText(R.id.tv_video_size, parserFileSize(item.getFileSize()));
}
private String parserFileSize(long size) {
float temp = size / (float) 1024;
if (temp < 1024) {
return (int) temp + "KB";
}
temp = temp / 1024;
if (temp < 1024) {
return ((int) (temp * 100)) / (float) 100 + "M";
}
temp = temp / 1024;
return ((int) (temp * 100)) / (float) 100 + "G";
}
}
...@@ -43,15 +43,20 @@ public interface DiscoveryApi extends RvFrameConfig { ...@@ -43,15 +43,20 @@ public interface DiscoveryApi extends RvFrameConfig {
String DISCOVERY_PRAISE_DELETE = IMA_BASEUSRL + "/b/circle/msg/praise/delete"; String DISCOVERY_PRAISE_DELETE = IMA_BASEUSRL + "/b/circle/msg/praise/delete";
// 添加消息(拍拍、段视频) // 添加消息(拍拍、段视频)
String DISCOVERY_MSG_ADD = IMA_BASEUSRL +"/b/circle/msg/add"; String DISCOVERY_MSG_ADD = IMA_BASEUSRL + "/b/circle/msg/add";
//im登录 //im登录
String DISCOVERY_IM_LOGIN = HOST + "/api/auth/jwt/imi/login"; String DISCOVERY_IM_LOGIN = HOST + "/api/auth/jwt/imi/login";
public static String HTTP_URL_FILE_UPLOAD = RvFrameConfig.VEHICLE_UPLOAD + "file/app/unauth/upload";//文件上传 public static String HTTP_URL_FILE_UPLOAD = RvFrameConfig.VEHICLE_UPLOAD + "file/app/unauth/upload";//文件上传
public static String HTTP_URL_FILE_UPLOAD_VIDEO = RvFrameConfig.VEHICLE_UPLOAD + "file/app/unauth/uploadVideo";//视频上传
// String HTTP_URL_FILE_UPLOADS = RvFrameConfig.VEHICLE_UPLOAD + "file/app/unauth/uploadFiles";//多张图片上传 // String HTTP_URL_FILE_UPLOADS = RvFrameConfig.VEHICLE_UPLOAD + "file/app/unauth/uploadFiles";//多张图片上传
String HTTP_URL_FILE_UPLOADS = RvFrameConfig.VEHICLE_UPLOAD + "file/app/unauth/uploads";//多张图片上传 String HTTP_URL_FILE_UPLOADS = RvFrameConfig.VEHICLE_UPLOAD + "file/app/unauth/uploads";//多张图片上传
//获取评论列表
String DISCOVERY_COMMENT_LIST = IMA_BASEUSRL + "/b/circle/msg/comment/list";
} }
package com.xxfc.discovery.bean;
import com.ruiwenliu.wrapper.base.BaseBean;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class DiscoveryCommentBean extends BaseBean {
private List<DataBean> data;
private boolean rel;
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
public static class DataBean {
private String body;// ": "wettuu",
private String commentId;// ": "5d6f1c4c2114c043579555c9",
private String msgId;// ": "5d6e0961f5df3f76cc78cca4",
private String nickname;// ": "XX_582704",
private long time;// ": 1567562828,
private String toUserId;// ": 0,
private String userId;// ": 10000056
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public String getCommentId() {
return commentId;
}
public void setCommentId(String commentId) {
this.commentId = commentId;
}
public String getMsgId() {
return msgId;
}
public void setMsgId(String msgId) {
this.msgId = msgId;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public long getTime() {
return time;
}
public void setTime(long time) {
this.time = time;
}
public String getToUserId() {
return toUserId;
}
public void setToUserId(String toUserId) {
this.toUserId = toUserId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
}
}
...@@ -231,9 +231,18 @@ public class DiscoveryRecommendBean extends BaseBean { ...@@ -231,9 +231,18 @@ public class DiscoveryRecommendBean extends BaseBean {
private MsgId id; private MsgId id;
private String msgId; private String msgId;
private Body body; private Body body;
private String location;
private List<Comments> comments; private List<Comments> comments;
private List<praises> praises; private List<praises> praises;
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getMsgId() { public String getMsgId() {
return msgId; return msgId;
} }
...@@ -540,6 +549,7 @@ public class DiscoveryRecommendBean extends BaseBean { ...@@ -540,6 +549,7 @@ public class DiscoveryRecommendBean extends BaseBean {
private String time; private String time;
private String type; private String type;
private List<Images> images; private List<Images> images;
private List<Videos> videos;
public String getText() { public String getText() {
return text; return text;
...@@ -573,6 +583,13 @@ public class DiscoveryRecommendBean extends BaseBean { ...@@ -573,6 +583,13 @@ public class DiscoveryRecommendBean extends BaseBean {
this.images = images; this.images = images;
} }
public List<Videos> getVideos() {
return videos;
}
public void setVideos(List<Videos> videos) {
this.videos = videos;
}
public static class Images implements Serializable { public static class Images implements Serializable {
private String length; private String length;
...@@ -630,6 +647,46 @@ public class DiscoveryRecommendBean extends BaseBean { ...@@ -630,6 +647,46 @@ public class DiscoveryRecommendBean extends BaseBean {
this.tUrl = tUrl; this.tUrl = tUrl;
} }
} }
public static class Videos implements Serializable {
private String length;
private String size;
private String ourl;
private String oUrl;
public String getLength() {
return length;
}
public void setLength(String length) {
this.length = length;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public String getOurl() {
return ourl;
}
public void setOurl(String ourl) {
this.ourl = ourl;
}
public String getoUrl() {
return oUrl;
}
public void setoUrl(String oUrl) {
this.oUrl = oUrl;
}
}
} }
public static class Comments implements Serializable { public static class Comments implements Serializable {
...@@ -755,7 +812,7 @@ public class DiscoveryRecommendBean extends BaseBean { ...@@ -755,7 +812,7 @@ public class DiscoveryRecommendBean extends BaseBean {
} }
} }
public static class praises implements Serializable{ public static class praises implements Serializable {
private String nickname; private String nickname;
private String time; private String time;
private String userId; private String userId;
......
package com.xxfc.discovery.bean;
import com.ruiwenliu.wrapper.base.BaseBean;
public class UpdateVideoFile extends BaseBean {
private String data;
private boolean rel;
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
}
package com.xxfc.imcamera.bean; package com.xxfc.discovery.bean;
import java.io.Serializable;
/** /**
* 本地视频文件的数据库信息 * 本地视频文件
*/ */
public class VideoFile { public class VideoFile implements Serializable {
public VideoFile() { public VideoFile() {
} }
private int _id; private int _id;
private String ownerId; //文件所属者是哪个user private String ownerId; //文件所属者是哪个user
private String filePath;//文件的本地Uri private String filePath;//文件的本地Uri
private String desc; // 文件的描述 private String desc; // 文件的描述
private String createTime;// 文件创建时间 private long createTime;// 文件创建时间
private long fileSize; // 文件大小 private long fileSize; // 文件大小
...@@ -62,11 +59,11 @@ public class VideoFile { ...@@ -62,11 +59,11 @@ public class VideoFile {
this.desc = desc; this.desc = desc;
} }
public String getCreateTime() { public long getCreateTime() {
return createTime; return createTime;
} }
public void setCreateTime(String createTime) { public void setCreateTime(long createTime) {
this.createTime = createTime; this.createTime = createTime;
} }
......
...@@ -35,7 +35,6 @@ public class DiscoveryVideoDialog extends BaseDialog { ...@@ -35,7 +35,6 @@ public class DiscoveryVideoDialog extends BaseDialog {
private DiscoveryVideoCommentAdapter commentAdapter; private DiscoveryVideoCommentAdapter commentAdapter;
public DiscoveryVideoDialog(@NonNull Context context) { public DiscoveryVideoDialog(@NonNull Context context) {
super(context); super(context);
this.context = context; this.context = context;
...@@ -70,17 +69,18 @@ public class DiscoveryVideoDialog extends BaseDialog { ...@@ -70,17 +69,18 @@ public class DiscoveryVideoDialog extends BaseDialog {
} }
}, R.id.ll_item_comment); }, R.id.ll_item_comment);
initData();
}
private void initData() { helper.setOnClickListener(new View.OnClickListener() {
ArrayList<String> list = new ArrayList<>(); @Override
for (int i = 0; i < 8; i++) { public void onClick(View v) {
list.add("3333"); dismiss();
} }
commentAdapter.addData(list); }, R.id.iv_close);
} }
@Override @Override
public int getViewLayout() { public int getViewLayout() {
return R.layout.dialog_discovery_video; return R.layout.dialog_discovery_video;
......
package com.xxfc.discovery.event;
import com.frame.base.bus.Event;
public class PostVideoEvent extends Event {
}
...@@ -4,10 +4,15 @@ import android.graphics.Rect; ...@@ -4,10 +4,15 @@ import android.graphics.Rect;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.Display; import android.view.Display;
import android.view.View; import android.view.View;
import com.alibaba.android.arouter.launcher.ARouter;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.bus.Observer;
import com.frame.base.bus.RxBus;
import com.frame.base.url.Constance;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment; import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout; import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
...@@ -15,26 +20,31 @@ import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView; ...@@ -15,26 +20,31 @@ import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView;
import com.xxfc.discovery.R; import com.xxfc.discovery.R;
import com.xxfc.discovery.R2; import com.xxfc.discovery.R2;
import com.xxfc.discovery.adapter.DiscoveryRecommendAdapter; import com.xxfc.discovery.adapter.DiscoveryRecommendAdapter;
import com.xxfc.discovery.adapter.DiscoveryShortVideoAdapter;
import com.xxfc.discovery.api.DiscoveryApi; import com.xxfc.discovery.api.DiscoveryApi;
import com.xxfc.discovery.bean.DiscoveryRecommendBean; import com.xxfc.discovery.bean.DiscoveryRecommendBean;
import com.xxfc.discovery.event.PostPatEvent;
import com.xxfc.discovery.event.PostVideoEvent;
import com.xxfc.discovery.other.ShortVideoActivity;
import com.xxfc.discovery.presenter.DiscoveryPresenter; import com.xxfc.discovery.presenter.DiscoveryPresenter;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import butterknife.BindView; import butterknife.BindView;
import io.reactivex.schedulers.Schedulers;
/** /**
* 短视频 * 短视频
*/ */
public class ShortVideoFragment extends BaseFragment<DiscoveryPresenter> implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener{ public class ShortVideoFragment extends BaseFragment<DiscoveryPresenter> implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener {
@BindView(R2.id.rv_content) @BindView(R2.id.rv_content)
RecyclerView rvContent; RecyclerView rvContent;
@BindView(R2.id.refresh) @BindView(R2.id.refresh)
SimpleRefreshLayout mSimpleRefreshLayout; SimpleRefreshLayout mSimpleRefreshLayout;
private DiscoveryRecommendAdapter mAdapter; private DiscoveryShortVideoAdapter mAdapter;
private int countPage; private int countPage;
private int mPage; private int mPage;
...@@ -56,14 +66,77 @@ public class ShortVideoFragment extends BaseFragment<DiscoveryPresenter> implem ...@@ -56,14 +66,77 @@ public class ShortVideoFragment extends BaseFragment<DiscoveryPresenter> implem
protected void initView(Bundle savedInstanceState) { protected void initView(Bundle savedInstanceState) {
mSimpleRefreshLayout.setHeaderView(new SimpleRefreshView(_mActivity)); mSimpleRefreshLayout.setHeaderView(new SimpleRefreshView(_mActivity));
mSimpleRefreshLayout.setOnSimpleRefreshListener(this); mSimpleRefreshLayout.setOnSimpleRefreshListener(this);
Display display = _mActivity.getWindowManager().getDefaultDisplay(); initRxbus();
mAdapter = new DiscoveryRecommendAdapter(display); mAdapter = new DiscoveryShortVideoAdapter();
rvContent.setLayoutManager(new GridLayoutManager(_mActivity, 2));
rvContent.addItemDecoration(new AbSpacesItemDecoration(15));// 分割线。
StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
rvContent.setItemAnimator(null);
rvContent.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
int[] first = new int[2];
staggeredGridLayoutManager.findFirstCompletelyVisibleItemPositions(first);
if (newState == RecyclerView.SCROLL_STATE_IDLE && (first[0] == 1 || first[1] == 1)) {
recyclerView.invalidateItemDecorations();
}
}
});
rvContent.setLayoutManager(staggeredGridLayoutManager);
// rvContent.setLayoutManager(new GridLayoutManager(_mActivity, 2));
rvContent.addItemDecoration(new AbSpacesItemDecoration(20, 10));// 分割线。
rvContent.setAdapter(mAdapter); rvContent.setAdapter(mAdapter);
mAdapter.bindToRecyclerView(rvContent);
mAdapter.setEnableLoadMore(true);
mAdapter.disableLoadMoreIfNotFullPage();
mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
// DiscoveryRecommendBean.DataBeanX.DataBean data = (DiscoveryRecommendBean.DataBeanX.DataBean) adapter.getData();
DiscoveryRecommendBean.DataBeanX.DataBean item = (DiscoveryRecommendBean.DataBeanX.DataBean) adapter.getItem(position);
if (item != null) {
startActivity(ShortVideoActivity.getIntent(_mActivity, item));
}
}
});
mAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
if (rvContent != null) {
rvContent.postDelayed(new Runnable() {
@Override
public void run() {
if (mPage >= countPage) {
mAdapter.loadMoreEnd();
} else {
mPage++;
geDataList(mPage);
}
}
}, 200);
}
}
}, rvContent);
} }
private void initRxbus() {
RxBus.tObservable(PostVideoEvent.class)
.observeOn(Schedulers.newThread())
.subscribe(new Observer<PostVideoEvent>(disposable) {
@Override
public void onNext(PostVideoEvent event) {
onFresh();
}
});
}
@Override @Override
protected void loadData(Bundle savedInstanceState) { protected void loadData(Bundle savedInstanceState) {
onFresh(); onFresh();
...@@ -85,7 +158,7 @@ public class ShortVideoFragment extends BaseFragment<DiscoveryPresenter> implem ...@@ -85,7 +158,7 @@ public class ShortVideoFragment extends BaseFragment<DiscoveryPresenter> implem
private void geDataList(int page) { private void geDataList(int page) {
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("page", page); map.put("page", page);
map.put("type",4); map.put("type", 4);
mPresenter.postData(0, DiscoveryApi.DISCOVERY_UNAUTH_LIST, DiscoveryRecommendBean.class, map, page == 1 ? false : false); mPresenter.postData(0, DiscoveryApi.DISCOVERY_UNAUTH_LIST, DiscoveryRecommendBean.class, map, page == 1 ? false : false);
} }
...@@ -125,21 +198,29 @@ public class ShortVideoFragment extends BaseFragment<DiscoveryPresenter> implem ...@@ -125,21 +198,29 @@ public class ShortVideoFragment extends BaseFragment<DiscoveryPresenter> implem
} }
public class AbSpacesItemDecoration extends RecyclerView.ItemDecoration { public class AbSpacesItemDecoration extends RecyclerView.ItemDecoration {
private int space; private int left;
private int right;
public AbSpacesItemDecoration(int space) { public AbSpacesItemDecoration(int left, int right) {
this.space = space; this.left = left;
this.right = right;
} }
@Override @Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
outRect.left = space; int position = parent.getChildAdapterPosition(view);
outRect.right = space; StaggeredGridLayoutManager.LayoutParams lp = (StaggeredGridLayoutManager.LayoutParams) view.getLayoutParams();
outRect.bottom = space;
outRect.top = space; if (lp.getSpanIndex() % 2 == 0) {
outRect.left = left;
outRect.right = right;
} else {
outRect.left = right;
outRect.right = left;
}
outRect.top = left;
} }
} }
} }
package com.xxfc.discovery.other;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.xxfc.discovery.R;
import com.xxfc.discovery.R2;
import com.xxfc.discovery.adapter.DiscoveryVideoSelectAdapter;
import com.xxfc.discovery.bean.DiscoveryRecommendBean;
import com.xxfc.discovery.bean.VideoFile;
import com.xxfc.discovery.presenter.DiscoveryPresenter;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
/**
* 视频选择
*/
public class SelectVideoActivity extends BaseStatusActivity<DiscoveryPresenter> {
@BindView(R2.id.rv_video_content)
RecyclerView rvVideoContent;
private DiscoveryVideoSelectAdapter selectAdapter;
public static Intent getIntent(Context context) {
return new Intent(context, SelectVideoActivity.class);
}
@Override
protected int setLayout() {
return R.layout.activity_select_video;
}
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle("视频选择");
selectAdapter = new DiscoveryVideoSelectAdapter();
rvVideoContent.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false));
rvVideoContent.setNestedScrollingEnabled(false);
rvVideoContent.setAdapter(selectAdapter);
selectAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
VideoFile item = (VideoFile) adapter.getItem(position);
getIntent().putExtra("videofile", item);
setResult(201, getIntent());
finish();
}
});
selectAdapter.addData(videoInAlbum());
}
@Override
public void onShowResult(int requestType, BaseBean result) {
}
/**
* 查系统相册中的视频,
*
* @return 查询失败返回null, 与空结果分开表示,
*/
@Nullable
private List<VideoFile> videoInAlbum() {
String[] projection = new String[]{
MediaStore.Video.Media.DATA,
MediaStore.Video.Media.DATE_ADDED,
MediaStore.Video.Media.SIZE,
MediaStore.Video.Media.DURATION
};
// 只支持mp4, 据测flv可能被搜到并出现问题,
String selection = MediaStore.Video.Media.MIME_TYPE + " = ?";
String[] selectionArgs = new String[]{
"video/mp4"
};
Cursor cursor = getContentResolver().query(
MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
projection, selection, selectionArgs,
MediaStore.Video.Media.DATE_ADDED + " DESC");
if (cursor == null) {
return null;
}
List<VideoFile> list = new ArrayList<>(cursor.getCount());
while (cursor.moveToNext()) {
String filePath = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATA));
if (!new File(filePath).exists()) {
// 系统相册数据库中可能没有及时同步,可能存在已经被删除了的视频的记录,
continue;
}
Long createTime = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATE_ADDED));
Long fileSize = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Video.Media.SIZE));
Long timeLen = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Video.Media.DURATION));
if (timeLen == 0) {
continue;
}
VideoFile videoFile = new VideoFile();
// 系统相册查出来的时间单位是秒,这里要的是毫秒,所以乘以一千,
videoFile.setCreateTime(1000 * createTime);
// 系统相册查出来的时长单位是毫秒,这里要的是秒,所以除以一千,
videoFile.setFileLength(timeLen / 1000);
videoFile.setFileSize(fileSize);
videoFile.setFilePath(filePath);
list.add(videoFile);
}
cursor.close();
return list;
}
}
...@@ -9,11 +9,13 @@ import android.widget.ImageView; ...@@ -9,11 +9,13 @@ import android.widget.ImageView;
import com.dueeeke.videoplayer.controller.BaseVideoController; import com.dueeeke.videoplayer.controller.BaseVideoController;
import com.dueeeke.videoplayer.player.VideoView; import com.dueeeke.videoplayer.player.VideoView;
import com.dueeeke.videoplayer.util.L; import com.dueeeke.videoplayer.util.L;
import com.ruiwenliu.wrapper.dialog.LoadingDialog;
import com.xxfc.discovery.R; import com.xxfc.discovery.R;
public class TikTokController extends BaseVideoController { public class TikTokController extends BaseVideoController {
private ImageView thumb; private ImageView thumb;
public TikTokController(@NonNull Context context) { public TikTokController(@NonNull Context context) {
super(context); super(context);
} }
...@@ -34,6 +36,7 @@ public class TikTokController extends BaseVideoController { ...@@ -34,6 +36,7 @@ public class TikTokController extends BaseVideoController {
@Override @Override
protected void initView() { protected void initView() {
super.initView(); super.initView();
thumb = mControllerView.findViewById(R.id.iv_thumb); thumb = mControllerView.findViewById(R.id.iv_thumb);
} }
...@@ -45,6 +48,7 @@ public class TikTokController extends BaseVideoController { ...@@ -45,6 +48,7 @@ public class TikTokController extends BaseVideoController {
case VideoView.STATE_IDLE: case VideoView.STATE_IDLE:
L.e("STATE_IDLE"); L.e("STATE_IDLE");
thumb.setVisibility(VISIBLE); thumb.setVisibility(VISIBLE);
break; break;
case VideoView.STATE_PLAYING: case VideoView.STATE_PLAYING:
L.e("STATE_PLAYING"); L.e("STATE_PLAYING");
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".other.SelectVideoActivity">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_video_content"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
\ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
android:orientation="vertical"> android:orientation="vertical">
<EditText <EditText
android:id="@+id/et_content" android:id="@+id/et_video_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@null" android:background="@null"
...@@ -28,13 +28,16 @@ ...@@ -28,13 +28,16 @@
android:textSize="@dimen/text_14" /> android:textSize="@dimen/text_14" />
<RelativeLayout <RelativeLayout
android:id="@+id/rl_item_select_video"
android:layout_width="@dimen/size_100" android:layout_width="@dimen/size_100"
android:layout_height="@dimen/size_100" android:layout_height="@dimen/size_100"
android:layout_marginLeft="@dimen/size_15"> android:layout_marginLeft="@dimen/size_15">
<ImageView <ImageView
android:id="@+id/iv_video_hint"
android:layout_width="@dimen/size_100" android:layout_width="@dimen/size_100"
android:layout_height="@dimen/size_100" android:layout_height="@dimen/size_100"
android:scaleType="centerCrop"
android:src="@drawable/icon_send_video_button_hint"/> android:src="@drawable/icon_send_video_button_hint"/>
</RelativeLayout> </RelativeLayout>
...@@ -53,7 +56,7 @@ ...@@ -53,7 +56,7 @@
android:src="@drawable/campsite_icon_citylocation_hint" /> android:src="@drawable/campsite_icon_citylocation_hint" />
<TextView <TextView
android:id="@+id/tv_pat_address" android:id="@+id/tv_video_address"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_5" android:layout_marginLeft="@dimen/size_5"
...@@ -64,6 +67,14 @@ ...@@ -64,6 +67,14 @@
android:textColor="@color/colorGray" android:textColor="@color/colorGray"
android:textSize="@dimen/text_12" /> android:textSize="@dimen/text_12" />
<ImageView
android:id="@+id/iv_item_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/size_8"
android:visibility="gone"
android:src="@drawable/common_icon_circle_delete" />
</LinearLayout> </LinearLayout>
<View <View
...@@ -82,7 +93,7 @@ ...@@ -82,7 +93,7 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <TextView
android:id="@+id/tv_pat_ok" android:id="@+id/tv_video_ok"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_45" android:layout_height="@dimen/size_45"
android:layout_marginLeft="@dimen/size_15" android:layout_marginLeft="@dimen/size_15"
......
...@@ -7,34 +7,18 @@ ...@@ -7,34 +7,18 @@
android:orientation="vertical" android:orientation="vertical"
tools:context=".fragment.ShortVideoFragment"> tools:context=".fragment.ShortVideoFragment">
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" <com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/refresh" android:id="@+id/refresh"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/size_80"
android:scaleType="centerCrop"
android:src="@drawable/icon_fragment_discovery_hint" />
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/rv_content" android:id="@+id/rv_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
</android.support.v7.widget.RecyclerView> </android.support.v7.widget.RecyclerView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout> </com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -11,18 +11,34 @@ ...@@ -11,18 +11,34 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView <ImageView
android:id="@+id/iv_activity" android:id="@+id/iv_icon_video"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_180" android:layout_height="wrap_content" />
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/iv_isvideo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/icon_fragment_video_hint"/>
</RelativeLayout>
<TextView <TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5" android:layout_marginTop="@dimen/size_5"
android:paddingLeft="@dimen/size_5" android:paddingLeft="@dimen/size_5"
android:paddingRight="@dimen/size_5" android:paddingRight="@dimen/size_5"
android:maxLines="2"
android:ellipsize="end"
android:text="行摄川西邂逅生命中未知的精彩" android:text="行摄川西邂逅生命中未知的精彩"
android:textColor="@color/colorMain" android:textColor="@color/colorMain"
android:textSize="@dimen/text_14" /> android:textSize="@dimen/text_14" />
...@@ -32,8 +48,7 @@ ...@@ -32,8 +48,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5" android:layout_marginTop="@dimen/size_5"
android:layout_marginBottom="@dimen/size_10" android:layout_marginBottom="@dimen/size_10"
android:paddingLeft="@dimen/size_5" android:paddingLeft="@dimen/size_5">
android:paddingRight="@dimen/size_5">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -41,12 +56,14 @@ ...@@ -41,12 +56,14 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <com.base.utils.ui.image.round.RoundImageView
android:id="@+id/iv_user_icon"
android:layout_width="@dimen/size_15" android:layout_width="@dimen/size_15"
android:layout_height="@dimen/size_15" android:layout_height="@dimen/size_15"
android:src="@drawable/aa_dis11" /> android:src="@drawable/aa_dis11" />
<TextView <TextView
android:id="@+id/tv_user_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_3" android:layout_marginLeft="@dimen/size_3"
...@@ -55,24 +72,31 @@ ...@@ -55,24 +72,31 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_item_islike"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="@dimen/size_15"
android:paddingTop="@dimen/size_5"
android:paddingBottom="@dimen/size_5"
android:paddingRight="@dimen/size_15"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/iv_like"
android:layout_width="@dimen/size_15" android:layout_width="@dimen/size_15"
android:layout_height="@dimen/size_15" android:layout_height="@dimen/size_15"
android:padding="@dimen/size_1" android:padding="@dimen/size_1"
android:src="@drawable/common_icon_like_selected" /> android:src="@drawable/icon_discovery_ask_unlike" />
<TextView <TextView
android:id="@+id/iv_like_number"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_3" android:layout_marginLeft="@dimen/size_3"
android:text="10589" android:text="10589"
android:textColor="#FFB74B" android:textColor="@color/textGray"
android:textSize="@dimen/text_8" /> android:textSize="@dimen/text_8" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
......
...@@ -27,12 +27,14 @@ ...@@ -27,12 +27,14 @@
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:id="@+id/iv_video_avatar"
android:layout_width="@dimen/size_60" android:layout_width="@dimen/size_60"
android:layout_height="@dimen/size_60" android:layout_height="@dimen/size_60"
android:src="@drawable/aa_dis11" /> android:src="@drawable/aa_dis11" />
<LinearLayout <LinearLayout
android:id="@+id/ll_item_video_islike"
android:layout_width="@dimen/size_45" android:layout_width="@dimen/size_45"
android:layout_height="@dimen/size_45" android:layout_height="@dimen/size_45"
android:layout_marginTop="@dimen/size_30" android:layout_marginTop="@dimen/size_30"
...@@ -40,6 +42,7 @@ ...@@ -40,6 +42,7 @@
android:gravity="center"> android:gravity="center">
<ImageView <ImageView
android:id="@+id/iv_video_islike"
android:layout_width="@dimen/size_20" android:layout_width="@dimen/size_20"
android:layout_height="@dimen/size_20" android:layout_height="@dimen/size_20"
android:src="@drawable/icon_discover_video_likeun" /> android:src="@drawable/icon_discover_video_likeun" />
...@@ -47,6 +50,7 @@ ...@@ -47,6 +50,7 @@
</LinearLayout> </LinearLayout>
<TextView <TextView
android:id="@+id/tv_video_islike_number"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_3" android:layout_marginTop="@dimen/size_3"
...@@ -64,6 +68,7 @@ ...@@ -64,6 +68,7 @@
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:id="@+id/iv_video_comment"
android:layout_width="@dimen/size_20" android:layout_width="@dimen/size_20"
android:layout_height="@dimen/size_20" android:layout_height="@dimen/size_20"
android:src="@drawable/icon_discover_video_commentun" /> android:src="@drawable/icon_discover_video_commentun" />
...@@ -71,6 +76,7 @@ ...@@ -71,6 +76,7 @@
</LinearLayout> </LinearLayout>
<TextView <TextView
android:id="@+id/tv_video_comment_number"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_3" android:layout_marginTop="@dimen/size_3"
...@@ -95,6 +101,7 @@ ...@@ -95,6 +101,7 @@
</LinearLayout> </LinearLayout>
<TextView <TextView
android:id="@+id/tv_video_share_number"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_3" android:layout_marginTop="@dimen/size_3"
...@@ -113,6 +120,7 @@ ...@@ -113,6 +120,7 @@
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_video_address_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="中蒙界湖-贝尔湖" android:text="中蒙界湖-贝尔湖"
...@@ -120,6 +128,7 @@ ...@@ -120,6 +128,7 @@
android:textSize="@dimen/text_14" /> android:textSize="@dimen/text_14" />
<TextView <TextView
android:id="@+id/tv_video_address"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
......
...@@ -14,11 +14,13 @@ ...@@ -14,11 +14,13 @@
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/iv_video_comment_avatar"
android:layout_width="@dimen/size_25" android:layout_width="@dimen/size_25"
android:layout_height="@dimen/size_25" android:layout_height="@dimen/size_25"
android:src="@drawable/aa_dis11" /> android:src="@drawable/aa_dis11" />
<TextView <TextView
android:id="@+id/iv_video_comment_name"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_10" android:layout_marginLeft="@dimen/size_10"
...@@ -28,6 +30,7 @@ ...@@ -28,6 +30,7 @@
android:textSize="@dimen/text_14" /> android:textSize="@dimen/text_14" />
<TextView <TextView
android:id="@+id/tv_video_comment_time"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="2019-06-05 12:00" android:text="2019-06-05 12:00"
...@@ -36,6 +39,7 @@ ...@@ -36,6 +39,7 @@
</LinearLayout> </LinearLayout>
<TextView <TextView
android:id="@+id/tv_video_comment_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10" android:layout_marginTop="@dimen/size_10"
...@@ -45,6 +49,6 @@ ...@@ -45,6 +49,6 @@
android:textColor="@color/textGray" android:textColor="@color/textGray"
android:textSize="@dimen/text_12" /> android:textSize="@dimen/text_12" />
<include layout="@layout/common_line"/> <include layout="@layout/common_line" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:layout_marginBottom="@dimen/size_10"
android:gravity="center_vertical"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="@dimen/size_100"
android:layout_height="@dimen/size_100">
<ImageView
android:id="@+id/iv_video_icon"
android:layout_width="@dimen/size_100"
android:layout_height="@dimen/size_100"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/iv_isvideo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/icon_fragment_video_hint" />
</RelativeLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_10"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tv_video_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2019-06-26 11:29:59"
android:textColor="@color/textGray"
android:textSize="@dimen/text_16" />
<TextView
android:id="@+id/tv_video_duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10"
android:text="8秒"
android:textColor="@color/textGray"
android:textSize="@dimen/text_16" />
<TextView
android:id="@+id/tv_video_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10"
android:text="13.85M"
android:textColor="@color/textGray"
android:textSize="@dimen/text_16" />
</LinearLayout>
</LinearLayout>
<include layout="@layout/common_line" />
</LinearLayout>
\ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
package="com.rv.rvmine"> package="com.rv.rvmine">
<application> <application>
<activity android:name=".fragment.MyReleasePatFragment"></activity>
<activity <activity
android:name=".personal.IDCardCertificationShowActivity" android:name=".personal.IDCardCertificationShowActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
......
...@@ -11,16 +11,17 @@ import com.ruiwenliu.wrapper.util.TransformationUtil; ...@@ -11,16 +11,17 @@ import com.ruiwenliu.wrapper.util.TransformationUtil;
import com.ruiwenliu.wrapper.util.glide.GlideOptions; import com.ruiwenliu.wrapper.util.glide.GlideOptions;
import com.rv.home.rv.module.ui.main.home.bean.HomeRecommendBean; import com.rv.home.rv.module.ui.main.home.bean.HomeRecommendBean;
import com.rv.rvmine.R; import com.rv.rvmine.R;
import com.rv.rvmine.bean.MyReleaseBean;
public class MyReleasePatAdapter extends BaseQuickAdapter<HomeRecommendBean.DataBeanX.DataBean, BaseGlideHolder> { public class MyReleasePatAdapter extends BaseQuickAdapter<MyReleaseBean.DataBeanX.DataBean, BaseGlideHolder> {
public MyReleasePatAdapter() { public MyReleasePatAdapter() {
super(R.layout.rv_item_rv_release_pat); super(R.layout.rv_item_rv_release_pat);
} }
@Override @Override
protected void convert(BaseGlideHolder helper, HomeRecommendBean.DataBeanX.DataBean item) { protected void convert(BaseGlideHolder helper, MyReleaseBean.DataBeanX.DataBean item) {
HomeRecommendBean.DataBeanX.DataBean.Body body = item.getBody(); MyReleaseBean.DataBeanX.DataBean.Body body = item.getBody();
if (body != null) { if (body != null) {
if (body.getImages() != null && body.getImages().size() > 0) { if (body.getImages() != null && body.getImages().size() > 0) {
......
package com.rv.rvmine.adapter;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.ruiwenliu.wrapper.util.BaseGlideHolder;
import com.ruiwenliu.wrapper.util.TransformationUtil;
import com.ruiwenliu.wrapper.util.glide.GlideOptions;
import com.rv.home.rv.module.ui.main.home.bean.HomeRecommendBean;
import com.rv.rvmine.R;
import com.rv.rvmine.bean.MyReleaseBean;
/**
* 短视频
*/
public class MyReleaseVideoAdapter extends BaseQuickAdapter<MyReleaseBean.DataBeanX.DataBean, BaseGlideHolder> {
public MyReleaseVideoAdapter() {
super(R.layout.rv_item_rv_release_video);
}
@Override
protected void convert(BaseGlideHolder helper, MyReleaseBean.DataBeanX.DataBean item) {
MyReleaseBean.DataBeanX.DataBean.Body body = item.getBody();
if (body != null) {
if (body.getVideos() != null && body.getVideos().size() > 0) {
// GlideManager.getInstance(mContext).loadRoundImage2(body.getImages().get(0).getOurl(), (ImageView) helper.getView(R.id.iv_icon_pat),8);
ImageView image = helper.getView(R.id.iv_icon_pat);
GlideOptions options = GlideOptions.placeholderOf(com.ruiwenliu.wrapper.R.drawable.glide_icon_placeholder).
error(com.ruiwenliu.wrapper.R.drawable.glide_icon_error);
TransformationUtil utils = new TransformationUtil(image);
Glide.with(mContext)
.asBitmap()
.load(body.getVideos().get(0).getOurl())
.apply(options)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(12)).override(image.getWidth(), image.getHeight()))
.into(utils);
}
helper.setText(R.id.tv_title, body.getText());
// helper.setText(R.id.tv_address, body);
if ("4".equals(body.getType())) { //消息类型 基础属性 1=文字消息、2=图文消息、3=语音消息、4=视频消息、 5=文件消
helper.setGone(R.id.iv_isvideo, true);
} else {
helper.setGone(R.id.iv_isvideo, false);
}
}
}
}
package com.rv.rvmine.fragment;
import android.graphics.Rect;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.View;
import com.alibaba.android.arouter.launcher.ARouter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.url.Constance;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.base.presenter.CommonPresenter;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.ui.main.home.bean.HomeRecommendBean;
import com.rv.rvmine.R;
import com.rv.rvmine.R2;
import com.rv.rvmine.adapter.MyReleasePatAdapter;
import com.rv.rvmine.bean.MyReleaseBean;
import com.yuyife.okgo.OkGoUtil;
import java.util.LinkedHashMap;
import java.util.Map;
import butterknife.BindView;
/**
* 问答
*/
public class MyReleaseAskFragment extends BaseFragment<CommonPresenter> implements SimpleRefreshLayout.OnSimpleRefreshListener {
@BindView(R2.id.rv_content)
RecyclerView rvContent;
@BindView(R2.id.refresh)
SimpleRefreshLayout mSimpleRefreshLayout;
private int countPage;
private int mPage;
private MyReleasePatAdapter mAdapter;
public static MyReleaseAskFragment getInstance(int type) {
Bundle bundl = new Bundle();
bundl.putInt("type", type);
MyReleaseAskFragment fragment = new MyReleaseAskFragment();
fragment.setArguments(bundl);
return fragment;
}
@Override
public int getViewLayout() {
return R.layout.fragment_my_release_pat;
}
@Override
protected void initView(Bundle savedInstanceState) {
mSimpleRefreshLayout.setHeaderView(new SimpleRefreshView(_mActivity));
mSimpleRefreshLayout.setOnSimpleRefreshListener(this);
mAdapter = new MyReleasePatAdapter();
final StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
rvContent.setItemAnimator(null);
rvContent.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
int[] first = new int[2];
staggeredGridLayoutManager.findFirstCompletelyVisibleItemPositions(first);
if (newState == RecyclerView.SCROLL_STATE_IDLE && (first[0] == 1 || first[1] == 1)) {
recyclerView.invalidateItemDecorations();
}
}
});
rvContent.setLayoutManager(staggeredGridLayoutManager);
rvContent.addItemDecoration(new AbSpacesItemDecoration(20, 10));// 分割线。
rvContent.setAdapter(mAdapter);
mAdapter.bindToRecyclerView(rvContent);
mAdapter.setEnableLoadMore(true);
mAdapter.disableLoadMoreIfNotFullPage();
mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
MyReleaseBean.DataBeanX.DataBean item = (MyReleaseBean.DataBeanX.DataBean) adapter.getItem(position);
if (item != null) {
ARouter.getInstance()
.build(Constance.ACTIVITY_URL_DETAILPAT)
.withString("id", item.getMsgId())
.withString("title", item.getBody().getText())
.withString("iconUrl", item.getBody().getImages().get(0).getOurl())
.withString("userName", item.getNickname())
.withString("userUrl", item.getPicUrl())
.navigation();
}
}
});
mAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
if (rvContent != null) {
rvContent.postDelayed(new Runnable() {
@Override
public void run() {
if (mPage >= countPage) {
mAdapter.loadMoreEnd();
} else {
mPage++;
geDataList(mPage);
}
}
}, 200);
}
}
}, rvContent);
}
@Override
protected void loadData(Bundle savedInstanceState) {
onFresh();
}
@Override
public void onShowResult(int requestType, BaseBean result) {
mSimpleRefreshLayout.onRefreshComplete();
switch (requestType) {
case 0:
processData((MyReleaseBean) result);
break;
}
}
private void processData(MyReleaseBean bean) {
if (mPage == 1) {
countPage = bean.getData().getPageSize();
mAdapter.setNewData(bean.getData().getData());
if (bean.getData().getTotalCount() == 0) {
mAdapter.setEmptyView(getEmptyView(rvContent, -1, "暂无发布的数据"));
mAdapter.notifyDataSetChanged();
}
} else {
mAdapter.addData(bean.getData().getData());
mAdapter.loadMoreComplete();
}
}
@Override
public void onRefresh() {
onFresh();
}
/**
* 刷新
*/
private void onFresh() {
mPage = 1;
geDataList(mPage);
}
/**
* 请求数据
*
* @param page
*/
private void geDataList(int page) {
Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null) {
headMap.put("Authorization", OkGoUtil.getToken());
}
Map<String, Object> map = new LinkedHashMap<>();
map.put("page", page);
map.put("type", "5");
mPresenter.getData(RvFrameConfig.HOST, 0, ApiConfig.RVENTHUSIAST_GETBYUSERID_LIST, MyReleaseBean.class, map, headMap, page == 1 ? true : false);
}
public class AbSpacesItemDecoration extends RecyclerView.ItemDecoration {
private int left;
private int right;
public AbSpacesItemDecoration(int left, int right) {
this.left = left;
this.right = right;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
int position = parent.getChildAdapterPosition(view);
StaggeredGridLayoutManager.LayoutParams lp = (StaggeredGridLayoutManager.LayoutParams) view.getLayoutParams();
if (lp.getSpanIndex() % 2 == 0) {
outRect.left = left;
outRect.right = right;
} else {
outRect.left = right;
outRect.right = left;
}
outRect.top = left;
}
}
}
package com.rv.rvmine.fragment;
import android.content.Intent;
import android.graphics.Rect;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.View;
import com.alibaba.android.arouter.launcher.ARouter;
import com.baidu.mapapi.model.LatLng;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.url.Constance;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.base.presenter.CommonPresenter;
import com.ruiwenliu.wrapper.util.MapUtil;
import com.ruiwenliu.wrapper.util.ViewHolder;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView;
import com.rv.component.dialog.BottomDeleteDialog;
import com.rv.component.dialog.BottomPromptDialog;
import com.rv.component.utils.LocationRecord;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.ui.main.home.bean.HomeRecommendBean;
import com.rv.rvmine.R;
import com.rv.rvmine.R2;
import com.rv.rvmine.adapter.MyReleasePatAdapter;
import com.rv.rvmine.bean.MyReleaseBean;
import com.rv.rvmine.traveler.MyReleaseActivity;
import com.xxrv.coupon.fragment.ExpiredCouponFragment;
import com.yuyife.okgo.OkGoUtil;
import java.util.LinkedHashMap;
import java.util.Map;
import butterknife.BindView;
/**
* 拍拍
*/
public class MyReleasePatFragment extends BaseFragment<CommonPresenter> implements SimpleRefreshLayout.OnSimpleRefreshListener {
@BindView(R2.id.rv_content)
RecyclerView rvContent;
@BindView(R2.id.refresh)
SimpleRefreshLayout mSimpleRefreshLayout;
private int countPage;
private int mPage;
private MyReleasePatAdapter mAdapter;
public static MyReleasePatFragment getInstance(int type) {
Bundle bundl = new Bundle();
bundl.putInt("type", type);
MyReleasePatFragment fragment = new MyReleasePatFragment();
fragment.setArguments(bundl);
return fragment;
}
@Override
public int getViewLayout() {
return R.layout.fragment_my_release_pat;
}
@Override
protected void initView(Bundle savedInstanceState) {
mSimpleRefreshLayout.setHeaderView(new SimpleRefreshView(_mActivity));
mSimpleRefreshLayout.setOnSimpleRefreshListener(this);
mAdapter = new MyReleasePatAdapter();
final StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
rvContent.setItemAnimator(null);
rvContent.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
int[] first = new int[2];
staggeredGridLayoutManager.findFirstCompletelyVisibleItemPositions(first);
if (newState == RecyclerView.SCROLL_STATE_IDLE && (first[0] == 1 || first[1] == 1)) {
recyclerView.invalidateItemDecorations();
}
}
});
rvContent.setLayoutManager(staggeredGridLayoutManager);
rvContent.addItemDecoration(new AbSpacesItemDecoration(20, 10));// 分割线。
rvContent.setAdapter(mAdapter);
mAdapter.bindToRecyclerView(rvContent);
mAdapter.setEnableLoadMore(true);
mAdapter.disableLoadMoreIfNotFullPage();
mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
MyReleaseBean.DataBeanX.DataBean item = (MyReleaseBean.DataBeanX.DataBean) adapter.getItem(position);
if (item != null) {
ARouter.getInstance()
.build(Constance.ACTIVITY_URL_DETAILPAT)
.withString("id", item.getMsgId())
.withString("title", item.getBody().getText())
.withString("iconUrl", item.getBody().getImages().get(0).getOurl())
.withString("userName", item.getNickname())
.withString("userUrl", item.getPicUrl())
.navigation();
}
}
});
mAdapter.setOnItemChildLongClickListener(new BaseQuickAdapter.OnItemChildLongClickListener() {
@Override
public boolean onItemChildLongClick(BaseQuickAdapter adapter, View view, int position) {
return true;
}
});
mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
showDeleteDialgo();
}
});
mAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
if (rvContent != null) {
rvContent.postDelayed(new Runnable() {
@Override
public void run() {
if (mPage >= countPage) {
mAdapter.loadMoreEnd();
} else {
mPage++;
geDataList(mPage);
}
}
}, 200);
}
}
}, rvContent);
}
@Override
protected void loadData(Bundle savedInstanceState) {
onFresh();
}
@Override
public void onShowResult(int requestType, BaseBean result) {
mSimpleRefreshLayout.onRefreshComplete();
switch (requestType) {
case 0:
processData((MyReleaseBean) result);
break;
}
}
private void processData(MyReleaseBean bean) {
if (mPage == 1) {
countPage = bean.getData().getPageSize();
mAdapter.setNewData(bean.getData().getData());
if (bean.getData().getTotalCount() == 0) {
mAdapter.setEmptyView(getEmptyView(rvContent, -1, "暂无发布的数据"));
mAdapter.notifyDataSetChanged();
}
} else {
mAdapter.addData(bean.getData().getData());
mAdapter.loadMoreComplete();
}
}
@Override
public void onRefresh() {
onFresh();
}
/**
* 刷新
*/
private void onFresh() {
mPage = 1;
geDataList(mPage);
}
/**
* 请求数据
*
* @param page
*/
private void geDataList(int page) {
Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null) {
headMap.put("Authorization", OkGoUtil.getToken());
}
Map<String, Object> map = new LinkedHashMap<>();
map.put("page", page);
map.put("type", "2");
mPresenter.getData(RvFrameConfig.HOST, 0, ApiConfig.RVENTHUSIAST_GETBYUSERID_LIST, MyReleaseBean.class, map, headMap, page == 1 ? true : false);
}
public void showDeleteDialgo() {
new BottomDeleteDialog(_mActivity) {
@Override
public void helper(ViewHolder helper) {
super.helper(helper);
helper.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int i = v.getId();
if (i == R.id.ll_item_delete) {
dismiss();
}
}
}, R.id.ll_item_delete);
}
}.show();
}
public class AbSpacesItemDecoration extends RecyclerView.ItemDecoration {
private int left;
private int right;
public AbSpacesItemDecoration(int left, int right) {
this.left = left;
this.right = right;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
int position = parent.getChildAdapterPosition(view);
StaggeredGridLayoutManager.LayoutParams lp = (StaggeredGridLayoutManager.LayoutParams) view.getLayoutParams();
if (lp.getSpanIndex() % 2 == 0) {
outRect.left = left;
outRect.right = right;
} else {
outRect.left = right;
outRect.right = left;
}
outRect.top = left;
}
}
}
package com.rv.rvmine.fragment;
import android.graphics.Rect;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.View;
import com.alibaba.android.arouter.launcher.ARouter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.url.Constance;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.base.presenter.CommonPresenter;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.ui.main.home.bean.HomeRecommendBean;
import com.rv.rvmine.R;
import com.rv.rvmine.R2;
import com.rv.rvmine.adapter.MyReleasePatAdapter;
import com.rv.rvmine.adapter.MyReleaseVideoAdapter;
import com.rv.rvmine.bean.MyReleaseBean;
import com.yuyife.okgo.OkGoUtil;
import java.util.LinkedHashMap;
import java.util.Map;
import butterknife.BindView;
/**
* 短视频
*/
public class MyReleaseVideoFragment extends BaseFragment<CommonPresenter> implements SimpleRefreshLayout.OnSimpleRefreshListener {
@BindView(R2.id.rv_content)
RecyclerView rvContent;
@BindView(R2.id.refresh)
SimpleRefreshLayout mSimpleRefreshLayout;
private int countPage;
private int mPage;
private MyReleaseVideoAdapter mAdapter;
public static MyReleaseVideoFragment getInstance(int type) {
Bundle bundl = new Bundle();
bundl.putInt("type", type);
MyReleaseVideoFragment fragment = new MyReleaseVideoFragment();
fragment.setArguments(bundl);
return fragment;
}
@Override
public int getViewLayout() {
return R.layout.fragment_my_release_pat;
}
@Override
protected void initView(Bundle savedInstanceState) {
mSimpleRefreshLayout.setHeaderView(new SimpleRefreshView(_mActivity));
mSimpleRefreshLayout.setOnSimpleRefreshListener(this);
mAdapter = new MyReleaseVideoAdapter();
final StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
rvContent.setItemAnimator(null);
rvContent.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
int[] first = new int[2];
staggeredGridLayoutManager.findFirstCompletelyVisibleItemPositions(first);
if (newState == RecyclerView.SCROLL_STATE_IDLE && (first[0] == 1 || first[1] == 1)) {
recyclerView.invalidateItemDecorations();
}
}
});
rvContent.setLayoutManager(staggeredGridLayoutManager);
rvContent.addItemDecoration(new AbSpacesItemDecoration(20, 10));// 分割线。
rvContent.setAdapter(mAdapter);
mAdapter.bindToRecyclerView(rvContent);
mAdapter.setEnableLoadMore(true);
mAdapter.disableLoadMoreIfNotFullPage();
mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
MyReleaseBean.DataBeanX.DataBean item = (MyReleaseBean.DataBeanX.DataBean) adapter.getItem(position);
if (item != null) {
// ARouter.getInstance()
// .build(Constance.ACTIVITY_URL_DETAILPAT)
// .withString("id", item.getMsgId())
// .withString("title", item.getBody().getText())
// .withString("iconUrl", item.getBody().getImages().get(0).getOurl())
// .withString("userName", item.getNickname())
// .withString("userUrl", item.getPicUrl())
// .navigation();
}
}
});
mAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
if (rvContent != null) {
rvContent.postDelayed(new Runnable() {
@Override
public void run() {
if (mPage >= countPage) {
mAdapter.loadMoreEnd();
} else {
mPage++;
geDataList(mPage);
}
}
}, 200);
}
}
}, rvContent);
}
@Override
protected void loadData(Bundle savedInstanceState) {
onFresh();
}
@Override
public void onShowResult(int requestType, BaseBean result) {
mSimpleRefreshLayout.onRefreshComplete();
switch (requestType) {
case 0:
processData((MyReleaseBean) result);
break;
}
}
private void processData(MyReleaseBean bean) {
if (mPage == 1) {
countPage = bean.getData().getPageSize();
mAdapter.setNewData(bean.getData().getData());
if (bean.getData().getTotalCount() == 0) {
mAdapter.setEmptyView(getEmptyView(rvContent, -1, "暂无发布的数据"));
mAdapter.notifyDataSetChanged();
}
} else {
mAdapter.addData(bean.getData().getData());
mAdapter.loadMoreComplete();
}
}
@Override
public void onRefresh() {
onFresh();
}
/**
* 刷新
*/
private void onFresh() {
mPage = 1;
geDataList(mPage);
}
/**
* 请求数据
*
* @param page
*/
private void geDataList(int page) {
Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null) {
headMap.put("Authorization", OkGoUtil.getToken());
}
Map<String, Object> map = new LinkedHashMap<>();
map.put("page", page);
map.put("type", "4");
mPresenter.getData(RvFrameConfig.HOST, 0, ApiConfig.RVENTHUSIAST_GETBYUSERID_LIST, MyReleaseBean.class, map, headMap, page == 1 ? true : false);
}
public class AbSpacesItemDecoration extends RecyclerView.ItemDecoration {
private int left;
private int right;
public AbSpacesItemDecoration(int left, int right) {
this.left = left;
this.right = right;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
int position = parent.getChildAdapterPosition(view);
StaggeredGridLayoutManager.LayoutParams lp = (StaggeredGridLayoutManager.LayoutParams) view.getLayoutParams();
if (lp.getSpanIndex() % 2 == 0) {
outRect.left = left;
outRect.right = right;
} else {
outRect.left = right;
outRect.right = left;
}
outRect.top = left;
}
}
}
...@@ -367,7 +367,7 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen ...@@ -367,7 +367,7 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen
RequestBody.create( RequestBody.create(
MediaType.parse("multipart/form-data"), fileName); MediaType.parse("multipart/form-data"), fileName);
// // 创建 RequestBody,用于封装构建RequestBody // // 创建 RequestBody,用于封装构建RequestBody uploadVideo
// RequestBody requestFile = // RequestBody requestFile =
// RequestBody.create(MediaType.parse("multipart/form-data"), file); // RequestBody.create(MediaType.parse("multipart/form-data"), file);
// MultipartBody.Part body = // MultipartBody.Part body =
......
...@@ -3,24 +3,19 @@ ...@@ -3,24 +3,19 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/gray_f5f5f5"
android:orientation="vertical"> android:orientation="vertical">
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/rv_content" android:id="@+id/recyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:background="@color/colorWrite" />
</android.support.v7.widget.RecyclerView> <include layout="@layout/common_line" />
<android.support.v4.view.ViewPager
</com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout> android:id="@+id/release_viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_f5f5f5"
android:orientation="vertical">
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_content"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.v7.widget.RecyclerView>
</com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_item_rv_enthusiast"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_icon_pat"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/iv_isvideo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/icon_fragment_video_hint"/>
</RelativeLayout>
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5"
android:paddingLeft="@dimen/size_5"
android:paddingRight="@dimen/size_5"
android:maxLines="2"
android:ellipsize="end"
android:text="行摄川西邂逅生命中未知的精彩"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_14" />
<TextView
android:id="@+id/tv_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5"
android:layout_marginBottom="@dimen/size_10"
android:paddingLeft="@dimen/size_5"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_12" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment