Skip to content

Instantly share code, notes, and snippets.

@codingwithsara

codingwithsara/toast_layout.xml Secret

Created May 27, 2019
Embed
What would you like to do?
Custom Toast
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal"
android:background="@color/colorPrimary"
android:paddingVertical="14dp"
android:paddingHorizontal="26dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Custom Toast"
android:textSize="20sp"
android:textColor="@android:color/white"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginTop="20dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:mipmap/sym_def_app_icon"/>
<TextView
android:id="@+id/msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message"
android:textSize="24sp"
android:textColor="@android:color/white"
android:layout_marginLeft="10dp"/>
</LinearLayout>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.