Skip to content

Instantly share code, notes, and snippets.

@codingwithsara
Created May 27, 2019 04:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codingwithsara/ce4db0c3fb97341c962c230ad5dcdd09 to your computer and use it in GitHub Desktop.
Save codingwithsara/ce4db0c3fb97341c962c230ad5dcdd09 to your computer and use it in GitHub Desktop.
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