diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt index 8c415ba081..1ed80836db 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt @@ -73,7 +73,7 @@ object PreferenceKeys { const val lastUsedCategory = "last_used_category" - const val catalogueDisplayMode = "pref_display_catalogue_display_mode" + const val catalogueDisplayMode = "pref_catalogue_display_mode" const val enabledLanguages = "source_languages" @@ -131,7 +131,7 @@ object PreferenceKeys { const val downloadNewCategories = "download_new_categories" - const val libraryDisplayMode = "pref_display_library_display_mode" + const val libraryDisplayMode = "pref_library_display_mode" const val lang = "app_language" diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceValues.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceValues.kt index 19ab786265..70c1e71b75 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceValues.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceValues.kt @@ -16,7 +16,9 @@ object PreferenceValues { const val THEME_DARK_BLUE = "blue" const val THEME_DARK_AMOLED = "amoled" - const val DISPLAY_COMPACT_GRID = 0 - const val DISPLAY_LIST = 1 - const val DISPLAY_COMFORTABLE_GRID = 2 + enum class DisplayMode(val value: Int) { + COMPACT_GRID(0), + COMFORTABLE_GRID(1), + LIST(2), + } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt index 96ffdd6499..801d8b7ebb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt @@ -7,9 +7,9 @@ import androidx.preference.PreferenceManager import com.tfcporciuncula.flow.FlowSharedPreferences import com.tfcporciuncula.flow.Preference import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.data.preference.PreferenceValues.DISPLAY_COMPACT_GRID import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys import eu.kanade.tachiyomi.data.preference.PreferenceValues as Values +import eu.kanade.tachiyomi.data.preference.PreferenceValues.DisplayMode import eu.kanade.tachiyomi.data.track.TrackService import eu.kanade.tachiyomi.data.track.anilist.Anilist import java.io.File @@ -139,7 +139,7 @@ class PreferencesHelper(val context: Context) { fun lastVersionCode() = flowPrefs.getInt("last_version_code", 0) - fun catalogueDisplayMode() = flowPrefs.getInt(Keys.catalogueDisplayMode, DISPLAY_COMPACT_GRID) + fun catalogueDisplayMode() = flowPrefs.getInt(Keys.catalogueDisplayMode, DisplayMode.COMPACT_GRID.value) fun enabledLanguages() = flowPrefs.getStringSet(Keys.enabledLanguages, setOf("en", Locale.getDefault().language)) @@ -185,7 +185,7 @@ class PreferencesHelper(val context: Context) { fun libraryUpdatePrioritization() = flowPrefs.getInt(Keys.libraryUpdatePrioritization, 0) - fun libraryDisplayMode() = flowPrefs.getInt(Keys.libraryDisplayMode, DISPLAY_COMPACT_GRID) + fun libraryDisplayMode() = flowPrefs.getInt(Keys.libraryDisplayMode, DisplayMode.COMPACT_GRID.value) fun downloadBadge() = flowPrefs.getBoolean(Keys.downloadBadge, false) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt index 48fd8579eb..04ece72398 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt @@ -22,9 +22,7 @@ import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Category import eu.kanade.tachiyomi.data.database.models.Manga -import eu.kanade.tachiyomi.data.preference.PreferenceValues.DISPLAY_COMFORTABLE_GRID -import eu.kanade.tachiyomi.data.preference.PreferenceValues.DISPLAY_COMPACT_GRID -import eu.kanade.tachiyomi.data.preference.PreferenceValues.DISPLAY_LIST +import eu.kanade.tachiyomi.data.preference.PreferenceValues.DisplayMode import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.asImmediateFlow import eu.kanade.tachiyomi.databinding.SourceControllerBinding @@ -190,7 +188,7 @@ open class BrowseSourceController(bundle: Bundle) : binding.catalogueView.removeView(oldRecycler) } - val recycler = if (preferences.catalogueDisplayMode().get() == DISPLAY_LIST) { + val recycler = if (preferences.catalogueDisplayMode().get() == DisplayMode.LIST.value) { RecyclerView(view.context).apply { id = R.id.recycler layoutManager = LinearLayoutManager(context) @@ -208,7 +206,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_grid_item, R.layout.source_comfortable_grid_item, null -> 1 + R.layout.source_compact_grid_item, R.layout.source_comfortable_grid_item, null -> 1 else -> spanCount } } @@ -270,10 +268,10 @@ open class BrowseSourceController(bundle: Bundle) : ) val displayItem = when (preferences.catalogueDisplayMode().get()) { - DISPLAY_COMPACT_GRID -> R.id.action_compact_grid - DISPLAY_LIST -> R.id.action_list - DISPLAY_COMFORTABLE_GRID -> R.id.action_comfortable_grid - else -> throw NotImplementedError("Unimplemented display") + DisplayMode.COMPACT_GRID.value -> R.id.action_compact_grid + DisplayMode.COMFORTABLE_GRID.value -> R.id.action_comfortable_grid + DisplayMode.LIST.value -> R.id.action_list + else -> throw NotImplementedError("Unknown display mode") } menu.findItem(displayItem).isChecked = true } @@ -291,9 +289,9 @@ open class BrowseSourceController(bundle: Bundle) : override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { R.id.action_search -> expandActionViewFromInteraction = true - R.id.action_compact_grid -> setDisplayMode(DISPLAY_COMPACT_GRID) - R.id.action_list -> setDisplayMode(DISPLAY_LIST) - R.id.action_comfortable_grid -> setDisplayMode(DISPLAY_COMFORTABLE_GRID) + R.id.action_compact_grid -> setDisplayMode(DisplayMode.COMPACT_GRID) + R.id.action_comfortable_grid -> setDisplayMode(DisplayMode.COMFORTABLE_GRID) + R.id.action_list -> setDisplayMode(DisplayMode.LIST) R.id.action_open_in_web_view -> openInWebView() R.id.action_local_source_help -> openLocalSourceHelpGuide() } @@ -440,15 +438,15 @@ open class BrowseSourceController(bundle: Bundle) : * * @param mode the mode to change to */ - private fun setDisplayMode(mode: Int) { + private fun setDisplayMode(mode: DisplayMode) { val view = view ?: return val adapter = adapter ?: return - preferences.catalogueDisplayMode().set(mode) + preferences.catalogueDisplayMode().set(mode.value) presenter.refreshDisplayMode() activity?.invalidateOptionsMenu() setupRecycler(view) - if (mode == DISPLAY_LIST || !view.context.connectivityManager.isActiveNetworkMetered) { + if (mode == DisplayMode.LIST || !view.context.connectivityManager.isActiveNetworkMetered) { // Initialize mangas if going to grid view or if over wifi when going to list view val mangas = (0 until adapter.itemCount).mapNotNull { (adapter.getItem(it) as? SourceItem)?.manga diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceGridHolder.kt index 887debb1d6..9c8794dcdb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceGridHolder.kt @@ -7,10 +7,10 @@ import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.data.glide.toMangaThumbnail import eu.kanade.tachiyomi.widget.StateImageViewTarget -import kotlinx.android.synthetic.main.source_grid_item.card -import kotlinx.android.synthetic.main.source_grid_item.progress -import kotlinx.android.synthetic.main.source_grid_item.thumbnail -import kotlinx.android.synthetic.main.source_grid_item.title +import kotlinx.android.synthetic.main.source_compact_grid_item.card +import kotlinx.android.synthetic.main.source_compact_grid_item.progress +import kotlinx.android.synthetic.main.source_compact_grid_item.thumbnail +import kotlinx.android.synthetic.main.source_compact_grid_item.title /** * Class used to hold the displayed data of a manga in the catalogue, like the cover or the title. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceItem.kt index 50b3ccc539..58568f15b6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceItem.kt @@ -12,20 +12,20 @@ import eu.davidea.flexibleadapter.items.AbstractFlexibleItem import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Manga -import eu.kanade.tachiyomi.data.preference.PreferenceValues.DISPLAY_COMPACT_GRID -import eu.kanade.tachiyomi.data.preference.PreferenceValues.DISPLAY_LIST +import eu.kanade.tachiyomi.data.preference.PreferenceValues.DisplayMode import eu.kanade.tachiyomi.widget.AutofitRecyclerView -import kotlinx.android.synthetic.main.source_grid_item.view.card -import kotlinx.android.synthetic.main.source_grid_item.view.gradient +import kotlinx.android.synthetic.main.source_compact_grid_item.view.card +import kotlinx.android.synthetic.main.source_compact_grid_item.view.gradient class SourceItem(val manga: Manga, private val catalogueDisplayMode: Preference) : AbstractFlexibleItem() { override fun getLayoutRes(): Int { return when (catalogueDisplayMode.get()) { - DISPLAY_COMPACT_GRID -> R.layout.source_grid_item - DISPLAY_LIST -> R.layout.source_list_item - else -> R.layout.source_comfortable_grid_item + DisplayMode.COMPACT_GRID.value -> R.layout.source_compact_grid_item + DisplayMode.COMFORTABLE_GRID.value -> R.layout.source_comfortable_grid_item + DisplayMode.LIST.value -> R.layout.source_list_item + else -> throw NotImplementedError("Unknown display mode") } } @@ -33,10 +33,10 @@ class SourceItem(val manga: Manga, private val catalogueDisplayMode: Preference< view: View, adapter: FlexibleAdapter> ): SourceHolder { - val parent = adapter.recyclerView - return if (parent is AutofitRecyclerView) { - val coverHeight = parent.itemWidth / 3 * 4 - if (catalogueDisplayMode.get() == DISPLAY_COMPACT_GRID) { + return when (catalogueDisplayMode.get()) { + DisplayMode.COMPACT_GRID.value -> { + val parent = adapter.recyclerView as AutofitRecyclerView + val coverHeight = parent.itemWidth / 3 * 4 view.apply { card.layoutParams = FrameLayout.LayoutParams( MATCH_PARENT, coverHeight @@ -46,19 +46,21 @@ class SourceItem(val manga: Manga, private val catalogueDisplayMode: Preference< ) } SourceGridHolder(view, adapter) - } else { + } + DisplayMode.COMFORTABLE_GRID.value -> { + val parent = adapter.recyclerView as AutofitRecyclerView + val coverHeight = parent.itemWidth / 3 * 4 view.apply { card.layoutParams = ConstraintLayout.LayoutParams( MATCH_PARENT, coverHeight ) - gradient.layoutParams = FrameLayout.LayoutParams( - MATCH_PARENT, coverHeight / 2, Gravity.BOTTOM - ) } SourceComfortableGridHolder(view, adapter) } - } else { - SourceListHolder(view, adapter) + DisplayMode.LIST.value -> { + SourceListHolder(view, adapter) + } + else -> throw NotImplementedError("Unknown display mode") } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt index d2a6026692..2268811171 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Category import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.library.LibraryUpdateService -import eu.kanade.tachiyomi.data.preference.PreferenceValues.DISPLAY_LIST +import eu.kanade.tachiyomi.data.preference.PreferenceValues.DisplayMode import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.util.lang.plusAssign import eu.kanade.tachiyomi.util.system.toast @@ -73,7 +73,7 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att fun onCreate(controller: LibraryController) { this.controller = controller - recycler = if (preferences.libraryDisplayMode().get() == DISPLAY_LIST) { + recycler = if (preferences.libraryDisplayMode().get() == DisplayMode.LIST.value) { (swipe_refresh.inflate(R.layout.library_list_recycler) as RecyclerView).apply { layoutManager = LinearLayoutManager(context) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt index abcf50d2a3..4a01c7d539 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt @@ -7,12 +7,12 @@ import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.data.glide.toMangaThumbnail import eu.kanade.tachiyomi.util.isLocal import eu.kanade.tachiyomi.util.view.visibleIf -import kotlinx.android.synthetic.main.source_grid_item.card -import kotlinx.android.synthetic.main.source_grid_item.download_text -import kotlinx.android.synthetic.main.source_grid_item.local_text -import kotlinx.android.synthetic.main.source_grid_item.thumbnail -import kotlinx.android.synthetic.main.source_grid_item.title -import kotlinx.android.synthetic.main.source_grid_item.unread_text +import kotlinx.android.synthetic.main.source_compact_grid_item.card +import kotlinx.android.synthetic.main.source_compact_grid_item.download_text +import kotlinx.android.synthetic.main.source_compact_grid_item.local_text +import kotlinx.android.synthetic.main.source_compact_grid_item.thumbnail +import kotlinx.android.synthetic.main.source_compact_grid_item.title +import kotlinx.android.synthetic.main.source_compact_grid_item.unread_text /** * Class used to hold the displayed data of a manga in the library, like the cover or the title. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt index 053c8657c9..0166944479 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt @@ -13,12 +13,11 @@ import eu.davidea.flexibleadapter.items.IFilterable import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.LibraryManga -import eu.kanade.tachiyomi.data.preference.PreferenceValues.DISPLAY_COMPACT_GRID -import eu.kanade.tachiyomi.data.preference.PreferenceValues.DISPLAY_LIST +import eu.kanade.tachiyomi.data.preference.PreferenceValues.DisplayMode import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.widget.AutofitRecyclerView -import kotlinx.android.synthetic.main.source_grid_item.view.card -import kotlinx.android.synthetic.main.source_grid_item.view.gradient +import kotlinx.android.synthetic.main.source_compact_grid_item.view.card +import kotlinx.android.synthetic.main.source_compact_grid_item.view.gradient import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get @@ -32,17 +31,18 @@ class LibraryItem(val manga: LibraryManga, private val libraryDisplayMode: Prefe override fun getLayoutRes(): Int { return when (libraryDisplayMode.get()) { - DISPLAY_COMPACT_GRID -> R.layout.source_grid_item - DISPLAY_LIST -> R.layout.source_list_item - else -> R.layout.source_comfortable_grid_item + DisplayMode.COMPACT_GRID.value -> R.layout.source_compact_grid_item + DisplayMode.COMFORTABLE_GRID.value -> R.layout.source_comfortable_grid_item + DisplayMode.LIST.value -> R.layout.source_list_item + else -> throw NotImplementedError("Unknown display mode") } } override fun createViewHolder(view: View, adapter: FlexibleAdapter>): LibraryHolder { - val parent = adapter.recyclerView - return if (parent is AutofitRecyclerView) { - val coverHeight = parent.itemWidth / 3 * 4 - if (libraryDisplayMode.get() == DISPLAY_COMPACT_GRID) { + return when (libraryDisplayMode.get()) { + DisplayMode.COMPACT_GRID.value -> { + val parent = adapter.recyclerView as AutofitRecyclerView + val coverHeight = parent.itemWidth / 3 * 4 view.apply { card.layoutParams = FrameLayout.LayoutParams(MATCH_PARENT, coverHeight) gradient.layoutParams = FrameLayout.LayoutParams( @@ -50,19 +50,21 @@ class LibraryItem(val manga: LibraryManga, private val libraryDisplayMode: Prefe ) } LibraryGridHolder(view, adapter) - } else { + } + DisplayMode.COMFORTABLE_GRID.value -> { + val parent = adapter.recyclerView as AutofitRecyclerView + val coverHeight = parent.itemWidth / 3 * 4 view.apply { card.layoutParams = ConstraintLayout.LayoutParams( MATCH_PARENT, coverHeight ) - gradient.layoutParams = FrameLayout.LayoutParams( - MATCH_PARENT, coverHeight / 2, Gravity.BOTTOM - ) } LibraryComfortableGridHolder(view, adapter) } - } else { - LibraryListHolder(view, adapter) + DisplayMode.LIST.value -> { + LibraryListHolder(view, adapter) + } + else -> throw NotImplementedError("Unknown display mode") } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt index c160dcbc91..408591282e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt @@ -5,9 +5,7 @@ import android.content.Context import android.util.AttributeSet import android.view.View import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.data.preference.PreferenceValues.DISPLAY_COMFORTABLE_GRID -import eu.kanade.tachiyomi.data.preference.PreferenceValues.DISPLAY_COMPACT_GRID -import eu.kanade.tachiyomi.data.preference.PreferenceValues.DISPLAY_LIST +import eu.kanade.tachiyomi.data.preference.PreferenceValues.DisplayMode import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.widget.ExtendedNavigationView import eu.kanade.tachiyomi.widget.TabbedBottomSheetDialog @@ -185,19 +183,19 @@ class LibrarySettingsSheet( inner class DisplayGroup : Group { - private val grid = Item.Radio(R.string.action_display_grid, this) + private val compactGrid = Item.Radio(R.string.action_display_grid, this) private val comfortableGrid = Item.Radio(R.string.action_display_comfortable_grid, this) private val list = Item.Radio(R.string.action_display_list, this) override val header = null - override val items = listOf(grid, comfortableGrid, list) + override val items = listOf(compactGrid, comfortableGrid, list) override val footer = null override fun initModels() { val mode = preferences.libraryDisplayMode().get() - grid.checked = mode == DISPLAY_COMPACT_GRID - list.checked = mode == DISPLAY_LIST - comfortableGrid.checked = mode == DISPLAY_COMFORTABLE_GRID + compactGrid.checked = mode == DisplayMode.COMPACT_GRID.value + comfortableGrid.checked = mode == DisplayMode.COMFORTABLE_GRID.value + list.checked = mode == DisplayMode.LIST.value } override fun onItemClicked(item: Item) { @@ -209,9 +207,10 @@ class LibrarySettingsSheet( preferences.libraryDisplayMode().set( when (item) { - grid -> DISPLAY_COMPACT_GRID - list -> DISPLAY_LIST - else -> DISPLAY_COMFORTABLE_GRID + compactGrid -> DisplayMode.COMPACT_GRID.value + comfortableGrid -> DisplayMode.COMFORTABLE_GRID.value + list -> DisplayMode.LIST.value + else -> throw NotImplementedError("Unknown display mode") } ) diff --git a/app/src/main/res/drawable/ic_view_list_24dp.xml b/app/src/main/res/drawable/ic_view_list_24dp.xml deleted file mode 100644 index fee886818b..0000000000 --- a/app/src/main/res/drawable/ic_view_list_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/layout/library_grid_recycler.xml b/app/src/main/res/layout/library_grid_recycler.xml index ded61710d8..68d03e83ed 100644 --- a/app/src/main/res/layout/library_grid_recycler.xml +++ b/app/src/main/res/layout/library_grid_recycler.xml @@ -11,4 +11,4 @@ android:paddingTop="5dp" android:paddingEnd="5dp" android:paddingBottom="@dimen/action_toolbar_list_padding" - tools:listitem="@layout/source_grid_item" /> + tools:listitem="@layout/source_compact_grid_item" /> diff --git a/app/src/main/res/layout/source_comfortable_grid_item.xml b/app/src/main/res/layout/source_comfortable_grid_item.xml index 376bd49071..ef8c6a2045 100644 --- a/app/src/main/res/layout/source_comfortable_grid_item.xml +++ b/app/src/main/res/layout/source_comfortable_grid_item.xml @@ -8,13 +8,12 @@ android:padding="4dp"> + android:layout_width="match_parent" + android:layout_height="wrap_content"> - - + - \ No newline at end of file + + diff --git a/app/src/main/res/layout/source_grid_item.xml b/app/src/main/res/layout/source_compact_grid_item.xml similarity index 100% rename from app/src/main/res/layout/source_grid_item.xml rename to app/src/main/res/layout/source_compact_grid_item.xml diff --git a/app/src/main/res/layout/source_recycler_autofit.xml b/app/src/main/res/layout/source_recycler_autofit.xml index dead2ec4d2..902ae8bc55 100644 --- a/app/src/main/res/layout/source_recycler_autofit.xml +++ b/app/src/main/res/layout/source_recycler_autofit.xml @@ -8,4 +8,4 @@ android:clipToPadding="false" android:columnWidth="140dp" android:padding="5dp" - tools:listitem="@layout/source_grid_item" /> + tools:listitem="@layout/source_compact_grid_item" />