2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00
* Fixes https://github.com/mozilla-mobile/fenix/issues/4067 besides snackbar

Makes layout hierarchy more shallow to increase performance.

* Fix https://github.com/mozilla-mobile/fenix/issues/4067 Feedback

Make sure quick_action_overlay appears on top and use horizontal chain in tab_header.
This commit is contained in:
Amaan Marfatia 2019-08-27 13:09:55 -04:00 committed by Jeff Boek
parent 118c704270
commit f42c71ccfe
8 changed files with 447 additions and 440 deletions

View File

@ -10,7 +10,7 @@ import android.util.AttributeSet
import android.view.View
import android.view.accessibility.AccessibilityEvent
import android.view.accessibility.AccessibilityNodeInfo
import android.widget.LinearLayout
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.widget.NestedScrollView
import com.google.android.material.bottomsheet.BottomSheetBehavior
import kotlinx.android.synthetic.main.layout_quick_action_sheet.view.*
@ -29,7 +29,7 @@ class QuickActionSheet @JvmOverloads constructor(
attrs: AttributeSet? = null,
defStyle: Int = 0,
defStyleRes: Int = 0
) : LinearLayout(context, attrs, defStyle, defStyleRes) {
) : ConstraintLayout(context, attrs, defStyle, defStyleRes) {
private val scope = MainScope()

View File

@ -66,12 +66,12 @@ class QuickActionSheetView(
updateImportantForAccessibility(quickActionSheetBehavior.state)
view.quick_action_share.setOnClickListener(this)
view.quick_action_downloads.setOnClickListener(this)
view.quick_action_bookmark.setOnClickListener(this)
view.quick_action_read.setOnClickListener(this)
view.quick_action_appearance.setOnClickListener(this)
view.quick_action_open_app_link.setOnClickListener(this)
quick_action_share.setOnClickListener(this)
quick_action_downloads.setOnClickListener(this)
quick_action_bookmark.setOnClickListener(this)
quick_action_read.setOnClickListener(this)
quick_action_appearance.setOnClickListener(this)
quick_action_open_app_link.setOnClickListener(this)
}
/**
@ -94,7 +94,7 @@ class QuickActionSheetView(
* Changes alpha of overlay based on new offset of this sheet within [-1,1] range.
*/
private fun animateOverlay(offset: Float) {
overlay.alpha = (1 - offset)
quick_action_overlay.alpha = (1 - offset)
}
/**

View File

@ -2,116 +2,111 @@
<!-- 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/. -->
<FrameLayout
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/item_collection"
android:layout_width="match_parent"
<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/item_collection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:background="@drawable/collection_home_list_row_background"
android:clickable="true"
android:clipToPadding="false"
android:elevation="5dp"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/collection_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:background="@drawable/collection_home_list_row_background"
android:clickable="true"
android:clipToPadding="false"
android:elevation="5dp"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground">
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:importantForAccessibility="no"
android:src="@drawable/ic_tab_collection"
android:tint="@null"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/collection_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:ellipsize="end"
android:gravity="start"
android:maxLines="1"
android:minLines="1"
android:textAppearance="@style/Header16TextStyle"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toStartOf="@id/chevron"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@+id/collection_icon"
app:layout_constraintTop_toTopOf="parent"
tools:text="@tools:sample/lorem/random" />
<ImageView
android:id="@+id/collection_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:importantForAccessibility="no"
android:src="@drawable/ic_tab_collection"
android:tint="@null"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/chevron"
android:layout_width="10dp"
android:layout_height="6dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="16dp"
android:background="@drawable/ic_chevron"
android:contentDescription="@string/tab_menu"
app:layout_constraintEnd_toStartOf="@+id/collection_share_button"
app:layout_constraintStart_toEndOf="@+id/collection_title"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/collection_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:ellipsize="end"
android:gravity="start"
android:maxLines="1"
android:minLines="1"
android:textAppearance="@style/Header16TextStyle"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toStartOf="@id/chevron"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@+id/collection_icon"
app:layout_constraintTop_toTopOf="parent"
tools:text="@tools:sample/lorem/random" />
<TextView
android:id="@+id/collection_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:ellipsize="end"
android:maxLines="2"
android:minLines="2"
android:textAppearance="@style/SubtitleTextStyle"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/collection_share_button"
app:layout_constraintStart_toStartOf="@id/collection_title"
app:layout_constraintTop_toBottomOf="@id/collection_title"
tools:text="@tools:sample/lorem/random" />
<ImageView
android:id="@+id/chevron"
android:layout_width="10dp"
android:layout_height="6dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="16dp"
android:background="@drawable/ic_chevron"
android:contentDescription="@string/tab_menu"
app:layout_constraintEnd_toStartOf="@+id/collection_share_button"
app:layout_constraintStart_toEndOf="@+id/collection_title"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/collection_share_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/share_button_content_description"
android:src="@drawable/ic_hollow_share"
app:layout_constraintBottom_toBottomOf="@id/collection_icon"
app:layout_constraintEnd_toStartOf="@id/collection_overflow_button"
app:layout_constraintTop_toTopOf="@id/collection_icon" />
<TextView
android:id="@+id/collection_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:ellipsize="end"
android:maxLines="2"
android:minLines="2"
android:textAppearance="@style/SubtitleTextStyle"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/collection_share_button"
app:layout_constraintStart_toStartOf="@id/collection_title"
app:layout_constraintTop_toBottomOf="@id/collection_title"
tools:text="@tools:sample/lorem/random" />
<ImageButton
android:id="@+id/collection_overflow_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/collection_menu_button_content_description"
android:src="@drawable/ic_menu"
app:layout_constraintBottom_toBottomOf="@id/collection_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/collection_icon" />
<ImageButton
android:id="@+id/collection_share_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/share_button_content_description"
android:src="@drawable/ic_hollow_share"
app:layout_constraintEnd_toStartOf="@id/collection_overflow_button"
app:layout_constraintBottom_toBottomOf="@id/collection_icon"
app:layout_constraintTop_toTopOf="@id/collection_icon" />
<ImageButton
android:id="@+id/collection_overflow_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/collection_menu_button_content_description"
android:src="@drawable/ic_menu"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/collection_icon"
app:layout_constraintBottom_toBottomOf="@id/collection_icon"/>
<View
android:id="@+id/selected_border"
android:layout_width="0dp"
android:layout_height="0dp"
android:alpha="0"
android:background="@drawable/session_border"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
<View
android:id="@+id/selected_border"
android:layout_width="0dp"
android:layout_height="0dp"
android:alpha="0"
android:background="@drawable/session_border"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -26,103 +26,97 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<FrameLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="?above"
android:background="@drawable/bottom_sheet_dialog_fragment_background"
android:backgroundTint="?above"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.Group
android:id="@+id/send_tab_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="account_header,account_devices_recyclerview,divider_line" />
<TextView
android:id="@+id/account_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:singleLine="true"
android:text="@string/share_device_subheader"
android:textAllCaps="true"
android:textColor="?secondaryText"
android:textSize="12sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<org.mozilla.fenix.share.AccountDevicesShareRecyclerView
android:id="@+id/account_devices_recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingEnd="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_header" />
<androidx.constraintlayout.widget.Group
android:id="@+id/send_tab_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="account_header,account_devices_recyclerview,divider_line"/>
<View
android:id="@+id/divider_line"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:background="?neutralFaded"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_devices_recyclerview" />
<TextView
android:text="@string/share_device_subheader"
android:textAllCaps="true"
android:singleLine="true"
android:textColor="?secondaryText"
android:textSize="12sp"
android:textStyle="bold"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/account_header"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/link_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:singleLine="true"
android:text="@string/share_link_subheader"
android:textAllCaps="true"
android:textColor="?secondaryText"
android:textSize="12sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/divider_line" />
<org.mozilla.fenix.share.AccountDevicesShareRecyclerView
android:id="@+id/account_devices_recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="8dp"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_header"/>
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="76dp"
android:layout_height="37dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/link_header" />
<View
android:id="@+id/divider_line"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:background="?neutralFaded"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_devices_recyclerview"/>
<org.mozilla.fenix.share.AppShareRecyclerView
android:id="@+id/intent_handler_recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingEnd="8dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/link_header" />
<TextView
android:text="@string/share_link_subheader"
android:textAllCaps="true"
android:singleLine="true"
android:textColor="?secondaryText"
android:textSize="12sp"
android:textStyle="bold"
android:layout_marginStart="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:id="@+id/link_header"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/divider_line"/>
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="76dp"
android:layout_height="37dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
app:layout_constraintTop_toBottomOf="@+id/link_header"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<org.mozilla.fenix.share.AppShareRecyclerView
android:id="@+id/intent_handler_recyclerview"
android:paddingStart="16dp"
android:paddingEnd="8dp"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/link_header"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -2,63 +2,65 @@
<!-- 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/. -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout
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:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:orientation="horizontal"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:background="@drawable/fenix_snackbar_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:background="@drawable/fenix_snackbar_background"
android:elevation="4dp"
android:minHeight="48dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:orientation="horizontal"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="8dp">
<TextView
android:id="@+id/snackbar_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:letterSpacing="0.05"
android:maxLines="2"
android:textAlignment="textStart"
android:textColor="@color/photonWhite"
android:textSize="18sp"
android:textStyle="bold"
android:typeface="sans"
android:letterSpacing="0.05"
tools:text="This is a custom Snackbar text"
android:textAlignment="textStart"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/snackbar_btn"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
tools:text="This is a custom Snackbar text" />
<Button
android:id="@+id/snackbar_btn"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/photonWhite"
android:textAlignment="textEnd"
android:layout_marginStart="16dp"
tools:text="Action text"
android:padding="0dp"
android:minHeight="0dp"
android:letterSpacing="0.05"
android:minWidth="0dp"
android:textSize="14sp"
android:minHeight="0dp"
android:padding="0dp"
android:textAlignment="textEnd"
android:textAllCaps="true"
android:textColor="@color/photonWhite"
android:textSize="14sp"
android:textStyle="bold"
android:typeface="sans"
android:letterSpacing="0.05"
android:visibility="gone"
app:layout_constraintStart_toEndOf="@id/snackbar_text"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/snackbar_text"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
tools:text="Action text" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@ -2,18 +2,23 @@
<!-- 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"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/quick_action_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?foundation"
android:orientation="vertical">
android:background="?foundation">
<View
android:id="@+id/quick_action_sheet_faded_handle"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/neutralFaded"
android:focusable="false" />
android:focusable="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/quick_action_sheet_handle"
@ -22,109 +27,115 @@
android:background="@null"
android:contentDescription="@string/quick_action_sheet_handle"
android:paddingTop="7dp"
android:src="@drawable/ic_drawer_pull_tab" />
android:src="@drawable/ic_drawer_pull_tab"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/quick_action_sheet_faded_handle" />
<FrameLayout
<LinearLayout
android:id="@+id/quick_action_buttons_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="12dp"
android:background="@null"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/quick_action_sheet_handle">
<LinearLayout
android:id="@+id/quick_action_buttons_layout"
android:layout_width="match_parent"
<Button
android:id="@+id/quick_action_share"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="12dp"
android:background="@null"
android:orientation="horizontal">
android:layout_weight="1"
android:background="?selectableItemBackgroundBorderless"
android:drawableTop="@drawable/quick_action_icon_share"
android:drawablePadding="5dp"
android:text="@string/quick_action_share"
android:textAllCaps="false"
android:textColor="?primaryText"
android:textSize="12sp" />
<Button
android:id="@+id/quick_action_share"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?selectableItemBackgroundBorderless"
android:drawableTop="@drawable/quick_action_icon_share"
android:drawablePadding="5dp"
android:text="@string/quick_action_share"
android:textAllCaps="false"
android:textColor="?primaryText"
android:textSize="12sp" />
<Button
android:id="@+id/quick_action_downloads"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?selectableItemBackgroundBorderless"
android:drawableTop="@drawable/library_icon_downloads_circle_background"
android:drawablePadding="5dp"
android:text="@string/quick_action_download"
android:textAllCaps="false"
android:textColor="?primaryText"
android:textSize="12sp"
android:visibility="gone" />
<Button
android:id="@+id/quick_action_downloads"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?selectableItemBackgroundBorderless"
android:drawableTop="@drawable/library_icon_downloads_circle_background"
android:drawablePadding="5dp"
android:text="@string/quick_action_download"
android:textAllCaps="false"
android:textColor="?primaryText"
android:textSize="12sp"
android:visibility="gone" />
<Button
android:id="@+id/quick_action_bookmark"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?selectableItemBackgroundBorderless"
android:drawableTop="@drawable/bookmark_two_state"
android:drawablePadding="5dp"
android:text="@string/quick_action_bookmark"
android:textAllCaps="false"
android:textColor="?primaryText"
android:textSize="12sp" />
<Button
android:id="@+id/quick_action_bookmark"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?selectableItemBackgroundBorderless"
android:drawableTop="@drawable/bookmark_two_state"
android:drawablePadding="5dp"
android:text="@string/quick_action_bookmark"
android:textAllCaps="false"
android:textColor="?primaryText"
android:textSize="12sp" />
<Button
android:id="@+id/quick_action_appearance"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?selectableItemBackgroundBorderless"
android:drawableTop="@drawable/quick_action_icon_appearance"
android:drawablePadding="5dp"
android:text="@string/quick_action_read_appearance"
android:textAllCaps="false"
android:textColor="?primaryText"
android:textSize="12sp"
android:visibility="gone" />
<Button
android:id="@+id/quick_action_appearance"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?selectableItemBackgroundBorderless"
android:drawableTop="@drawable/quick_action_icon_appearance"
android:drawablePadding="5dp"
android:text="@string/quick_action_read_appearance"
android:textAllCaps="false"
android:textColor="?primaryText"
android:textSize="12sp"
android:visibility="gone" />
<Button
android:id="@+id/quick_action_open_app_link"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?selectableItemBackgroundBorderless"
android:drawableTop="@drawable/library_icon_app_links_circle_background"
android:drawablePadding="5dp"
android:text="@string/quick_action_open_app_link"
android:textAllCaps="false"
android:textColor="?primaryText"
android:textSize="12sp"
android:visibility="gone" />
<Button
android:id="@+id/quick_action_open_app_link"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?selectableItemBackgroundBorderless"
android:drawableTop="@drawable/library_icon_app_links_circle_background"
android:drawablePadding="5dp"
android:text="@string/quick_action_open_app_link"
android:textAllCaps="false"
android:textColor="?primaryText"
android:textSize="12sp"
android:visibility="gone" />
<Button
android:id="@+id/quick_action_read"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?selectableItemBackgroundBorderless"
android:drawableTop="@drawable/reader_two_state"
android:drawablePadding="5dp"
android:text="@string/quick_action_read"
android:textAllCaps="false"
android:textColor="?primaryText"
android:textSize="12sp"
android:visibility="gone" />
</LinearLayout>
<Button
android:id="@+id/quick_action_read"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?selectableItemBackgroundBorderless"
android:drawableTop="@drawable/reader_two_state"
android:drawablePadding="5dp"
android:text="@string/quick_action_read"
android:textAllCaps="false"
android:textColor="?primaryText"
android:textSize="12sp"
android:visibility="gone" />
</LinearLayout>
<View
android:id="@+id/overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.0"
android:background="?foundation" />
</FrameLayout>
</LinearLayout>
<View
android:id="@+id/quick_action_overlay"
android:layout_width="0dp"
android:layout_height="0dp"
android:alpha="0.0"
android:background="?foundation"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/quick_action_buttons_layout" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -6,58 +6,68 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/tabs_header"
android:layout_marginBottom="8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<TextView
android:id="@+id/header_text"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4.5dp"
android:text="@string/tab_header_label"
android:textAppearance="@style/HeaderTextStyle"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/add_tab_button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
<ImageButton
android:id="@+id/add_tab_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/add_tab"
android:src="@drawable/ic_new"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<ImageButton
android:id="@+id/add_tab_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/add_tab"
android:src="@drawable/ic_new"/>
app:layout_constraintEnd_toStartOf="@+id/share_tabs_button"
app:layout_constraintStart_toEndOf="@id/header_text"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/share_tabs_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/tabs_menu_share_tabs"
android:src="@drawable/ic_hollow_share"/>
<ImageButton
android:id="@+id/share_tabs_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/tabs_menu_share_tabs"
android:src="@drawable/ic_hollow_share"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/close_tabs_button"
app:layout_constraintStart_toEndOf="@+id/add_tab_button"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/close_tabs_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/tabs_menu_close_all_tabs"
android:src="@drawable/ic_delete"/>
<ImageButton
android:id="@+id/close_tabs_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/tabs_menu_close_all_tabs"
android:src="@drawable/ic_delete"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/tabs_overflow_button"
app:layout_constraintStart_toEndOf="@+id/share_tabs_button"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/tabs_overflow_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/open_tabs_menu"
android:src="@drawable/ic_menu"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/close_tabs_button"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/tabs_overflow_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/open_tabs_menu"
android:src="@drawable/ic_menu" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -2,84 +2,79 @@
<!-- 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"
android:id="@+id/tab_in_collection_item"
android:layout_width="match_parent"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/tab_in_collection_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?above"
android:clickable="true"
android:clipToPadding="false"
android:elevation="5dp"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/collection_tab_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="16dp"
android:layout_marginTop="23dp"
android:layout_marginBottom="24dp"
android:importantForAccessibility="no"
android:src="@drawable/ic_tab_collection"
android:tint="@null"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/collection_tab_hostname"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:clickable="true"
android:clipToPadding="false"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
android:background="?above"
android:elevation="5dp">
android:layout_marginStart="14dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="74dp"
android:ellipsize="end"
android:maxLines="1"
android:minLines="1"
android:textAppearance="@style/Header12TextStyle"
app:layout_constraintEnd_toStartOf="@id/collection_tab_close_button"
app:layout_constraintStart_toEndOf="@id/collection_tab_icon"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/collection_tab_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:ellipsize="end"
android:maxLines="2"
android:minLines="2"
android:textAppearance="@style/Body14TextStyle"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/collection_tab_hostname"
app:layout_constraintStart_toStartOf="@id/collection_tab_hostname"
app:layout_constraintTop_toBottomOf="@id/collection_tab_hostname" />
<ImageView
android:id="@+id/collection_tab_icon"
android:importantForAccessibility="no"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginTop="23dp"
android:layout_marginBottom="24dp"
android:layout_marginStart="16dp"
android:tint="@null"
android:src="@drawable/ic_tab_collection"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<ImageButton
android:id="@+id/collection_tab_close_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:alpha="0.8"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/close_tab"
android:src="@drawable/ic_close"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/collection_tab_hostname"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="14dp"
android:layout_marginEnd="74dp"
android:ellipsize="end"
android:maxLines="1"
android:minLines="1"
android:textAppearance="@style/Header12TextStyle"
app:layout_constraintStart_toEndOf="@id/collection_tab_icon"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="@id/collection_tab_close_button"/>
<View
android:id="@+id/divider_line"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="?neutralFaded"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/collection_tab_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:ellipsize="end"
android:maxLines="2"
android:minLines="2"
android:textAppearance="@style/Body14TextStyle"
app:layout_constraintStart_toStartOf="@id/collection_tab_hostname"
app:layout_constraintTop_toBottomOf="@id/collection_tab_hostname"
app:layout_constraintEnd_toEndOf="@id/collection_tab_hostname"
app:layout_constraintBottom_toBottomOf="parent"/>
<ImageButton
android:id="@+id/collection_tab_close_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/close_tab"
android:src="@drawable/ic_close"
android:alpha="0.8"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<View
android:id="@+id/divider_line"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="?neutralFaded"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>