3x grid for 360DP mobiles

This commit is contained in:
aayush262
2024-01-02 21:08:33 +05:30
parent 18121f02eb
commit 4ec1baefe2
2 changed files with 2 additions and 2 deletions

View File

@@ -78,7 +78,7 @@ class SearchActivity : AppCompatActivity() {
mediaAdaptor = MediaAdaptor(style, model.searchResults.results, this, matchParent = true)
val headerAdaptor = SearchAdapter(this)
val gridSize = (screenWidth / 124f).toInt()
val gridSize = (screenWidth / 120f).toInt()
val gridLayoutManager = GridLayoutManager(this, gridSize)
gridLayoutManager.spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
override fun getSpanSize(position: Int): Int {

View File

@@ -46,7 +46,7 @@ class ListFragment : Fragment() {
binding.listRecyclerView.layoutManager =
GridLayoutManager(
requireContext(),
if (grid!!) (screenWidth / 124f).toInt() else 1
if (grid!!) (screenWidth / 120f).toInt() else 1
)
binding.listRecyclerView.adapter = adapter
}