public void showToast(final SuperActivityToast toast) { hideToast(); myToast = toast; // TODO: avoid this hack (accessing text style via option) final int dpi = getZLibrary().getDisplayDPI(); final int defaultFontSize = dpi * 18 / 160; final int fontSize = new ZLIntegerOption("Style", "Base:fontSize", defaultFontSize).getValue(); final int percent = new ZLIntegerRangeOption("Options", "ToastFontSizePercent", 25, 100, 90).getValue(); final int dpFontSize = fontSize * 160 * percent / dpi / 100; toast.setTextSize(dpFontSize); toast.setButtonTextSize(dpFontSize * 7 / 8); final String fontFamily = new ZLStringOption("Style", "Base:fontFamily", "sans-serif").getValue(); toast.setTypeface(AndroidFontUtil.systemTypeface(fontFamily, false, false)); runOnUiThread(new Runnable() { public void run() { toast.show(); } }); } /* ------ SUPER TOAST ------ */