If all this is inside a RelativeLayout, remove the external LinearLayout (moving fields, etc. to the first descendant of LinearLayout as needed) and change the second child LinearLayout - the one that has 5dp padding, so that
android:layout_alignParentRight="true" android:layout_alignParentTop="true"
If you do not want to do this, and for some reason you need to leave an external LinearLayout, move
android:layout_marginTop="20dp"
from the parent LinearLayout to the first child and set the layout_width of the second child fill_parent and add android: gravity = "right" to it.
source share