diff --git a/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java b/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java index 492611fab9..d4eca2fd40 100644 --- a/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java +++ b/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java @@ -35,6 +35,7 @@ import com.android.quickstep.util.RecentsOrientedState; */ public class GoOverviewActionsView extends OverviewActionsView { + @Nullable private ArrowTipView mArrowTipView; public GoOverviewActionsView(Context context) { diff --git a/quickstep/src/com/android/quickstep/views/AllAppsEduView.java b/quickstep/src/com/android/quickstep/views/AllAppsEduView.java index e9d7c3cb31..d79b318023 100644 --- a/quickstep/src/com/android/quickstep/views/AllAppsEduView.java +++ b/quickstep/src/com/android/quickstep/views/AllAppsEduView.java @@ -35,6 +35,7 @@ import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; +import androidx.annotation.Nullable; import androidx.core.graphics.ColorUtils; import com.android.launcher3.AbstractFloatingView; @@ -58,6 +59,7 @@ public class AllAppsEduView extends AbstractFloatingView { private Launcher mLauncher; private AllAppsEduTouchController mTouchController; + @Nullable private AnimatorSet mAnimation; private GradientDrawable mCircle; diff --git a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java index 7c8041c992..dbdcf19d84 100644 --- a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java +++ b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java @@ -44,6 +44,7 @@ import android.view.ViewOutlineProvider; import android.widget.FrameLayout; import android.widget.TextView; +import androidx.annotation.Nullable; import androidx.annotation.StringRes; import com.android.launcher3.BaseActivity; @@ -69,6 +70,7 @@ public final class DigitalWellBeingToast { private Task mTask; private boolean mHasLimit; private long mAppRemainingTimeMs; + @Nullable private View mBanner; private ViewOutlineProvider mOldBannerOutlineProvider; private float mBannerOffsetPercentage; @@ -234,7 +236,7 @@ public final class DigitalWellBeingToast { task.titleDescription; } - private void replaceBanner(View view) { + private void replaceBanner(@Nullable View view) { resetOldBanner(); setBanner(view); } @@ -248,7 +250,7 @@ public final class DigitalWellBeingToast { } } - private void setBanner(View view) { + private void setBanner(@Nullable View view) { mBanner = view; if (view != null) { setupAndAddBanner(); diff --git a/quickstep/src/com/android/quickstep/views/FloatingWidgetBackgroundView.java b/quickstep/src/com/android/quickstep/views/FloatingWidgetBackgroundView.java index 1548268891..c3b166fada 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingWidgetBackgroundView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingWidgetBackgroundView.java @@ -27,6 +27,8 @@ import android.view.View; import android.view.ViewOutlineProvider; import android.widget.RemoteViews.RemoteViewOutlineProvider; +import androidx.annotation.Nullable; + import com.android.launcher3.widget.LauncherAppWidgetHostView; import com.android.launcher3.widget.RoundedCornerEnforcement; @@ -42,7 +44,9 @@ final class FloatingWidgetBackgroundView extends View { private final DrawableProperties mForegroundProperties = new DrawableProperties(); private final DrawableProperties mBackgroundProperties = new DrawableProperties(); + @Nullable private Drawable mOriginalForeground; + @Nullable private Drawable mOriginalBackground; private float mFinalRadius; private float mInitialOutlineRadius; @@ -50,7 +54,7 @@ final class FloatingWidgetBackgroundView extends View { private boolean mIsUsingFallback; private View mSourceView; - FloatingWidgetBackgroundView(Context context, AttributeSet attrs, int defStyleAttr) { + FloatingWidgetBackgroundView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); setOutlineProvider(new ViewOutlineProvider() { @Override @@ -161,8 +165,10 @@ final class FloatingWidgetBackgroundView extends View { /** Stores and modifies a drawable's properties through an animation. */ private static class DrawableProperties { + @Nullable private Drawable mDrawable; private float mOriginalRadius; + @Nullable private float[] mOriginalRadii; private final float[] mTmpRadii = new float[8]; diff --git a/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java b/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java index 463ed4bd9c..8a5f42afaf 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java @@ -57,10 +57,14 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, private LauncherAppWidgetHostView mAppWidgetView; private View mAppWidgetBackgroundView; private RectF mBackgroundPosition; + @Nullable private GhostView mForegroundOverlayView; + @Nullable private Runnable mEndRunnable; + @Nullable private Runnable mFastFinishRunnable; + @Nullable private Runnable mOnTargetChangeRunnable; private boolean mAppTargetIsTranslucent; diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java index ba74b0dc61..db4b743fe1 100644 --- a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java +++ b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java @@ -39,10 +39,13 @@ import java.util.function.Consumer; */ public class GroupedTaskView extends TaskView { + @Nullable private Task mSecondaryTask; private TaskThumbnailView mSnapshotView2; private IconView mIconView2; + @Nullable private CancellableTask mThumbnailLoadRequest2; + @Nullable private CancellableTask mIconLoadRequest2; private final float[] mIcon2CenterCoords = new float[2]; private TransformingTouchDelegate mIcon2TouchDelegate; @@ -153,6 +156,7 @@ public class GroupedTaskView extends TaskView { } } + @Nullable @Override public RunnableList launchTaskAnimated() { getRecentsView().getSplitPlaceholder().launchTasks(mTask, mSecondaryTask, @@ -167,7 +171,7 @@ public class GroupedTaskView extends TaskView { } @Override - void refreshThumbnails(HashMap thumbnailDatas) { + void refreshThumbnails(@Nullable HashMap thumbnailDatas) { super.refreshThumbnails(thumbnailDatas); if (mSecondaryTask != null && thumbnailDatas != null) { final ThumbnailData thumbnailData = thumbnailDatas.get(mSecondaryTask.key.id); diff --git a/quickstep/src/com/android/quickstep/views/IconView.java b/quickstep/src/com/android/quickstep/views/IconView.java index 813e653c85..ccb1a991ea 100644 --- a/quickstep/src/com/android/quickstep/views/IconView.java +++ b/quickstep/src/com/android/quickstep/views/IconView.java @@ -23,6 +23,8 @@ import android.util.AttributeSet; import android.view.Gravity; import android.view.View; +import androidx.annotation.Nullable; + import com.android.launcher3.Utilities; /** @@ -31,6 +33,7 @@ import com.android.launcher3.Utilities; */ public class IconView extends View { + @Nullable private Drawable mDrawable; private int mDrawableWidth, mDrawableHeight; @@ -46,7 +49,10 @@ public class IconView extends View { super(context, attrs, defStyleAttr); } - public void setDrawable(Drawable d) { + /** + * Sets a {@link Drawable} to be displayed. + */ + public void setDrawable(@Nullable Drawable d) { if (mDrawable != null) { mDrawable.setCallback(null); } @@ -76,6 +82,7 @@ public class IconView extends View { mDrawable.setBounds(drawableRect); } + @Nullable public Drawable getDrawable() { return mDrawable; } diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java index 5c0b50c3aa..f3b6a63306 100644 --- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java +++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java @@ -90,8 +90,10 @@ public class OverviewActionsView extends FrameLayo @ActionsDisabledFlags protected int mDisabledFlags; + @Nullable protected T mCallbacks; + @Nullable protected DeviceProfile mDp; public OverviewActionsView(Context context) { diff --git a/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java b/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java index 845e13eecc..04a5761fdc 100644 --- a/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java +++ b/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java @@ -40,6 +40,7 @@ public class SplitPlaceholderView extends FrameLayout { } }; + @Nullable private IconView mIconView; public SplitPlaceholderView(Context context, AttributeSet attrs) { diff --git a/quickstep/src/com/android/quickstep/views/TaskMenuView.java b/quickstep/src/com/android/quickstep/views/TaskMenuView.java index d55b89c5a1..853a02343f 100644 --- a/quickstep/src/com/android/quickstep/views/TaskMenuView.java +++ b/quickstep/src/com/android/quickstep/views/TaskMenuView.java @@ -39,6 +39,8 @@ import android.view.ViewTreeObserver.OnScrollChangedListener; import android.widget.LinearLayout; import android.widget.TextView; +import androidx.annotation.Nullable; + import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.DeviceProfile; @@ -67,6 +69,7 @@ public class TaskMenuView extends AbstractFloatingView implements OnScrollChange private BaseDraggingActivity mActivity; private TextView mTaskName; + @Nullable private AnimatorSet mOpenCloseAnimator; private TaskView mTaskView; private TaskIdAttributeContainer mTaskContainer; diff --git a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java index d498428076..c960f88437 100644 --- a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java +++ b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java @@ -78,6 +78,7 @@ public class TaskThumbnailView extends View { }; private final BaseActivity mActivity; + @Nullable private TaskOverlay mOverlay; private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); private final Paint mBackgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG); @@ -90,8 +91,11 @@ public class TaskThumbnailView extends View { private final PreviewPositionHelper mPreviewPositionHelper = new PreviewPositionHelper(); private TaskView.FullscreenDrawParams mFullscreenParams; + @Nullable private Task mTask; + @Nullable private ThumbnailData mThumbnailData; + @Nullable protected BitmapShader mBitmapShader; /** How much this thumbnail is dimmed, 0 not dimmed at all, 1 totally dimmed. */ @@ -141,7 +145,8 @@ public class TaskThumbnailView extends View { * upon swipe up so that a usable screenshot is accessible immediately when * recents animation needs to be finished / cancelled. */ - public void setThumbnail(Task task, ThumbnailData thumbnailData, boolean refreshNow) { + public void setThumbnail(@Nullable Task task, @Nullable ThumbnailData thumbnailData, + boolean refreshNow) { mTask = task; mThumbnailData = (thumbnailData != null && thumbnailData.thumbnail != null) ? thumbnailData : null; @@ -151,7 +156,7 @@ public class TaskThumbnailView extends View { } /** See {@link #setThumbnail(Task, ThumbnailData, boolean)} */ - public void setThumbnail(Task task, ThumbnailData thumbnailData) { + public void setThumbnail(@Nullable Task task, @Nullable ThumbnailData thumbnailData) { setThumbnail(task, thumbnailData, true /* refreshNow */); } @@ -366,6 +371,10 @@ public class TaskThumbnailView extends View { return Utilities.makeColorTintingColorFilter(mDimColor, dimAmount); } + /** + * Returns current thumbnail or null if none is set. + */ + @Nullable public Bitmap getThumbnail() { if (mThumbnailData == null) { return null; diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index d09ffa6a73..1952c6d5a4 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -360,6 +360,7 @@ public class TaskView extends FrameLayout implements Reusable { private final TaskOutlineProvider mOutlineProvider; + @Nullable protected Task mTask; protected TaskThumbnailView mSnapshotView; protected IconView mIconView; @@ -394,6 +395,7 @@ public class TaskView extends FrameLayout implements Reusable { private float mSplitSelectTranslationX; private float mSplitSelectScrollOffsetPrimary; + @Nullable private ObjectAnimator mIconAndDimAnimator; private float mIconScaleAnimStartProgress = 0; private float mFocusTransitionProgress = 1; @@ -411,7 +413,9 @@ public class TaskView extends FrameLayout implements Reusable { private boolean mShowScreenshot; // The current background requests to load the task thumbnail and icon + @Nullable private CancellableTask mThumbnailLoadRequest; + @Nullable private CancellableTask mIconLoadRequest; private boolean mEndQuickswitchCuj; @@ -544,6 +548,7 @@ public class TaskView extends FrameLayout implements Reusable { return mTaskIdAttributeContainer; } + @Nullable public Task getTask() { return mTask; } @@ -686,6 +691,7 @@ public class TaskView extends FrameLayout implements Reusable { * Starts the task associated with this view and animates the startup. * @return CompletionStage to indicate the animation completion or null if the launch failed. */ + @Nullable public RunnableList launchTaskAnimated() { if (mTask != null) { TestLogging.recordEvent( @@ -843,7 +849,7 @@ public class TaskView extends FrameLayout implements Reusable { } } - protected void setIcon(IconView iconView, Drawable icon) { + protected void setIcon(IconView iconView, @Nullable Drawable icon) { if (icon != null) { iconView.setDrawable(icon); iconView.setOnClickListener(v -> {