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) { with(holder.itemView) {
tv_title.text = item.title tv_title.text = item.title
tv_pub_date.text = item.pubDate tv_pub_date.text = item.pubDate
if (item.author.isNullOrBlank()) {
tv_author.text = item.link
} else {
tv_author.text = item.author
}
onClick { onClick {
callBack.readRss(item) callBack.readRss(item)
} }

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