I am new in android and i am trying to develop a application in which I am using on linear layout custom Edit text and Image View and on relative layout FAB and google Ad you see in image This is what i am trying to get for all device but when i am using small I am getting different thing which i am adding in second imageThis what I am getting in small device Please help me to achieve image 1 for all device . Thanks in Advance any Help will be Helpful for me.
This is XML code:-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.hp.newcode.MainActivity">
<LinearLayout
android:id="@+id/linearlayout"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@drawable/edittextxml"
android:orientation="horizontal"
android:layout_marginBottom="20dp"
android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:layout_above="@+id/adView"
android:layout_toLeftOf="@+id/btnQR"
android:layout_gravity="bottom">
<EditText
android:layout_toLeftOf="@+id/search"
android:id="@+id/inputSearchEditText"
android:layout_width="220dp"
android:paddingLeft="15dp"
android:layout_height="match_parent"
android:ellipsize="start"
android:hint="Search Society"
android:inputType="number"
android:maxLength="10"
android:textSize="15sp"
android:background="@drawable/edittextxml"/>
<LinearLayout
android:id="@+id/imageLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:background="#275766">
<ImageView
android:id="@+id/search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:clickable="true"
android:src="@drawable/search"/>
</LinearLayout>
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/btnQR"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
app:fabSize="normal"
app:srcCompat="@drawable/ic_action_name1"
android:scaleType="center"
android:layout_marginRight="20dp"
android:layout_marginEnd="9dp"
android:layout_alignBottom="@+id/linearlayout"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
ads:adSize="SMART_BANNER"
ads:adUnitId="ca-app-pub-3940256099942544/6300978111"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true">
</com.google.android.gms.ads.AdView>
</RelativeLayout>