parent
ad448b37ae
commit
6f7ae227a8
|
@ -6,11 +6,13 @@ package org.mozilla.fenix.library.bookmarks.selectfolder
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import kotlinx.android.extensions.LayoutContainer
|
import kotlinx.android.extensions.LayoutContainer
|
||||||
import mozilla.components.concept.storage.BookmarkNode
|
import mozilla.components.concept.storage.BookmarkNode
|
||||||
import mozilla.components.concept.storage.BookmarkNodeType
|
import mozilla.components.concept.storage.BookmarkNodeType
|
||||||
import mozilla.components.support.ktx.android.util.dpToPx
|
import mozilla.components.support.ktx.android.util.dpToPx
|
||||||
|
import org.jetbrains.anko.image
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.library.LibrarySiteItemView
|
import org.mozilla.fenix.library.LibrarySiteItemView
|
||||||
import org.mozilla.fenix.library.bookmarks.BookmarksSharedViewModel
|
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) {
|
fun bind(folder: BookmarkNodeWithDepth, selected: Boolean, onSelect: (BookmarkNode) -> Unit) {
|
||||||
view.changeSelected(selected)
|
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.titleView.text = folder.node.title
|
||||||
view.setOnClickListener {
|
view.setOnClickListener {
|
||||||
onSelect(folder.node)
|
onSelect(folder.node)
|
||||||
|
|
|
@ -2,19 +2,18 @@
|
||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- 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
|
- 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/. -->
|
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||||
<LinearLayout
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/selectBookmarkLayout"
|
android:id="@+id/selectBookmarkLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/recylerViewBookmarkFolders"
|
android:id="@+id/recylerViewBookmarkFolders"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
tools:listitem="@layout/bookmark_row"/>
|
tools:listitem="@layout/library_site_item" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
Loading…
Reference in New Issue