For #8788 Use Flexbox instead of Grid manager for top sites
parent
a581486e1c
commit
320fc4e4ae
|
@ -504,6 +504,8 @@ dependencies {
|
|||
implementation Deps.androidx_work_ktx
|
||||
implementation Deps.google_material
|
||||
|
||||
implementation Deps.google_flexbox
|
||||
|
||||
implementation Deps.lottie
|
||||
|
||||
implementation Deps.adjust
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
package org.mozilla.fenix.home.sessioncontrol.viewholders
|
||||
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.android.flexbox.FlexboxLayoutManager
|
||||
import kotlinx.android.extensions.LayoutContainer
|
||||
import kotlinx.android.synthetic.main.component_top_sites.view.*
|
||||
import mozilla.components.feature.top.sites.TopSite
|
||||
|
@ -24,7 +24,7 @@ class TopSiteViewHolder(
|
|||
init {
|
||||
view.top_sites_list.apply {
|
||||
adapter = topSitesAdapter
|
||||
layoutManager = GridLayoutManager(view.context, NUM_COLUMNS)
|
||||
layoutManager = FlexboxLayoutManager(view.context)
|
||||
isNestedScrollingEnabled = false
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,5 @@ class TopSiteViewHolder(
|
|||
|
||||
companion object {
|
||||
const val LAYOUT_ID = R.layout.component_top_sites
|
||||
const val NUM_COLUMNS = 5
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/top_site_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:padding="4dp"
|
||||
|
|
|
@ -31,6 +31,7 @@ object Versions {
|
|||
const val androidx_transition = "1.3.0"
|
||||
const val androidx_work = "2.2.0"
|
||||
const val google_material = "1.1.0"
|
||||
const val google_flexbox = "2.0.1"
|
||||
|
||||
const val mozilla_android_components = "36.0.0-SNAPSHOT"
|
||||
|
||||
|
@ -174,6 +175,7 @@ object Deps {
|
|||
const val androidx_work_ktx = "androidx.work:work-runtime-ktx:${Versions.androidx_work}"
|
||||
const val androidx_work_testing = "androidx.work:work-testing:${Versions.androidx_work}"
|
||||
const val google_material = "com.google.android.material:material:${Versions.google_material}"
|
||||
const val google_flexbox = "com.google.android:flexbox:${Versions.google_flexbox}"
|
||||
|
||||
const val adjust = "com.adjust.sdk:adjust-android:${Versions.adjust}"
|
||||
const val installreferrer = "com.android.installreferrer:installreferrer:${Versions.installreferrer}"
|
||||
|
|
Loading…
Reference in New Issue