mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-11 06:49:08 +01:00
Scrollable toolbar + centered + same color toolbar
I'm stealing from that reddit sync alpha Also light blue theme is now broken...too bad
This commit is contained in:
parent
c8570759fa
commit
b7e66fa404
@ -148,6 +148,10 @@
|
||||
android:name=".data.backup.BackupRestoreService"
|
||||
android:exported="false"/>
|
||||
|
||||
<meta-data
|
||||
android:name="preloaded_fonts"
|
||||
android:resource="@array/preloaded_fonts" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
@ -0,0 +1,33 @@
|
||||
package eu.kanade.tachiyomi.ui.base
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.graphics.drawable.DrawerArrowDrawable
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import kotlinx.android.synthetic.main.main_activity.view.*
|
||||
|
||||
class CenteredToolbar@JvmOverloads constructor(context: Context, attrs: AttributeSet? = null): Toolbar
|
||||
(context, attrs) {
|
||||
|
||||
override fun setTitle(resId: Int) {
|
||||
if (navigationIcon is DrawerArrowDrawable) {
|
||||
super.setTitle(resId)
|
||||
toolbar_title.text = null
|
||||
}
|
||||
else {
|
||||
toolbar_title.text = context.getString(resId)
|
||||
super.setTitle(null)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setTitle(title: CharSequence?) {
|
||||
if (navigationIcon is DrawerArrowDrawable) {
|
||||
super.setTitle(title)
|
||||
toolbar_title.text = null
|
||||
}
|
||||
else {
|
||||
toolbar_title.text = title
|
||||
super.setTitle(null)
|
||||
}
|
||||
}
|
||||
}
|
@ -26,9 +26,11 @@ import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||
import eu.kanade.tachiyomi.ui.catalogue.browse.BrowseCatalogueController
|
||||
import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchController
|
||||
import eu.kanade.tachiyomi.ui.catalogue.latest.LatestUpdatesController
|
||||
import eu.kanade.tachiyomi.ui.main.RootSearchInterface
|
||||
import eu.kanade.tachiyomi.ui.setting.SettingsSourcesController
|
||||
import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener
|
||||
import eu.kanade.tachiyomi.util.view.applyWindowInsetsForRootController
|
||||
import eu.kanade.tachiyomi.util.view.scrollViewWith
|
||||
import eu.kanade.tachiyomi.widget.preference.SourceLoginDialog
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import kotlinx.android.synthetic.main.catalogue_main_controller.*
|
||||
@ -47,6 +49,7 @@ class CatalogueController : NucleusController<CataloguePresenter>(),
|
||||
SourceLoginDialog.Listener,
|
||||
FlexibleAdapter.OnItemClickListener,
|
||||
CatalogueAdapter.OnBrowseClickListener,
|
||||
RootSearchInterface,
|
||||
CatalogueAdapter.OnLatestClickListener {
|
||||
|
||||
/**
|
||||
@ -113,6 +116,8 @@ class CatalogueController : NucleusController<CataloguePresenter>(),
|
||||
recycler.addItemDecoration(SourceDividerItemDecoration(view.context))
|
||||
recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener)
|
||||
|
||||
scrollViewWith(recycler)
|
||||
|
||||
requestPermissionsSafe(arrayOf(WRITE_EXTERNAL_STORAGE), 301)
|
||||
}
|
||||
|
||||
@ -216,7 +221,7 @@ class CatalogueController : NucleusController<CataloguePresenter>(),
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
// Initialize option to open catalogue settings.
|
||||
R.id.action_settings -> {
|
||||
R.id.action_filter -> {
|
||||
router.pushController((RouterTransaction.with(SettingsSourcesController()))
|
||||
.popChangeHandler(SettingsSourcesFadeChangeHandler())
|
||||
.pushChangeHandler(FadeChangeHandler()))
|
||||
|
@ -37,11 +37,11 @@ import eu.kanade.tachiyomi.ui.webview.WebViewActivity
|
||||
import eu.kanade.tachiyomi.util.system.connectivityManager
|
||||
import eu.kanade.tachiyomi.util.view.HeightTopWindowInsetsListener
|
||||
import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener
|
||||
import eu.kanade.tachiyomi.util.view.applyWindowInsetsForController
|
||||
import eu.kanade.tachiyomi.util.view.gone
|
||||
import eu.kanade.tachiyomi.util.view.inflate
|
||||
import eu.kanade.tachiyomi.util.view.marginBottom
|
||||
import eu.kanade.tachiyomi.util.view.marginTop
|
||||
import eu.kanade.tachiyomi.util.view.scrollViewWith
|
||||
import eu.kanade.tachiyomi.util.view.snack
|
||||
import eu.kanade.tachiyomi.util.view.updateLayoutParams
|
||||
import eu.kanade.tachiyomi.util.view.updatePaddingRelative
|
||||
@ -140,13 +140,13 @@ open class BrowseCatalogueController(bundle: Bundle) :
|
||||
|
||||
override fun onViewCreated(view: View) {
|
||||
super.onViewCreated(view)
|
||||
view.applyWindowInsetsForController()
|
||||
|
||||
// Initialize adapter, scroll listener and recycler views
|
||||
adapter = FlexibleAdapter(null, this)
|
||||
setupRecycler(view)
|
||||
|
||||
navView?.setFilters(presenter.filterItems)
|
||||
scrollViewWith(recycler!!, true)
|
||||
|
||||
progress?.visible()
|
||||
}
|
||||
@ -246,6 +246,7 @@ open class BrowseCatalogueController(bundle: Bundle) :
|
||||
}
|
||||
}
|
||||
}
|
||||
recycler.clipToPadding = false
|
||||
recycler.setHasFixedSize(true)
|
||||
recycler.adapter = adapter
|
||||
|
||||
|
@ -23,7 +23,7 @@ import eu.kanade.tachiyomi.extension.model.Extension
|
||||
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
||||
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||
import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener
|
||||
import eu.kanade.tachiyomi.util.view.applyWindowInsetsForController
|
||||
import eu.kanade.tachiyomi.util.view.scrollViewWith
|
||||
import kotlinx.android.synthetic.main.extension_controller.*
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
@ -64,7 +64,7 @@ open class ExtensionController : NucleusController<ExtensionPresenter>(),
|
||||
|
||||
override fun onViewCreated(view: View) {
|
||||
super.onViewCreated(view)
|
||||
view.applyWindowInsetsForController()
|
||||
//view.applyWindowInsetsForController()
|
||||
|
||||
ext_swipe_refresh.isRefreshing = true
|
||||
ext_swipe_refresh.refreshes().subscribeUntilDestroy {
|
||||
@ -78,6 +78,7 @@ open class ExtensionController : NucleusController<ExtensionPresenter>(),
|
||||
ext_recycler.adapter = adapter
|
||||
ext_recycler.addItemDecoration(ExtensionDividerItemDecoration(view.context))
|
||||
ext_recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener)
|
||||
scrollViewWith(ext_recycler, true, ext_swipe_refresh)
|
||||
}
|
||||
|
||||
override fun onDestroyView(view: View) {
|
||||
|
@ -43,6 +43,7 @@ import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||
import eu.kanade.tachiyomi.ui.download.DownloadController
|
||||
import eu.kanade.tachiyomi.ui.library.filter.SortFilterBottomSheet
|
||||
import eu.kanade.tachiyomi.ui.main.MainActivity
|
||||
import eu.kanade.tachiyomi.ui.main.RootSearchInterface
|
||||
import eu.kanade.tachiyomi.ui.manga.MangaDetailsController
|
||||
import eu.kanade.tachiyomi.ui.migration.MigrationInterface
|
||||
import eu.kanade.tachiyomi.ui.migration.manga.design.PreMigrationController
|
||||
@ -69,6 +70,7 @@ open class LibraryController(
|
||||
ChangeMangaCategoriesDialog.Listener,
|
||||
MigrationInterface,
|
||||
DownloadServiceListener,
|
||||
RootSearchInterface,
|
||||
LibraryServiceListener {
|
||||
|
||||
/**
|
||||
|
@ -7,10 +7,9 @@ import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.view.ActionMode
|
||||
import androidx.appcompat.widget.PopupMenu
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.core.math.MathUtils.clamp
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
@ -28,12 +27,13 @@ import eu.kanade.tachiyomi.data.database.models.LibraryManga
|
||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
import eu.kanade.tachiyomi.data.library.LibraryUpdateService
|
||||
import eu.kanade.tachiyomi.data.preference.getOrDefault
|
||||
import eu.kanade.tachiyomi.ui.main.MainActivity
|
||||
import eu.kanade.tachiyomi.ui.main.SwipeGestureInterface
|
||||
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||
import eu.kanade.tachiyomi.util.system.launchUI
|
||||
import eu.kanade.tachiyomi.util.view.inflate
|
||||
import eu.kanade.tachiyomi.util.view.scrollViewWith
|
||||
import eu.kanade.tachiyomi.util.view.snack
|
||||
import eu.kanade.tachiyomi.util.view.updateLayoutParams
|
||||
import eu.kanade.tachiyomi.util.view.updatePaddingRelative
|
||||
import kotlinx.android.synthetic.main.filter_bottom_sheet.*
|
||||
import kotlinx.android.synthetic.main.library_grid_recycler.*
|
||||
@ -61,7 +61,7 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
|
||||
|
||||
private var lastItemPosition:Int? = null
|
||||
private var lastItem:IFlexible<*>? = null
|
||||
private lateinit var customTitleSpinner: LinearLayout
|
||||
private lateinit var customTitleSpinner: ViewGroup
|
||||
private lateinit var titlePopupMenu:PopupMenu
|
||||
|
||||
private var switchingCategories = false
|
||||
@ -73,13 +73,15 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
|
||||
|
||||
override fun contentView():View = recycler_layout
|
||||
|
||||
override fun getTitle(): String? {
|
||||
return when {
|
||||
spinnerAdapter?.array?.size ?: 0 > 1 -> null
|
||||
spinnerAdapter?.array?.size == 1 -> return spinnerAdapter?.array?.firstOrNull()
|
||||
else -> return super.getTitle()
|
||||
}
|
||||
}
|
||||
/* override fun getTitle(): String? {
|
||||
return if (::customTitleSpinner.isInitialized) customTitleSpinner.category_title.text.toString()
|
||||
else super.getTitle()
|
||||
// when {
|
||||
// spinnerAdapter?.array?.size ?: 0 > 1 -> null
|
||||
// spinnerAdapter?.array?.size == 1 -> return spinnerAdapter?.array?.firstOrNull()
|
||||
// else -> return super.getTitle()
|
||||
// }
|
||||
}*/
|
||||
|
||||
private var scrollListener = object : RecyclerView.OnScrollListener () {
|
||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
@ -97,6 +99,9 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
|
||||
val category = presenter.categories.find { it.order == order }
|
||||
|
||||
customTitleSpinner.category_title.text = category?.name ?: ""
|
||||
val isCurrentController = router?.backstack?.lastOrNull()?.controller() ==
|
||||
this@LibraryListController
|
||||
if (isCurrentController) setTitle()
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -135,8 +140,8 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
|
||||
val tv = TypedValue()
|
||||
activity!!.theme.resolveAttribute(R.attr.actionBarTintColor, tv, true)
|
||||
|
||||
customTitleSpinner = library_layout.inflate(R.layout.spinner_title) as LinearLayout
|
||||
(activity as MainActivity).supportActionBar?.setDisplayShowCustomEnabled(false)
|
||||
customTitleSpinner = library_layout.inflate(R.layout.spinner_title) as ViewGroup
|
||||
// (activity as MainActivity).supportActionBar?.setDisplayShowCustomEnabled(false)
|
||||
spinnerAdapter = SpinnerAdapter(
|
||||
view.context,
|
||||
R.layout.library_spinner_textview,
|
||||
@ -151,12 +156,17 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
|
||||
scrollToHeader(item.itemId)
|
||||
true
|
||||
}
|
||||
(activity as MainActivity).supportActionBar?.customView = customTitleSpinner
|
||||
//(activity as MainActivity).supportActionBar?.customView = customTitleSpinner
|
||||
scrollViewWith(recycler) { insets ->
|
||||
fast_scroller.updateLayoutParams<CoordinatorLayout.LayoutParams> {
|
||||
topMargin = insets.systemWindowInsetTop
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onChangeStarted(handler: ControllerChangeHandler, type: ControllerChangeType) {
|
||||
super.onChangeStarted(handler, type)
|
||||
if (type.isEnter) {
|
||||
/*if (type.isEnter) {
|
||||
(activity as MainActivity).supportActionBar
|
||||
?.setDisplayShowCustomEnabled(router?.backstack?.lastOrNull()?.controller() ==
|
||||
this && spinnerAdapter?.array?.size ?: 0 > 1)
|
||||
@ -165,11 +175,11 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
|
||||
(activity as MainActivity).toolbar.menu.findItem(R.id
|
||||
.action_search)?.collapseActionView()
|
||||
(activity as MainActivity).supportActionBar?.setDisplayShowCustomEnabled(false)
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
(activity as MainActivity).supportActionBar?.setDisplayShowCustomEnabled(false)
|
||||
// (activity as MainActivity).supportActionBar?.setDisplayShowCustomEnabled(false)
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
@ -195,14 +205,14 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
|
||||
|
||||
val isCurrentController = router?.backstack?.lastOrNull()?.controller() ==
|
||||
this
|
||||
(activity as AppCompatActivity).supportActionBar
|
||||
?.setDisplayShowCustomEnabled(isCurrentController && presenter.categories.size > 1)
|
||||
if (isCurrentController) setTitle()
|
||||
// (activity as AppCompatActivity).supportActionBar
|
||||
// ?.setDisplayShowCustomEnabled(isCurrentController && presenter.categories.size > 1)
|
||||
|
||||
customTitleSpinner.category_title.text =
|
||||
presenter.categories[clamp(activeCategory,
|
||||
0,
|
||||
presenter.categories.size - 1)].name
|
||||
if (isCurrentController) setTitle()
|
||||
updateScroll = false
|
||||
if (!freshStart) {
|
||||
justStarted = false
|
||||
@ -232,6 +242,7 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
|
||||
val headerPosition = adapter.indexOf(pos)
|
||||
switchingCategories = true
|
||||
if (headerPosition > -1) {
|
||||
activity?.appbar?.y = 0f
|
||||
recycler.suppressLayout(true)
|
||||
(recycler.layoutManager as LinearLayoutManager).scrollToPositionWithOffset(
|
||||
headerPosition, if (headerPosition == 0) 0 else (-30).dpToPx
|
||||
@ -544,7 +555,13 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
|
||||
}
|
||||
|
||||
override fun onSwipeBottom(x: Float, y: Float) { }
|
||||
override fun onSwipeTop(x: Float, y: Float) { }
|
||||
|
||||
override fun onSwipeTop(x: Float, y: Float) {
|
||||
val sheetRect = Rect()
|
||||
activity!!.navigationView.getGlobalVisibleRect(sheetRect)
|
||||
if (sheetRect.contains(x.toInt(), y.toInt()))
|
||||
showFiltersBottomSheet()
|
||||
}
|
||||
override fun onSwipeLeft(x: Float, y: Float) = goToNextCategory(x, y,-1)
|
||||
override fun onSwipeRight(x: Float, y: Float) = goToNextCategory(x, y,1)
|
||||
|
||||
|
@ -617,7 +617,7 @@ class LibraryPresenter(
|
||||
if (mangas.isEmpty()) return emptyList()
|
||||
return mangas.toSet()
|
||||
.map { db.getCategoriesForManga(it).executeAsBlocking() }
|
||||
.reduce { set1: Iterable<Category>, set2 -> set1.intersect(set2) }
|
||||
.reduce { set1: Iterable<Category>, set2 -> set1.intersect(set2).toMutableList() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -8,9 +8,11 @@ import android.content.Intent
|
||||
import android.content.res.Configuration
|
||||
import android.graphics.Color
|
||||
import android.graphics.Rect
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.GestureDetector
|
||||
import android.view.MenuItem
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@ -18,6 +20,7 @@ import android.view.WindowManager
|
||||
import android.webkit.WebView
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.appcompat.graphics.drawable.DrawerArrowDrawable
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.graphics.ColorUtils
|
||||
import androidx.core.view.GestureDetectorCompat
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
@ -79,6 +82,7 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
|
||||
protected lateinit var router: Router
|
||||
|
||||
protected var drawerArrow: DrawerArrowDrawable? = null
|
||||
private var searchDrawable:Drawable? = null
|
||||
private var currentGestureDelegate:SwipeGestureInterface? = null
|
||||
private lateinit var gestureDetector:GestureDetectorCompat
|
||||
|
||||
@ -130,7 +134,8 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
|
||||
|
||||
drawerArrow = DrawerArrowDrawable(this)
|
||||
drawerArrow?.color = getResourceColor(R.attr.actionBarTintColor)
|
||||
toolbar.navigationIcon = drawerArrow
|
||||
searchDrawable = ContextCompat.getDrawable(this, R.drawable
|
||||
.ic_search_white_24dp)
|
||||
|
||||
// tabAnimator = TabsAnimator(tabs)
|
||||
|
||||
@ -160,7 +165,7 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
|
||||
setRoot(RecentlyReadController(), id)
|
||||
}
|
||||
R.id.nav_catalogues -> setRoot(CatalogueController(), id)
|
||||
R.id.nav_settings -> setRoot(SettingsMainController(), id)
|
||||
//R.id.nav_settings -> setRoot(SettingsMainController(), id)
|
||||
}
|
||||
}
|
||||
else if (currentRoot.tag()?.toIntOrNull() == id) {
|
||||
@ -183,7 +188,7 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
|
||||
controller?.showFiltersBottomSheet()
|
||||
}
|
||||
}
|
||||
R.id.nav_catalogues, R.id.nav_settings -> router.popToRoot()
|
||||
R.id.nav_catalogues -> router.popToRoot()
|
||||
}
|
||||
}
|
||||
true
|
||||
@ -221,7 +226,8 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
|
||||
|
||||
supportActionBar?.setDisplayShowCustomEnabled(true)
|
||||
|
||||
window.statusBarColor = getResourceColor(android.R.attr.colorPrimary)
|
||||
window.statusBarColor = ColorUtils.setAlphaComponent(getResourceColor(android.R.attr
|
||||
.colorBackground), 175)
|
||||
content.setOnApplyWindowInsetsListener { v, insets ->
|
||||
// if device doesn't support light nav bar
|
||||
window.navigationBarColor = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||
@ -307,8 +313,15 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
|
||||
}
|
||||
}
|
||||
|
||||
toolbar.navigationIcon = if (router.backstackSize > 1) drawerArrow else searchDrawable
|
||||
(router.backstack.lastOrNull()?.controller() as? BaseController)?.setTitle()
|
||||
|
||||
toolbar.setNavigationOnClickListener {
|
||||
onBackPressed()
|
||||
val rootSearchController = router.backstack.lastOrNull()?.controller()
|
||||
if (rootSearchController is RootSearchInterface) {
|
||||
toolbar.menu.findItem(R.id.action_search)?.expandActionView()
|
||||
}
|
||||
else onBackPressed()
|
||||
}
|
||||
|
||||
navigationView.visibility = if (router.backstackSize > 1) View.GONE else View.VISIBLE
|
||||
@ -318,10 +331,12 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
|
||||
container: ViewGroup, handler: ControllerChangeHandler) {
|
||||
|
||||
syncActivityViewWithController(to, from, isPush)
|
||||
appbar.y = 0f
|
||||
}
|
||||
|
||||
override fun onChangeCompleted(to: Controller?, from: Controller?, isPush: Boolean,
|
||||
container: ViewGroup, handler: ControllerChangeHandler) {
|
||||
appbar.y = 0f
|
||||
}
|
||||
|
||||
})
|
||||
@ -383,13 +398,13 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
|
||||
private fun setExtensionsBadge() {
|
||||
val updates = preferences.extensionUpdatesCount().getOrDefault()
|
||||
if (updates > 0) {
|
||||
val badge = navigationView.getOrCreateBadge(R.id.nav_settings)
|
||||
val badge = navigationView.getOrCreateBadge(R.id.nav_catalogues)
|
||||
badge.number = updates
|
||||
badge.backgroundColor = getResourceColor(R.attr.badgeColor)
|
||||
badge.badgeTextColor = Color.WHITE
|
||||
}
|
||||
else {
|
||||
navigationView.removeBadge(R.id.nav_settings)
|
||||
navigationView.removeBadge(R.id.nav_catalogues)
|
||||
}
|
||||
}
|
||||
|
||||
@ -522,6 +537,19 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
|
||||
router.setRoot(controller.withFadeTransaction().tag(id.toString()))
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
// Initialize option to open catalogue settings.
|
||||
R.id.action_settings -> {
|
||||
router.pushController((RouterTransaction.with(SettingsMainController()))
|
||||
.popChangeHandler(FadeChangeHandler())
|
||||
.pushChangeHandler(FadeChangeHandler()))
|
||||
}
|
||||
else -> return super.onOptionsItemSelected(item)
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
|
||||
gestureDetector.onTouchEvent(ev)
|
||||
if (ev?.action == MotionEvent.ACTION_DOWN) {
|
||||
@ -556,7 +584,7 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
|
||||
}
|
||||
val onRoot = router.backstackSize == 1
|
||||
if (onRoot) {
|
||||
toolbar.navigationIcon = null
|
||||
toolbar.navigationIcon = searchDrawable
|
||||
} else {
|
||||
toolbar.navigationIcon = drawerArrow
|
||||
}
|
||||
@ -581,8 +609,14 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
|
||||
|
||||
if (to is NoToolbarElevationController) {
|
||||
appbar.disableElevation()
|
||||
/*controller_container.updateLayoutParams<CoordinatorLayout.LayoutParams> {
|
||||
behavior = null
|
||||
}*/
|
||||
} else {
|
||||
appbar.enableElevation()
|
||||
/*controller_container.updateLayoutParams<CoordinatorLayout.LayoutParams> {
|
||||
behavior = AppBarLayout.ScrollingViewBehavior()
|
||||
}*/
|
||||
}
|
||||
|
||||
if (to !is DialogController) {
|
||||
@ -700,6 +734,8 @@ interface BottomNavBarInterface {
|
||||
fun canChangeTabs(block: () -> Unit): Boolean
|
||||
}
|
||||
|
||||
interface RootSearchInterface
|
||||
|
||||
interface SwipeGestureInterface {
|
||||
fun onSwipeRight(x: Float, y: Float)
|
||||
fun onSwipeLeft(x: Float, y: Float)
|
||||
|
@ -309,7 +309,7 @@ class MangaDetailsController : BaseController,
|
||||
super.onChangeStarted(handler, type)
|
||||
if (type == ControllerChangeType.PUSH_ENTER || type == ControllerChangeType.POP_ENTER) {
|
||||
if (type == ControllerChangeType.POP_ENTER)
|
||||
return
|
||||
return
|
||||
(activity as MainActivity).appbar.setBackgroundColor(Color.TRANSPARENT)
|
||||
(activity as MainActivity).toolbar.setBackgroundColor(Color.TRANSPARENT)
|
||||
activity?.window?.statusBarColor = Color.TRANSPARENT
|
||||
@ -320,13 +320,13 @@ class MangaDetailsController : BaseController,
|
||||
if (type == ControllerChangeType.POP_EXIT) setHasOptionsMenu(false)
|
||||
colorAnimator?.cancel()
|
||||
|
||||
(activity as MainActivity).toolbar.setBackgroundColor(activity?.getResourceColor(
|
||||
android.R.attr.colorPrimary
|
||||
) ?: Color.BLACK)
|
||||
|
||||
activity?.window?.statusBarColor = activity?.getResourceColor(
|
||||
android.R.attr.colorPrimary
|
||||
val colorPrimary = activity?.getResourceColor(
|
||||
android.R.attr.colorBackground
|
||||
) ?: Color.BLACK
|
||||
(activity as MainActivity).appbar.setBackgroundColor(colorPrimary)
|
||||
(activity as MainActivity).toolbar.setBackgroundColor(colorPrimary)
|
||||
|
||||
activity?.window?.statusBarColor = ColorUtils.setAlphaComponent(colorPrimary, 175)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ class RecentChaptersAdapter(val controller: RecentChaptersController) :
|
||||
|
||||
init {
|
||||
setDisplayHeadersAtStartUp(true)
|
||||
setStickyHeaders(true)
|
||||
//setStickyHeaders(true)
|
||||
}
|
||||
|
||||
interface OnCoverClickListener {
|
||||
|
@ -20,7 +20,6 @@ import eu.kanade.tachiyomi.data.download.model.Download
|
||||
import eu.kanade.tachiyomi.data.library.LibraryUpdateService
|
||||
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.ui.base.controller.NoToolbarElevationController
|
||||
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
||||
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||
import eu.kanade.tachiyomi.ui.main.MainActivity
|
||||
@ -29,6 +28,7 @@ import eu.kanade.tachiyomi.ui.reader.ReaderActivity
|
||||
import eu.kanade.tachiyomi.ui.recently_read.RecentlyReadController
|
||||
import eu.kanade.tachiyomi.util.system.notificationManager
|
||||
import eu.kanade.tachiyomi.util.view.applyWindowInsetsForRootController
|
||||
import eu.kanade.tachiyomi.util.view.scrollViewWith
|
||||
import eu.kanade.tachiyomi.util.view.snack
|
||||
import kotlinx.android.synthetic.main.main_activity.*
|
||||
import kotlinx.android.synthetic.main.recent_chapters_controller.*
|
||||
@ -42,7 +42,6 @@ import uy.kohesive.injekt.api.get
|
||||
* UI related actions should be called from here.
|
||||
*/
|
||||
class RecentChaptersController : NucleusController<RecentChaptersPresenter>(),
|
||||
NoToolbarElevationController,
|
||||
ActionMode.Callback,
|
||||
FlexibleAdapter.OnItemClickListener,
|
||||
FlexibleAdapter.OnItemLongClickListener,
|
||||
@ -111,7 +110,8 @@ class RecentChaptersController : NucleusController<RecentChaptersPresenter>(),
|
||||
// It can be a very long operation, so we disable swipe refresh and show a snackbar.
|
||||
swipe_refresh.isRefreshing = false
|
||||
}
|
||||
//recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener)
|
||||
|
||||
scrollViewWith(recycler, swipeRefreshLayout = swipe_refresh)
|
||||
}
|
||||
|
||||
override fun onDestroyView(view: View) {
|
||||
|
@ -20,6 +20,7 @@ import eu.kanade.tachiyomi.ui.base.controller.BaseController
|
||||
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||
import eu.kanade.tachiyomi.ui.catalogue.browse.ProgressItem
|
||||
import eu.kanade.tachiyomi.ui.main.MainActivity
|
||||
import eu.kanade.tachiyomi.ui.main.RootSearchInterface
|
||||
import eu.kanade.tachiyomi.ui.manga.MangaDetailsController
|
||||
import eu.kanade.tachiyomi.ui.reader.ReaderActivity
|
||||
import eu.kanade.tachiyomi.ui.recent_updates.RecentChaptersController
|
||||
@ -27,6 +28,7 @@ import eu.kanade.tachiyomi.util.system.launchUI
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener
|
||||
import eu.kanade.tachiyomi.util.view.applyWindowInsetsForRootController
|
||||
import eu.kanade.tachiyomi.util.view.scrollViewWith
|
||||
import eu.kanade.tachiyomi.util.view.setOnQueryTextChangeListener
|
||||
import kotlinx.android.synthetic.main.main_activity.*
|
||||
import kotlinx.android.synthetic.main.recently_read_controller.*
|
||||
@ -44,6 +46,7 @@ class RecentlyReadController(bundle: Bundle? = null) : BaseController(bundle),
|
||||
RecentlyReadAdapter.OnRemoveClickListener,
|
||||
RecentlyReadAdapter.OnResumeClickListener,
|
||||
RecentlyReadAdapter.OnCoverClickListener,
|
||||
RootSearchInterface,
|
||||
RemoveHistoryDialog.Listener {
|
||||
|
||||
init {
|
||||
@ -89,6 +92,7 @@ class RecentlyReadController(bundle: Bundle? = null) : BaseController(bundle),
|
||||
recycler.setHasFixedSize(true)
|
||||
recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener)
|
||||
resetProgressItem()
|
||||
scrollViewWith(recycler)
|
||||
|
||||
if (recentItems != null)
|
||||
adapter?.updateDataSet(recentItems!!.toList())
|
||||
@ -132,9 +136,10 @@ class RecentlyReadController(bundle: Bundle? = null) : BaseController(bundle),
|
||||
|
||||
override fun onUpdateEmptyView(size: Int) {
|
||||
if (size > 0) {
|
||||
empty_view?.hide()
|
||||
// empty_view?.hide()
|
||||
} else {
|
||||
empty_view.show(R.drawable.ic_history_white_128dp, R.string.information_no_recent_manga)
|
||||
// empty_view.show(R.drawable.ic_history_white_128dp, R.string
|
||||
//.information_no_recent_manga)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,8 +17,6 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.ui.base.controller.BaseController
|
||||
import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener
|
||||
import eu.kanade.tachiyomi.util.view.applyWindowInsetsForController
|
||||
import eu.kanade.tachiyomi.util.view.applyWindowInsetsForRootController
|
||||
import kotlinx.android.synthetic.main.main_activity.*
|
||||
import rx.Observable
|
||||
import rx.Subscription
|
||||
import rx.subscriptions.CompositeSubscription
|
||||
@ -37,12 +35,8 @@ abstract class SettingsController : PreferenceController() {
|
||||
untilDestroySubscriptions = CompositeSubscription()
|
||||
}
|
||||
val view = super.onCreateView(inflater, container, savedInstanceState)
|
||||
if (this is SettingsMainController)
|
||||
view.applyWindowInsetsForRootController(activity!!.navigationView)
|
||||
else {
|
||||
view.applyWindowInsetsForController()
|
||||
listView.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener)
|
||||
}
|
||||
view.applyWindowInsetsForController()
|
||||
listView.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener)
|
||||
return view
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,11 @@ import androidx.annotation.Px
|
||||
import androidx.appcompat.widget.SearchView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.graphics.ColorUtils
|
||||
import androidx.core.math.MathUtils.clamp
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
import com.amulyakhare.textdrawable.TextDrawable
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator
|
||||
import com.bluelinelabs.conductor.Controller
|
||||
@ -29,9 +33,12 @@ import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||
import kotlinx.android.synthetic.main.main_activity.*
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
@ -231,7 +238,8 @@ fun View.applyWindowInsetsForRootController(bottomNav: View) {
|
||||
view.updateLayoutParams<FrameLayout.LayoutParams> {
|
||||
val attrsArray = intArrayOf(android.R.attr.actionBarSize)
|
||||
val array = view.context.obtainStyledAttributes(attrsArray)
|
||||
topMargin = insets.systemWindowInsetTop + array.getDimensionPixelSize(0, 0)
|
||||
//topMargin = insets.systemWindowInsetTop + array
|
||||
//.getDimensionPixelSize(0, 0)
|
||||
bottomMargin = bottomNav.height
|
||||
array.recycle()
|
||||
}
|
||||
@ -304,6 +312,66 @@ fun Controller.setOnQueryTextChangeListener(searchView: SearchView, f: (text: St
|
||||
})
|
||||
}
|
||||
|
||||
fun Controller.scrollViewWith(recycler: RecyclerView,
|
||||
padBottom: Boolean = false,
|
||||
swipeRefreshLayout: SwipeRefreshLayout? = null,
|
||||
f: ((WindowInsets) -> Unit)? = null) {
|
||||
var statusBarHeight = -1
|
||||
activity!!.appbar.y = 0f
|
||||
recycler.doOnApplyWindowInsets { view, insets, _ ->
|
||||
val attrsArray = intArrayOf(android.R.attr.actionBarSize)
|
||||
val array = view.context.obtainStyledAttributes(attrsArray)
|
||||
val headerHeight = insets.systemWindowInsetTop + array.getDimensionPixelSize(0, 0)
|
||||
view.updatePaddingRelative(
|
||||
top = headerHeight,
|
||||
bottom = if (padBottom) insets.systemWindowInsetBottom else 0
|
||||
)
|
||||
swipeRefreshLayout?.setProgressViewOffset(false, headerHeight + (-60).dpToPx,
|
||||
headerHeight + 10.dpToPx)
|
||||
statusBarHeight = insets.systemWindowInsetTop
|
||||
array.recycle()
|
||||
f?.invoke(insets)
|
||||
}
|
||||
recycler.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
super.onScrolled(recyclerView, dx, dy)
|
||||
if (router.backstack.lastOrNull()?.controller() == this@scrollViewWith &&
|
||||
statusBarHeight > -1 &&
|
||||
activity!!.appbar.height > 0) {
|
||||
activity!!.appbar.y -= dy
|
||||
activity!!.appbar.y = clamp(
|
||||
activity!!.appbar.y,
|
||||
-activity!!.appbar.height.toFloat(),// + statusBarHeight,
|
||||
0f
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
|
||||
super.onScrollStateChanged(recyclerView, newState)
|
||||
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
|
||||
if (router.backstack.lastOrNull()?.controller() == this@scrollViewWith &&
|
||||
statusBarHeight > -1 &&
|
||||
activity!!.appbar.height > 0) {
|
||||
val halfWay = abs((-activity!!.appbar.height.toFloat()) / 2)
|
||||
val shortAnimationDuration = resources?.getInteger(
|
||||
android.R.integer.config_shortAnimTime
|
||||
) ?: 0
|
||||
val closerToTop = abs(activity!!.appbar.y) - halfWay > 0
|
||||
val atTop = (recycler.layoutManager as LinearLayoutManager)
|
||||
.findFirstVisibleItemPosition() < 2
|
||||
activity!!.appbar.animate()
|
||||
.y(if (closerToTop && !atTop)
|
||||
(-activity!!.appbar.height.toFloat())
|
||||
else 0f)
|
||||
.setDuration(shortAnimationDuration.toLong())
|
||||
.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
inline fun View.updatePaddingRelative(
|
||||
@Px start: Int = paddingStart,
|
||||
@Px top: Int = paddingTop,
|
||||
|
@ -19,15 +19,15 @@ class ElevationAppBarLayout @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
fun enableElevation() {
|
||||
if (stateListAnimator == null) {
|
||||
/* if (stateListAnimator == null) {
|
||||
stateListAnimator = origStateAnimator
|
||||
elevation = origElevation
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
fun disableElevation() {
|
||||
stateListAnimator = null
|
||||
elevation = 0f
|
||||
// stateListAnimator = null
|
||||
//elevation = 0f
|
||||
//translationZ = 0.1f.dpToPx
|
||||
}
|
||||
|
||||
|
7
app/src/main/res/font/roboto_medium.xml
Normal file
7
app/src/main/res/font/roboto_medium.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
app:fontProviderAuthority="com.google.android.gms.fonts"
|
||||
app:fontProviderPackage="com.google.android.gms"
|
||||
app:fontProviderQuery="name=Roboto&weight=500"
|
||||
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
|
||||
</font-family>
|
@ -4,7 +4,6 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/catalouge_layout"
|
||||
android:fitsSystemWindows="true"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -4,6 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/manga_layout"
|
||||
android:layout_width="match_parent"
|
||||
tools:background="?android:attr/colorBackground"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom">
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
@ -4,7 +4,6 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
android:id="@+id/ext_swipe_refresh">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
@ -9,11 +9,13 @@
|
||||
<com.bluelinelabs.conductor.ChangeHandlerFrameLayout
|
||||
android:id="@+id/controller_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0">
|
||||
|
||||
</com.bluelinelabs.conductor.ChangeHandlerFrameLayout>
|
||||
|
||||
@ -21,16 +23,32 @@
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/colorBackground"
|
||||
android:stateListAnimator="@null"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
<eu.kanade.tachiyomi.ui.base.CenteredToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="?attr/actionBarTheme" />
|
||||
android:background="?android:attr/colorBackground">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/toolbar_title"
|
||||
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:ellipsize="end"
|
||||
android:gravity="start"
|
||||
android:maxLines="1"
|
||||
android:text="@string/label_library"
|
||||
android:textColor="?actionBarTintColor"
|
||||
android:textSize="20sp"
|
||||
app:fontFamily="@font/roboto_medium" />
|
||||
</eu.kanade.tachiyomi.ui.base.CenteredToolbar>
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tabs"
|
||||
|
@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32dp"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:background="?android:attr/colorBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
|
@ -1,12 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/frame_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@ -16,12 +10,3 @@
|
||||
tools:listitem="@layout/recently_read_item">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
<eu.kanade.tachiyomi.widget.EmptyView
|
||||
android:id="@+id/empty_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone" />
|
||||
|
||||
</FrameLayout>
|
||||
|
@ -1,33 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/title_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
tools:background="?colorPrimary"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="start"
|
||||
android:textSize="20sp"
|
||||
android:id="@+id/category_title"
|
||||
android:textColor="?actionBarTintColor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="Title Text"/>
|
||||
android:orientation="horizontal"
|
||||
tools:background="?colorPrimary">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/category_title"
|
||||
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="start"
|
||||
android:maxLines="1"
|
||||
android:textColor="?actionBarTintColor"
|
||||
android:textSize="20sp"
|
||||
tools:text="Title Text" />
|
||||
|
||||
<ImageView
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="4dp"
|
||||
android:background="@drawable/round_ripple"
|
||||
android:id="@+id/dropdown"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:tint="?actionBarTintColor"
|
||||
android:src="@drawable/ic_arrow_drop_down_white_24dp"/>
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="4dp"
|
||||
android:background="@drawable/round_ripple"
|
||||
android:src="@drawable/ic_arrow_drop_down_white_24dp"
|
||||
android:tint="?actionBarTintColor" />
|
||||
</LinearLayout>
|
@ -15,10 +15,5 @@
|
||||
android:id="@+id/nav_catalogues"
|
||||
android:icon="@drawable/ic_explore_black_24dp"
|
||||
android:title="@string/short_catalogues" />
|
||||
<item
|
||||
android:id="@+id/nav_settings"
|
||||
android:icon="@drawable/ic_settings_black_24dp"
|
||||
android:title="@string/label_settings"
|
||||
android:checkable="false" />
|
||||
</group>
|
||||
</menu>
|
||||
|
@ -6,11 +6,19 @@
|
||||
android:id="@+id/action_search"
|
||||
android:title="@string/action_search"
|
||||
android:icon="@drawable/ic_search_white_24dp"
|
||||
android:visible="false"
|
||||
app:showAsAction="collapseActionView|ifRoom"
|
||||
app:actionViewClass="androidx.appcompat.widget.SearchView"/>
|
||||
|
||||
<item android:id="@+id/action_settings"
|
||||
android:title="@string/pref_category_sources"
|
||||
<item android:id="@+id/action_filter"
|
||||
android:title="@string/action_filter"
|
||||
android:icon="@drawable/ic_filter_list_white_24dp"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:icon="@drawable/ic_settings_white_24dp"
|
||||
app:showAsAction="ifRoom"/>
|
||||
android:title="@string/label_settings"
|
||||
app:showAsAction="never"
|
||||
/>
|
||||
</menu>
|
||||
|
@ -8,12 +8,14 @@
|
||||
android:id="@+id/action_search"
|
||||
android:icon="@drawable/ic_search_white_24dp"
|
||||
android:title="@string/action_search"
|
||||
android:visible="false"
|
||||
app:actionViewClass="androidx.appcompat.widget.SearchView"
|
||||
app:showAsAction="collapseActionView|ifRoom"/>
|
||||
app:showAsAction="collapseActionView|ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_library_filter"
|
||||
android:icon="@drawable/ic_filter_list_white_24dp"
|
||||
android:visible="false"
|
||||
android:title="@string/action_filter"
|
||||
app:showAsAction="ifRoom"/>
|
||||
|
||||
@ -21,7 +23,14 @@
|
||||
android:id="@+id/action_library_display"
|
||||
android:icon="@drawable/ic_tune_white_24dp"
|
||||
android:title="@string/action_view_options"
|
||||
app:showAsAction="ifRoom"
|
||||
app:showAsAction="never"
|
||||
/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:icon="@drawable/ic_settings_white_24dp"
|
||||
android:title="@string/label_settings"
|
||||
app:showAsAction="never"
|
||||
/>
|
||||
|
||||
</menu>
|
||||
|
@ -6,5 +6,12 @@
|
||||
android:id="@+id/action_recents"
|
||||
android:icon="@drawable/ic_history_black_24dp"
|
||||
android:title="@string/label_recent_manga"
|
||||
app:showAsAction="ifRoom" />
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:icon="@drawable/ic_settings_white_24dp"
|
||||
android:title="@string/label_settings"
|
||||
app:showAsAction="never"
|
||||
/>
|
||||
</menu>
|
@ -4,6 +4,7 @@
|
||||
android:id="@+id/action_search"
|
||||
android:icon="@drawable/ic_search_white_24dp"
|
||||
android:title="@string/action_search"
|
||||
android:visible="false"
|
||||
app:actionViewClass="androidx.appcompat.widget.SearchView"
|
||||
app:showAsAction="ifRoom|collapseActionView" />
|
||||
|
||||
@ -11,6 +12,12 @@
|
||||
android:id="@+id/action_recents"
|
||||
android:icon="@drawable/ic_update_black_24dp"
|
||||
android:title="@string/label_recent_updates"
|
||||
app:showAsAction="ifRoom" />
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:icon="@drawable/ic_settings_white_24dp"
|
||||
android:title="@string/label_settings"
|
||||
app:showAsAction="never"
|
||||
/>
|
||||
</menu>
|
17
app/src/main/res/values/font_certs.xml
Normal file
17
app/src/main/res/values/font_certs.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<array name="com_google_android_gms_fonts_certs">
|
||||
<item>@array/com_google_android_gms_fonts_certs_dev</item>
|
||||
<item>@array/com_google_android_gms_fonts_certs_prod</item>
|
||||
</array>
|
||||
<string-array name="com_google_android_gms_fonts_certs_dev">
|
||||
<item>
|
||||
MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
|
||||
</item>
|
||||
</string-array>
|
||||
<string-array name="com_google_android_gms_fonts_certs_prod">
|
||||
<item>
|
||||
MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
|
||||
</item>
|
||||
</string-array>
|
||||
</resources>
|
6
app/src/main/res/values/preloaded_fonts.xml
Normal file
6
app/src/main/res/values/preloaded_fonts.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<array name="preloaded_fonts" translatable="false">
|
||||
<item>@font/roboto_medium</item>
|
||||
</array>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user