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

Commit b55c02c9 authored by Matthew Ng's avatar Matthew Ng
Browse files

Added visual affordance/handle for navigation bar

Added the handle that would sit at the bottom where the navigation bar
would be and off by default. Use prototype to make it visible. The bar
will also use color adaptation. Needed to fix null states when the
inflator would swap the normal home/back button layout with the handle.
Added the new 16dp overlay as the visual inset.

Test: manual
Bug: 112934365
Change-Id: I88f3443ad36ceefa8f490d17b4daefbeaab5c60a
parent 42596b17
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2019 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.statusbar.phone.NavigationHandle
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/home_handle"
    android:layout_width="@dimen/navigation_handle_width"
    android:layout_height="match_parent"
    android:layout_weight="0"
    />
+1 −0
Original line number Diff line number Diff line
@@ -325,6 +325,7 @@
    <!-- Nav bar button default ordering/layout -->
    <string name="config_navBarLayout" translatable="false">left[.5W],back[1WC];home;recent[1WC],right[.5W]</string>
    <string name="config_navBarLayoutQuickstep" translatable="false">back[1.7WC];home;contextual[1.7WC]</string>
    <string name="config_navBarLayoutHandle" translatable="false">";home_handle;"</string>

    <bool name="quick_settings_show_full_alarm">false</bool>

+5 −0
Original line number Diff line number Diff line
@@ -33,6 +33,11 @@
    <!-- size of the dead zone when touches have recently occurred elsewhere on screen -->
    <dimen name="navigation_bar_deadzone_size_max">32dp</dimen>

    <!-- dimensions for the navigation bar handle -->
    <dimen name="navigation_handle_width">180dp</dimen>
    <dimen name="navigation_handle_radius">2dp</dimen>
    <dimen name="navigation_handle_bottom">8dp</dimen>

    <!-- Height of notification icons in the status bar -->
    <dimen name="status_bar_icon_size">@*android:dimen/status_bar_icon_size</dimen>

+3 −0
Original line number Diff line number Diff line
@@ -112,6 +112,9 @@ public class ContextualButtonGroup extends ButtonDispatcher {
     * their icons for their buttons.
     */
    public void updateIcons() {
        if (getCurrentView() == null || !getCurrentView().isAttachedToWindow()) {
            return;
        }
        for (ButtonData data : mButtonData) {
            data.button.updateIcon();
        }
+1 −5
Original line number Diff line number Diff line
@@ -18,14 +18,12 @@ package com.android.systemui.statusbar.phone;

import static com.android.systemui.statusbar.phone.NavBarTintController.DEFAULT_COLOR_ADAPT_TRANSITION_TIME;
import static com.android.systemui.statusbar.phone.NavBarTintController.MIN_COLOR_ADAPT_TRANSITION_TIME;
import static com.android.systemui.statusbar.phone.NavBarTintController.NAV_COLOR_TRANSITION_TIME_SETTING;

import android.animation.ValueAnimator;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.SystemClock;
import android.provider.Settings;
import android.util.MathUtils;
import android.util.TimeUtils;

@@ -167,9 +165,7 @@ public class LightBarTransitionsController implements Dumpable, Callbacks,

    public long getTintAnimationDuration() {
        if (NavBarTintController.isEnabled(mContext)) {
            return Math.max(Settings.Global.getInt(mContext.getContentResolver(),
                    NAV_COLOR_TRANSITION_TIME_SETTING, DEFAULT_COLOR_ADAPT_TRANSITION_TIME),
                    MIN_COLOR_ADAPT_TRANSITION_TIME);
            return Math.max(DEFAULT_COLOR_ADAPT_TRANSITION_TIME, MIN_COLOR_ADAPT_TRANSITION_TIME);
        }
        return DEFAULT_TINT_ANIMATION_DURATION;
    }
Loading