Skip to content

Commit

Permalink
Remove card backgrounds from browse lists
Browse files Browse the repository at this point in the history
  • Loading branch information
arkon committed Sep 26, 2020
1 parent 9ce8c5c commit a3c598a
Show file tree
Hide file tree
Showing 15 changed files with 144 additions and 334 deletions.
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ dependencies {
implementation 'eu.davidea:flexible-adapter-ui:1.0.0'
implementation 'com.nononsenseapps:filepicker:2.5.2'
implementation 'com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.1.0'
implementation 'com.github.mthli:Slice:v1.3'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'com.github.carlosesco:DirectionalViewPager:a844dbca0a'

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ 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.ui.browse.BrowseController
import eu.kanade.tachiyomi.ui.browse.SourceDividerItemDecoration
import eu.kanade.tachiyomi.ui.browse.extension.details.ExtensionDetailsController
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.launchIn
Expand Down Expand Up @@ -76,7 +75,6 @@ open class ExtensionController :
// Create recycler and set adapter.
binding.recycler.layoutManager = LinearLayoutManager(view.context)
binding.recycler.adapter = adapter
binding.recycler.addItemDecoration(SourceDividerItemDecoration(view.context))
adapter?.fastScroller = binding.fastScroller
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,16 @@ import eu.kanade.tachiyomi.data.glide.GlideApp
import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.extension.model.InstallStep
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder
import eu.kanade.tachiyomi.ui.browse.SourceListItem
import eu.kanade.tachiyomi.util.system.LocaleHelper
import io.github.mthli.slice.Slice
import kotlinx.android.synthetic.main.extension_card_item.card
import kotlinx.android.synthetic.main.extension_card_item.ext_button
import kotlinx.android.synthetic.main.extension_card_item.ext_title
import kotlinx.android.synthetic.main.extension_card_item.image
import kotlinx.android.synthetic.main.extension_card_item.lang
import kotlinx.android.synthetic.main.extension_card_item.version
import kotlinx.android.synthetic.main.extension_card_item.warning

class ExtensionHolder(view: View, override val adapter: ExtensionAdapter) :
BaseFlexibleViewHolder(view, adapter),
SourceListItem,
SlicedHolder {

override val slice = Slice(card).apply {
setColor(adapter.cardBackground)
}

override val viewToSlice: View
get() = card
class ExtensionHolder(view: View, val adapter: ExtensionAdapter) :
BaseFlexibleViewHolder(view, adapter) {

init {
ext_button.setOnClickListener {
Expand All @@ -38,7 +25,6 @@ class ExtensionHolder(view: View, override val adapter: ExtensionAdapter) :

fun bind(item: ExtensionItem) {
val extension = item.extension
setCardEdges(item)

ext_title.text = extension.name
version.text = extension.versionName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import eu.davidea.flexibleadapter.items.IFlexible
import eu.kanade.tachiyomi.databinding.MigrationMangaControllerBinding
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
import eu.kanade.tachiyomi.ui.browse.SourceDividerItemDecoration
import eu.kanade.tachiyomi.ui.browse.migration.search.SearchController

class MigrationMangaController :
Expand Down Expand Up @@ -54,7 +53,6 @@ class MigrationMangaController :
adapter = FlexibleAdapter<IFlexible<*>>(null, this)
binding.recycler.layoutManager = LinearLayoutManager(view.context)
binding.recycler.adapter = adapter
binding.recycler.addItemDecoration(SourceDividerItemDecoration(view.context))
adapter?.fastScroller = binding.fastScroller
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import eu.davidea.flexibleadapter.FlexibleAdapter
import eu.kanade.tachiyomi.databinding.MigrationSourcesControllerBinding
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
import eu.kanade.tachiyomi.ui.browse.SourceDividerItemDecoration
import eu.kanade.tachiyomi.ui.browse.migration.manga.MigrationMangaController

class MigrationSourcesController :
Expand All @@ -32,7 +31,6 @@ class MigrationSourcesController :
adapter = SourceAdapter(this)
binding.recycler.layoutManager = LinearLayoutManager(view.context)
binding.recycler.adapter = adapter
binding.recycler.addItemDecoration(SourceDividerItemDecoration(view.context))
adapter?.fastScroller = binding.fastScroller
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,14 @@ package eu.kanade.tachiyomi.ui.browse.migration.sources
import android.view.View
import eu.kanade.tachiyomi.source.icon
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder
import eu.kanade.tachiyomi.ui.browse.SourceListItem
import io.github.mthli.slice.Slice
import kotlinx.android.synthetic.main.source_main_controller_card_item.card
import kotlinx.android.synthetic.main.source_main_controller_card_item.image
import kotlinx.android.synthetic.main.source_main_controller_card_item.title

class SourceHolder(view: View, override val adapter: SourceAdapter) :
BaseFlexibleViewHolder(view, adapter),
SourceListItem,
SlicedHolder {

override val slice = Slice(card).apply {
setColor(adapter.cardBackground)
}

override val viewToSlice: View
get() = card
class SourceHolder(view: View, val adapter: SourceAdapter) :
BaseFlexibleViewHolder(view, adapter) {

fun bind(item: SourceItem) {
val source = item.source
setCardEdges(item)

// Set source name
title.text = source.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import eu.kanade.tachiyomi.ui.base.controller.NucleusController
import eu.kanade.tachiyomi.ui.base.controller.requestPermissionsSafe
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
import eu.kanade.tachiyomi.ui.browse.BrowseController
import eu.kanade.tachiyomi.ui.browse.SourceDividerItemDecoration
import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceController
import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchController
import eu.kanade.tachiyomi.ui.browse.source.latest.LatestUpdatesController
Expand Down Expand Up @@ -93,7 +92,6 @@ class SourceController :
// Create recycler and set adapter.
binding.recycler.layoutManager = LinearLayoutManager(view.context)
binding.recycler.adapter = adapter
binding.recycler.addItemDecoration(SourceDividerItemDecoration(view.context))
adapter?.fastScroller = binding.fastScroller

requestPermissionsSafe(arrayOf(WRITE_EXTERNAL_STORAGE), 301)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,15 @@ import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.source.LocalSource
import eu.kanade.tachiyomi.source.icon
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder
import eu.kanade.tachiyomi.ui.browse.SourceListItem
import eu.kanade.tachiyomi.util.system.getResourceColor
import eu.kanade.tachiyomi.util.view.setVectorCompat
import io.github.mthli.slice.Slice
import kotlinx.android.synthetic.main.source_main_controller_card_item.card
import kotlinx.android.synthetic.main.source_main_controller_card_item.image
import kotlinx.android.synthetic.main.source_main_controller_card_item.pin
import kotlinx.android.synthetic.main.source_main_controller_card_item.source_latest
import kotlinx.android.synthetic.main.source_main_controller_card_item.title

class SourceHolder(private val view: View, override val adapter: SourceAdapter) :
BaseFlexibleViewHolder(view, adapter),
SourceListItem,
SlicedHolder {

override val slice = Slice(card).apply {
setColor(adapter.cardBackground)
}

override val viewToSlice: View
get() = card
class SourceHolder(private val view: View, val adapter: SourceAdapter) :
BaseFlexibleViewHolder(view, adapter) {

init {
source_latest.setOnClickListener {
Expand All @@ -41,7 +28,6 @@ class SourceHolder(private val view: View, override val adapter: SourceAdapter)

fun bind(item: SourceItem) {
val source = item.source
setCardEdges(item)

// Set source name
title.text = source.name
Expand Down
Loading

0 comments on commit a3c598a

Please sign in to comment.