添加文件预览、邮件附件展示方式修改
This commit is contained in:
parent
a5e6f8c79c
commit
647aafc47f
@ -2,12 +2,14 @@ package com.tenlionsoft.baselib.core.widget.base;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.Rect;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.TouchDelegate;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
@ -86,7 +88,25 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
setDataToView(mDataView);
|
setDataToView(mDataView);
|
||||||
return contentView;
|
return contentView;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 将view的点击区域放大
|
||||||
|
*
|
||||||
|
* @param view 需要放大的view
|
||||||
|
* @param expandTouchWidth 放大的宽度
|
||||||
|
*/
|
||||||
|
public void setTouchDelegate(final View view, final int expandTouchWidth) {
|
||||||
|
final View parentView = (View) view.getParent();
|
||||||
|
parentView.post(() -> {
|
||||||
|
final Rect rect = new Rect();
|
||||||
|
view.getHitRect(rect);
|
||||||
|
rect.top -= expandTouchWidth;
|
||||||
|
rect.bottom += expandTouchWidth;
|
||||||
|
rect.left -= expandTouchWidth;
|
||||||
|
rect.right += expandTouchWidth;
|
||||||
|
TouchDelegate touchDelegate = new TouchDelegate(rect, view);
|
||||||
|
parentView.setTouchDelegate(touchDelegate);
|
||||||
|
});
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 设置是否显示titlebar
|
* 设置是否显示titlebar
|
||||||
*/
|
*/
|
||||||
|
@ -363,37 +363,7 @@ public class DocumentDetailActivity extends BaseActivity {
|
|||||||
AddFileAdapter adapter = new AddFileAdapter(mActivity, files);
|
AddFileAdapter adapter = new AddFileAdapter(mActivity, files);
|
||||||
mRlvFiles.setLayoutManager(new LinearLayoutManager(mActivity));
|
mRlvFiles.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||||
mRlvFiles.setAdapter(adapter);
|
mRlvFiles.setAdapter(adapter);
|
||||||
adapter.addOnItemClickListener(addFileBean -> {
|
adapter.addOnItemClickListener(addFileBean -> previewFile(addFileBean, files));
|
||||||
if (addFileBean.getFileType() == 1) {
|
|
||||||
//文档
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
|
||||||
.withString("fileName", addFileBean.getFileName())
|
|
||||||
.withString("fileId", addFileBean.getId())
|
|
||||||
.navigation();
|
|
||||||
} else if (2 == addFileBean.getFileType()) {
|
|
||||||
//图片预览
|
|
||||||
//遍历文件获取所有图片文件
|
|
||||||
ArrayList<String> imgUrls = new ArrayList<>();
|
|
||||||
for (int i = 0; i < files.size(); i++) {
|
|
||||||
AddFileBean fileBean = files.get(i);
|
|
||||||
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
|
||||||
imgUrls.add(url);
|
|
||||||
}
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
|
||||||
.withStringArrayList(TAG_IMGURL, imgUrls)
|
|
||||||
.navigation();
|
|
||||||
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
|
||||||
//TODO 视频或音频预览
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
|
||||||
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
|
||||||
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
|
||||||
.withString("type", addFileBean.getFileType() == 4 ? "audio" : "video")
|
|
||||||
.navigation();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
ToastUtils.show("未找到文档信息");
|
ToastUtils.show("未找到文档信息");
|
||||||
}
|
}
|
||||||
@ -412,6 +382,42 @@ public class DocumentDetailActivity extends BaseActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预览文件
|
||||||
|
*/
|
||||||
|
private void previewFile(AddFileBean addFileBean, List<AddFileBean> mFiles) {
|
||||||
|
if (addFileBean.getFileType() == 1) {
|
||||||
|
//文档
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
||||||
|
.withString("fileName", addFileBean.getFileName())
|
||||||
|
.withString("fileId", addFileBean.getId())
|
||||||
|
.navigation();
|
||||||
|
} else if (2 == addFileBean.getFileType()) {
|
||||||
|
//图片预览
|
||||||
|
//遍历文件获取所有图片文件
|
||||||
|
ArrayList<String> imgUrls = new ArrayList<>();
|
||||||
|
for (int i = 0; i < mFiles.size(); i++) {
|
||||||
|
if (mFiles.get(i).getFileType() == 2) {
|
||||||
|
AddFileBean fileBean = mFiles.get(i);
|
||||||
|
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
||||||
|
imgUrls.add(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||||
|
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||||
|
.navigation();
|
||||||
|
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||||
|
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||||
|
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||||
|
.withString("type", addFileBean.getFileType() == 4 ? "audio" : "video")
|
||||||
|
.navigation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doSearchByTitle() {
|
protected void doSearchByTitle() {
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
|||||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||||
import com.tenlionsoft.baselib.utils.FileUtils;
|
import com.tenlionsoft.baselib.utils.FileUtils;
|
||||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
|
||||||
import com.tenlionsoft.oamodule.R;
|
import com.tenlionsoft.oamodule.R;
|
||||||
import com.tenlionsoft.oamodule.R2;
|
import com.tenlionsoft.oamodule.R2;
|
||||||
import com.tenlionsoft.oamodule.beans.EmailDraftDetailBean;
|
import com.tenlionsoft.oamodule.beans.EmailDraftDetailBean;
|
||||||
@ -35,6 +34,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
@ -161,7 +161,7 @@ public class DraftEmailDetailActivity extends BaseActivity {
|
|||||||
if (fileInfoBeans.size() > 0) {
|
if (fileInfoBeans.size() > 0) {
|
||||||
mFileBeans = new ArrayList<>();
|
mFileBeans = new ArrayList<>();
|
||||||
mAddFileAdapter = new AddFileAdapter(mActivity, mFileBeans);
|
mAddFileAdapter = new AddFileAdapter(mActivity, mFileBeans);
|
||||||
mRlvFiles.setLayoutManager(new GridLayoutManager(mActivity, 5));
|
mRlvFiles.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||||
mRlvFiles.setAdapter(mAddFileAdapter);
|
mRlvFiles.setAdapter(mAddFileAdapter);
|
||||||
for (int i = 0; i < fileInfoBeans.size(); i++) {
|
for (int i = 0; i < fileInfoBeans.size(); i++) {
|
||||||
FileInfoBean infoBean = fileInfoBeans.get(i);
|
FileInfoBean infoBean = fileInfoBeans.get(i);
|
||||||
@ -173,33 +173,7 @@ public class DraftEmailDetailActivity extends BaseActivity {
|
|||||||
mFileBeans.add(0, bean);
|
mFileBeans.add(0, bean);
|
||||||
}
|
}
|
||||||
mAddFileAdapter.setData(mFileBeans);
|
mAddFileAdapter.setData(mFileBeans);
|
||||||
mAddFileAdapter.addOnItemClickListener(addFileBean -> {
|
mAddFileAdapter.addOnItemClickListener(addFileBean -> previewFile(addFileBean, mFileBeans));
|
||||||
if (addFileBean.getFileType() == 1) {
|
|
||||||
//文档
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
|
||||||
.withString("fileName", addFileBean.getFileName())
|
|
||||||
.withString("fileId", addFileBean.getId())
|
|
||||||
.navigation();
|
|
||||||
} else if (2 == addFileBean.getFileType()) {
|
|
||||||
//图片预览
|
|
||||||
//遍历文件获取所有图片文件
|
|
||||||
ArrayList<String> imgUrls = new ArrayList<>();
|
|
||||||
for (int i = 0; i < mFileBeans.size(); i++) {
|
|
||||||
if (mFileBeans.get(i).getFileType() == 2) {
|
|
||||||
AddFileBean fileBean = mFileBeans.get(i);
|
|
||||||
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
|
||||||
imgUrls.add(url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
|
||||||
.withStringArrayList(TAG_IMGURL, imgUrls)
|
|
||||||
.navigation();
|
|
||||||
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
|
||||||
//TODO 视频或音频预览
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
ToastUtils.show("未找到文档信息");
|
ToastUtils.show("未找到文档信息");
|
||||||
}
|
}
|
||||||
@ -284,6 +258,43 @@ public class DraftEmailDetailActivity extends BaseActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预览文件
|
||||||
|
*/
|
||||||
|
private void previewFile(AddFileBean addFileBean, List<AddFileBean> mFiles) {
|
||||||
|
if (addFileBean.getFileType() == 1) {
|
||||||
|
//文档
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
||||||
|
.withString("fileName", addFileBean.getFileName())
|
||||||
|
.withString("fileId", addFileBean.getId())
|
||||||
|
.navigation();
|
||||||
|
} else if (2 == addFileBean.getFileType()) {
|
||||||
|
//图片预览
|
||||||
|
//遍历文件获取所有图片文件
|
||||||
|
ArrayList<String> imgUrls = new ArrayList<>();
|
||||||
|
for (int i = 0; i < mFiles.size(); i++) {
|
||||||
|
if (mFiles.get(i).getFileType() == 2) {
|
||||||
|
AddFileBean fileBean = mFiles.get(i);
|
||||||
|
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
||||||
|
imgUrls.add(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||||
|
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||||
|
.navigation();
|
||||||
|
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||||
|
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||||
|
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||||
|
.withString("type", addFileBean.getFileType() == 4 ? "audio" : "video")
|
||||||
|
.navigation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doSearchByTitle() {
|
protected void doSearchByTitle() {
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
|||||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||||
import com.tenlionsoft.baselib.utils.FileUtils;
|
import com.tenlionsoft.baselib.utils.FileUtils;
|
||||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
|
||||||
import com.tenlionsoft.oamodule.R;
|
import com.tenlionsoft.oamodule.R;
|
||||||
import com.tenlionsoft.oamodule.R2;
|
import com.tenlionsoft.oamodule.R2;
|
||||||
import com.tenlionsoft.oamodule.beans.EmailInboxDetailBean;
|
import com.tenlionsoft.oamodule.beans.EmailInboxDetailBean;
|
||||||
@ -34,6 +33,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
@ -217,7 +217,7 @@ public class InboxDetailActivity extends BaseActivity {
|
|||||||
if (fileInfoBeans.size() > 0) {
|
if (fileInfoBeans.size() > 0) {
|
||||||
mFileBeans = new ArrayList<>();
|
mFileBeans = new ArrayList<>();
|
||||||
mAddFileAdapter = new AddFileAdapter(mActivity, mFileBeans);
|
mAddFileAdapter = new AddFileAdapter(mActivity, mFileBeans);
|
||||||
mRlvFiles.setLayoutManager(new GridLayoutManager(mActivity, 5));
|
mRlvFiles.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||||
mRlvFiles.setAdapter(mAddFileAdapter);
|
mRlvFiles.setAdapter(mAddFileAdapter);
|
||||||
for (int i = 0; i < fileInfoBeans.size(); i++) {
|
for (int i = 0; i < fileInfoBeans.size(); i++) {
|
||||||
FileInfoBean infoBean = fileInfoBeans.get(i);
|
FileInfoBean infoBean = fileInfoBeans.get(i);
|
||||||
@ -229,33 +229,7 @@ public class InboxDetailActivity extends BaseActivity {
|
|||||||
mFileBeans.add(0, bean);
|
mFileBeans.add(0, bean);
|
||||||
}
|
}
|
||||||
mAddFileAdapter.setData(mFileBeans);
|
mAddFileAdapter.setData(mFileBeans);
|
||||||
mAddFileAdapter.addOnItemClickListener(addFileBean -> {
|
mAddFileAdapter.addOnItemClickListener(addFileBean -> previewFile(addFileBean, mFileBeans));
|
||||||
if (addFileBean.getFileType() == 1) {
|
|
||||||
//文档
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
|
||||||
.withString("fileName", addFileBean.getFileName())
|
|
||||||
.withString("fileId", addFileBean.getId())
|
|
||||||
.navigation();
|
|
||||||
} else if (2 == addFileBean.getFileType()) {
|
|
||||||
//图片预览
|
|
||||||
//遍历文件获取所有图片文件
|
|
||||||
ArrayList<String> imgUrls = new ArrayList<>();
|
|
||||||
for (int i = 0; i < mFileBeans.size(); i++) {
|
|
||||||
if (mFileBeans.get(i).getFileType() == 2) {
|
|
||||||
AddFileBean fileBean = mFileBeans.get(i);
|
|
||||||
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
|
||||||
imgUrls.add(url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
|
||||||
.withStringArrayList(TAG_IMGURL, imgUrls)
|
|
||||||
.navigation();
|
|
||||||
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
|
||||||
//TODO 视频或音频预览
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
ToastUtils.show("未找到文档信息");
|
ToastUtils.show("未找到文档信息");
|
||||||
}
|
}
|
||||||
@ -274,6 +248,41 @@ public class InboxDetailActivity extends BaseActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预览文件
|
||||||
|
*/
|
||||||
|
private void previewFile(AddFileBean addFileBean, List<AddFileBean> mFiles) {
|
||||||
|
if (addFileBean.getFileType() == 1) {
|
||||||
|
//文档
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
||||||
|
.withString("fileName", addFileBean.getFileName())
|
||||||
|
.withString("fileId", addFileBean.getId())
|
||||||
|
.navigation();
|
||||||
|
} else if (2 == addFileBean.getFileType()) {
|
||||||
|
//图片预览
|
||||||
|
//遍历文件获取所有图片文件
|
||||||
|
ArrayList<String> imgUrls = new ArrayList<>();
|
||||||
|
for (int i = 0; i < mFiles.size(); i++) {
|
||||||
|
if (mFiles.get(i).getFileType() == 2) {
|
||||||
|
AddFileBean fileBean = mFiles.get(i);
|
||||||
|
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
||||||
|
imgUrls.add(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||||
|
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||||
|
.navigation();
|
||||||
|
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||||
|
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||||
|
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||||
|
.withString("type", addFileBean.getFileType() == 4 ? "audio" : "video")
|
||||||
|
.navigation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void doSaveReadState() {
|
private void doSaveReadState() {
|
||||||
RetrofitManager
|
RetrofitManager
|
||||||
|
@ -24,7 +24,6 @@ import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
|||||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||||
import com.tenlionsoft.baselib.utils.FileUtils;
|
import com.tenlionsoft.baselib.utils.FileUtils;
|
||||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
|
||||||
import com.tenlionsoft.oamodule.R;
|
import com.tenlionsoft.oamodule.R;
|
||||||
import com.tenlionsoft.oamodule.R2;
|
import com.tenlionsoft.oamodule.R2;
|
||||||
import com.tenlionsoft.oamodule.beans.EmailRecycleDetailBean;
|
import com.tenlionsoft.oamodule.beans.EmailRecycleDetailBean;
|
||||||
@ -33,7 +32,7 @@ import com.tenlionsoft.oamodule.net.OAApi;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
@ -269,7 +268,7 @@ public class RecycleEmailDetailActivity extends BaseActivity {
|
|||||||
if (fileInfoBeans.size() > 0) {
|
if (fileInfoBeans.size() > 0) {
|
||||||
mFileBeans = new ArrayList<>();
|
mFileBeans = new ArrayList<>();
|
||||||
mAddFileAdapter = new AddFileAdapter(mActivity, mFileBeans);
|
mAddFileAdapter = new AddFileAdapter(mActivity, mFileBeans);
|
||||||
mRlvFiles.setLayoutManager(new GridLayoutManager(mActivity, 5));
|
mRlvFiles.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||||
mRlvFiles.setAdapter(mAddFileAdapter);
|
mRlvFiles.setAdapter(mAddFileAdapter);
|
||||||
for (int i = 0; i < fileInfoBeans.size(); i++) {
|
for (int i = 0; i < fileInfoBeans.size(); i++) {
|
||||||
FileInfoBean infoBean = fileInfoBeans.get(i);
|
FileInfoBean infoBean = fileInfoBeans.get(i);
|
||||||
@ -281,33 +280,7 @@ public class RecycleEmailDetailActivity extends BaseActivity {
|
|||||||
mFileBeans.add(0, bean);
|
mFileBeans.add(0, bean);
|
||||||
}
|
}
|
||||||
mAddFileAdapter.setData(mFileBeans);
|
mAddFileAdapter.setData(mFileBeans);
|
||||||
mAddFileAdapter.addOnItemClickListener(addFileBean -> {
|
mAddFileAdapter.addOnItemClickListener(addFileBean -> previewFile(addFileBean, mFileBeans));
|
||||||
if (addFileBean.getFileType() == 1) {
|
|
||||||
//文档
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
|
||||||
.withString("fileName", addFileBean.getFileName())
|
|
||||||
.withString("fileId", addFileBean.getId())
|
|
||||||
.navigation();
|
|
||||||
} else if (2 == addFileBean.getFileType()) {
|
|
||||||
//图片预览
|
|
||||||
//遍历文件获取所有图片文件
|
|
||||||
ArrayList<String> imgUrls = new ArrayList<>();
|
|
||||||
for (int i = 0; i < mFileBeans.size(); i++) {
|
|
||||||
if (mFileBeans.get(i).getFileType() == 2) {
|
|
||||||
AddFileBean fileBean = mFileBeans.get(i);
|
|
||||||
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
|
||||||
imgUrls.add(url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
|
||||||
.withStringArrayList(TAG_IMGURL, imgUrls)
|
|
||||||
.navigation();
|
|
||||||
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
|
||||||
//TODO 视频或音频预览
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
ToastUtils.show("未找到文档信息");
|
ToastUtils.show("未找到文档信息");
|
||||||
}
|
}
|
||||||
@ -326,6 +299,43 @@ public class RecycleEmailDetailActivity extends BaseActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预览文件
|
||||||
|
*/
|
||||||
|
private void previewFile(AddFileBean addFileBean, List<AddFileBean> mFiles) {
|
||||||
|
if (addFileBean.getFileType() == 1) {
|
||||||
|
//文档
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
||||||
|
.withString("fileName", addFileBean.getFileName())
|
||||||
|
.withString("fileId", addFileBean.getId())
|
||||||
|
.navigation();
|
||||||
|
} else if (2 == addFileBean.getFileType()) {
|
||||||
|
//图片预览
|
||||||
|
//遍历文件获取所有图片文件
|
||||||
|
ArrayList<String> imgUrls = new ArrayList<>();
|
||||||
|
for (int i = 0; i < mFiles.size(); i++) {
|
||||||
|
if (mFiles.get(i).getFileType() == 2) {
|
||||||
|
AddFileBean fileBean = mFiles.get(i);
|
||||||
|
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
||||||
|
imgUrls.add(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||||
|
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||||
|
.navigation();
|
||||||
|
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||||
|
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||||
|
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||||
|
.withString("type", addFileBean.getFileType() == 4 ? "audio" : "video")
|
||||||
|
.navigation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doSearchByTitle() {
|
protected void doSearchByTitle() {
|
||||||
|
|
||||||
|
@ -597,7 +597,7 @@ public class SendEmailActivity extends BaseActivity {
|
|||||||
mAddFileAdapter.notifyDataSetChanged();
|
mAddFileAdapter.notifyDataSetChanged();
|
||||||
++mFileMax;
|
++mFileMax;
|
||||||
});
|
});
|
||||||
mRlvFiles.setLayoutManager(new GridLayoutManager(mActivity, 4));
|
mRlvFiles.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||||
mRlvFiles.setAdapter(mAddFileAdapter);
|
mRlvFiles.setAdapter(mAddFileAdapter);
|
||||||
|
|
||||||
mIvAddFile.setOnClickListener(v -> {
|
mIvAddFile.setOnClickListener(v -> {
|
||||||
|
@ -23,7 +23,6 @@ import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
|||||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||||
import com.tenlionsoft.baselib.utils.FileUtils;
|
import com.tenlionsoft.baselib.utils.FileUtils;
|
||||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
|
||||||
import com.tenlionsoft.oamodule.R;
|
import com.tenlionsoft.oamodule.R;
|
||||||
import com.tenlionsoft.oamodule.R2;
|
import com.tenlionsoft.oamodule.R2;
|
||||||
import com.tenlionsoft.oamodule.beans.EmailSendDetailBean;
|
import com.tenlionsoft.oamodule.beans.EmailSendDetailBean;
|
||||||
@ -32,7 +31,6 @@ import com.tenlionsoft.oamodule.net.OAApi;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
@ -160,7 +158,7 @@ public class SendEmailDetailActivity extends BaseActivity {
|
|||||||
if (fileInfoBeans.size() > 0) {
|
if (fileInfoBeans.size() > 0) {
|
||||||
mFileBeans = new ArrayList<>();
|
mFileBeans = new ArrayList<>();
|
||||||
mAddFileAdapter = new AddFileAdapter(mActivity, mFileBeans);
|
mAddFileAdapter = new AddFileAdapter(mActivity, mFileBeans);
|
||||||
mRlvFiles.setLayoutManager(new GridLayoutManager(mActivity, 5));
|
mRlvFiles.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||||
mRlvFiles.setAdapter(mAddFileAdapter);
|
mRlvFiles.setAdapter(mAddFileAdapter);
|
||||||
for (int i = 0; i < fileInfoBeans.size(); i++) {
|
for (int i = 0; i < fileInfoBeans.size(); i++) {
|
||||||
FileInfoBean infoBean = fileInfoBeans.get(i);
|
FileInfoBean infoBean = fileInfoBeans.get(i);
|
||||||
@ -172,33 +170,7 @@ public class SendEmailDetailActivity extends BaseActivity {
|
|||||||
mFileBeans.add(0, bean);
|
mFileBeans.add(0, bean);
|
||||||
}
|
}
|
||||||
mAddFileAdapter.setData(mFileBeans);
|
mAddFileAdapter.setData(mFileBeans);
|
||||||
mAddFileAdapter.addOnItemClickListener(addFileBean -> {
|
mAddFileAdapter.addOnItemClickListener(addFileBean -> previewFile(addFileBean, mFileBeans));
|
||||||
if (addFileBean.getFileType() == 1) {
|
|
||||||
//文档
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
|
||||||
.withString("fileName", addFileBean.getFileName())
|
|
||||||
.withString("fileId", addFileBean.getId())
|
|
||||||
.navigation();
|
|
||||||
} else if (2 == addFileBean.getFileType()) {
|
|
||||||
//图片预览
|
|
||||||
//遍历文件获取所有图片文件
|
|
||||||
ArrayList<String> imgUrls = new ArrayList<>();
|
|
||||||
for (int i = 0; i < mFileBeans.size(); i++) {
|
|
||||||
if (mFileBeans.get(i).getFileType() == 2) {
|
|
||||||
AddFileBean fileBean = mFileBeans.get(i);
|
|
||||||
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
|
||||||
imgUrls.add(url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
|
||||||
.withStringArrayList(TAG_IMGURL, imgUrls)
|
|
||||||
.navigation();
|
|
||||||
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
|
||||||
//TODO 视频或音频预览
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
ToastUtils.show("未找到文档信息");
|
ToastUtils.show("未找到文档信息");
|
||||||
}
|
}
|
||||||
@ -217,6 +189,43 @@ public class SendEmailDetailActivity extends BaseActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预览文件
|
||||||
|
*/
|
||||||
|
private void previewFile(AddFileBean addFileBean, List<AddFileBean> mFiles) {
|
||||||
|
if (addFileBean.getFileType() == 1) {
|
||||||
|
//文档
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
||||||
|
.withString("fileName", addFileBean.getFileName())
|
||||||
|
.withString("fileId", addFileBean.getId())
|
||||||
|
.navigation();
|
||||||
|
} else if (2 == addFileBean.getFileType()) {
|
||||||
|
//图片预览
|
||||||
|
//遍历文件获取所有图片文件
|
||||||
|
ArrayList<String> imgUrls = new ArrayList<>();
|
||||||
|
for (int i = 0; i < mFiles.size(); i++) {
|
||||||
|
if (mFiles.get(i).getFileType() == 2) {
|
||||||
|
AddFileBean fileBean = mFiles.get(i);
|
||||||
|
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
||||||
|
imgUrls.add(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||||
|
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||||
|
.navigation();
|
||||||
|
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||||
|
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||||
|
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||||
|
.withString("type", addFileBean.getFileType() == 4 ? "audio" : "video")
|
||||||
|
.navigation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void onShowConfirm(int type) {
|
private void onShowConfirm(int type) {
|
||||||
new AlertDialog.Builder(mActivity)
|
new AlertDialog.Builder(mActivity)
|
||||||
.setTitle("提示")
|
.setTitle("提示")
|
||||||
|
@ -282,7 +282,12 @@ public class MeetingDetailActivity extends BaseActivity {
|
|||||||
.withStringArrayList(TAG_IMGURL, imgUrls)
|
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||||
.navigation();
|
.navigation();
|
||||||
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||||
//TODO 视频或音频预览
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||||
|
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||||
|
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||||
|
.withString("type", addFileBean.getFileType() == 4 ? "audio" : "video")
|
||||||
|
.navigation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,7 +310,12 @@ public class NoticeDetailActivity extends BaseActivity {
|
|||||||
.withStringArrayList(TAG_IMGURL, imgUrls)
|
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||||
.navigation();
|
.navigation();
|
||||||
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||||
//TODO 视频或音频预览
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||||
|
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||||
|
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||||
|
.withString("type", addFileBean.getFileType() == 4 ? "audio" : "video")
|
||||||
|
.navigation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,6 +98,8 @@ import okhttp3.MediaType;
|
|||||||
import okhttp3.MultipartBody;
|
import okhttp3.MultipartBody;
|
||||||
import okhttp3.RequestBody;
|
import okhttp3.RequestBody;
|
||||||
|
|
||||||
|
import static com.tenlionsoft.baselib.core.widget.PhotoActivity.TAG_IMGURL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作者: Adam
|
* 作者: Adam
|
||||||
* 日期: 2022年06月01日16:34:20
|
* 日期: 2022年06月01日16:34:20
|
||||||
@ -239,6 +241,7 @@ public class OaFlowCenterActivity extends BaseActivity {
|
|||||||
mFileBlueAdapter = new AddFileBlueAdapter(mActivity, mFiles);
|
mFileBlueAdapter = new AddFileBlueAdapter(mActivity, mFiles);
|
||||||
mRlvFiles.setLayoutManager(new LinearLayoutManager(mActivity));
|
mRlvFiles.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||||
mRlvFiles.setAdapter(mFileBlueAdapter);
|
mRlvFiles.setAdapter(mFileBlueAdapter);
|
||||||
|
mFileBlueAdapter.addOnItemClickListener(addFileBean -> previewFile(addFileBean, mFiles));
|
||||||
|
|
||||||
mTvNext.setOnClickListener(v -> nextCounterSigned());
|
mTvNext.setOnClickListener(v -> nextCounterSigned());
|
||||||
mTvPre.setOnClickListener(v -> preCounterSigned());
|
mTvPre.setOnClickListener(v -> preCounterSigned());
|
||||||
@ -1102,6 +1105,7 @@ public class OaFlowCenterActivity extends BaseActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
public void invokeNative(String method) {
|
public void invokeNative(String method) {
|
||||||
if ("back".equals(method)) {
|
if ("back".equals(method)) {
|
||||||
@ -1112,6 +1116,42 @@ public class OaFlowCenterActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预览文件
|
||||||
|
*/
|
||||||
|
private void previewFile(AddFileBean addFileBean, List<AddFileBean> mFiles) {
|
||||||
|
if (addFileBean.getFileType() == 1) {
|
||||||
|
//文档
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
||||||
|
.withString("fileName", addFileBean.getFileName())
|
||||||
|
.withString("fileId", addFileBean.getId())
|
||||||
|
.navigation();
|
||||||
|
} else if (2 == addFileBean.getFileType()) {
|
||||||
|
//图片预览
|
||||||
|
//遍历文件获取所有图片文件
|
||||||
|
ArrayList<String> imgUrls = new ArrayList<>();
|
||||||
|
for (int i = 0; i < mFiles.size(); i++) {
|
||||||
|
if (mFiles.get(i).getFileType() == 2) {
|
||||||
|
AddFileBean fileBean = mFiles.get(i);
|
||||||
|
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
||||||
|
imgUrls.add(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||||
|
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||||
|
.navigation();
|
||||||
|
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||||
|
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||||
|
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||||
|
.withString("type", addFileBean.getFileType() == 4 ? "audio" : "video")
|
||||||
|
.navigation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doSearchByTitle() {
|
protected void doSearchByTitle() {
|
||||||
|
|
||||||
|
@ -357,70 +357,12 @@ public class UserRecordDetailActivity extends BaseActivity {
|
|||||||
AddFileAdapter adapter = new AddFileAdapter(mActivity, files);
|
AddFileAdapter adapter = new AddFileAdapter(mActivity, files);
|
||||||
mRlvImgs.setLayoutManager(new GridLayoutManager(mActivity, 5));
|
mRlvImgs.setLayoutManager(new GridLayoutManager(mActivity, 5));
|
||||||
mRlvImgs.setAdapter(adapter);
|
mRlvImgs.setAdapter(adapter);
|
||||||
adapter.addOnItemClickListener(addFileBean -> {
|
adapter.addOnItemClickListener(addFileBean -> previewFile(addFileBean, files));
|
||||||
if (addFileBean.getFileType() == 1) {
|
|
||||||
//文档
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
|
||||||
.withString("fileName", addFileBean.getFileName())
|
|
||||||
.withString("fileId", addFileBean.getId())
|
|
||||||
.navigation();
|
|
||||||
} else if (2 == addFileBean.getFileType()) {
|
|
||||||
//图片预览
|
|
||||||
//遍历文件获取所有图片文件
|
|
||||||
ArrayList<String> imgUrls = new ArrayList<>();
|
|
||||||
for (int i = 0; i < files.size(); i++) {
|
|
||||||
AddFileBean fileBean = files.get(i);
|
|
||||||
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
|
||||||
imgUrls.add(url);
|
|
||||||
}
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
|
||||||
.withStringArrayList(TAG_IMGURL, imgUrls)
|
|
||||||
.navigation();
|
|
||||||
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
|
||||||
//TODO 视频或音频预览
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
|
||||||
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
|
||||||
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
|
||||||
.navigation();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
AddFileAdapter adapter = new AddFileAdapter(mActivity, files);
|
AddFileAdapter adapter = new AddFileAdapter(mActivity, files);
|
||||||
mRlvResumeFile.setLayoutManager(new LinearLayoutManager(mActivity));
|
mRlvResumeFile.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||||
mRlvResumeFile.setAdapter(adapter);
|
mRlvResumeFile.setAdapter(adapter);
|
||||||
adapter.addOnItemClickListener(addFileBean -> {
|
adapter.addOnItemClickListener(addFileBean -> previewFile(addFileBean, files));
|
||||||
if (addFileBean.getFileType() == 1) {
|
|
||||||
//文档
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
|
||||||
.withString("fileName", addFileBean.getFileName())
|
|
||||||
.withString("fileId", addFileBean.getId())
|
|
||||||
.navigation();
|
|
||||||
} else if (2 == addFileBean.getFileType()) {
|
|
||||||
//图片预览
|
|
||||||
//遍历文件获取所有图片文件
|
|
||||||
ArrayList<String> imgUrls = new ArrayList<>();
|
|
||||||
for (int i = 0; i < files.size(); i++) {
|
|
||||||
AddFileBean fileBean = files.get(i);
|
|
||||||
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
|
||||||
imgUrls.add(url);
|
|
||||||
}
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
|
||||||
.withStringArrayList(TAG_IMGURL, imgUrls)
|
|
||||||
.navigation();
|
|
||||||
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
|
||||||
//TODO 视频或音频预览
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
|
||||||
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
|
||||||
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
|
||||||
.navigation();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -452,6 +394,42 @@ public class UserRecordDetailActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预览文件
|
||||||
|
*/
|
||||||
|
private void previewFile(AddFileBean addFileBean, List<AddFileBean> mFiles) {
|
||||||
|
if (addFileBean.getFileType() == 1) {
|
||||||
|
//文档
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
||||||
|
.withString("fileName", addFileBean.getFileName())
|
||||||
|
.withString("fileId", addFileBean.getId())
|
||||||
|
.navigation();
|
||||||
|
} else if (2 == addFileBean.getFileType()) {
|
||||||
|
//图片预览
|
||||||
|
//遍历文件获取所有图片文件
|
||||||
|
ArrayList<String> imgUrls = new ArrayList<>();
|
||||||
|
for (int i = 0; i < mFiles.size(); i++) {
|
||||||
|
if (mFiles.get(i).getFileType() == 2) {
|
||||||
|
AddFileBean fileBean = mFiles.get(i);
|
||||||
|
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
||||||
|
imgUrls.add(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||||
|
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||||
|
.navigation();
|
||||||
|
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||||
|
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||||
|
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||||
|
.withString("type", addFileBean.getFileType() == 4 ? "audio" : "video")
|
||||||
|
.navigation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doSearchByTitle() {
|
protected void doSearchByTitle() {
|
||||||
|
|
||||||
|
@ -298,33 +298,7 @@ public class RoutineWorkDetailActivity extends BaseActivity {
|
|||||||
fileBeans.add(0, bean);
|
fileBeans.add(0, bean);
|
||||||
}
|
}
|
||||||
addFileAdapter.setData(fileBeans);
|
addFileAdapter.setData(fileBeans);
|
||||||
addFileAdapter.addOnItemClickListener(addFileBean -> {
|
addFileAdapter.addOnItemClickListener(addFileBean -> previewFile(addFileBean, fileBeans));
|
||||||
if (addFileBean.getFileType() == 1) {
|
|
||||||
//文档
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
|
||||||
.withString("fileName", addFileBean.getFileName())
|
|
||||||
.withString("fileId", addFileBean.getId())
|
|
||||||
.navigation();
|
|
||||||
} else if (2 == addFileBean.getFileType()) {
|
|
||||||
//图片预览
|
|
||||||
//遍历文件获取所有图片文件
|
|
||||||
ArrayList<String> imgUrls = new ArrayList<>();
|
|
||||||
for (int i = 0; i < addFileAdapter.getData().size(); i++) {
|
|
||||||
if (addFileAdapter.getData().get(i).getFileType() == 2) {
|
|
||||||
AddFileBean fileBean = addFileAdapter.getData().get(i);
|
|
||||||
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
|
||||||
imgUrls.add(url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ARouter.getInstance()
|
|
||||||
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
|
||||||
.withStringArrayList(TAG_IMGURL, imgUrls)
|
|
||||||
.navigation();
|
|
||||||
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
|
||||||
//TODO 视频或音频预览
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
ToastUtils.show("未找到文档信息");
|
ToastUtils.show("未找到文档信息");
|
||||||
}
|
}
|
||||||
@ -344,6 +318,42 @@ public class RoutineWorkDetailActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预览文件
|
||||||
|
*/
|
||||||
|
private void previewFile(AddFileBean addFileBean, List<AddFileBean> mFiles) {
|
||||||
|
if (addFileBean.getFileType() == 1) {
|
||||||
|
//文档
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
||||||
|
.withString("fileName", addFileBean.getFileName())
|
||||||
|
.withString("fileId", addFileBean.getId())
|
||||||
|
.navigation();
|
||||||
|
} else if (2 == addFileBean.getFileType()) {
|
||||||
|
//图片预览
|
||||||
|
//遍历文件获取所有图片文件
|
||||||
|
ArrayList<String> imgUrls = new ArrayList<>();
|
||||||
|
for (int i = 0; i < mFiles.size(); i++) {
|
||||||
|
if (mFiles.get(i).getFileType() == 2) {
|
||||||
|
AddFileBean fileBean = mFiles.get(i);
|
||||||
|
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
||||||
|
imgUrls.add(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||||
|
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||||
|
.navigation();
|
||||||
|
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||||
|
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||||
|
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||||
|
.withString("type", addFileBean.getFileType() == 4 ? "audio" : "video")
|
||||||
|
.navigation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doSearchByTitle() {
|
protected void doSearchByTitle() {
|
||||||
|
|
||||||
|
@ -253,6 +253,7 @@ public class WorkReportDetailActivity extends BaseActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预览文件
|
* 预览文件
|
||||||
*/
|
*/
|
||||||
@ -280,10 +281,16 @@ public class WorkReportDetailActivity extends BaseActivity {
|
|||||||
.withStringArrayList(TAG_IMGURL, imgUrls)
|
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||||
.navigation();
|
.navigation();
|
||||||
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||||
//TODO 视频或音频预览
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||||
|
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||||
|
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||||
|
.withString("type", addFileBean.getFileType() == 4 ? "audio" : "video")
|
||||||
|
.navigation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
@ -97,6 +97,7 @@ public class EmailFragment extends BaseFragment {
|
|||||||
.withTransition(R.anim.anim_fade_in, R.anim.anim_fade_out)
|
.withTransition(R.anim.anim_fade_in, R.anim.anim_fade_out)
|
||||||
.navigation(mActivity));
|
.navigation(mActivity));
|
||||||
getInboxList();
|
getInboxList();
|
||||||
|
setTouchDelegate(mIvAdd, 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -69,7 +69,8 @@
|
|||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rlv_files"
|
android:id="@+id/rlv_files"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="10dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
@ -55,7 +55,8 @@
|
|||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rlv_files"
|
android:id="@+id/rlv_files"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="10dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
@ -80,7 +80,8 @@
|
|||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rlv_files"
|
android:id="@+id/rlv_files"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="10dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
@ -179,7 +179,8 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:padding="10dp">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rlv_files"
|
android:id="@+id/rlv_files"
|
||||||
|
Loading…
Reference in New Issue
Block a user