diff --git a/app/src/main/assets/PCap Terminal.otf b/app/src/main/assets/PCap Terminal.otf new file mode 100644 index 0000000..daf0652 Binary files /dev/null and b/app/src/main/assets/PCap Terminal.otf differ diff --git a/app/src/main/java/es/dmoral/toastysample/MainActivity.java b/app/src/main/java/es/dmoral/toastysample/MainActivity.java index f68c70d..8a472fd 100644 --- a/app/src/main/java/es/dmoral/toastysample/MainActivity.java +++ b/app/src/main/java/es/dmoral/toastysample/MainActivity.java @@ -80,6 +80,18 @@ public void onClick(View view) { Toasty.info(MainActivity.this, getFormattedMessage()).show(); } }); + findViewById(R.id.button_custom_config).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Toasty.Config.getInstance() + .setTextColor(Color.GREEN) + .setToastTypeface(getAssets(), "PCap Terminal.otf") + .apply(); + Toasty.custom(MainActivity.this, "sudo kill -9 everyone", getResources().getDrawable(R.drawable.laptop512), + Color.BLACK, Toast.LENGTH_SHORT, true, true).show(); + Toasty.Config.reset(); // Use this if you want to use the configuration above only once + } + }); } private CharSequence getFormattedMessage() { diff --git a/app/src/main/res/drawable/laptop512.png b/app/src/main/res/drawable/laptop512.png new file mode 100644 index 0000000..943eddf Binary files /dev/null and b/app/src/main/res/drawable/laptop512.png differ diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 764840d..79238be 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,90 +1,106 @@ - -