Android Positioning Toast

Example:

                                    
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".PositioningToastExample">
    
    <ScrollView
           android:layout_width="match_parent"
           android:layout_height="match_parent">
   
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="16dp"
            android:gravity="center">
   
        <Button
           android:id="@+id/topToast"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="TOP"
           android:textColor="@color/colorWhite"
           android:background="@color/colorOrange"
           android:layout_marginBottom="15dp"
           />
   
        <Button
           android:id="@+id/bottomToast"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="BOTTOM"
           android:textColor="@color/colorWhite"
           android:background="@color/colorOrange"
           android:layout_marginBottom="15dp"
           />
   
        <Button
           android:id="@+id/leftToast"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="LEFT"
           android:textColor="@color/colorWhite"
           android:background="@color/colorOrange"
           android:layout_marginBottom="15dp"
           />
   
        <Button
           android:id="@+id/rightToast"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="RIGHT"
           android:textColor="@color/colorWhite"
           android:background="@color/colorOrange"
           android:layout_marginBottom="15dp"
           />
   
        <Button
           android:id="@+id/centerToast"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="CENTER"
           android:textColor="@color/colorWhite"
           android:background="@color/colorOrange"
           android:layout_marginBottom="15dp"
           />
   
        <Button
           android:id="@+id/center_horizontalToast"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="CENTER HORIZONTAL"
           android:textColor="@color/colorWhite"
           android:background="@color/colorOrange"
           android:layout_marginBottom="15dp"
           />
   
        <Button
           android:id="@+id/center_verticalToast"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="CENTER VERTICAL"
           android:textColor="@color/colorWhite"
           android:background="@color/colorOrange"
           android:layout_marginBottom="15dp"
           />
   
        </LinearLayout>
   
    </ScrollView>
   
</LinearLayout>
                                    
                                  

Output