Created
June 12, 2020 04:02
-
-
Save peterpazmandi/c8963e7338fb061de8771ea37a77a2f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun showCustomToast(message: String) | |
{ | |
val layout = layoutInflater.inflate ( | |
R.layout.custom_toast, | |
findViewById(R.id.cl_customToastContainer) | |
) | |
val textView = layout.findViewById(R.id.tv_message) | |
textView.text = message | |
val toast = Toast(applicationContext) | |
toast.apply { | |
setGravity(Gravity.BOTTOM, 0, 40) | |
duration = Toast.LENGTH_LONG | |
view = layout | |
show() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment