Loading quickstep/res/drawable/keyboard_quick_switch_thumbnail_background.xml 0 → 100644 +21 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2024 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. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@android:color/white" /> <corners android:radius="@dimen/keyboard_quick_switch_task_view_radius" /> </shape> quickstep/res/layout/keyboard_quick_switch_taskview_thumbnail.xml +1 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,6 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="centerCrop" android:background="@drawable/keyboard_quick_switch_task_view_background" android:background="@drawable/keyboard_quick_switch_thumbnail_background" android:clipToOutline="true" android:importantForAccessibility="no"/> quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchTaskView.java +7 −4 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.View; Loading Loading @@ -174,21 +175,23 @@ public class KeyboardQuickSwitchTaskView extends ConstraintLayout { return; } if (updateFunction == null) { applyThumbnail(thumbnailView, task.thumbnail); applyThumbnail(thumbnailView, task.colorBackground, task.thumbnail); return; } updateFunction.updateThumbnailInBackground( task, thumbnailData -> applyThumbnail(thumbnailView, thumbnailData)); updateFunction.updateThumbnailInBackground(task, thumbnailData -> applyThumbnail(thumbnailView, task.colorBackground, thumbnailData)); } private void applyThumbnail( @NonNull ImageView thumbnailView, ThumbnailData thumbnailData) { @ColorInt int backgroundColor, @Nullable ThumbnailData thumbnailData) { Bitmap bm = thumbnailData == null ? null : thumbnailData.thumbnail; if (thumbnailView.getVisibility() != VISIBLE) { thumbnailView.setVisibility(VISIBLE); } thumbnailView.getBackground().setTint(bm == null ? backgroundColor : Color.TRANSPARENT); thumbnailView.setImageDrawable(new BlurredBitmapDrawable(bm, THUMBNAIL_BLUR_RADIUS)); } Loading Loading
quickstep/res/drawable/keyboard_quick_switch_thumbnail_background.xml 0 → 100644 +21 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2024 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. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@android:color/white" /> <corners android:radius="@dimen/keyboard_quick_switch_task_view_radius" /> </shape>
quickstep/res/layout/keyboard_quick_switch_taskview_thumbnail.xml +1 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,6 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="centerCrop" android:background="@drawable/keyboard_quick_switch_task_view_background" android:background="@drawable/keyboard_quick_switch_thumbnail_background" android:clipToOutline="true" android:importantForAccessibility="no"/>
quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchTaskView.java +7 −4 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.View; Loading Loading @@ -174,21 +175,23 @@ public class KeyboardQuickSwitchTaskView extends ConstraintLayout { return; } if (updateFunction == null) { applyThumbnail(thumbnailView, task.thumbnail); applyThumbnail(thumbnailView, task.colorBackground, task.thumbnail); return; } updateFunction.updateThumbnailInBackground( task, thumbnailData -> applyThumbnail(thumbnailView, thumbnailData)); updateFunction.updateThumbnailInBackground(task, thumbnailData -> applyThumbnail(thumbnailView, task.colorBackground, thumbnailData)); } private void applyThumbnail( @NonNull ImageView thumbnailView, ThumbnailData thumbnailData) { @ColorInt int backgroundColor, @Nullable ThumbnailData thumbnailData) { Bitmap bm = thumbnailData == null ? null : thumbnailData.thumbnail; if (thumbnailView.getVisibility() != VISIBLE) { thumbnailView.setVisibility(VISIBLE); } thumbnailView.getBackground().setTint(bm == null ? backgroundColor : Color.TRANSPARENT); thumbnailView.setImageDrawable(new BlurredBitmapDrawable(bm, THUMBNAIL_BLUR_RADIUS)); } Loading