edit ReadRecordActivity.kt item_read_record.xml

pull/840/head
gedoor 4 years ago
parent 1c973afa16
commit 41942086e4
  1. 4
      app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt
  2. 30
      app/src/main/res/layout/item_read_record.xml

@ -59,7 +59,7 @@ class ReadRecordActivity : BaseActivity<ActivityReadRecordBinding>() {
readRecord.tvBookName.setText(R.string.all_read_time) readRecord.tvBookName.setText(R.string.all_read_time)
adapter = RecordAdapter(this@ReadRecordActivity) adapter = RecordAdapter(this@ReadRecordActivity)
recyclerView.adapter = adapter recyclerView.adapter = adapter
readRecord.ivRemove.onClick { readRecord.tvRemove.onClick {
alert(R.string.delete, R.string.sure_del) { alert(R.string.delete, R.string.sure_del) {
okButton { okButton {
App.db.readRecordDao.clear() App.db.readRecordDao.clear()
@ -112,7 +112,7 @@ class ReadRecordActivity : BaseActivity<ActivityReadRecordBinding>() {
override fun registerListener(holder: ItemViewHolder, binding: ItemReadRecordBinding) { override fun registerListener(holder: ItemViewHolder, binding: ItemReadRecordBinding) {
binding.apply { binding.apply {
ivRemove.onClick { tvRemove.onClick {
getItem(holder.layoutPosition)?.let { item -> getItem(holder.layoutPosition)?.let { item ->
sureDelAlert(item) sureDelAlert(item)
} }

@ -1,21 +1,22 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="10dp" android:paddingLeft="10dp"
android:paddingRight="10dp" android:paddingRight="10dp">
android:orientation="horizontal"
android:gravity="center_vertical">
<TextView <TextView
android:id="@+id/tv_book_name" android:id="@+id/tv_book_name"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="6dp" android:padding="6dp"
android:maxLength="10" android:maxLength="10"
android:textIsSelectable="true" android:textIsSelectable="true"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toLeftOf="@+id/tv_remove"
tools:ignore="RtlHardcoded" /> tools:ignore="RtlHardcoded" />
<TextView <TextView
@ -23,14 +24,19 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:padding="6dp" /> android:padding="6dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_book_name"
app:layout_constraintRight_toLeftOf="@+id/tv_remove" />
<ImageView <TextView
android:id="@+id/iv_remove" android:id="@+id/tv_remove"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/ic_remove" android:padding="6dp"
android:contentDescription="@string/delete" android:text="@string/clear"
app:tint="@color/primaryText" /> app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_book_name"
app:layout_constraintBottom_toBottomOf="@+id/tv_read_time" />
</LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>
Loading…
Cancel
Save