diff --git a/quickstep/res/drawable/bg_circle.xml b/quickstep/res/drawable/bg_circle.xml deleted file mode 100644 index 506177b6a1..0000000000 --- a/quickstep/res/drawable/bg_circle.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - \ No newline at end of file diff --git a/quickstep/res/drawable/ic_desktop.xml b/quickstep/res/drawable/ic_desktop.xml index 8de275df5c..11feca5604 100644 --- a/quickstep/res/drawable/ic_desktop.xml +++ b/quickstep/res/drawable/ic_desktop.xml @@ -1,5 +1,4 @@ - - - - - + android:width="24dp" + android:height="24dp" + android:autoMirrored="true" + android:tint="?attr/colorControlNormal" + android:viewportHeight="960" + android:viewportWidth="960"> + diff --git a/quickstep/src/com/android/quickstep/DesktopSystemShortcut.kt b/quickstep/src/com/android/quickstep/DesktopSystemShortcut.kt index 358f644e40..fbc0d14e5e 100644 --- a/quickstep/src/com/android/quickstep/DesktopSystemShortcut.kt +++ b/quickstep/src/com/android/quickstep/DesktopSystemShortcut.kt @@ -34,7 +34,7 @@ class DesktopSystemShortcut( abstractFloatingViewHelper: AbstractFloatingViewHelper ) : SystemShortcut( - R.drawable.ic_caption_desktop_button_foreground, + R.drawable.ic_desktop, R.string.recent_task_option_desktop, container, taskContainer.itemInfo, diff --git a/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt b/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt index 9ce2277b14..ffe6672ecf 100644 --- a/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt +++ b/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt @@ -19,7 +19,6 @@ import android.content.Context import android.graphics.Point import android.graphics.PointF import android.graphics.Rect -import android.graphics.drawable.LayerDrawable import android.graphics.drawable.ShapeDrawable import android.graphics.drawable.shapes.RoundRectShape import android.util.AttributeSet @@ -27,6 +26,7 @@ import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.core.content.res.ResourcesCompat import androidx.core.view.updateLayoutParams import com.android.launcher3.Flags.enableRefactorTaskThumbnail import com.android.launcher3.R @@ -84,9 +84,15 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu } iconView = getOrInflateIconView(R.id.icon).apply { - val iconBackground = resources.getDrawable(R.drawable.bg_circle, context.theme) - val icon = resources.getDrawable(R.drawable.ic_desktop, context.theme) - setIcon(this, LayerDrawable(arrayOf(iconBackground, icon))) + setIcon( + this, + ResourcesCompat.getDrawable( + context.resources, + R.drawable.ic_desktop_with_bg, + context.theme + ) + ) + setText(resources.getText(R.string.recent_task_option_desktop)) } childCountAtInflation = childCount } @@ -266,6 +272,7 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu private const val TAG = "DesktopTaskView" private const val DEBUG = false private const val VIEW_POOL_MAX_SIZE = 10 + // As DesktopTaskView is inflated in background, use initialSize=0 to avoid initPool. private const val VIEW_POOL_INITIAL_SIZE = 0 private val ORIGIN = Point(0, 0) diff --git a/res/drawable/ic_desktop_with_bg.xml b/res/drawable/ic_desktop_with_bg.xml new file mode 100644 index 0000000000..f54285c444 --- /dev/null +++ b/res/drawable/ic_desktop_with_bg.xml @@ -0,0 +1,29 @@ + + + + + +