Skip to content

Instantly share code, notes, and snippets.

@first087
Created May 16, 2015 14:23
Show Gist options
  • Save first087/21713acf36e9a7d37e08 to your computer and use it in GitHub Desktop.
Save first087/21713acf36e9a7d37e08 to your computer and use it in GitHub Desktop.
Word Quiz Game - Layout Main
<RelativeLayout 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"
android:background="@color/background_color"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/imageView"
android:layout_centerHorizontal="true"
android:layout_marginBottom="40dp"
android:gravity="center_horizontal"
android:text="@string/app_title"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:minHeight="240dp"
android:minWidth="240dp"
android:src="@android:mipmap/sym_def_app_icon" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="24dp"
android:orientation="horizontal">
<Button
android:id="@+id/btn_play_game"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/play_game_label" />
<Space
android:layout_width="8dp"
android:layout_height="match_parent" />
<Button
android:id="@+id/btn_high_score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/high_score_label" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout 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"
android:background="@color/background_color"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/linearLayout"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:text="@string/app_title"
android:textAppearance="?android:attr/textAppearanceLarge" />
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:minHeight="200dp"
android:minWidth="200dp"
android:src="@android:mipmap/sym_def_app_icon" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="vertical">
<Button
android:id="@+id/btn_play_game"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/play_game_label" />
<Space
android:layout_width="match_parent"
android:layout_height="8dp" />
<Button
android:id="@+id/btn_high_score"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/high_score_label" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment