diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksAdapterGrid.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksAdapterGrid.kt index c6d1cbba4..6bb5509ae 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksAdapterGrid.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksAdapterGrid.kt @@ -12,15 +12,18 @@ import kotlinx.android.synthetic.main.item_bookshelf_grid.view.* import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.sdk27.listeners.onLongClick -class BooksAdapterGrid(context: Context, private val callBack: CallBack) : +class BooksAdapterGrid(context: Context, private val span: Int, private val callBack: CallBack) : BooksAdapter(context, R.layout.item_bookshelf_grid) { override fun convert(holder: ItemViewHolder, item: Book, payloads: MutableList) { with(holder.itemView) { if (payloads.isEmpty()) { ATH.applyBackgroundTint(this) + tv_name.textSize = (16 - span).toFloat() + bv_author.textSize = (10 - span).toFloat() + bv_unread.textSize = (10 - span).toFloat() tv_name.text = item.name - tv_author.text = item.author + bv_author.text = item.author item.getDisplayCover()?.let { ImageLoader.load(context, it)//Glide自动识别http://和file:// .placeholder(R.drawable.image_cover_default) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt index fe2363b5c..3ccb39105 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt @@ -71,7 +71,7 @@ class BooksFragment : BaseFragment(R.layout.fragment_books), booksAdapter = BooksAdapterList(requireContext(), this) } else { rv_bookshelf.layoutManager = GridLayoutManager(context, bookshelfLayout + 2) - booksAdapter = BooksAdapterGrid(requireContext(), this) + booksAdapter = BooksAdapterGrid(requireContext(), bookshelfLayout, this) } rv_bookshelf.adapter = booksAdapter } diff --git a/app/src/main/res/layout/item_bookshelf_grid.xml b/app/src/main/res/layout/item_bookshelf_grid.xml index 4ed7e8158..58eb839a2 100644 --- a/app/src/main/res/layout/item_bookshelf_grid.xml +++ b/app/src/main/res/layout/item_bookshelf_grid.xml @@ -49,13 +49,33 @@ tools:ignore="RtlHardcoded" /> + + + + + + - - \ No newline at end of file diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 7534dcab1..b873165ff 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -40,7 +40,7 @@ @string/layout_grid3 @string/layout_grid4 @string/layout_grid5 - @string/layout_grid6 +