Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
machine
Overview
Overview
Details
Activity
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
hooloo
android
machine
Commits
4c99e9b4
Commit
4c99e9b4
authored
Jul 11, 2022
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、修复推荐字体大小错误问题
parent
9a97481f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
app/src/main/java/com/ihaoin/hooloo/device/adapter/RecommendAdapter.java
+9
-2
app/src/main/res/values-w1080dp/dimens.xml
+2
-0
app/src/main/res/values/dimens.xml
+4
-2
No files found.
app/src/main/java/com/ihaoin/hooloo/device/adapter/RecommendAdapter.java
View file @
4c99e9b4
...
@@ -4,6 +4,7 @@ import android.content.Context;
...
@@ -4,6 +4,7 @@ import android.content.Context;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
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
;
...
@@ -26,8 +27,10 @@ public class RecommendAdapter extends BaseQuickAdapter<ScrollBean, BaseViewHolde
...
@@ -26,8 +27,10 @@ public class RecommendAdapter extends BaseQuickAdapter<ScrollBean, BaseViewHolde
protected
void
convert
(
BaseViewHolder
helper
,
ScrollBean
item
)
{
protected
void
convert
(
BaseViewHolder
helper
,
ScrollBean
item
)
{
ScrollBean
.
ScrollItemBean
t
=
item
.
t
;
ScrollBean
.
ScrollItemBean
t
=
item
.
t
;
Recommend
recommend
=
(
Recommend
)
t
.
getObject
();
Recommend
recommend
=
(
Recommend
)
t
.
getObject
();
helper
.
setText
(
R
.
id
.
txt_name
,
recommend
.
getTitle
());
TextView
txtName
=
helper
.
getView
(
R
.
id
.
txt_name
);
helper
.
setText
(
R
.
id
.
txt_intro
,
recommend
.
getDesc
());
TextView
txtDesc
=
helper
.
getView
(
R
.
id
.
txt_intro
);
txtName
.
setText
(
recommend
.
getTitle
());
txtDesc
.
setText
(
recommend
.
getDesc
());
ImageView
imgRecommend
=
helper
.
getView
(
R
.
id
.
img_recommend
);
ImageView
imgRecommend
=
helper
.
getView
(
R
.
id
.
img_recommend
);
// RoundedCorners roundedCorners = new RoundedCorners(5);
// RoundedCorners roundedCorners = new RoundedCorners(5);
...
@@ -49,8 +52,12 @@ public class RecommendAdapter extends BaseQuickAdapter<ScrollBean, BaseViewHolde
...
@@ -49,8 +52,12 @@ public class RecommendAdapter extends BaseQuickAdapter<ScrollBean, BaseViewHolde
ViewGroup
.
LayoutParams
lp
=
imgRecommend
.
getLayoutParams
();
ViewGroup
.
LayoutParams
lp
=
imgRecommend
.
getLayoutParams
();
if
(
recommend
.
getIndex
()
==
0
)
{
if
(
recommend
.
getIndex
()
==
0
)
{
lp
.
height
=
Utils
.
getDimens
(
mContext
,
R
.
dimen
.
recommend_image_height_0
);
lp
.
height
=
Utils
.
getDimens
(
mContext
,
R
.
dimen
.
recommend_image_height_0
);
txtName
.
setTextSize
(
Utils
.
getDimens
(
mContext
,
R
.
dimen
.
ts_recommend_name
));
txtDesc
.
setTextSize
(
Utils
.
getDimens
(
mContext
,
R
.
dimen
.
ts_recommend_desc
));
}
else
{
}
else
{
lp
.
height
=
Utils
.
getDimens
(
mContext
,
R
.
dimen
.
recommend_image_height_other
);
lp
.
height
=
Utils
.
getDimens
(
mContext
,
R
.
dimen
.
recommend_image_height_other
);
txtName
.
setTextSize
(
Utils
.
getDimens
(
mContext
,
R
.
dimen
.
ts_recommend_name_small
));
txtDesc
.
setTextSize
(
Utils
.
getDimens
(
mContext
,
R
.
dimen
.
ts_recommend_desc_small
));
}
}
imgRecommend
.
setLayoutParams
(
lp
);
imgRecommend
.
setLayoutParams
(
lp
);
}
}
...
...
app/src/main/res/values-w1080dp/dimens.xml
View file @
4c99e9b4
...
@@ -134,6 +134,8 @@
...
@@ -134,6 +134,8 @@
<dimen
name=
"ts_trolley_item_discount"
>
22px
</dimen>
<dimen
name=
"ts_trolley_item_discount"
>
22px
</dimen>
<dimen
name=
"ts_recommend_name"
>
60px
</dimen>
<dimen
name=
"ts_recommend_name"
>
60px
</dimen>
<dimen
name=
"ts_recommend_desc"
>
36px
</dimen>
<dimen
name=
"ts_recommend_desc"
>
36px
</dimen>
<dimen
name=
"ts_recommend_name_small"
>
36px
</dimen>
<dimen
name=
"ts_recommend_desc_small"
>
21px
</dimen>
<dimen
name=
"ts_category_radio"
>
28px
</dimen>
<dimen
name=
"ts_category_radio"
>
28px
</dimen>
<dimen
name=
"ts_category_item"
>
40px
</dimen>
<dimen
name=
"ts_category_item"
>
40px
</dimen>
<dimen
name=
"ts_goods_item_name"
>
28px
</dimen>
<dimen
name=
"ts_goods_item_name"
>
28px
</dimen>
...
...
app/src/main/res/values/dimens.xml
View file @
4c99e9b4
...
@@ -132,8 +132,10 @@
...
@@ -132,8 +132,10 @@
<dimen
name=
"ts_toast"
>
28px
</dimen>
<dimen
name=
"ts_toast"
>
28px
</dimen>
<dimen
name=
"ts_trolley_item_price"
>
20px
</dimen>
<dimen
name=
"ts_trolley_item_price"
>
20px
</dimen>
<dimen
name=
"ts_trolley_item_discount"
>
22px
</dimen>
<dimen
name=
"ts_trolley_item_discount"
>
22px
</dimen>
<dimen
name=
"ts_recommend_name"
>
20sp
</dimen>
<dimen
name=
"ts_recommend_name"
>
16sp
</dimen>
<dimen
name=
"ts_recommend_desc"
>
20sp
</dimen>
<dimen
name=
"ts_recommend_desc"
>
12sp
</dimen>
<dimen
name=
"ts_recommend_name_small"
>
12sp
</dimen>
<dimen
name=
"ts_recommend_desc_small"
>
6sp
</dimen>
<dimen
name=
"ts_category_radio"
>
12sp
</dimen>
<dimen
name=
"ts_category_radio"
>
12sp
</dimen>
<dimen
name=
"ts_category_item"
>
18sp
</dimen>
<dimen
name=
"ts_category_item"
>
18sp
</dimen>
<dimen
name=
"ts_goods_item_name"
>
14sp
</dimen>
<dimen
name=
"ts_goods_item_name"
>
14sp
</dimen>
...
...
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