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

Commit f8e61cf3 authored by Anton Potapov's avatar Anton Potapov Committed by Android (Google) Code Review
Browse files

Merge "Remove SlashState and SignalState from QSTile" into main

parents b498ab84 f5c7f38d
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -14,8 +14,6 @@

package com.android.systemui.plugins.qs;

import android.content.Context;

import com.android.systemui.plugins.Plugin;
import com.android.systemui.plugins.annotations.DependsOn;
import com.android.systemui.plugins.annotations.ProvidesInterface;
@@ -30,18 +28,7 @@ import com.android.systemui.plugins.annotations.ProvidesInterface;
public interface QSFactory extends Plugin {

    String ACTION = "com.android.systemui.action.PLUGIN_QS_FACTORY";
    int VERSION = 2;
    int VERSION = 3;

    QSTile createTile(String tileSpec);

    /**
     * Create a view for a tile.
     *
     * @param context a themed context for inflating the view
     * @param tile the tile for which the view is created
     * @param collapsedView {@code true} if the view will live in QQS and {@code false} otherwise.
     * @return a view for the tile
     */
    QSTileView createTileView(Context context, QSTile tile, boolean collapsedView);

}
+0 −75
Original line number Diff line number Diff line
@@ -55,8 +55,6 @@ public interface QSTile {
    void removeCallback(Callback callback);
    void removeCallbacks();

    QSIconView createTileView(Context context);

    /**
     * The tile was clicked.
     *
@@ -170,7 +168,6 @@ public interface QSTile {
        public boolean dualTarget = false;
        public boolean isTransient = false;
        public String expandedAccessibilityClassName;
        public SlashState slash;
        public boolean handlesLongClick = true;
        @Nullable
        public Drawable sideViewCustomDrawable;
@@ -214,7 +211,6 @@ public interface QSTile {
                    || !Objects.equals(other.state, state)
                    || !Objects.equals(other.isTransient, isTransient)
                    || !Objects.equals(other.dualTarget, dualTarget)
                    || !Objects.equals(other.slash, slash)
                    || !Objects.equals(other.handlesLongClick, handlesLongClick)
                    || !Objects.equals(other.sideViewCustomDrawable, sideViewCustomDrawable);
            other.spec = spec;
@@ -230,7 +226,6 @@ public interface QSTile {
            other.state = state;
            other.dualTarget = dualTarget;
            other.isTransient = isTransient;
            other.slash = slash != null ? slash.copy() : null;
            other.handlesLongClick = handlesLongClick;
            other.sideViewCustomDrawable = sideViewCustomDrawable;
            return changed;
@@ -258,7 +253,6 @@ public interface QSTile {
            sb.append(",dualTarget=").append(dualTarget);
            sb.append(",isTransient=").append(isTransient);
            sb.append(",state=").append(state);
            sb.append(",slash=\"").append(slash).append("\"");
            sb.append(",sideViewCustomDrawable=").append(sideViewCustomDrawable);
            return sb.append(']');
        }
@@ -302,73 +296,4 @@ public interface QSTile {
            return state;
        }
    }

    @ProvidesInterface(version = SignalState.VERSION)
    public static final class SignalState extends BooleanState {
        public static final int VERSION = 1;
        public boolean activityIn;
        public boolean activityOut;
        public boolean isOverlayIconWide;
        public int overlayIconId;

        @Override
        public boolean copyTo(State other) {
            final SignalState o = (SignalState) other;
            final boolean changed = o.activityIn != activityIn
                    || o.activityOut != activityOut
                    || o.isOverlayIconWide != isOverlayIconWide
                    || o.overlayIconId != overlayIconId;
            o.activityIn = activityIn;
            o.activityOut = activityOut;
            o.isOverlayIconWide = isOverlayIconWide;
            o.overlayIconId = overlayIconId;
            return super.copyTo(other) || changed;
        }

        @Override
        protected StringBuilder toStringBuilder() {
            final StringBuilder rt = super.toStringBuilder();
            rt.insert(rt.length() - 1, ",activityIn=" + activityIn);
            rt.insert(rt.length() - 1, ",activityOut=" + activityOut);
            return rt;
        }

        @Override
        public State copy() {
            SignalState state = new SignalState();
            copyTo(state);
            return state;
        }
    }

    @ProvidesInterface(version = SlashState.VERSION)
    public static class SlashState {
        public static final int VERSION = 2;

        public boolean isSlashed;
        public float rotation;

        @Override
        public String toString() {
            return "isSlashed=" + isSlashed + ",rotation=" + rotation;
        }

        @Override
        public boolean equals(Object o) {
            if (o == null) return false;
            try {
                return (((SlashState) o).rotation == rotation)
                        && (((SlashState) o).isSlashed == isSlashed);
            } catch (ClassCastException e) {
                return false;
            }
        }

        public SlashState copy() {
            SlashState state = new SlashState();
            state.rotation = rotation;
            state.isSlashed = isSlashed;
            return state;
        }
    }
}
+0 −25
Original line number Diff line number Diff line
<!--
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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="6.0dp"
        android:height="32dp"
        android:viewportWidth="6.0"
        android:viewportHeight="24.0"
        android:tint="?android:attr/colorAccent">
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M6.000000,15.700000l-3.000000,5.599999 -3.000000,-5.599999z"/>
</vector>
+0 −25
Original line number Diff line number Diff line
<!--
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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="6.0dp"
        android:height="32dp"
        android:viewportWidth="6.0"
        android:viewportHeight="24.0"
        android:tint="?android:attr/colorAccent">
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M0.000000,13.700000l3.000000,-5.700000 3.000000,5.700000z"/>
</vector>
+0 −6
Original line number Diff line number Diff line
@@ -873,12 +873,6 @@
         is displayed in the upper left corner. -->
    <dimen name="roaming_icon_start_padding">2sp</dimen>

    <!-- Extra padding between the mobile data type icon and the strength indicator when the data
         type icon is wide for the tile in quick settings. -->
    <dimen name="wide_type_icon_start_padding_qs">3dp</dimen>

    <dimen name="signal_indicator_to_icon_frame_spacing">3dp</dimen>

    <!-- Starting margin before the signal cluster -->

    <!-- Padding between signal cluster and battery icon -->
Loading