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

Commit 01c0d6b9 authored by Fedor Kudasov's avatar Fedor Kudasov Committed by Android (Google) Code Review
Browse files

Merge "Annotate com.android.systemui.qs with @Nullable"

parents 63fd265a 0a7934c3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -159,9 +159,9 @@ public interface QSTile {
        public Supplier<Icon> iconSupplier;
        public int state = DEFAULT_STATE;
        public CharSequence label;
        public CharSequence secondaryLabel;
        @Nullable public CharSequence secondaryLabel;
        public CharSequence contentDescription;
        public CharSequence stateDescription;
        @Nullable public CharSequence stateDescription;
        public CharSequence dualLabelContentDescription;
        public boolean disabledByPolicy;
        public boolean dualTarget = false;
@@ -170,6 +170,7 @@ public interface QSTile {
        public SlashState slash;
        public boolean handlesLongClick = true;
        public boolean showRippleEffect = true;
        @Nullable
        public Drawable sideViewCustomDrawable;
        public String spec;

+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ public class AutoSizingList extends LinearLayout {
    private final int mItemSize;
    private final Handler mHandler;

    @Nullable
    private ListAdapter mAdapter;
    private int mCount;
    private boolean mEnableAutoSizing;
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import android.view.animation.Interpolator;
import android.view.animation.OvershootInterpolator;
import android.widget.Scroller;

import androidx.annotation.Nullable;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;

@@ -51,14 +52,17 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
    private final ArrayList<TileRecord> mTiles = new ArrayList<>();
    private final ArrayList<TileLayout> mPages = new ArrayList<>();

    @Nullable
    private PageIndicator mPageIndicator;
    private float mPageIndicatorPosition;

    @Nullable
    private PageListener mPageListener;

    private boolean mListening;
    private Scroller mScroller;

    @Nullable
    private AnimatorSet mBounceAnimatorSet;
    private float mLastExpansion;
    private boolean mDistributeTiles = false;
+8 −1
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ import android.view.View;
import android.view.View.OnAttachStateChangeListener;
import android.view.View.OnLayoutChangeListener;

import androidx.annotation.Nullable;

import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.plugins.qs.QS;
import com.android.systemui.plugins.qs.QSTile;
@@ -88,6 +90,7 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
    private final View mQSFooterActions;
    private final View mQQSFooterActions;

    @Nullable
    private PagedTileLayout mPagedLayout;

    private boolean mOnFirstPage = true;
@@ -95,6 +98,7 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
    private final QSExpansionPathInterpolator mQSExpansionPathInterpolator;
    // Animator for elements in the first page, including secondary labels and qqs brightness
    // slider, as well as animating the alpha of the QS tile layout (as we are tracking QQS tiles)
    @Nullable
    private TouchAnimator mFirstPageAnimator;
    // TranslationX animator for QQS/QS tiles
    private TouchAnimator mTranslationXAnimator;
@@ -109,13 +113,16 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
    // This animates fading of SecurityFooter and media divider
    private TouchAnimator mAllPagesDelayedAnimator;
    // Animator for brightness slider(s)
    @Nullable
    private TouchAnimator mBrightnessAnimator;
    // Animator for Footer actions in QQS
    private TouchAnimator mQQSFooterActionsAnimator;
    // Height animator for QQS tiles (height changing from QQS size to QS size)
    @Nullable
    private HeightExpansionAnimator mQQSTileHeightAnimator;
    // Height animator for QS tile in first page but not in QQS, to present the illusion that they
    // are expanding alongside the QQS tiles
    @Nullable
    private HeightExpansionAnimator mOtherFirstPageTilesHeightAnimator;
    // Pair of animators for each non first page. The creation is delayed until the user first
    // scrolls to that page, in order to get the proper measures and layout.
@@ -215,7 +222,7 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
    }

    @Override
    public void onViewAttachedToWindow(View v) {
    public void onViewAttachedToWindow(@Nullable View v) {
        mTunerService.addTunable(this, ALLOW_FANCY_ANIMATION,
                MOVE_FULL_ROWS);
    }
+10 −3
Original line number Diff line number Diff line
@@ -64,15 +64,18 @@ public class QSDetail extends LinearLayout {
    protected TextView mDetailDoneButton;
    @VisibleForTesting
    QSDetailClipper mClipper;
    @Nullable
    private DetailAdapter mDetailAdapter;
    private QSPanelController mQsPanelController;

    protected View mQsDetailHeader;
    protected TextView mQsDetailHeaderTitle;
    private ViewStub mQsDetailHeaderSwitchStub;
    @Nullable
    private Switch mQsDetailHeaderSwitch;
    protected ImageView mQsDetailHeaderProgress;

    @Nullable
    protected QSTileHost mHost;

    private boolean mScanState;
@@ -87,6 +90,7 @@ public class QSDetail extends LinearLayout {
    private boolean mSwitchState;
    private QSFooter mFooter;

    @Nullable
    private QSContainerController mQsContainerController;

    public QSDetail(Context context, @Nullable AttributeSet attrs) {
@@ -183,12 +187,14 @@ public class QSDetail extends LinearLayout {
    }

    public interface Callback {
        void onShowingDetail(DetailAdapter detail, int x, int y);
        /** Handle an event of showing detail. */
        void onShowingDetail(@Nullable DetailAdapter detail, int x, int y);
        void onToggleStateChanged(boolean state);
        void onScanStateChanged(boolean state);
    }

    public void handleShowingDetail(final DetailAdapter adapter, int x, int y,
    /** Handle an event of showing detail. */
    public void handleShowingDetail(final @Nullable DetailAdapter adapter, int x, int y,
            boolean toggleQs) {
        final boolean showingDetail = adapter != null;
        final boolean wasShowingDetail = mDetailAdapter != null;
@@ -378,7 +384,8 @@ public class QSDetail extends LinearLayout {
        }

        @Override
        public void onShowingDetail(final DetailAdapter detail, final int x, final int y) {
        public void onShowingDetail(
                final @Nullable DetailAdapter detail, final int x, final int y) {
            post(new Runnable() {
                @Override
                public void run() {
Loading