Skip to content

Instantly share code, notes, and snippets.

@MikeySmash
Created April 18, 2019 12:17
Show Gist options
  • Save MikeySmash/27f9568e4b62c9e104678eed86f2b710 to your computer and use it in GitHub Desktop.
Save MikeySmash/27f9568e4b62c9e104678eed86f2b710 to your computer and use it in GitHub Desktop.
Udacity Android Developer - Soccer Counter - XML
<LinearLayout 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:orientation="vertical"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<!-- TEAM A -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:text="Team A"
android:textColor="#616161"
android:textSize="14sp" />
<TextView
android:id="@+id/team_a_goals"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:text="0"
android:textColor="#000000"
android:textSize="48sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="2dp"
android:src="@drawable/icon_throw_in" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="2dp"
android:src="@drawable/icon_goal_kick" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="2dp"
android:src="@drawable/icon_corner" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="2dp"
android:src="@drawable/icon_free_kick" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="2dp"
android:src="@drawable/icon_yellow_card" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="2dp"
android:src="@drawable/icon_red_card" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/team_a_throwIns"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="2dp" />
<TextView
android:id="@+id/team_a_goalKicks"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="2dp" />
<TextView
android:id="@+id/team_a_corners"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="2dp" />
<TextView
android:id="@+id/team_a_freeKicks"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="2dp" />
<TextView
android:id="@+id/team_a_yellowCards"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="2dp" />
<TextView
android:id="@+id/team_a_redCards"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="2dp" />
</LinearLayout>
<Button
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:onClick="addGoalTeamA"
android:text="Goal" />
<Button
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="4dp"
android:layout_marginRight="24dp"
android:onClick="addThrowInTeamA"
android:text="Thrown In" />
<Button
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="4dp"
android:layout_marginRight="24dp"
android:onClick="addGoalKickTeamA"
android:text="Goal Kick" />
<Button
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="4dp"
android:layout_marginRight="24dp"
android:onClick="addCornerTeamA"
android:text="Corner" />
<Button
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="4dp"
android:layout_marginRight="24dp"
android:onClick="addFreeKickTeamA"
android:text="Free Kick" />
<Button
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="4dp"
android:layout_marginRight="24dp"
android:onClick="addYellowCardTeamA"
android:text="Yellow Card" />
<Button
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="4dp"
android:layout_marginRight="24dp"
android:onClick="addRedCardTeamA"
android:text="Red Card" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@android:color/darker_gray" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<!-- TEAM A -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:text="Team B"
android:textColor="#616161"
android:textSize="14sp" />
<TextView
android:id="@+id/team_b_goals"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:text="0"
android:textColor="#000000"
android:textSize="48sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="2dp"
android:src="@drawable/icon_throw_in" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="2dp"
android:src="@drawable/icon_goal_kick" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="2dp"
android:src="@drawable/icon_corner" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="2dp"
android:src="@drawable/icon_free_kick" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="2dp"
android:src="@drawable/icon_yellow_card" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="2dp"
android:src="@drawable/icon_red_card" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/team_b_throwIns"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="2dp" />
<TextView
android:id="@+id/team_b_goalKicks"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="2dp" />
<TextView
android:id="@+id/team_b_corners"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="2dp" />
<TextView
android:id="@+id/team_b_freeKicks"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="2dp" />
<TextView
android:id="@+id/team_b_yellowCards"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="2dp" />
<TextView
android:id="@+id/team_b_redCards"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="2dp" />
</LinearLayout>
<Button
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="4dp"
android:layout_marginRight="24dp"
android:onClick="addGoalTeamB"
android:text="Goal" />
<Button
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="4dp"
android:layout_marginRight="24dp"
android:onClick="addThrowInTeamB"
android:text="Thrown In" />
<Button
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="4dp"
android:layout_marginRight="24dp"
android:onClick="addGoalKickTeamB"
android:text="Goal Kick" />
<Button
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="4dp"
android:layout_marginRight="24dp"
android:onClick="addCornerTeamB"
android:text="Corner" />
<Button
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="4dp"
android:layout_marginRight="24dp"
android:onClick="addFreeKickTeamB"
android:text="Free Kick" />
<Button
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="4dp"
android:layout_marginRight="24dp"
android:onClick="addYellowCardTeamB"
android:text="Yellow Card" />
<Button
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="4dp"
android:layout_marginRight="24dp"
android:onClick="addRedCardTeamB"
android:text="Red Card" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="32dp"
android:onClick="resetScores"
android:text="Reset All" />
</RelativeLayout>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment