Use backgroundColor for the old toast layout.
Some history necessary to understand why this is needed: - From Android R, we started rendering text toasts in System UI instead of having them rendered by the app. As a result, we have two separate layouts for toasts: * targetSdk < 30: transient_notification.xml (rendered by the app) * targetSdg >= 30: text_toast.xml (rendered by SystemUI) - We previously used backgroundColor for the toast background (toastFrameBackground), but we moved to using surfaceColor (a system color which matches the device theme). The problem is that surfaceColor isn't available when the toast is rendered by the app though, leading to weird behaviors like showing light grey text on a white background if the app's theme is material dark. To fix this, we should still use backgroundColor (like before) for toasts that are rendered by the app. Fix: 245678793 Test: manually triggered toast from app targeting SDK 29, observed color is correct Change-Id: I7ab1991c628b85f01391e41b6a03b3bd7f219058
Loading
Please register or sign in to comment