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

Commit e5b770e4 authored by Jason Monk's avatar Jason Monk
Browse files

Updated QS UI

 - Adds footer to QS which contains the date/alarm info
   and all touch targets (settings, edit, etc.)
 - Swaps out emergency + carrier text on cell tile for a
   standard CarrierText from lock screen in the header
   to make the header only contain status info.
 - Add dividing line
 - Work on animations

Test: runtest systemui
Change-Id: I97dfea1b1ea7006b53eb61ac3a1f942c64dd282d
parent 702e2ebf
Loading
Loading
Loading
Loading
+47 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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.
 */

package com.android.systemui.plugins.qs;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.ViewGroup;

import com.android.systemui.plugins.annotations.ProvidesInterface;

@ProvidesInterface(version = DetailAdapter.VERSION)
public interface DetailAdapter {
    public static final int VERSION = 1;

    CharSequence getTitle();
    Boolean getToggleState();

    default boolean getToggleEnabled() {
        return true;
    }

    View createDetailView(Context context, View convertView, ViewGroup parent);
    Intent getSettingsIntent();
    void setToggleState(boolean state);
    int getMetricsCategory();

    /**
     * Indicates whether the detail view wants to have its header (back button, title and
     * toggle) shown.
     */
    default boolean hasHeader() {
        return true;
    }
}
+29 −81
Original line number Diff line number Diff line
@@ -14,58 +14,53 @@

package com.android.systemui.plugins.qs;

import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;

import com.android.systemui.plugins.FragmentBase;
import com.android.systemui.plugins.annotations.DependsOn;
import com.android.systemui.plugins.annotations.ProvidesInterface;
import com.android.systemui.plugins.qs.QS.Callback;
import com.android.systemui.plugins.qs.QS.DetailAdapter;
import com.android.systemui.plugins.qs.QS.HeightListener;

import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;

/**
 * Fragment that contains QS in the notification shade.  Most of the interface is for
 * handling the expand/collapsing of the view interaction.
 */
@ProvidesInterface(action = QS.ACTION, version = QS.VERSION)
@DependsOn(target = HeightListener.class)
@DependsOn(target = Callback.class)
@DependsOn(target = DetailAdapter.class)
public interface QS extends FragmentBase {

    public static final String ACTION = "com.android.systemui.action.PLUGIN_QS";

    public static final int VERSION = 5;
    public static final int VERSION = 6;

    String TAG = "QS";

    public abstract void setPanelView(HeightListener notificationPanelView);
    public abstract BaseStatusBarHeader getHeader();

    public abstract void hideImmediately();
    public abstract int getQsMinExpansionHeight();
    public abstract int getDesiredHeight();
    public abstract void setHeightOverride(int desiredHeight);
    public abstract void setHeaderClickable(boolean qsExpansionEnabled);
    public abstract boolean isCustomizing();
    public abstract void setOverscrolling(boolean overscrolling);
    public abstract void setExpanded(boolean qsExpanded);
    public abstract void setListening(boolean listening);
    public abstract boolean isShowingDetail();
    public abstract void closeDetail();
    public abstract void setKeyguardShowing(boolean keyguardShowing);
    public abstract void animateHeaderSlidingIn(long delay);
    public abstract void animateHeaderSlidingOut();
    public abstract void setQsExpansion(float qsExpansionFraction, float headerTranslation);
    public abstract void setHeaderListening(boolean listening);
    public abstract void notifyCustomizeChanged();

    public abstract void setContainer(ViewGroup container);
    void setPanelView(HeightListener notificationPanelView);

    void hideImmediately();
    int getQsMinExpansionHeight();
    int getDesiredHeight();
    void setHeightOverride(int desiredHeight);
    void setHeaderClickable(boolean qsExpansionEnabled);
    boolean isCustomizing();
    void setOverscrolling(boolean overscrolling);
    void setExpanded(boolean qsExpanded);
    void setListening(boolean listening);
    boolean isShowingDetail();
    void closeDetail();
    void setKeyguardShowing(boolean keyguardShowing);
    void animateHeaderSlidingIn(long delay);
    void animateHeaderSlidingOut();
    void setQsExpansion(float qsExpansionFraction, float headerTranslation);
    void setHeaderListening(boolean listening);
    void notifyCustomizeChanged();

    void setContainer(ViewGroup container);
    void setExpandClickListener(OnClickListener onClickListener);

    View getHeader();

    @ProvidesInterface(version = HeightListener.VERSION)
    public interface HeightListener {
@@ -73,51 +68,4 @@ public interface QS extends FragmentBase {
        void onQsHeightChanged();
    }

    @ProvidesInterface(version = Callback.VERSION)
    public interface Callback {
        public static final int VERSION = 1;
        void onShowingDetail(DetailAdapter detail, int x, int y);
        void onToggleStateChanged(boolean state);
        void onScanStateChanged(boolean state);
    }

    @ProvidesInterface(version = DetailAdapter.VERSION)
    public interface DetailAdapter {
        public static final int VERSION = 1;
        CharSequence getTitle();
        Boolean getToggleState();
        default boolean getToggleEnabled() {
            return true;
        }
        View createDetailView(Context context, View convertView, ViewGroup parent);
        Intent getSettingsIntent();
        void setToggleState(boolean state);
        int getMetricsCategory();

        /**
         * Indicates whether the detail view wants to have its header (back button, title and
         * toggle) shown.
         */
        default boolean hasHeader() { return true; }
    }

    @ProvidesInterface(version = BaseStatusBarHeader.VERSION)
    public abstract static class BaseStatusBarHeader extends RelativeLayout {
        public static final int VERSION = 1;

        public BaseStatusBarHeader(Context context, AttributeSet attrs) {
            super(context, attrs);
        }

        public abstract int getCollapsedHeight();
        public abstract int getExpandedHeight();

        public abstract void setExpanded(boolean b);
        public abstract void setExpansion(float headerExpansionFraction);
        public abstract void setListening(boolean listening);
        public abstract void updateEverything();
        public abstract void setCallback(Callback qsPanelCallback);
        public abstract View getExpandView();
    }

}
+0 −1
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.service.quicksettings.Tile;

import com.android.systemui.plugins.annotations.DependsOn;
import com.android.systemui.plugins.annotations.ProvidesInterface;
import com.android.systemui.plugins.qs.QS.DetailAdapter;
import com.android.systemui.plugins.qs.QSTile.Callback;
import com.android.systemui.plugins.qs.QSTile.Icon;
import com.android.systemui.plugins.qs.QSTile.State;
+2 −2
Original line number Diff line number Diff line
@@ -14,8 +14,8 @@
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="20dp"
    android:height="20dp"
    android:width="16dp"
    android:height="16dp"
    android:viewportWidth="24.0"
    android:viewportHeight="24.0">
    <path
+27 −0
Original line number Diff line number Diff line
<!--
    Copyright (C) 2017 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24.0dp"
        android:height="24.0dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:pathData="M0 0h24v24H0z"
        android:fillColor="#00000000"/>
    <path
        android:fillColor="#FF000000"
        android:pathData="M18.0,2.0l-8.0,0.0L4.02,8.0 4.0,20.0c0.0,1.0 0.9,2.0 2.0,2.0l12.0,0.0c1.1,0.0 2.0,-0.9 2.0,-2.0L20.0,4.0c0.0,-1.1 -0.9,-2.0 -2.0,-2.0z"/>
</vector>
Loading