Cover only grid added to library (#6528)
* No title grid added to library and source * Else added to display title in case image is null or empty * No title grid renamed and now only available in library * Spanish strings about cover only grid removed Co-authored-by: micaelagimenez <micaela.gimenez@ext.prosegur.com>
This commit is contained in:
+3
-3
@@ -222,7 +222,7 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
(layoutManager as GridLayoutManager).spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
|
||||
override fun getSpanSize(position: Int): Int {
|
||||
return when (adapter?.getItemViewType(position)) {
|
||||
R.layout.source_compact_grid_item, R.layout.source_comfortable_grid_item, null -> 1
|
||||
R.layout.source_compact_grid_item, R.layout.source_comfortable_grid_item -> 1
|
||||
else -> spanCount
|
||||
}
|
||||
}
|
||||
@@ -273,9 +273,9 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
)
|
||||
|
||||
val displayItem = when (preferences.sourceDisplayMode().get()) {
|
||||
DisplayModeSetting.COMPACT_GRID -> R.id.action_compact_grid
|
||||
DisplayModeSetting.COMFORTABLE_GRID -> R.id.action_comfortable_grid
|
||||
DisplayModeSetting.LIST -> R.id.action_list
|
||||
DisplayModeSetting.COMFORTABLE_GRID -> R.id.action_comfortable_grid
|
||||
else -> R.id.action_compact_grid
|
||||
}
|
||||
menu.findItem(displayItem).isChecked = true
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ class SourceItem(val manga: Manga, private val displayMode: Preference<DisplayMo
|
||||
|
||||
override fun getLayoutRes(): Int {
|
||||
return when (displayMode.get()) {
|
||||
DisplayModeSetting.COMPACT_GRID -> R.layout.source_compact_grid_item
|
||||
DisplayModeSetting.COMFORTABLE_GRID -> R.layout.source_comfortable_grid_item
|
||||
DisplayModeSetting.LIST -> R.layout.source_list_item
|
||||
DisplayModeSetting.COMFORTABLE_GRID -> R.layout.source_comfortable_grid_item
|
||||
else -> R.layout.source_compact_grid_item
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,22 @@ class SourceItem(val manga: Manga, private val displayMode: Preference<DisplayMo
|
||||
adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>
|
||||
): SourceHolder<*> {
|
||||
return when (displayMode.get()) {
|
||||
DisplayModeSetting.COMPACT_GRID -> {
|
||||
DisplayModeSetting.LIST -> {
|
||||
SourceListHolder(view, adapter)
|
||||
}
|
||||
DisplayModeSetting.COMFORTABLE_GRID -> {
|
||||
val binding = SourceComfortableGridItemBinding.bind(view)
|
||||
val parent = adapter.recyclerView as AutofitRecyclerView
|
||||
val coverHeight = parent.itemWidth / 3 * 4
|
||||
view.apply {
|
||||
binding.card.layoutParams = ConstraintLayout.LayoutParams(
|
||||
MATCH_PARENT,
|
||||
coverHeight
|
||||
)
|
||||
}
|
||||
SourceComfortableGridHolder(view, adapter)
|
||||
}
|
||||
else -> {
|
||||
val binding = SourceCompactGridItemBinding.bind(view)
|
||||
val parent = adapter.recyclerView as AutofitRecyclerView
|
||||
val coverHeight = parent.itemWidth / 3 * 4
|
||||
@@ -50,21 +65,6 @@ class SourceItem(val manga: Manga, private val displayMode: Preference<DisplayMo
|
||||
}
|
||||
SourceCompactGridHolder(view, adapter)
|
||||
}
|
||||
DisplayModeSetting.COMFORTABLE_GRID -> {
|
||||
val binding = SourceComfortableGridItemBinding.bind(view)
|
||||
val parent = adapter.recyclerView as AutofitRecyclerView
|
||||
val coverHeight = parent.itemWidth / 3 * 4
|
||||
view.apply {
|
||||
binding.card.layoutParams = ConstraintLayout.LayoutParams(
|
||||
MATCH_PARENT,
|
||||
coverHeight
|
||||
)
|
||||
}
|
||||
SourceComfortableGridHolder(view, adapter)
|
||||
}
|
||||
DisplayModeSetting.LIST -> {
|
||||
SourceListHolder(view, adapter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user