Is there a way to change a toast's color and text size/color, but retain the system toast layout?

android, android-xml, toast

Solution

This is the default layout used by `Toasts`.

transient_notification

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/toast_frame">

<TextView
    android:id="@android:id/message"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:textAppearance="@style/TextAppearance.Small"
    android:textColor="@color/bright_foreground_dark"
    android:shadowColor="#BB000000"
    android:shadowRadius="2.75"/>
</LinearLayout>

These are the enter and exit animations

ENTER

<alpha xmlns:android="http://schemas.android.com/apk/res/android"
        android:interpolator="@interpolator/decelerate_quad"
        android:fromAlpha="0.0" android:toAlpha="1.0"
        android:duration="@android:integer/config_longAnimTime" />

EXIT

<alpha xmlns:android="http://schemas.android.com/apk/res/android"
        android:interpolator="@interpolator/accelerate_quad" 
        android:fromAlpha="1.0" android:toAlpha="0.0"
        android:duration="@android:integer/config_longAnimTime" />

toast_frame_holo.9 is the name of the resource used for the background. Search the SDK to find all of the sizes.

And here is the full source for `Toasts`

If you're unsure about any of that, search the SDK for all of the resources, that's where I looked.

Problem

I know that I could do all of this easily with a custom toast layout, but in creating a custom layout, I would no longer be using the system's default toast view. Example: Toasts of course look different in Android 2.2 vs Android 4.0. If I create a custom view for my toast, then it will look the exact same in both versions, but what I want is for it to retain its... "Androidiness" for lack of a better word. Basically, does anyone know of a default toast XML layout? Is that even possible?

Original source