From 4b846714d09f08de18dc9304ee5da1309de83e3a Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 27 Sep 2019 11:54:50 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/main/bookshelf/BooksFragment.kt | 11 ++++++----- .../legado/app/ui/main/bookshelf/BookshelfFragment.kt | 3 +++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BooksFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BooksFragment.kt index bf556ffd5..98fc44aee 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BooksFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BooksFragment.kt @@ -2,6 +2,7 @@ package io.legado.app.ui.main.bookshelf import android.os.Bundle import android.view.View +import androidx.core.content.ContextCompat import androidx.lifecycle.LiveData import androidx.lifecycle.Observer import androidx.paging.LivePagedListBuilder @@ -62,11 +63,11 @@ class BooksFragment : VMBaseFragment(R.layout.fragment_books), } rv_bookshelf.layoutManager = LinearLayoutManager(context) rv_bookshelf.addItemDecoration( - DividerItemDecoration( - rv_bookshelf.context, - LinearLayoutManager.VERTICAL - ) - ) + DividerItemDecoration(requireContext(), DividerItemDecoration.VERTICAL).apply { + ContextCompat.getDrawable(requireContext(), R.drawable.ic_divider)?.let { + this.setDrawable(it) + } + }) booksAdapter = BooksAdapter(this) rv_bookshelf.adapter = booksAdapter diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt index 1102ea3de..26924d5d3 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt @@ -9,6 +9,7 @@ import android.widget.EditText import androidx.appcompat.widget.SearchView import androidx.lifecycle.LiveData import androidx.lifecycle.Observer +import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayoutMediator import io.legado.app.App import io.legado.app.R @@ -62,6 +63,8 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b } private fun initRecyclerView() { + tab_layout.isTabIndicatorFullWidth = false + tab_layout.tabMode = TabLayout.MODE_SCROLLABLE ATH.applyEdgeEffectColor(view_pager_bookshelf) view_pager_bookshelf.adapter = BookshelfAdapter(this, this) TabLayoutMediator(tab_layout, view_pager_bookshelf) { tab, position ->