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.
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
.
As I found Default Toast Color and Alpha are as below
Color - black (0, 0, 0)
Alpha - 150
ARGB - (150, 0, 0, 0)
You can use the below java code to make a Toast Rectangular:-
Toast_obj.getView().setBackgroundColor(Color.argb(150, 0, 0, 0));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With