Commit 4c99e9b4 by wjg

1、修复推荐字体大小错误问题

parent 9a97481f
......@@ -4,6 +4,7 @@ import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
......@@ -26,8 +27,10 @@ public class RecommendAdapter extends BaseQuickAdapter<ScrollBean, BaseViewHolde
protected void convert(BaseViewHolder helper, ScrollBean item) {
ScrollBean.ScrollItemBean t = item.t;
Recommend recommend = (Recommend) t.getObject();
helper.setText(R.id.txt_name, recommend.getTitle());
helper.setText(R.id.txt_intro, recommend.getDesc());
TextView txtName = helper.getView(R.id.txt_name);
TextView txtDesc = helper.getView(R.id.txt_intro);
txtName.setText(recommend.getTitle());
txtDesc.setText(recommend.getDesc());
ImageView imgRecommend = helper.getView(R.id.img_recommend);
// RoundedCorners roundedCorners = new RoundedCorners(5);
......@@ -49,8 +52,12 @@ public class RecommendAdapter extends BaseQuickAdapter<ScrollBean, BaseViewHolde
ViewGroup.LayoutParams lp = imgRecommend.getLayoutParams();
if (recommend.getIndex() == 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 {
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);
}
......
......@@ -134,6 +134,8 @@
<dimen name="ts_trolley_item_discount">22px</dimen>
<dimen name="ts_recommend_name">60px</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_item">40px</dimen>
<dimen name="ts_goods_item_name">28px</dimen>
......
......@@ -132,8 +132,10 @@
<dimen name="ts_toast">28px</dimen>
<dimen name="ts_trolley_item_price">20px</dimen>
<dimen name="ts_trolley_item_discount">22px</dimen>
<dimen name="ts_recommend_name">20sp</dimen>
<dimen name="ts_recommend_desc">20sp</dimen>
<dimen name="ts_recommend_name">16sp</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_item">18sp</dimen>
<dimen name="ts_goods_item_name">14sp</dimen>
......
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