2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

For #1949 - Fixes bookmark separator appearance, removes menu (#3957)

This commit is contained in:
Emily Kager 2019-07-10 15:23:35 -04:00 committed by Colin Lee
parent 21c75ca1bb
commit 9e7282cf18
2 changed files with 30 additions and 26 deletions

View File

@ -262,8 +262,16 @@ class BookmarkAdapter(val emptyView: View, val actionEmitter: Observer<BookmarkA
BookmarkNodeViewHolder(view, actionEmitter, job, containerView) {
override fun bind(item: BookmarkNode, mode: BookmarkState.Mode, selected: Boolean) {
bookmark_favicon.setImageResource(R.drawable.ic_folder_icon)
containerView?.context?.let {
val drawable = it.getDrawable(R.drawable.ic_folder_icon)
drawable?.setTint(
ContextCompat.getColor(
it,
R.color.primary_text_light_theme
)
)
bookmark_favicon.setImageDrawable(drawable)
}
bookmark_favicon.visibility = View.VISIBLE
bookmark_title.visibility = View.VISIBLE
bookmark_url.visibility = View.GONE
@ -364,7 +372,7 @@ class BookmarkAdapter(val emptyView: View, val actionEmitter: Observer<BookmarkA
bookmark_title.visibility = View.GONE
bookmark_url.visibility = View.GONE
bookmark_overflow.increaseTapArea(bookmarkOverflowExtraDips)
bookmark_overflow.visibility = View.VISIBLE
bookmark_overflow.visibility = View.GONE
bookmark_separator.visibility = View.VISIBLE
bookmark_layout.isClickable = false

View File

@ -2,30 +2,27 @@
<!-- 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/. -->
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout 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/bookmark_layout"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:padding="4dp"
android:paddingStart="20dp"
android:paddingEnd="0dp"
android:background="?android:attr/selectableItemBackground">
android:focusable="true">
<ImageView
android:id="@+id/bookmark_favicon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="20dp"
android:background="@drawable/favicon_background"
android:importantForAccessibility="no"
android:padding="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
tools:src="@drawable/ic_folder_icon" />
<TextView
@ -37,12 +34,12 @@
android:ellipsize="end"
android:singleLine="true"
android:textAlignment="viewStart"
android:textSize="18sp"
android:textColor="?primaryText"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/bookmark_url"
app:layout_constraintEnd_toStartOf="@id/bookmark_overflow"
app:layout_constraintStart_toEndOf="@id/bookmark_favicon"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/bookmark_url"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Internet" />
@ -56,11 +53,11 @@
android:textAlignment="viewStart"
android:textColor="?secondaryText"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/bookmark_overflow"
app:layout_constraintStart_toEndOf="@id/bookmark_favicon"
app:layout_constraintTop_toBottomOf="@id/bookmark_title"
tools:text="https://github.com/mozilla-mobile/fenix"
app:layout_constraintBottom_toBottomOf="parent" />
tools:text="https://github.com/mozilla-mobile/fenix" />
<ImageButton
android:id="@+id/bookmark_overflow"
@ -72,20 +69,19 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/bookmark_separator"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginStart="68dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:importantForAccessibility="no"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/bookmark_overflow"
android:layout_height="2dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="?neutralFaded"
android:visibility="gone"/>
android:importantForAccessibility="no"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>