Created
December 30, 2016 11:35
-
-
Save pranavchandra27/564c3cc40df4bc88a2095bc2cdba5170 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"> | |
<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" | |
tools:context="com.example.android.courtcounter.MainActivity"> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="15dp" | |
android:fontFamily="sans-serif-medium" | |
android:gravity="center_horizontal" | |
android:padding="5dp" | |
android:text="Team A" | |
android:textColor="#616161" | |
android:textSize="15sp" /> | |
<TextView | |
android:id="@+id/text_a_score" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="15dp" | |
android:fontFamily="sans-serif-light" | |
android:gravity="center_horizontal" | |
android:padding="5dp" | |
android:text="0" | |
android:textColor="#000000" | |
android:textSize="55sp" /> | |
<Button | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="8dp" | |
android:layout_marginLeft="24dp" | |
android:layout_marginRight="24dp" | |
android:layout_marginTop="25dp" | |
android:onClick="addScoreThree" | |
android:text="+3 Points" /> | |
<Button | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="8dp" | |
android:layout_marginLeft="24dp" | |
android:layout_marginRight="24dp" | |
android:layout_marginTop="7dp" | |
android:onClick="addScoreTwo" | |
android:text="+2 Points" /> | |
<Button | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="8dp" | |
android:layout_marginLeft="24dp" | |
android:layout_marginRight="24dp" | |
android:layout_marginTop="7dp" | |
android:onClick="addScoreOne" | |
android:text="Free Throw" /> | |
</LinearLayout> | |
<LinearLayout | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_weight="1" | |
android:orientation="vertical"> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="15dp" | |
android:fontFamily="sans-serif-medium" | |
android:gravity="center_horizontal" | |
android:padding="5dp" | |
android:text="Team B" | |
android:textColor="#616161" | |
android:textSize="15sp" /> | |
<TextView | |
android:id="@+id/text_b_score" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="15dp" | |
android:fontFamily="sans-serif-light" | |
android:gravity="center_horizontal" | |
android:padding="5dp" | |
android:text="0" | |
android:textColor="#000000" | |
android:textSize="55sp" /> | |
<Button | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="8dp" | |
android:layout_marginLeft="24dp" | |
android:layout_marginRight="24dp" | |
android:layout_marginTop="25dp" | |
android:onClick="addScoreThreeTeamB" | |
android:text="+3 Points" /> | |
<Button | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="8dp" | |
android:layout_marginLeft="24dp" | |
android:layout_marginRight="24dp" | |
android:layout_marginTop="7dp" | |
android:onClick="addScoreTwoTeamB" | |
android:text="+2 Points" /> | |
<Button | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="8dp" | |
android:layout_marginLeft="24dp" | |
android:layout_marginRight="24dp" | |
android:layout_marginTop="7dp" | |
android:onClick="addScoreOneTeamB" | |
android:text="Free Throw" /> | |
</LinearLayout> | |
</LinearLayout> | |
<Button | |
android:id="@+id/button5" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_alignParentBottom="true" | |
android:layout_centerHorizontal="true" | |
android:layout_marginBottom="30dp" | |
android:onClick="resetScore" | |
android:text="Reset" /> | |
<View | |
android:layout_width="1dp" | |
android:layout_height="320dp" | |
android:background="@android:color/background_dark" | |
android:layout_marginTop="30dp" | |
android:id="@+id/view" | |
android:layout_alignParentTop="true" | |
android:layout_centerHorizontal="true"> | |
</View> | |
</RelativeLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
java code for court counter App
package com.example.android.courtcounter;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
int scoreTeamA = 0;
int scoreTeamB = 0;
}