Commit f42759de by Pedro Henrique Committed by GitHub

Toast doesn't shows up the correct background (#333)

Toast doesn't shows up the correct background  color on android 11
parent a5de0ad3
...@@ -46,7 +46,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler { ...@@ -46,7 +46,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
Toast.LENGTH_SHORT Toast.LENGTH_SHORT
} }
if (bgcolor != null && Build.VERSION.SDK_INT < 30) { if (bgcolor != null && Build.VERSION.SDK_INT <= 30) {
val layout = (context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater).inflate(R.layout.toast_custom, null) val layout = (context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater).inflate(R.layout.toast_custom, null)
val text = layout.findViewById<TextView>(R.id.text) val text = layout.findViewById<TextView>(R.id.text)
text.text = mMessage text.text = mMessage
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment