<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".LoginActivity" > <TextView android:id="@+id/password" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignRight="@+id/username" android:layout_below="@+id/username" android:layout_marginTop="30dp" android:text="@string/password" android:textAppearance="?android:attr/textAppearanceLarge" /> <EditText android:id="@+id/usernameEdit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/username" android:layout_marginLeft="14dp" android:layout_toRightOf="@+id/username" android:ems="10" /> <TextView android:id="@+id/username" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginLeft="20dp" android:layout_marginTop="51dp" android:text="@string/username" android:textAppearance="?android:attr/textAppearanceLarge" /> <EditText android:id="@+id/passwordEdit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/password" android:layout_alignBottom="@+id/password" android:layout_alignLeft="@+id/usernameEdit" android:layout_alignParentRight="true" android:ems="10" > <requestFocus /> </EditText> <Button android:id="@+id/cancel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_marginBottom="14dp" android:layout_toLeftOf="@+id/passwordEdit" android:onClick="sendMessage" android:text="@string/cancel" /> <Button android:id="@+id/submit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/cancel" android:layout_alignBottom="@+id/cancel" android:layout_alignLeft="@+id/passwordEdit" android:layout_marginLeft="41dp" android:onClick="sendMessage" android:text="@string/submit" /> <TextView android:id="@+id/newuser" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/passwordEdit" android:layout_centerHorizontal="true" android:layout_marginTop="16dp" android:textColor="#0000ff" android:text="@string/new_user" android:clickable="true" android:onClick="sendMessage" android:textAppearance="?android:attr/textAppearanceMedium" android:textStyle="italic" /> </RelativeLayout>