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

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

resolve merge conflicts of db8e84f7 to master

Change-Id: Idfa2cbce7070bd3cfe01dcfc9136ffd42e7675cf
parents 652d5553 db8e84f7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -178,6 +178,7 @@ public class QSContainer extends FrameLayout {
    private void updateQsState() {
        boolean expandVisually = mQsExpanded || mStackScrollerOverscrolling || mHeaderAnimating;
        mQSPanel.setExpanded(mQsExpanded);
        mQSDetail.setExpanded(mQsExpanded);
        mHeader.setVisibility((mQsExpanded || !mKeyguardShowing || mHeaderAnimating)
                ? View.VISIBLE
                : View.INVISIBLE);
+27 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Switch;
import android.widget.TextView;

import com.android.internal.logging.MetricsLogger;
import com.android.systemui.FontSizeUtils;
import com.android.systemui.R;
@@ -64,6 +65,9 @@ public class QSDetail extends LinearLayout {
    private boolean mFullyExpanded;
    protected View mQsDetailHeaderBack;
    private BaseStatusBarHeader mHeader;
    private boolean mTriggeredExpand;
    private int mOpenX;
    private int mOpenY;

    public QSDetail(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
@@ -112,6 +116,7 @@ public class QSDetail extends LinearLayout {
    public void setQsPanel(QSPanel panel, BaseStatusBarHeader header) {
        mQsPanel = panel;
        mHeader = header;
        mHeader.setCallback(mQsPanelCallback);
        mQsPanel.setCallback(mQsPanelCallback);
    }

@@ -126,6 +131,12 @@ public class QSDetail extends LinearLayout {
        mFullyExpanded = fullyExpanded;
    }

    public void setExpanded(boolean qsExpanded) {
        if (!qsExpanded) {
            mTriggeredExpand = false;
        }
    }

    private void updateDetailText() {
        mDetailDoneButton.setText(R.string.quick_settings_done);
        mDetailSettingsButton.setText(R.string.quick_settings_more_settings);
@@ -146,6 +157,22 @@ public class QSDetail extends LinearLayout {
        setClickable(showingDetail);
        if (showingDetail) {
            setupDetailHeader(adapter);
            if (!mFullyExpanded) {
                mTriggeredExpand = true;
                mHost.animateToggleQSExpansion();
            } else {
                mTriggeredExpand = false;
            }
            mOpenX = x;
            mOpenY = y;
        } else {
            // Ensure we collapse into the same point we opened from.
            x = mOpenX;
            y = mOpenY;
            if (mTriggeredExpand) {
                mHost.animateToggleQSExpansion();
                mTriggeredExpand = false;
            }
        }

        boolean visibleDiff = (mDetailAdapter != null) != (adapter != null);
+10 −14
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.res.Resources;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
@@ -70,7 +71,6 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {

    private QSCustomizer mCustomizePanel;
    private Record mDetailRecord;
    private boolean mTriggeredExpand;

    public QSPanel(Context context) {
        this(context, null);
@@ -220,7 +220,6 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {
        }
        MetricsLogger.visibility(mContext, MetricsEvent.QS_PANEL, mExpanded);
        if (!mExpanded) {
            mTriggeredExpand = false;
            closeDetail();
        } else {
            logTiles();
@@ -298,6 +297,10 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {
        return new QSTileView(mContext, tile.createTileView(mContext), collapsedView);
    }

    protected boolean shouldShowDetail() {
        return mExpanded;
    }

    protected TileRecord addTile(final QSTile<?> tile, boolean collapsedView) {
        final TileRecord r = new TileRecord();
        r.tile = tile;
@@ -310,8 +313,12 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {

            @Override
            public void onShowDetail(boolean show) {
                // Both the collapsed and full QS panels get this callback, this check determines
                // which one should handle showing the detail.
                if (shouldShowDetail()) {
                    QSPanel.this.showDetail(show, r);
                }
            }

            @Override
            public void onToggleStateChanged(boolean state) {
@@ -397,17 +404,6 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {
    }

    protected void handleShowDetail(Record r, boolean show) {
        if (show) {
            if (!mExpanded) {
                mTriggeredExpand = true;
                mHost.animateToggleQSExpansion();
            } else {
                mTriggeredExpand = false;
            }
        } else if (mTriggeredExpand) {
            mHost.animateToggleQSExpansion();
            mTriggeredExpand = false;
        }
        if (r instanceof TileRecord) {
            handleShowDetailTile((TileRecord) r, show);
        } else {
+5 −5
Original line number Diff line number Diff line
@@ -76,6 +76,11 @@ public class QuickQSPanel extends QSPanel {
        mHeader = header;
    }

    @Override
    protected boolean shouldShowDetail() {
        return !mExpanded;
    }

    @Override
    protected void drawTile(TileRecord r, State state) {
        if (state instanceof SignalState) {
@@ -89,11 +94,6 @@ public class QuickQSPanel extends QSPanel {
        super.drawTile(r, state);
    }

    @Override
    protected void showDetail(boolean show, Record r) {
        // Do nothing, will be handled by the QSPanel.
    }

    @Override
    protected QSTileBaseView createTileView(QSTile<?> tile, boolean collapsedView) {
        return new QSTileBaseView(mContext, tile.createTileView(mContext), collapsedView);
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
import com.android.systemui.qs.QSPanel;
import com.android.systemui.qs.QSPanel.Callback;
import com.android.systemui.statusbar.policy.BatteryController;
import com.android.systemui.statusbar.policy.NetworkControllerImpl;
import com.android.systemui.statusbar.policy.NextAlarmController;
@@ -44,4 +45,5 @@ public abstract class BaseStatusBarHeader extends RelativeLayout implements
    public abstract void setBatteryController(BatteryController batteryController);
    public abstract void setNextAlarmController(NextAlarmController nextAlarmController);
    public abstract void setUserInfoController(UserInfoController userInfoController);
    public abstract void setCallback(Callback qsPanelCallback);
}
Loading