You can easily create custom toast by the following code:
Toast toast = Toast.makeText(context, resTxtId, Toast.LENGTH_LONG);
View view = toast.getView();
view.setBackgroundResource(R.drawable.custom_bkg);
TextView text = (TextView) view.findViewById(android.R.id.message);
/*here you can do anything with text*/
toast.show();
Or you can instantiate a completely custom toast:
Toast toast = new Toast(context);
toast.setDuration(Toast.LENGTH_LONG);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.custom_layout, null);
toast.setView(view);
toast.show();
Dialog customizing is a more complex routine. But there is similar workaround.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…