sketchub icon

How to get Roundend Toast

CoCoCo_CoCoCo
6 Likes
5 Comments
39 Downloads

Screenshots

About

Currently Showing Toast Like Below.

You can make a custom Toast. Please refer bellow example code

This is java code:

Toast toast = Toast.makeText(MainActivity.this, _text, 3000);
View view = toast.getView();

//Gets the actual oval background of the Toast then sets the colour filter
view.getBackground().setColorFilter(Color.parseColor(_bg), PorterDuff.Mode.SRC_IN);

TextView text = view.findViewById(android.R.id.message);
text.setTextColor(Color.parseColor(_color));

toast.setGravity(Gravity.BOTTOM, 0, 50);

toast.show();

Project code taken from the channel: @ySTACK

The code corner radius has been added.

toast.setGravity(Gravity.BOTTOM, 0, 50);

©2025 Sketchub | User Policy