Bear with me Bear with me - 6 months ago 24
Android Question

Android's Toast default colors and alpha

What are the default colors of the Toast component - the inner dark gray color, light gray border color and the value of alpha? I double checked the source of Toast.java but couldn't find it.

Answer

So from the transient_notification layout xml:

<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>

Which points to the res/drawable-hdpi/toast_frame.9.png. That image seems to vary from version to version though. You can find these in your android-sdk folder, inside /platforms/<the version you want>/data/res.

Comments