@ -8,6 +8,7 @@ import android.content.Context
import android.graphics.ColorFilter
import android.graphics.PorterDuff
import android.graphics.PorterDuffColorFilter
import android.view.View
import android.view.ViewGroup
import android.widget.ActionMenuView
import android.widget.ImageButton
@ -15,8 +16,11 @@ import androidx.annotation.ColorInt
import androidx.appcompat.view.menu.ActionMenuItemView
import androidx.appcompat.widget.Toolbar
import androidx.core.content.ContextCompat
import androidx.core.view.children
import androidx.core.view.forEach
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
@ -27,20 +31,32 @@ open class LibraryPageView(
protected val context : Context inline get ( ) = containerView . context
protected val activity = context . asActivity ( )
protected fun setUiForNormalMode ( title : String ? ) {
protected fun setUiForNormalMode (
title : String ? ,
libraryItemsList : RecyclerView
) {
activity ?. title = title
setToolbarColors (
context . getColorFromAttr ( R . attr . primaryText ) ,
context . getColorFromAttr ( R . attr . foundation )
)
libraryItemsList . children . forEach {
item -> item . overflow _menu . visibility = View . VISIBLE
}
}
protected fun setUiForSelectingMode ( title : String ? ) {
protected fun setUiForSelectingMode (
title : String ? ,
libraryItemsList : RecyclerView
) {
activity ?. title = title
setToolbarColors (
ContextCompat . getColor ( context , R . color . white _color ) ,
context . getColorFromAttr ( R . attr . accentHighContrast )
)
libraryItemsList . children . forEach {
item -> item . overflow _menu . visibility = View . INVISIBLE
}
}
/ * *