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

Commit 14424e9e authored by Jeremy Sim's avatar Jeremy Sim Committed by Vinit Nayak
Browse files

App pairs: themed icons

App pairs now use themed icons when theming is enabled.

Fixes: 312452183
Test: Manual and presubmit tested
Flag: ACONFIG com.android.wm.shell.enable_app_pairs TEAMFOOD
Change-Id: I21801b63bc3b52da9b2dfff02cc9ec70e679b300
parent d36d4f3f
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -25,8 +25,10 @@ import android.util.Log
import android.view.Gravity
import android.view.Gravity
import android.widget.FrameLayout
import android.widget.FrameLayout
import com.android.launcher3.DeviceProfile
import com.android.launcher3.DeviceProfile
import com.android.launcher3.icons.BitmapInfo
import com.android.launcher3.icons.PlaceHolderIconDrawable
import com.android.launcher3.icons.PlaceHolderIconDrawable
import com.android.launcher3.model.data.WorkspaceItemInfo
import com.android.launcher3.model.data.WorkspaceItemInfo
import com.android.launcher3.util.Themes


/**
/**
 * A FrameLayout marking the area on an [AppPairIcon] where the visual icon will be drawn. One of
 * A FrameLayout marking the area on an [AppPairIcon] where the visual icon will be drawn. One of
@@ -95,9 +97,10 @@ class AppPairIconGraphic @JvmOverloads constructor(context: Context, attrs: Attr
            return
            return
        }
        }


        // Generate new icons
        // Generate new icons, using themed flag if needed
        val newIcon1 = parentIcon.info.contents[0].newIcon(context)
        val flags = if (Themes.isThemedIconEnabled(context)) BitmapInfo.FLAG_THEMED else 0
        val newIcon2 = parentIcon.info.contents[1].newIcon(context)
        val newIcon1 = parentIcon.info.contents[0].newIcon(context, flags)
        val newIcon2 = parentIcon.info.contents[1].newIcon(context, flags)


        // If app icons did not draw fully last time, animate to full icon
        // If app icons did not draw fully last time, animate to full icon
        (appIcon1 as? PlaceHolderIconDrawable)?.animateIconUpdate(newIcon1)
        (appIcon1 as? PlaceHolderIconDrawable)?.animateIconUpdate(newIcon1)