Revision control
Copy as Markdown
<?xml version="1.0" encoding="utf-8"?>
<!-- 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
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
<LinearLayout
android:id="@+id/bannerLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="#2A2A2E"
android:gravity="center">
<ImageView
android:contentDescription="@null"
android:layout_width="80sp"
android:layout_height="64sp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:src="@drawable/warning"/>
<TextView
android:id="@+id/bannerTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@string/font_ember_regular"
android:textSize="18sp"
android:lineSpacingExtra="6sp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:text="@string/banner_text"
android:textColor="#FBFBFE" />
<Button
android:id="@+id/bannerMoreInfoButton"
style="@style/BannerConfirmButton"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="16dp"
android:layout_weight="0"
android:text="@string/banner_more_info_button"
android:textSize="18sp"
android:gravity="center"
android:fontFamily="@string/font_ember_regular"/>
</LinearLayout>
<org.mozilla.focus.TouchInterceptorLayout
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
<!-- The designs state we should have no elevation shadow on the initial homescreen and an
elevation shadow over web content. However, the elevation shadow over web content
is broken so we could just set elevation to 0 everywhere. However, on Echo Show
5, for an unknown reason setting any elevation on this view will cause the
WebView to stop playing videos when the AppBar scrolls offscreen (#305). As such,
we do not modify the elevation. One side effect of this is that an elevation
shadow undesirably appears on the initial homescreen. Therefore, in code we selectively
set the AppBar elevation to zero on devices that are not affected by this issue.
Unfortunately, not modifying the elevation also means the NavigationOverlay's
semi opaque background will not appear over the AppBar, even if the semi opaque
background's elevation is set very high. As such, we add a separate semi opaque
view inside this AppBar layout that appears together with the NavigationOverlay's
so that the entire screen is covered. -->
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="@dimen/appbar_height"
android:background="@color/photonGrey70">
<!-- AppBarLayout is a LinearLayout so to have two views overlap & fill the space,
we need this inner ViewGroup.
CoordinatorLayout scroll flags are added dynamically: see
BrowserAppBarLayoutController's ViewGroup.setIsScrollEnabled.
The accessibility of this view is changed dynamically: see ToolbarIntegration. -->
<FrameLayout
android:id="@+id/appBarInnerContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<mozilla.components.browser.toolbar.BrowserToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!-- See containing AppBarLayout for details. Visibility updated dynamically. -->
<View
android:id="@+id/appBarSemiOpaqueBackground"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/nav_overlay_semi_opaque_background"
android:visibility="gone"/>
</FrameLayout>
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:id="@+id/unpinOverlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#80000000"
android:visibility="gone"
android:elevation="16dp">
<Button
android:id="@+id/unpinButton"
style="@style/PlatformPrimaryButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:elevation="18dp"
android:text="@string/homescreen_tile_remove" />
</FrameLayout>
<FrameLayout
android:id="@+id/navigationOverlayContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</org.mozilla.focus.TouchInterceptorLayout>
</LinearLayout>