Skip to content

Instantly share code, notes, and snippets.

@ericlucero
Created July 29, 2016 00:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericlucero/c4d158a7561e6add1536e518341dcd2a to your computer and use it in GitHub Desktop.
Save ericlucero/c4d158a7561e6add1536e518341dcd2a to your computer and use it in GitHub Desktop.
Activity_Main.xml for Basketball Score Counter
<?xml version="1.0" encoding="utf-8"?>
<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: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="com.example.android.courtcounter.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingTop="16dp"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="4sp"
android:text="Team A"
android:fontFamily="sans-serif-medium"
android:textColor="#616161"
android:textSize="14sp" />
<TextView
android:id="@+id/team_a_score"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:paddingTop="16dp"
android:paddingBottom="24dp"
android:textColor="#000000"
android:fontFamily="sans-serif-light"
android:text="0"
android:textSize="56sp" />
<Button
android:id="@+id/points3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:onClick="SumaTresTeamA"
android:text="+3 points" />
<Button
android:id="@+id/points2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:onClick="SumaDosTeamA"
android:text="+2 points" />
<Button
android:id="@+id/points1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:onClick="SumaUnoTeamA"
android:text="free throw"
android:textAllCaps="true" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@android:color/darker_gray"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingTop="16dp"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="4dp"
android:text="Team B"
android:fontFamily="sans-serif-medium"
android:textColor="#616161"
android:textSize="14sp" />
<TextView
android:id="@+id/team_b_score"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:paddingTop="16dp"
android:paddingBottom="24dp"
android:textColor="#000000"
android:fontFamily="sans-serif-light"
android:text="0"
android:textSize="56sp" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:onClick="SumaTresTeamB"
android:text="+3 points" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:onClick="SumaDosTeamB"
android:text="+2 points" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:onClick="SumaUnoTeamB"
android:text="free throw"
android:textAllCaps="true" />
</LinearLayout>
</LinearLayout>
<Button
android:onClick="resetea"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="reset"
android:layout_marginBottom="32dp"
android:textAllCaps="true"
android:textSize="20sp"
/>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment