Skip to content

Commit

Permalink
title visibility gone if null
Browse files Browse the repository at this point in the history
  • Loading branch information
har2008preet committed Sep 9, 2022
1 parent cf4f6e1 commit 46e8d69
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Toast/src/main/java/com/collegedunia/toast/ToastGenerate.kt
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,18 @@ class ToastGenerate constructor(private val context: Context) {
imgLeft.setImageDrawable(item.leftImage)
}

if (item.title == null) {
title.visibility = GONE
} else {
title.visibility = VISIBLE
title.text = item.title
}
if (item.message == null) {
description.visibility = GONE
} else {
description.visibility = VISIBLE
description.text = item.message
}
title.text = item.title
return shell
}

Expand Down

0 comments on commit 46e8d69

Please sign in to comment.