1
0
Fork 0

Closes #4540 - Set correct tint for select bookmark folder icon (#4541)

master
Emily Kager 2019-08-05 14:54:39 -07:00 committed by Sawyer Blatz
parent ad448b37ae
commit 6f7ae227a8
2 changed files with 17 additions and 14 deletions

View File

@ -6,11 +6,13 @@ package org.mozilla.fenix.library.bookmarks.selectfolder
import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.extensions.LayoutContainer
import mozilla.components.concept.storage.BookmarkNode
import mozilla.components.concept.storage.BookmarkNodeType
import mozilla.components.support.ktx.android.util.dpToPx
import org.jetbrains.anko.image
import org.mozilla.fenix.R
import org.mozilla.fenix.library.LibrarySiteItemView
import org.mozilla.fenix.library.bookmarks.BookmarksSharedViewModel
@ -67,7 +69,9 @@ class SelectBookmarkFolderAdapter(private val sharedViewModel: BookmarksSharedVi
fun bind(folder: BookmarkNodeWithDepth, selected: Boolean, onSelect: (BookmarkNode) -> Unit) {
view.changeSelected(selected)
view.iconView.setImageResource(R.drawable.ic_folder_icon)
view.iconView.image = containerView.context.getDrawable(R.drawable.ic_folder_icon)?.apply {
setTint(ContextCompat.getColor(containerView.context, R.color.primary_text_light_theme))
}
view.titleView.text = folder.node.title
view.setOnClickListener {
onSelect(folder.node)

View File

@ -2,19 +2,18 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/selectBookmarkLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/selectBookmarkLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recylerViewBookmarkFolders"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/bookmark_row"/>
android:id="@+id/recylerViewBookmarkFolders"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/library_site_item" />
</LinearLayout>