pull/35/head^2
kunfei 5 years ago
parent 0b0244d726
commit f3b2e296e7
  1. 5
      app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter.kt
  2. 74
      app/src/main/res/layout/item_rss_article.xml

@ -16,11 +16,6 @@ class RssArticlesAdapter(context: Context, val callBack: CallBack) :
with(holder.itemView) {
tv_title.text = item.title
tv_pub_date.text = item.pubDate
if (item.author.isNullOrBlank()) {
tv_author.text = item.link
} else {
tv_author.text = item.author
}
onClick {
callBack.readRss(item)
}

@ -1,45 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="2dp"
app:cardElevation="8dp">
android:layout_height="100dp"
android:padding="16dp">
<LinearLayout
android:layout_margin="8dp"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_title"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="@string/app_name"
android:textSize="16sp"
android:textStyle="bold"
android:layout_marginBottom="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/tv_pub_date"
app:layout_constraintRight_toLeftOf="@+id/image_view" />
<TextView
android:id="@+id/tv_title"
android:textSize="18sp"
android:text="Title"
android:layout_gravity="center"
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tv_pub_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="8dp"
android:text="@string/app_name"
android:textSize="12sp"
android:textStyle="italic"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@+id/image_view" />
<TextView
android:id="@+id/tv_pub_date"
android:textSize="12sp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:text="2019-10-01 13:48:00"
android:layout_gravity="center"
android:textStyle="italic"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/image_view"
android:layout_width="68dp"
android:layout_height="68dp"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:contentDescription="@string/img_cover" />
<TextView
android:id="@+id/tv_author"
android:textSize="16sp"
android:text="author"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
Loading…
Cancel
Save