From 55a200907a3ad8f682bfac14166b3f06fa5a2017 Mon Sep 17 00:00:00 2001 From: Mihai Adrian <48995920+mcarare@users.noreply.github.com> Date: Sat, 16 Nov 2019 01:48:48 +0200 Subject: [PATCH] For #2570: Hide 3-dots menu for all library items when in select mode. (#6321) Used notifyItemRangeChanged to redraw already drawn items. --- .../org/mozilla/fenix/library/LibraryPageView.kt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/library/LibraryPageView.kt b/app/src/main/java/org/mozilla/fenix/library/LibraryPageView.kt index 39ffa7b65..773927fb4 100644 --- a/app/src/main/java/org/mozilla/fenix/library/LibraryPageView.kt +++ b/app/src/main/java/org/mozilla/fenix/library/LibraryPageView.kt @@ -8,16 +8,12 @@ import android.content.Context import android.view.ViewGroup import androidx.appcompat.widget.Toolbar import androidx.core.content.ContextCompat -import androidx.core.view.children import androidx.recyclerview.widget.RecyclerView import kotlinx.android.extensions.LayoutContainer -import kotlinx.android.synthetic.main.library_site_item.view.* import org.mozilla.fenix.R import org.mozilla.fenix.ext.asActivity import org.mozilla.fenix.ext.getColorFromAttr -import org.mozilla.fenix.ext.hideAndDisable import org.mozilla.fenix.ext.setToolbarColors -import org.mozilla.fenix.ext.showAndEnable open class LibraryPageView( override val containerView: ViewGroup @@ -35,9 +31,7 @@ open class LibraryPageView( backgroundColor = context.getColorFromAttr(R.attr.foundation) ) libraryItemsList.setItemViewCacheSize(0) - libraryItemsList.children.forEach { item -> - item.overflow_menu.showAndEnable() - } + libraryItemsList.adapter?.notifyItemRangeChanged(0, libraryItemsList.childCount) } protected fun setUiForSelectingMode( @@ -50,9 +44,7 @@ open class LibraryPageView( backgroundColor = context.getColorFromAttr(R.attr.accentHighContrast) ) libraryItemsList.setItemViewCacheSize(0) - libraryItemsList.children.forEach { item -> - item.overflow_menu.hideAndDisable() - } + libraryItemsList.adapter?.notifyItemRangeChanged(0, libraryItemsList.childCount) } private fun updateToolbar(title: String?, foregroundColor: Int, backgroundColor: Int) {