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

View File

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

View File

@ -2,7 +2,7 @@
<!-- 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/. -->
<FrameLayout <androidx.constraintlayout.widget.ConstraintLayout
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"
@ -17,10 +17,6 @@
android:focusable="true" android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"> android:foreground="?android:attr/selectableItemBackground">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView <ImageView
android:id="@+id/collection_icon" android:id="@+id/collection_icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -88,8 +84,8 @@
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/share_button_content_description" android:contentDescription="@string/share_button_content_description"
android:src="@drawable/ic_hollow_share" android:src="@drawable/ic_hollow_share"
app:layout_constraintEnd_toStartOf="@id/collection_overflow_button"
app:layout_constraintBottom_toBottomOf="@id/collection_icon" app:layout_constraintBottom_toBottomOf="@id/collection_icon"
app:layout_constraintEnd_toStartOf="@id/collection_overflow_button"
app:layout_constraintTop_toTopOf="@id/collection_icon" /> app:layout_constraintTop_toTopOf="@id/collection_icon" />
<ImageButton <ImageButton
@ -99,9 +95,9 @@
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/collection_menu_button_content_description" android:contentDescription="@string/collection_menu_button_content_description"
android:src="@drawable/ic_menu" android:src="@drawable/ic_menu"
app:layout_constraintBottom_toBottomOf="@id/collection_icon"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/collection_icon" app:layout_constraintTop_toTopOf="@id/collection_icon" />
app:layout_constraintBottom_toBottomOf="@id/collection_icon"/>
<View <View
android:id="@+id/selected_border" android:id="@+id/selected_border"
@ -114,4 +110,3 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@ -26,19 +26,15 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<FrameLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:backgroundTint="?above"
android:background="@drawable/bottom_sheet_dialog_fragment_background" android:background="@drawable/bottom_sheet_dialog_fragment_background"
android:backgroundTint="?above"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"> app:layout_constraintStart_toStartOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/send_tab_group" android:id="@+id/send_tab_group"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -46,17 +42,17 @@
app:constraint_referenced_ids="account_header,account_devices_recyclerview,divider_line" /> app:constraint_referenced_ids="account_header,account_devices_recyclerview,divider_line" />
<TextView <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:text="@string/share_device_subheader"
android:textAllCaps="true" android:textAllCaps="true"
android:singleLine="true"
android:textColor="?secondaryText" android:textColor="?secondaryText"
android:textSize="12sp" android:textSize="12sp"
android:textStyle="bold" 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_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -64,10 +60,10 @@
android:id="@+id/account_devices_recyclerview" android:id="@+id/account_devices_recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:clipToPadding="false" android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingEnd="8dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_header" /> app:layout_constraintTop_toBottomOf="@+id/account_header" />
@ -78,22 +74,22 @@
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:background="?neutralFaded" android:background="?neutralFaded"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_devices_recyclerview" /> app:layout_constraintTop_toBottomOf="@+id/account_devices_recyclerview" />
<TextView <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:text="@string/share_link_subheader"
android:textAllCaps="true" android:textAllCaps="true"
android:singleLine="true"
android:textColor="?secondaryText" android:textColor="?secondaryText"
android:textSize="12sp" android:textSize="12sp"
android:textStyle="bold" 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_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/divider_line" /> app:layout_constraintTop_toBottomOf="@+id/divider_line" />
@ -103,26 +99,24 @@
android:layout_height="37dp" android:layout_height="37dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
app:layout_constraintTop_toBottomOf="@+id/link_header" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/link_header" />
<org.mozilla.fenix.share.AppShareRecyclerView <org.mozilla.fenix.share.AppShareRecyclerView
android:id="@+id/intent_handler_recyclerview" 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_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"
android:visibility="gone" android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/link_header" /> app:layout_constraintTop_toBottomOf="@+id/link_header" />
</androidx.constraintlayout.widget.ConstraintLayout> </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 <!-- 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/. -->
<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" xmlns:tools="http://schemas.android.com/tools"
android:layout_height="match_parent"
android:layout_width="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 <androidx.constraintlayout.widget.ConstraintLayout
android:orientation="horizontal" android:layout_width="match_parent"
android:paddingTop="8dp" android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:background="@drawable/fenix_snackbar_background"
android:layout_margin="8dp" android:layout_margin="8dp"
android:background="@drawable/fenix_snackbar_background"
android:elevation="4dp" android:elevation="4dp"
android:minHeight="48dp" android:minHeight="48dp"
android:layout_width="match_parent" android:orientation="horizontal"
android:layout_height="wrap_content"> android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="8dp">
<TextView <TextView
android:id="@+id/snackbar_text" android:id="@+id/snackbar_text"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:letterSpacing="0.05"
android:maxLines="2" android:maxLines="2"
android:textAlignment="textStart"
android:textColor="@color/photonWhite" android:textColor="@color/photonWhite"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" android:textStyle="bold"
android:typeface="sans" android:typeface="sans"
android:letterSpacing="0.05" app:layout_constraintBottom_toBottomOf="parent"
tools:text="This is a custom Snackbar text"
android:textAlignment="textStart"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/snackbar_btn" app:layout_constraintEnd_toStartOf="@id/snackbar_btn"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" /> tools:text="This is a custom Snackbar text" />
<Button <Button
android:id="@+id/snackbar_btn" android:id="@+id/snackbar_btn"
style="@style/Widget.AppCompat.Button.Borderless" style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/photonWhite"
android:textAlignment="textEnd"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
tools:text="Action text" android:letterSpacing="0.05"
android:padding="0dp"
android:minHeight="0dp"
android:minWidth="0dp" android:minWidth="0dp"
android:textSize="14sp" android:minHeight="0dp"
android:padding="0dp"
android:textAlignment="textEnd"
android:textAllCaps="true" android:textAllCaps="true"
android:textColor="@color/photonWhite"
android:textSize="14sp"
android:textStyle="bold" android:textStyle="bold"
android:typeface="sans" android:typeface="sans"
android:letterSpacing="0.05"
android:visibility="gone" android:visibility="gone"
app:layout_constraintStart_toEndOf="@id/snackbar_text" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/snackbar_text"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" /> tools:text="Action text" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout> </FrameLayout>

View File

@ -2,18 +2,23 @@
<!-- 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 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:id="@+id/quick_action_sheet"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?foundation" android:background="?foundation">
android:orientation="vertical">
<View <View
android:id="@+id/quick_action_sheet_faded_handle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:background="?attr/neutralFaded" 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 <ImageButton
android:id="@+id/quick_action_sheet_handle" android:id="@+id/quick_action_sheet_handle"
@ -22,11 +27,10 @@
android:background="@null" android:background="@null"
android:contentDescription="@string/quick_action_sheet_handle" android:contentDescription="@string/quick_action_sheet_handle"
android:paddingTop="7dp" android:paddingTop="7dp"
android:src="@drawable/ic_drawer_pull_tab" /> android:src="@drawable/ic_drawer_pull_tab"
app:layout_constraintEnd_toEndOf="parent"
<FrameLayout app:layout_constraintStart_toStartOf="parent"
android:layout_width="match_parent" app:layout_constraintTop_toTopOf="@id/quick_action_sheet_faded_handle" />
android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:id="@+id/quick_action_buttons_layout" android:id="@+id/quick_action_buttons_layout"
@ -35,7 +39,11 @@
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginBottom="12dp" android:layout_marginBottom="12dp"
android:background="@null" android:background="@null"
android:orientation="horizontal"> 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">
<Button <Button
android:id="@+id/quick_action_share" android:id="@+id/quick_action_share"
@ -121,10 +129,13 @@
</LinearLayout> </LinearLayout>
<View <View
android:id="@+id/overlay" android:id="@+id/quick_action_overlay"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="0dp"
android:alpha="0.0" android:alpha="0.0"
android:background="?foundation" /> android:background="?foundation"
</FrameLayout> app:layout_constraintBottom_toBottomOf="parent"
</LinearLayout> 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,35 +6,33 @@
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"
android:id="@+id/tabs_header" android:id="@+id/tabs_header"
android:layout_marginBottom="8dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<TextView <TextView
android:id="@+id/header_text" android:id="@+id/header_text"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="4.5dp" android:layout_marginStart="4.5dp"
android:text="@string/tab_header_label" android:text="@string/tab_header_label"
android:textAppearance="@style/HeaderTextStyle" android:textAppearance="@style/HeaderTextStyle"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/add_tab_button"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<ImageButton <ImageButton
android:id="@+id/add_tab_button" android:id="@+id/add_tab_button"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/add_tab" android:contentDescription="@string/add_tab"
android:src="@drawable/ic_new"/> android:src="@drawable/ic_new"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/share_tabs_button"
app:layout_constraintStart_toEndOf="@id/header_text"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton <ImageButton
android:id="@+id/share_tabs_button" android:id="@+id/share_tabs_button"
@ -42,7 +40,11 @@
android:layout_height="48dp" android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/tabs_menu_share_tabs" android:contentDescription="@string/tabs_menu_share_tabs"
android:src="@drawable/ic_hollow_share"/> 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 <ImageButton
android:id="@+id/close_tabs_button" android:id="@+id/close_tabs_button"
@ -50,7 +52,11 @@
android:layout_height="48dp" android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/tabs_menu_close_all_tabs" android:contentDescription="@string/tabs_menu_close_all_tabs"
android:src="@drawable/ic_delete"/> 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 <ImageButton
android:id="@+id/tabs_overflow_button" android:id="@+id/tabs_overflow_button"
@ -58,6 +64,10 @@
android:layout_height="48dp" android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/open_tabs_menu" android:contentDescription="@string/open_tabs_menu"
android:src="@drawable/ic_menu" /> android:src="@drawable/ic_menu"
</LinearLayout> app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/close_tabs_button"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

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