LayoutInflater i = getLayoutInflater();
View inflate = getLayoutInflater().inflate(R.layout.snack, null);
Toast t = Toast.makeText(getApplicationContext(),"",Toast.LENGTH_SHORT);
t.setView(inflate);
t.setGravity(Gravity.BOTTOM |Gravity.FILL_HORIZONTAL,0,0);
final LinearLayout container = (LinearLayout)inflate.findViewById(R.id.linear1);
final TextView textview1 = (TextView)inflate.findViewById(R.id.textview1);
android.graphics.drawable.GradientDrawable IFGCDDD = new android.graphics.drawable.GradientDrawable();
IFGCDDD.setColor(Color.parseColor("#FFFFFFFF"));
IFGCDDD.setCornerRadii(new float[] { 28, 28, 28, 28, 0, 0, 0, 0 });
container.setBackground(IFGCDDD);
if(Build.VERSION.SDK_INT >= 21) { container.setElevation(4f); }
textview1.setText(texto);
t.show();

SnackBar Material (androidx)



Ejemplo: