Commit bc14ee9f by 段启岩

博客列表优化

parent d8ffc637
......@@ -53,7 +53,7 @@ public class BlogListAdapter extends BaseQuickAdapter<Blog , BlogListAdapter.Blo
BlogItemBinding binding = helper.binding;
binding.txtTitle.setText(blog.getBlogTitle());
binding.txtAbstract.setText(blog.getBlogAbstract());
if (null != blog.getCover() && !TextUtils.isEmpty(blog.getCover())) {
if (null != blog.getCover() && !TextUtils.isEmpty(blog.getCover().trim())) {
RequestOptions options = new RequestOptions()
.centerCrop()
.placeholder(R.drawable.pic1) //预加载图片
......@@ -62,6 +62,8 @@ public class BlogListAdapter extends BaseQuickAdapter<Blog , BlogListAdapter.Blo
.diskCacheStrategy(DiskCacheStrategy.NONE) //缓存
.transform(new GlideRoundTransform(3)); //圆角
Glide.with(helper.binding.getRoot().getContext()).load(blog.getCover()).apply(options).into(binding.blogCover);
} else {
binding.blogCover.setVisibility(View.GONE);
}
}
}
\ No newline at end of file
......@@ -16,7 +16,7 @@
android:layout_width="wrap_content"
android:layout_height="22dp"
android:text="SpringBoot迭代发布JRA瘦身配置"
android:textSize="15sp"
android:textSize="16sp"
android:textColor="@color/colorTextAccent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......@@ -34,8 +34,9 @@
android:id="@+id/txt_abstract"
android:layout_marginTop="10dp"
android:layout_width="0dp"
android:layout_height="55dp"
android:textSize="13sp"
android:layout_height="wrap_content"
android:maxHeight="55dp"
android:textSize="12sp"
android:text="我们所处的时代我们所处的时代我们所处的时代我们所处的时代我们所处的时代我们所处的时代我们所处的时代我们所处的时代"
app:layout_constraintTop_toBottomOf="@id/barrier_title"
app:layout_constraintStart_toStartOf="parent"
......@@ -57,7 +58,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="txt_abstract"
app:constraint_referenced_ids="txt_abstract,blog_cover"
tools:layout_editor_absoluteX="12dp"
tools:layout_editor_absoluteY="16dp" />
......
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