This view is a custom toast is included success, fail, warning , info and changeable toast arguments .
- Success toast
- Fail toast
- Warning toast
- Info's toast
- Changeable arguments toast
Install my-project with https://jitpack.io/
implementation 'com.github.Mori-hub:Colored-Toast:1.0.0'
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ColoredToast coloredToast= new ColoredToast(MainActivity.this);
coloredToast.success("Welcome to Colored Toast", Toast.LENGTH_SHORT).show());
coloredToast.fail("Welcome to Colored Toast", Toast.LENGTH_SHORT).show());
coloredToast.warning("Welcome to Colored Toast", Toast.LENGTH_SHORT).show());
coloredToast.info("Welcome to Colored Toast", Toast.LENGTH_SHORT).show());
findViewById(R.id.button5).setOnClickListener(v->
coloredToast.customs("Welcome to Colored Toast", Toast.LENGTH_SHORT,
R.color.white, //Must be from Resource - Ignore 0
android.R.drawable.editbox_dropdown_dark_frame,//Must be from Resource - Ignore 0
Color.argb(205, 182, 104, 0),//Must be argb - Ignore 0
android.R.drawable.btn_star_big_on,//Must be from Resource - Ignore 0
Gravity.BOTTOM // Ignore 0
).show());
}
I'm a full stack developer...
Java, Kotlin, CSS...
Important: For Gradle 7.2 & jitpack.io Please use this way : https://stackoverflow.com/a/71603699/12272687
Update: March 2022