Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
21adc216
Commit
21adc216
authored
Sep 14, 2021
by
chengkun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片拉伸问题
parent
7d8a1be7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
22 deletions
+21
-22
OrderListAdapter.kt
...idian/shenghuoquan/buserorder/adapter/OrderListAdapter.kt
+21
-19
border_recycle_order_item.xml
...erOrder/src/main/res/layout/border_recycle_order_item.xml
+0
-3
No files found.
Components/BUserOrder/src/main/java/com/yidian/shenghuoquan/buserorder/adapter/OrderListAdapter.kt
View file @
21adc216
...
@@ -7,6 +7,7 @@ import android.widget.LinearLayout
...
@@ -7,6 +7,7 @@ import android.widget.LinearLayout
import
android.widget.RelativeLayout
import
android.widget.RelativeLayout
import
android.widget.TextView
import
android.widget.TextView
import
com.bumptech.glide.Glide
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.resource.bitmap.CenterCrop
import
com.bumptech.glide.load.resource.bitmap.RoundedCorners
import
com.bumptech.glide.load.resource.bitmap.RoundedCorners
import
com.bumptech.glide.request.RequestOptions
import
com.bumptech.glide.request.RequestOptions
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.BaseQuickAdapter
...
@@ -18,13 +19,14 @@ import com.yidian.bcommon.utils.CPointUtils
...
@@ -18,13 +19,14 @@ import com.yidian.bcommon.utils.CPointUtils
import
com.yidian.shenghuoquan.buserorder.R
import
com.yidian.shenghuoquan.buserorder.R
import
com.yidian.shenghuoquan.buserorder.app.bean.OrderWebData
import
com.yidian.shenghuoquan.buserorder.app.bean.OrderWebData
import
com.yidian.shenghuoquan.buserorder.utils.Utils
import
com.yidian.shenghuoquan.buserorder.utils.Utils
import
com.yidian.utils.DensityUtil
import
com.yidian.xpage.XPageManager
import
com.yidian.xpage.XPageManager
import
org.json.JSONObject
import
org.json.JSONObject
import
timber.log.Timber
import
timber.log.Timber
class
OrderListAdapter
:
BaseQuickAdapter
<
OrderWebData
,
BaseViewHolder
>(
R
.
layout
.
border_recycle_order_item
){
class
OrderListAdapter
:
BaseQuickAdapter
<
OrderWebData
,
BaseViewHolder
>(
R
.
layout
.
border_recycle_order_item
){
companion
object
{
companion
object
{
const
val
roundRadus
=
40
const
val
roundRadus
:
Float
=
10.0F
}
}
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
OrderWebData
)
{
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
OrderWebData
)
{
...
@@ -49,9 +51,9 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout
...
@@ -49,9 +51,9 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout
holder
.
itemView
.
findViewById
<
LinearLayout
>(
R
.
id
.
ll_order_image2
).
visibility
=
View
.
GONE
holder
.
itemView
.
findViewById
<
LinearLayout
>(
R
.
id
.
ll_order_image2
).
visibility
=
View
.
GONE
holder
.
itemView
.
findViewById
<
LinearLayout
>(
R
.
id
.
ll_order_image3
).
visibility
=
View
.
GONE
holder
.
itemView
.
findViewById
<
LinearLayout
>(
R
.
id
.
ll_order_image3
).
visibility
=
View
.
GONE
if
(
Utils
.
isWebUrl
(
data
.
order_item_list
[
0
].
desc_pic_url
))
{
if
(
Utils
.
isWebUrl
(
data
.
order_item_list
[
0
].
desc_pic_url
))
{
Glide
.
with
(
context
).
load
(
Uri
.
parse
(
data
.
order_item_list
[
0
].
desc_pic_url
)).
apply
(
RequestOptions
.
bitmapTransform
(
RoundedCorners
(
Glide
.
with
(
context
).
load
(
Uri
.
parse
(
data
.
order_item_list
[
0
].
desc_pic_url
)).
apply
(
RequestOptions
().
transform
(
roundRadus
CenterCrop
(),
RoundedCorners
(
))).
into
(
holder
.
itemView
.
findViewById
(
R
.
id
.
round_image1
))
DensityUtil
.
dp2px
(
roundRadus
)
))).
into
(
holder
.
itemView
.
findViewById
(
R
.
id
.
round_image1
))
}
}
}
}
2
->
{
2
->
{
...
@@ -59,12 +61,12 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout
...
@@ -59,12 +61,12 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_goog2_name
).
text
=
data
.
order_item_list
[
1
].
goods_name
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_goog2_name
).
text
=
data
.
order_item_list
[
1
].
goods_name
holder
.
itemView
.
findViewById
<
LinearLayout
>(
R
.
id
.
ll_order_image3
).
visibility
=
View
.
GONE
holder
.
itemView
.
findViewById
<
LinearLayout
>(
R
.
id
.
ll_order_image3
).
visibility
=
View
.
GONE
if
(
Utils
.
isWebUrl
(
data
.
order_item_list
[
0
].
desc_pic_url
)
&&
Utils
.
isWebUrl
(
data
.
order_item_list
[
1
].
desc_pic_url
))
{
if
(
Utils
.
isWebUrl
(
data
.
order_item_list
[
0
].
desc_pic_url
)
&&
Utils
.
isWebUrl
(
data
.
order_item_list
[
1
].
desc_pic_url
))
{
Glide
.
with
(
context
).
load
(
Uri
.
parse
(
data
.
order_item_list
[
0
].
desc_pic_url
)).
apply
(
RequestOptions
.
bitmapTransform
(
RoundedCorners
(
Glide
.
with
(
context
).
load
(
Uri
.
parse
(
data
.
order_item_list
[
0
].
desc_pic_url
)).
apply
(
RequestOptions
().
transform
(
roundRadus
CenterCrop
(),
RoundedCorners
(
))).
into
(
holder
.
itemView
.
findViewById
(
R
.
id
.
round_image1
))
DensityUtil
.
dp2px
(
roundRadus
)
))).
into
(
holder
.
itemView
.
findViewById
(
R
.
id
.
round_image1
))
Glide
.
with
(
context
).
load
(
Uri
.
parse
(
data
.
order_item_list
[
1
].
desc_pic_url
)).
apply
(
RequestOptions
.
bitmapTransform
(
RoundedCorners
(
Glide
.
with
(
context
).
load
(
Uri
.
parse
(
data
.
order_item_list
[
1
].
desc_pic_url
)).
apply
(
RequestOptions
().
transform
(
roundRadus
CenterCrop
(),
RoundedCorners
(
))).
into
(
holder
.
itemView
.
findViewById
(
R
.
id
.
round_image2
))
DensityUtil
.
dp2px
(
roundRadus
)
))).
into
(
holder
.
itemView
.
findViewById
(
R
.
id
.
round_image2
))
}
}
}
}
else
->
{
else
->
{
...
@@ -72,15 +74,15 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout
...
@@ -72,15 +74,15 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_goog2_name
).
text
=
data
.
order_item_list
[
1
].
goods_name
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_goog2_name
).
text
=
data
.
order_item_list
[
1
].
goods_name
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_good3_name
).
text
=
data
.
order_item_list
[
2
].
goods_name
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_good3_name
).
text
=
data
.
order_item_list
[
2
].
goods_name
if
(
Utils
.
isWebUrl
(
data
.
order_item_list
[
0
].
desc_pic_url
)
&&
Utils
.
isWebUrl
(
data
.
order_item_list
[
1
].
desc_pic_url
)
&&
Utils
.
isWebUrl
(
data
.
order_item_list
[
2
].
desc_pic_url
))
{
if
(
Utils
.
isWebUrl
(
data
.
order_item_list
[
0
].
desc_pic_url
)
&&
Utils
.
isWebUrl
(
data
.
order_item_list
[
1
].
desc_pic_url
)
&&
Utils
.
isWebUrl
(
data
.
order_item_list
[
2
].
desc_pic_url
))
{
Glide
.
with
(
context
).
load
(
Uri
.
parse
(
data
.
order_item_list
[
0
].
desc_pic_url
)).
apply
(
RequestOptions
.
bitmapTransform
(
RoundedCorners
(
Glide
.
with
(
context
).
load
(
Uri
.
parse
(
data
.
order_item_list
[
0
].
desc_pic_url
)).
apply
(
RequestOptions
().
transform
(
roundRadus
CenterCrop
(),
RoundedCorners
(
))).
into
(
holder
.
itemView
.
findViewById
(
R
.
id
.
round_image1
))
DensityUtil
.
dp2px
(
roundRadus
)
))).
into
(
holder
.
itemView
.
findViewById
(
R
.
id
.
round_image1
))
Glide
.
with
(
context
).
load
(
Uri
.
parse
(
data
.
order_item_list
[
1
].
desc_pic_url
)).
apply
(
RequestOptions
.
bitmapTransform
(
RoundedCorners
(
Glide
.
with
(
context
).
load
(
Uri
.
parse
(
data
.
order_item_list
[
1
].
desc_pic_url
)).
apply
(
RequestOptions
().
transform
(
roundRadus
CenterCrop
(),
RoundedCorners
(
))).
into
(
holder
.
itemView
.
findViewById
(
R
.
id
.
round_image2
))
DensityUtil
.
dp2px
(
roundRadus
)
))).
into
(
holder
.
itemView
.
findViewById
(
R
.
id
.
round_image2
))
Glide
.
with
(
context
).
load
(
Uri
.
parse
(
data
.
order_item_list
[
2
].
desc_pic_url
)).
apply
(
RequestOptions
.
bitmapTransform
(
RoundedCorners
(
Glide
.
with
(
context
).
load
(
Uri
.
parse
(
data
.
order_item_list
[
2
].
desc_pic_url
)).
apply
(
RequestOptions
().
transform
(
roundRadus
CenterCrop
(),
RoundedCorners
(
))).
into
(
holder
.
itemView
.
findViewById
(
R
.
id
.
round_image3
))
DensityUtil
.
dp2px
(
roundRadus
)
))).
into
(
holder
.
itemView
.
findViewById
(
R
.
id
.
round_image3
))
}
}
}
}
}
}
...
...
Components/BUserOrder/src/main/res/layout/border_recycle_order_item.xml
View file @
21adc216
...
@@ -84,7 +84,6 @@
...
@@ -84,7 +84,6 @@
android:id=
"@+id/round_image1"
android:id=
"@+id/round_image1"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:layout_height=
"@dimen/dp60"
android:scaleType=
"fitXY"
android:src=
"@drawable/icon_default_order_pic"
android:src=
"@drawable/icon_default_order_pic"
app:radius=
"@dimen/dp10"
/>
app:radius=
"@dimen/dp10"
/>
...
@@ -113,7 +112,6 @@
...
@@ -113,7 +112,6 @@
android:id=
"@+id/round_image2"
android:id=
"@+id/round_image2"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:layout_height=
"@dimen/dp60"
android:scaleType=
"fitXY"
android:src=
"@drawable/icon_default_order_pic"
android:src=
"@drawable/icon_default_order_pic"
app:radius=
"@dimen/dp10"
/>
app:radius=
"@dimen/dp10"
/>
...
@@ -142,7 +140,6 @@
...
@@ -142,7 +140,6 @@
android:id=
"@+id/round_image3"
android:id=
"@+id/round_image3"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:layout_height=
"60dp"
android:scaleType=
"fitXY"
android:src=
"@drawable/icon_default_order_pic"
android:src=
"@drawable/icon_default_order_pic"
app:radius=
"@dimen/dp10"
/>
app:radius=
"@dimen/dp10"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment