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

Commit db2cfa36 authored by Rohan Shah's avatar Rohan Shah
Browse files

[QS] Add header tooltip for long press

Added some hooks in animator to pass along expanded/animating/collapsed
state in a more clear manner. Added tooltip view with the teaser text to
animate in at the top of the view (and fade out either when we start
animating or automatically after 5 seconds).

Added prefs for tracking how often tooltip is shown/hiding it based on
that number.

Updated dimensions for correct spacing (based on redlines).

Test: Visually
Bug: 72528203

Change-Id: I70e4654ed95057fac6d8dbb890d575c2a5d9f215
parent 29f1cdd5
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2018 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
  -->
<com.android.systemui.qs.QSTooltipView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="@dimen/qs_header_tooltip_height"
    android:alpha="0"
    android:gravity="center_horizontal|bottom"
    android:visibility="invisible">

    <TextView
        android:id="@+id/header_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/quick_settings_header_onboarding_text"
        android:textAppearance="@style/TextAppearance.QS.TileLabel"
        android:textColor="?android:attr/colorAccent" />

</com.android.systemui.qs.QSTooltipView>
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@
    <dimen name="battery_detail_graph_space_top">27dp</dimen>
    <dimen name="battery_detail_graph_space_bottom">27dp</dimen>

    <dimen name="qs_tile_margin_top">16dp</dimen>
    <dimen name="qs_tile_margin_top">32dp</dimen>
    <dimen name="qs_brightness_padding_top">6dp</dimen>
    <dimen name="qs_detail_margin_top">28dp</dimen>
</resources>
+5 −1
Original line number Diff line number Diff line
@@ -290,7 +290,7 @@

    <dimen name="qs_tile_height">106dp</dimen>
    <dimen name="qs_tile_margin">19dp</dimen>
    <dimen name="qs_tile_margin_top">16dp</dimen>
    <dimen name="qs_tile_margin_top">32dp</dimen>
    <dimen name="qs_quick_tile_size">48dp</dimen>
    <dimen name="qs_quick_tile_padding">12dp</dimen>
    <dimen name="qs_header_gear_translation">16dp</dimen>
@@ -309,6 +309,7 @@
    <dimen name="qs_tile_padding_bottom">16dp</dimen>
    <dimen name="qs_tile_spacing">4dp</dimen>
    <dimen name="qs_panel_padding_bottom">0dp</dimen>
    <dimen name="qs_panel_padding_top">32dp</dimen>
    <dimen name="qs_detail_header_height">56dp</dimen>
    <dimen name="qs_detail_header_padding">0dp</dimen>
    <dimen name="qs_detail_image_width">56dp</dimen>
@@ -333,6 +334,9 @@
    <dimen name="qs_detail_item_icon_width">32dp</dimen>
    <dimen name="qs_detail_item_icon_marginStart">0dp</dimen>
    <dimen name="qs_detail_item_icon_marginEnd">20dp</dimen>
    <dimen name="qs_header_padding_start">16dp</dimen>
    <dimen name="qs_header_padding_end">24dp</dimen>
    <dimen name="qs_header_tooltip_height">32dp</dimen>
    <dimen name="qs_footer_padding_start">16dp</dimen>
    <dimen name="qs_footer_padding_end">24dp</dimen>
    <dimen name="qs_footer_icon_size">16dp</dimen>
+2 −0
Original line number Diff line number Diff line
@@ -666,6 +666,8 @@
    <!-- Textual description of Ethernet connections -->
    <string name="ethernet_label">Ethernet</string>

    <!-- QuickSettings: Onboarding text that introduces users to long press on an option in order to view the option's menu in Settings [CHAR LIMIT=NONE] -->
    <string name="quick_settings_header_onboarding_text">Press &amp; hold on the icons for more options</string>
    <!-- QuickSettings: Do not disturb [CHAR LIMIT=NONE] -->
    <string name="quick_settings_dnd_label">Do not disturb</string>
    <!-- QuickSettings: Do not disturb - Priority only [CHAR LIMIT=NONE] -->
+6 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ public final class Prefs {
        Key.QS_INVERT_COLORS_ADDED,
        Key.QS_WORK_ADDED,
        Key.QS_NIGHTDISPLAY_ADDED,
        Key.QS_LONG_PRESS_TOOLTIP_SHOWN_COUNT,
        Key.SEEN_MULTI_USER,
        Key.NUM_APPS_LAUNCHED,
        Key.HAS_SEEN_RECENTS_ONBOARDING,
@@ -76,6 +77,11 @@ public final class Prefs {
        String QS_WORK_ADDED = "QsWorkAdded";
        @Deprecated
        String QS_NIGHTDISPLAY_ADDED = "QsNightDisplayAdded";
        /**
         * Used for tracking how many times the user has seen the long press tooltip in the Quick
         * Settings panel.
         */
        String QS_LONG_PRESS_TOOLTIP_SHOWN_COUNT = "QsLongPressTooltipShownCount";
        String SEEN_MULTI_USER = "HasSeenMultiUser";
        String NUM_APPS_LAUNCHED = "NumAppsLaunched";
        String HAS_SEEN_RECENTS_ONBOARDING = "HasSeenRecentsOnboarding";
Loading