The image above is my current activity with a dialog fragment. as you can see dialog is in the middle of the screen but it want it to look something like in google maps where when I click on the button the dialog appears near the button:
=>
As you can see in google maps the dialog is not in the middle its near the selected button. This is my code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/edit_name"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/lbl_your_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Your name" />
<EditText
android:id="@+id/txt_your_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:inputType="text" />
</LinearLayout>
Which looks like this:
As you can see when I edit my dialogfragment the edittext and textview are on the top of the screen but for some reason when I deploy the app they are in the middle.