Skip to content
项目
Groups
代码片段
帮助
正在加载...
Sign in / Register
Toggle navigation
W
workoffice
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图表
统计图
Create a new issue
作业
提交
议题看板
Open sidebar
冷广德
workoffice
Commits
fc72997b
提交
fc72997b
authored
4月 29, 2020
作者:
lgd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.日志图片展示
2.//TODO erp用户是否选择新部门为空,质检接口数据无对应问题,内部交易订单审核,审核规则,领用申请列表/退件列表/参数,坩埚下单,mes,刷新token,编辑任务担当无法修改
上级
9afa8b48
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
317 行增加
和
85 行删除
+317
-85
ImageBean.java
...c/main/java/com/wd/workoffice/bean/mesBean/ImageBean.java
+72
-0
LogBean.java
...src/main/java/com/wd/workoffice/bean/mesBean/LogBean.java
+3
-68
MesApiService.java
...c/main/java/com/wd/workoffice/retrofit/MesApiService.java
+13
-0
MesTicketAddLogActivity.java
...ffice/ui/activity/mes/ticket/MesTicketAddLogActivity.java
+123
-4
MesTicketDetailReviewActivity.java
...ui/activity/mes/ticket/MesTicketDetailReviewActivity.java
+3
-6
ImgAdapter.java
...rc/main/java/com/wd/workoffice/ui/adapter/ImgAdapter.java
+9
-3
MesTicketLogAdapter.java
...ava/com/wd/workoffice/ui/adapter/MesTicketLogAdapter.java
+2
-1
GlideUtils.java
app/src/main/java/com/wd/workoffice/util/GlideUtils.java
+69
-0
activity_mes_ticket_log_add.xml
app/src/main/res/layout/activity_mes_ticket_log_add.xml
+23
-3
img_add.png
app/src/main/res/mipmap-xhdpi/img_add.png
+0
-0
没有找到文件。
app/src/main/java/com/wd/workoffice/bean/mesBean/ImageBean.java
0 → 100644
浏览文件 @
fc72997b
package
com
.
wd
.
workoffice
.
bean
.
mesBean
;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
ImageBean
{
/**
* id : 9f1faeae878111ea8334fa163e1166bd
* name : 1.png
* path : group1/M00/00/0A/wKgAwV6lIMiATCNxAABBiqJSaT8612.png
* type : png
* size : 16778
* url : http://114.116.55.221/group1/M00/00/0A/wKgAwV6lIMiATCNxAABBiqJSaT8612.png
*/
private
String
id
;
private
String
name
;
private
String
path
;
private
String
type
;
private
int
size
;
private
String
url
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getPath
()
{
return
path
;
}
public
void
setPath
(
String
path
)
{
this
.
path
=
path
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
int
getSize
()
{
return
size
;
}
public
void
setSize
(
int
size
)
{
this
.
size
=
size
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
}
app/src/main/java/com/wd/workoffice/bean/mesBean/LogBean.java
浏览文件 @
fc72997b
...
@@ -54,7 +54,7 @@ public class LogBean {
...
@@ -54,7 +54,7 @@ public class LogBean {
private
Object
approvalStatus
;
private
Object
approvalStatus
;
private
Object
remark
;
private
Object
remark
;
private
Object
delete
;
private
Object
delete
;
private
List
<
Attachments
Bean
>
attachments
;
private
List
<
Image
Bean
>
attachments
;
public
String
getId
()
{
public
String
getId
()
{
return
id
;
return
id
;
...
@@ -216,77 +216,12 @@ public class LogBean {
...
@@ -216,77 +216,12 @@ public class LogBean {
this
.
delete
=
delete
;
this
.
delete
=
delete
;
}
}
public
List
<
Attachments
Bean
>
getAttachments
()
{
public
List
<
Image
Bean
>
getAttachments
()
{
return
attachments
;
return
attachments
;
}
}
public
void
setAttachments
(
List
<
Attachments
Bean
>
attachments
)
{
public
void
setAttachments
(
List
<
Image
Bean
>
attachments
)
{
this
.
attachments
=
attachments
;
this
.
attachments
=
attachments
;
}
}
public
static
class
AttachmentsBean
{
/**
* id : 9f1faeae878111ea8334fa163e1166bd
* name : 1.png
* path : group1/M00/00/0A/wKgAwV6lIMiATCNxAABBiqJSaT8612.png
* type : png
* size : 16778
* url : http://114.116.55.221/group1/M00/00/0A/wKgAwV6lIMiATCNxAABBiqJSaT8612.png
*/
private
String
id
;
private
String
name
;
private
String
path
;
private
String
type
;
private
int
size
;
private
String
url
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getPath
()
{
return
path
;
}
public
void
setPath
(
String
path
)
{
this
.
path
=
path
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
int
getSize
()
{
return
size
;
}
public
void
setSize
(
int
size
)
{
this
.
size
=
size
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
}
}
}
app/src/main/java/com/wd/workoffice/retrofit/MesApiService.java
浏览文件 @
fc72997b
...
@@ -6,10 +6,13 @@ import com.wd.workoffice.app.BaseMesBean;
...
@@ -6,10 +6,13 @@ import com.wd.workoffice.app.BaseMesBean;
import
com.wd.workoffice.app.Config
;
import
com.wd.workoffice.app.Config
;
import
io.reactivex.Observable
;
import
io.reactivex.Observable
;
import
okhttp3.MultipartBody
;
import
okhttp3.RequestBody
;
import
okhttp3.RequestBody
;
import
retrofit2.http.Body
;
import
retrofit2.http.Body
;
import
retrofit2.http.GET
;
import
retrofit2.http.GET
;
import
retrofit2.http.Multipart
;
import
retrofit2.http.POST
;
import
retrofit2.http.POST
;
import
retrofit2.http.Part
;
import
retrofit2.http.Path
;
import
retrofit2.http.Path
;
import
retrofit2.http.Query
;
import
retrofit2.http.Query
;
...
@@ -136,4 +139,14 @@ public interface MesApiService {
...
@@ -136,4 +139,14 @@ public interface MesApiService {
*/
*/
@POST
(
"/himes/api/user/noClear/show/page.json"
)
@POST
(
"/himes/api/user/noClear/show/page.json"
)
Observable
<
BaseMesBean
>
takeOnList
(
@Query
(
"functionId"
)
String
functionId
,
@Body
RequestBody
requestBody
);
Observable
<
BaseMesBean
>
takeOnList
(
@Query
(
"functionId"
)
String
functionId
,
@Body
RequestBody
requestBody
);
/**
* 产品
*
* @return
*/
@Multipart
@POST
(
"/file/uploadFile"
)
Observable
<
BaseMesBean
>
upload
(
@Part
MultipartBody
.
Part
file
);
}
}
app/src/main/java/com/wd/workoffice/ui/activity/mes/ticket/MesTicketAddLogActivity.java
浏览文件 @
fc72997b
package
com
.
wd
.
workoffice
.
ui
.
activity
.
mes
.
ticket
;
package
com
.
wd
.
workoffice
.
ui
.
activity
.
mes
.
ticket
;
import
android.Manifest
;
import
android.content.Intent
;
import
android.content.pm.ActivityInfo
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.view.Menu
;
import
android.view.Menu
;
import
android.view.MenuItem
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.EditText
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.bumptech.glide.load.model.GlideUrl
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.BaseBean
;
import
com.wd.workoffice.app.BaseMesBean
;
import
com.wd.workoffice.app.BaseMesBean
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.bean.AccountBean
;
import
com.wd.workoffice.bean.mesBean.LogBean
;
import
com.wd.workoffice.bean.mesBean.TicketBean
;
import
com.wd.workoffice.bean.mesBean.TicketBean
;
import
com.wd.workoffice.retrofit.ApiService
;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.retrofit.WorkObserver
;
import
com.wd.workoffice.retrofit.WorkObserver
;
import
com.wd.workoffice.ui.activity.bat.store.StoreSaleConfirmActivity
;
import
com.wd.workoffice.util.Glide4Engine
;
import
com.wd.workoffice.util.WorkUtils
;
import
com.wd.workoffice.util.WorkUtils
;
import
com.zhihu.matisse.Matisse
;
import
com.zhihu.matisse.MimeType
;
import
com.zhihu.matisse.internal.entity.CaptureStrategy
;
import
java.
util.Arrays
;
import
java.
io.File
;
import
java.util.Map
;
import
java.util.Map
;
import
androidx.annotation.Nullable
;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
import
flexible.xd.android_base.network.rtfhttp.RtfHelper
;
import
flexible.xd.android_base.network.rtfhttp.Transformer
;
import
flexible.xd.android_base.network.rtfhttp.Transformer
;
import
io.reactivex.disposables.Disposable
;
import
io.reactivex.disposables.Disposable
;
import
okhttp3.MediaType
;
import
okhttp3.MultipartBody
;
import
okhttp3.RequestBody
;
/**
/**
* 工单新增
* 工单新增
...
@@ -44,6 +63,12 @@ public class MesTicketAddLogActivity extends WorkToolBarActivity {
...
@@ -44,6 +63,12 @@ public class MesTicketAddLogActivity extends WorkToolBarActivity {
EditText
etQuestionDesc
;
EditText
etQuestionDesc
;
@BindView
(
R
.
id
.
et_client
)
@BindView
(
R
.
id
.
et_client
)
EditText
etClient
;
EditText
etClient
;
@BindView
(
R
.
id
.
iv_img1
)
ImageView
ivImg1
;
@BindView
(
R
.
id
.
iv_img2
)
ImageView
ivImg2
;
@BindView
(
R
.
id
.
iv_img3
)
ImageView
ivImg3
;
private
Map
<
String
,
Object
>
param
;
private
Map
<
String
,
Object
>
param
;
private
TicketBean
.
ListBean
data
;
private
TicketBean
.
ListBean
data
;
...
@@ -120,4 +145,98 @@ public class MesTicketAddLogActivity extends WorkToolBarActivity {
...
@@ -120,4 +145,98 @@ public class MesTicketAddLogActivity extends WorkToolBarActivity {
}
}
return
super
.
onOptionsItemSelected
(
item
);
return
super
.
onOptionsItemSelected
(
item
);
}
}
@OnClick
({
R
.
id
.
iv_img1
,
R
.
id
.
iv_img2
,
R
.
id
.
iv_img3
})
public
void
onViewClicked
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
iv_img1
:
break
;
case
R
.
id
.
iv_img2
:
break
;
case
R
.
id
.
iv_img3
:
break
;
}
}
private
void
addImg
(
int
position
)
{
RxPermissions
rxPermissions
=
new
RxPermissions
(
this
);
rxPermissions
.
request
(
Manifest
.
permission
.
CAMERA
,
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
.
subscribe
(
granted
->
{
if
(
granted
)
{
// All requested permissions are granted
Matisse
.
from
(
MesTicketAddLogActivity
.
this
)
.
choose
(
MimeType
.
ofImage
())
.
countable
(
true
)
.
maxSelectable
(
1
).
capture
(
true
).
captureStrategy
(
new
CaptureStrategy
(
true
,
"com.wd.workoffice.fileprovider"
))
// .addFilter(new GifSizeFilter(320, 320, 5 * Filter.K * Filter.K))
// .gridExpectedSize(getResources().getDimensionPixelSize(R.dimen.grid_expected_size))
.
restrictOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_UNSPECIFIED
)
.
thumbnailScale
(
0.85f
)
.
imageEngine
(
new
Glide4Engine
())
.
forResult
(
10000
+
position
);
}
else
{
// At least one permission is denied
toast
(
"您需要开启拍照、存储权限!"
);
}
});
}
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
@Nullable
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
resultCode
==
RESULT_OK
)
{
switch
(
requestCode
)
{
case
10001
:
if
(
Matisse
.
obtainResult
(
data
).
size
()
!=
0
)
{
upload
(
1
,
Matisse
.
obtainResult
(
data
).
get
(
0
));
}
break
;
case
10002
:
if
(
Matisse
.
obtainResult
(
data
).
size
()
!=
0
)
{
upload
(
2
,
Matisse
.
obtainResult
(
data
).
get
(
0
));
}
break
;
case
10003
:
if
(
Matisse
.
obtainResult
(
data
).
size
()
!=
0
)
{
upload
(
3
,
Matisse
.
obtainResult
(
data
).
get
(
0
));
}
break
;
}
}
}
private
void
upload
(
int
position
,
Uri
data
)
{
showLoading
();
File
file
=
WorkUtils
.
uriToFile
(
data
,
this
);
RequestBody
requestFile
=
RequestBody
.
create
(
MediaType
.
parse
(
"image/png"
),
file
);
RtfUtils
.
getMesRtf
().
upload
(
MultipartBody
.
Part
.
createFormData
(
"file"
,
file
.
getName
(),
requestFile
)).
compose
(
Transformer
.
schedule
()).
subscribe
(
new
WorkObserver
<
BaseMesBean
>()
{
@Override
public
void
doOnSubscribe
(
Disposable
d
)
{
}
@Override
public
void
onFail
(
String
errorMsg
)
{
hideLoading
();
toast
(
errorMsg
);
}
@Override
public
void
onSuccess
(
BaseMesBean
data
)
{
hideLoading
();
if
(
data
.
isSuccess
())
{
toast
(
data
.
getMessage
());
return
;
}
toast
(
"上传成功"
);
}
});
}
}
}
app/src/main/java/com/wd/workoffice/ui/activity/mes/ticket/MesTicketDetailReviewActivity.java
浏览文件 @
fc72997b
package
com
.
wd
.
workoffice
.
ui
.
activity
.
mes
.
ticket
;
package
com
.
wd
.
workoffice
.
ui
.
activity
.
mes
.
ticket
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.EditText
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.BaseMesBean
;
import
com.wd.workoffice.app.BaseMesBean
;
...
@@ -125,14 +123,13 @@ public class MesTicketDetailReviewActivity extends WorkToolBarActivity {
...
@@ -125,14 +123,13 @@ public class MesTicketDetailReviewActivity extends WorkToolBarActivity {
imgAdapter
=
new
ImgAdapter
(
R
.
layout
.
item_mes_ticket_img
,
imgList
);
imgAdapter
=
new
ImgAdapter
(
R
.
layout
.
item_mes_ticket_img
,
imgList
);
imgAdapter
.
bindToRecyclerView
(
rvData
);
imgAdapter
.
bindToRecyclerView
(
rvData
);
starAdapter
=
WorkUtils
.
starView
(
rvStar
,
this
);
starAdapter
=
WorkUtils
.
starView
(
rvStar
,
this
);
imgList
.
add
(
null
);
//
imgList.add(null);
imgList
.
add
(
null
);
//
imgList.add(null);
imgList
.
add
(
null
);
//
imgList.add(null);
imgAdapter
.
notifyDataSetChanged
();
imgAdapter
.
notifyDataSetChanged
();
getData
();
getData
();
}
}
@Override
@Override
protected
void
initEvent
()
{
protected
void
initEvent
()
{
}
}
...
...
app/src/main/java/com/wd/workoffice/ui/adapter/ImgAdapter.java
浏览文件 @
fc72997b
package
com
.
wd
.
workoffice
.
ui
.
adapter
;
package
com
.
wd
.
workoffice
.
ui
.
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.wd.workoffice.R
;
import
com.wd.workoffice.bean.mesBean.ImageBean
;
import
com.wd.workoffice.util.GlideUtils
;
import
java.util.List
;
import
java.util.List
;
...
@@ -10,7 +15,7 @@ import java.util.List;
...
@@ -10,7 +15,7 @@ import java.util.List;
* Created by flexible on 2018/8/13.
* Created by flexible on 2018/8/13.
*/
*/
public
class
ImgAdapter
extends
BaseQuickAdapter
<
Object
,
BaseViewHolder
>
{
public
class
ImgAdapter
extends
BaseQuickAdapter
<
ImageBean
,
BaseViewHolder
>
{
public
ImgAdapter
(
int
layoutResId
,
List
data
)
{
public
ImgAdapter
(
int
layoutResId
,
List
data
)
{
super
(
layoutResId
,
data
);
super
(
layoutResId
,
data
);
...
@@ -18,8 +23,9 @@ public class ImgAdapter extends BaseQuickAdapter<Object, BaseViewHolder> {
...
@@ -18,8 +23,9 @@ public class ImgAdapter extends BaseQuickAdapter<Object, BaseViewHolder> {
@Override
@Override
protected
void
convert
(
BaseViewHolder
helper
,
Object
item
)
{
protected
void
convert
(
BaseViewHolder
helper
,
ImageBean
item
)
{
ImageView
ivImg
=
helper
.
getView
(
R
.
id
.
iv_img
);
GlideUtils
.
getRequest
().
load
(
item
.
getUrl
()).
into
(
ivImg
);
}
}
}
}
app/src/main/java/com/wd/workoffice/ui/adapter/MesTicketLogAdapter.java
浏览文件 @
fc72997b
...
@@ -7,6 +7,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
...
@@ -7,6 +7,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.bean.ProPriceBean
;
import
com.wd.workoffice.bean.ProPriceBean
;
import
com.wd.workoffice.bean.mesBean.ImageBean
;
import
com.wd.workoffice.bean.mesBean.LogBean
;
import
com.wd.workoffice.bean.mesBean.LogBean
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -31,7 +32,7 @@ public class MesTicketLogAdapter extends BaseQuickAdapter<LogBean, BaseViewHolde
...
@@ -31,7 +32,7 @@ public class MesTicketLogAdapter extends BaseQuickAdapter<LogBean, BaseViewHolde
RecyclerView
rvImg
=
helper
.
getView
(
R
.
id
.
rv_img
);
RecyclerView
rvImg
=
helper
.
getView
(
R
.
id
.
rv_img
);
rvImg
.
setLayoutManager
(
new
LinearLayoutManager
(
helper
.
getConvertView
().
getContext
(),
RecyclerView
.
HORIZONTAL
rvImg
.
setLayoutManager
(
new
LinearLayoutManager
(
helper
.
getConvertView
().
getContext
(),
RecyclerView
.
HORIZONTAL
,
false
));
,
false
));
List
imgList
=
item
.
getAttachments
();
List
<
ImageBean
>
imgList
=
item
.
getAttachments
();
ImgAdapter
imgAdapter
=
new
ImgAdapter
(
R
.
layout
.
item_mes_ticket_img
,
imgList
);
ImgAdapter
imgAdapter
=
new
ImgAdapter
(
R
.
layout
.
item_mes_ticket_img
,
imgList
);
imgAdapter
.
bindToRecyclerView
(
rvImg
);
imgAdapter
.
bindToRecyclerView
(
rvImg
);
helper
.
setText
(
R
.
id
.
tv_time
,
item
.
getLogDateTime
());
helper
.
setText
(
R
.
id
.
tv_time
,
item
.
getLogDateTime
());
...
...
app/src/main/java/com/wd/workoffice/util/GlideUtils.java
0 → 100644
浏览文件 @
fc72997b
package
com
.
wd
.
workoffice
.
util
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.media.MediaMetadataRetriever
;
import
android.widget.ImageView
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.load.engine.DiskCacheStrategy
;
import
com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool
;
import
com.bumptech.glide.load.resource.bitmap.BitmapTransformation
;
import
com.bumptech.glide.request.RequestOptions
;
import
com.wd.workoffice.app.WorkApp
;
import
java.security.MessageDigest
;
import
androidx.annotation.NonNull
;
import
static
com
.
bumptech
.
glide
.
load
.
resource
.
bitmap
.
VideoDecoder
.
FRAME_OPTION
;
public
class
GlideUtils
{
public
static
GlideRequests
getRequest
()
{
return
GlideApp
.
with
(
WorkApp
.
getApp
());
}
public
static
void
circleImg
(
ImageView
iv
,
String
url
)
{
RequestOptions
mRequestOptions
=
RequestOptions
.
circleCropTransform
()
.
diskCacheStrategy
(
DiskCacheStrategy
.
NONE
)
//不做磁盘缓存
.
skipMemoryCache
(
true
);
//不做内存缓存
GlideApp
.
with
(
WorkApp
.
getApp
()).
load
(
url
)
// .error(R.mipmap.info_head)
.
circleCrop
().
into
(
iv
);
}
// public static void videoShow(Context context, ImageView imageView, String url) {
// imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
// Glide.with(context).setDefaultRequestOptions(new RequestOptions()
// .frame(1000)//单位微秒
// .centerCrop()
// .error(R.mipmap.img_default)
// .placeholder(R.mipmap.img_default))
// .load(url)
// .into(imageView);
// }
public
static
void
videoShow
(
final
Context
context
,
ImageView
imageView
,
String
uri
)
{
RequestOptions
requestOptions
=
RequestOptions
.
frameOf
(
2000
);
requestOptions
.
set
(
FRAME_OPTION
,
MediaMetadataRetriever
.
OPTION_CLOSEST
);
requestOptions
.
transform
(
new
BitmapTransformation
()
{
@Override
protected
Bitmap
transform
(
@NonNull
BitmapPool
pool
,
@NonNull
Bitmap
toTransform
,
int
outWidth
,
int
outHeight
)
{
return
toTransform
;
}
@Override
public
void
updateDiskCacheKey
(
MessageDigest
messageDigest
)
{
try
{
messageDigest
.
update
((
context
.
getPackageName
()
+
"RotateTransform"
).
getBytes
(
"utf-8"
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
});
Glide
.
with
(
context
).
load
(
uri
).
apply
(
requestOptions
).
into
(
imageView
);
}
}
app/src/main/res/layout/activity_mes_ticket_log_add.xml
浏览文件 @
fc72997b
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:background=
"@color/white"
android:paddingHorizontal=
"10mm"
android:paddingVertical=
"8mm"
>
android:paddingVertical=
"8mm"
>
<LinearLayout
<LinearLayout
...
@@ -163,8 +162,29 @@
...
@@ -163,8 +162,29 @@
android:text=
"上传现场照片/视频"
android:text=
"上传现场照片/视频"
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
/>
<
androidx.recyclerview.widget.RecyclerView
<
LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
android:paddingHorizontal=
"20mm"
>
<ImageView
android:id=
"@+id/iv_img1"
android:layout_width=
"100mm"
android:layout_height=
"100mm"
android:src=
"@mipmap/img_add"
/>
<ImageView
android:id=
"@+id/iv_img2"
android:layout_width=
"100mm"
android:layout_height=
"100mm"
android:layout_marginHorizontal=
"15mm"
android:src=
"@mipmap/img_add"
/>
<ImageView
android:id=
"@+id/iv_img3"
android:layout_width=
"100mm"
android:layout_height=
"100mm"
android:src=
"@mipmap/img_add"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.core.widget.NestedScrollView>
app/src/main/res/mipmap-xhdpi/img_add.png
0 → 100644
浏览文件 @
fc72997b
1.2 KB
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论