Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03452600 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

New SecurityFooter design

Changes:
* Footer appears below QSFooter in portrait, QSBH in landscape
* In portrait, height is 48dp for one line of text, 88dp for two lines
of text.

Creates a new layout that inherits from LinearLayout (horizontal) and
adjusts its height based on the number of lines of the containing text.

Test: manual
Test: atest QSSecurityFooterTest
Fixes: 186033456

Change-Id: Ia4f9d5c9b4078d790f654dbd4b82d14670985f8d
parent 0ce27fdf
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:color="@android:color/system_neutral1_100" android:alpha="0.8" />
</selector>
 No newline at end of file
+37 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2021 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
    android:insetTop="@dimen/qs_security_footer_background_inset"
    android:insetBottom="@dimen/qs_security_footer_background_inset"
    >
    <ripple
        android:color="?android:attr/colorControlHighlight">
        <item android:id="@android:id/mask">
            <shape android:shape="rectangle">
                <solid android:color="@android:color/white"/>
                <corners android:radius="@dimen/qs_security_footer_corner_radius"/>
            </shape>
        </item>
        <item>
            <shape android:shape="rectangle">
                <stroke android:width="1dp"
                        android:color="@color/qs_security_footer_background_stroke"/>
                <corners android:radius="@dimen/qs_security_footer_corner_radius"/>
            </shape>
        </item>
    </ripple>
</inset>
 No newline at end of file
+0 −8
Original line number Diff line number Diff line
@@ -44,14 +44,6 @@
        android:layout_weight="1"
        />

    <!-- Will hold security footer in landscape with media -->
    <FrameLayout
        android:id="@+id/header_text_container"
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
        android:gravity="center"
        />

    <include layout="@layout/qs_carrier_group"
        android:id="@+id/carrier_group"
        android:layout_width="wrap_content"
+22 −21
Original line number Diff line number Diff line
@@ -14,38 +14,39 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<com.android.systemui.util.NeverExactlyLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:minHeight="48dp"
<com.android.systemui.util.DualHeightHorizontalLinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="@dimen/qs_security_footer_height"
    android:clickable="true"
    android:paddingBottom="@dimen/qs_tile_padding_top"
    android:paddingTop="@dimen/qs_tile_padding_top"
    android:paddingStart="@dimen/qs_footer_padding_start"
    android:paddingEnd="@dimen/qs_footer_padding_end"
    android:padding="@dimen/qs_footer_padding"
    android:gravity="center_vertical"
    android:layout_gravity="center_vertical|center_horizontal"
    android:background="@android:color/transparent">
    android:layout_marginVertical="@dimen/qs_security_footer_vertical_margin"
    android:background="@drawable/qs_security_footer_background"
    systemui:singleLineHeight="@dimen/qs_security_footer_single_line_height"
    systemui:textViewId="@id/footer_text"
    >

    <ImageView
        android:id="@+id/primary_footer_icon"
        android:layout_width="@dimen/qs_footer_icon_size"
        android:layout_height="@dimen/qs_footer_icon_size"
        android:gravity="start"
        android:layout_marginEnd="8dp"
        android:layout_marginEnd="12dp"
        android:contentDescription="@null"
        android:tint="?android:attr/textColorPrimary" />
        android:tint="?android:attr/textColorSecondary" />

    <com.android.systemui.util.AutoMarqueeTextView
    <TextView
        android:id="@+id/footer_text"
        android:layout_width="wrap_content"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:singleLine="true"
        android:ellipsize="marquee"
        android:marqueeRepeatLimit="marquee_forever"
        android:textAppearance="@style/TextAppearance.QS.TileLabel"
        android:textColor="?android:attr/textColorPrimary"/>
        android:maxLines="@integer/qs_security_footer_maxLines"
        android:ellipsize="end"
        android:textAppearance="@style/TextAppearance.QS.SecurityFooter"
        android:textColor="?android:attr/textColorSecondary"/>

    <ImageView
        android:id="@+id/footer_icon"
@@ -53,7 +54,7 @@
        android:layout_height="@dimen/qs_footer_icon_size"
        android:layout_marginStart="8dp"
        android:contentDescription="@null"
        android:src="@drawable/ic_info_outline"
        android:tint="?android:attr/textColorPrimary" />
        android:src="@*android:drawable/ic_chevron_end"
        android:tint="?android:attr/textColorSecondary" />

</com.android.systemui.util.NeverExactlyLinearLayout>
</com.android.systemui.util.DualHeightHorizontalLinearLayout>
+10 −0
Original line number Diff line number Diff line
@@ -55,6 +55,16 @@
        android:layout_gravity="center_vertical|center_horizontal"
        android:visibility="gone" />

    <!-- Will hold security footer in landscape with media -->
    <FrameLayout
        android:id="@+id/header_text_container"
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
        android:paddingStart="16dp"
        android:paddingEnd="16dp"
        android:gravity="center"
    />

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
Loading