Skip to content

Instantly share code, notes, and snippets.

@Garretthh07
Garretthh07 / MainActivity.java
Last active April 27, 2016 16:27
JustJava MainActivity.java
package com.shunzhang.justjava;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;
@Garretthh07
Garretthh07 / activity_main.xml
Last active April 27, 2016 16:26
JustJava activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="match_parent"
android:layout_width="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
@Garretthh07
Garretthh07 / strings.xml
Last active April 27, 2016 16:24
JustJava: Define Only One Global Var
<resources>
<string name="app_name">Just Java</string>
<string name="quantity_of_coffee">2</string>
<string name="quantity_pre_coffee">5</string>
<string name="price_all_coffee">$10.00</string>
<string name="toppings">Toppings</string>
<string name="name">Name</string>
<string name="quantity">Quantity</string>
<string name="ordersummary">Order Summary</string>
</resources>
@Garretthh07
Garretthh07 / build.gradle
Created April 13, 2016 16:17
build.gradle
apply plugin: 'com.android.application'
def releaseTime() {
return new Date().format("yyyy-MM-dd", java.util.TimeZone.getTimeZone("UTC"));
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
<?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"
tools:context="com.shunzhang.countscore.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
package com.shunzhang.countscore;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private int scoreTeamA = 0;
@Garretthh07
Garretthh07 / styles.xml
Created April 19, 2016 16:00
CountScore
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#FF9800</item>
<item name="colorButtonNormal">#FF9800</item>
<!-- <item name="colorPrimaryDark">@color/colorPrimaryDark</item> -->
<item name="colorAccent">@color/colorAccent</item>
</style>
@Garretthh07
Garretthh07 / styles.xml
Created April 27, 2016 16:29
JustJava
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>