Skip to content

Commit

Permalink
Fixed Unresolved reference: Q
Browse files Browse the repository at this point in the history
  • Loading branch information
ponnamkarthik committed Apr 20, 2021
1 parent 37a29c8 commit 5ba6489
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
Toast.LENGTH_SHORT
}

if (bgcolor != null && Build.VERSION.SDK_INT < 29) {
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 text = layout.findViewById<TextView>(R.id.text)
text.text = mMessage

val gradientDrawable: Drawable = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
val gradientDrawable: Drawable = if (Build.VERSION.SDK_INT >= 21) {
context.getDrawable(R.drawable.corner)!!
} else {
context.resources.getDrawable(R.drawable.corner)
Expand All @@ -71,7 +71,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
mToast.view = layout
} else {
mToast = Toast.makeText(context, mMessage, mDuration)
if (Build.VERSION.SDK_INT < 29) {
if (Build.VERSION.SDK_INT < 30) {
try {
val textView: TextView = mToast.view!!.findViewById(android.R.id.message)
if (textSize != null) {
Expand All @@ -86,7 +86,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
}
}

// if(Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
// if(Build.VERSION.SDK_INT < 30) {
when (mGravity) {
Gravity.CENTER -> {
mToast.setGravity(mGravity, 0, 0)
Expand Down

0 comments on commit 5ba6489

Please sign in to comment.