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

Commit 6cf5fbf9 authored by Matt Pietal's avatar Matt Pietal
Browse files

Wrap context in order to apply correct theme

When using a non sysui context, it needs to use a ContextThemeWrapper
in order to pick up sysui theme attributes.

Bug: 305040033
Test: manual - Launch WallpaperPicker with MIGRATE_KEYGUARD_STATUS_VIEW
Change-Id: I3ef875451c9cf35e64cba20326654b0ef58d5457
parent 2d2326ca
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.hardware.display.DisplayManager
import android.os.Bundle
import android.os.Handler
import android.os.IBinder
import android.view.ContextThemeWrapper
import android.view.Display
import android.view.Display.DEFAULT_DISPLAY
import android.view.DisplayInfo
@@ -179,7 +180,11 @@ constructor(

    fun render() {
        mainHandler.post {
            val previewContext = display?.let { context.createDisplayContext(it) } ?: context
            val previewContext =
                display?.let {
                    ContextThemeWrapper(context.createDisplayContext(it), context.getTheme())
                }
                    ?: context

            val rootView = FrameLayout(previewContext)