feat: 优化代码

pull/164/head
kunfei 5 years ago
parent 3329c162e0
commit a4d488d9c7
  1. 6
      app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt
  2. 6
      app/src/main/res/layout/item_find_book.xml

@ -12,6 +12,7 @@ import io.legado.app.data.entities.BookSource
import io.legado.app.help.coroutine.Coroutine import io.legado.app.help.coroutine.Coroutine
import io.legado.app.lib.theme.accentColor import io.legado.app.lib.theme.accentColor
import io.legado.app.utils.ACache import io.legado.app.utils.ACache
import io.legado.app.utils.dp
import io.legado.app.utils.gone import io.legado.app.utils.gone
import io.legado.app.utils.visible import io.legado.app.utils.visible
import kotlinx.android.synthetic.main.item_fillet_text.view.* import kotlinx.android.synthetic.main.item_fillet_text.view.*
@ -28,6 +29,11 @@ class ExploreAdapter(context: Context, private val scope: CoroutineScope, val ca
override fun convert(holder: ItemViewHolder, item: BookSource, payloads: MutableList<Any>) { override fun convert(holder: ItemViewHolder, item: BookSource, payloads: MutableList<Any>) {
with(holder.itemView) { with(holder.itemView) {
if (holder.layoutPosition == getActualItemCount() - 1) {
setPadding(16.dp, 12.dp, 16.dp, 12.dp)
} else {
setPadding(16.dp, 12.dp, 16.dp, 0)
}
if (payloads.isEmpty()) { if (payloads.isEmpty()) {
tv_name.text = item.bookSourceName tv_name.text = item.bookSourceName
} }

@ -4,9 +4,6 @@
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:paddingTop="15dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
@ -36,7 +33,8 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginRight="4dp" android:layout_marginRight="4dp"
app:hide_mode="gone" app:hide_mode="gone"
app:loading_width="1dp" /> app:loading_width="1dp"
tools:ignore="RtlHardcoded" />
<ImageView <ImageView
android:id="@+id/iv_status" android:id="@+id/iv_status"

Loading…
Cancel
Save