Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/main/java/nyc/c4q/AbstractAwesomeClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Created by amyquispe on 5/19/15.
*/
public abstract class AbstractAwesomeClass implements AwesomeInterface {
// AbstractAwesomeClass awesomeObject = new ConcreteAwesomeClass(4);

@Override
public int getData() {
Expand All @@ -14,4 +15,7 @@ public int getData() {
public void setData(int someData) {

}

// AbstractAwesomeClass awesomeObject = new ConcreteAwesomeClass();

}
5 changes: 5 additions & 0 deletions src/main/java/nyc/c4q/AwesomeContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ public static Collection createAwesomeContainer(){
public static void addAwesomeObject(Collection awesomeContainer){
return;
}





}
11 changes: 11 additions & 0 deletions src/main/java/nyc/c4q/ConcreteAwesomeClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,15 @@ public ConcreteAwesomeClass(){
}
public ConcreteAwesomeClass(int startData){
}
@Override
public int getData() {
return 0;
}

@Override
public void setData(int someData) {

}
//AbstractAwesomeClass awesomeObject = new ConcreteAwesomeClass();

}
40 changes: 38 additions & 2 deletions src/main/java/nyc/c4q/InitialActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
Expand All @@ -10,7 +11,6 @@
import android.widget.TextView;

public class InitialActivity extends Activity {

public int counter = 0;
public SharedPreferences preferences = null;
public final static String TAG = "C4QTAG";
Expand All @@ -29,10 +29,46 @@ public void saveState(){
editor.commit();
}

@Override
// @Override
// protected void onStop() {
// // super.onStop();
// saveState();
// }
//
// @Override
// protected void onDestroy() {
// // super.onDestroy();
// saveState();
// }

@Override
protected void onPause() {
saveState();
super.onPause();

}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_initial);
preferences = getPreferences(Context.MODE_PRIVATE);
loadState();


}
public void addone(View v){
counter+=1;
TextView t = (TextView) findViewById(R.id.tvCounter);
t.setText(counter+"");
}
public void subone(View v){
counter-=1;
TextView t = (TextView) findViewById(R.id.tvCounter);
t.setText(counter+"");
}
public void toTile(View v) {
Intent intent = new Intent(InitialActivity.this, TileActivity.class);
startActivity(intent);
}
}
13 changes: 12 additions & 1 deletion src/main/java/nyc/c4q/SubFunClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
/**
* Created by amyquispe on 5/19/15.
*/
public class SubFunClass {
public class SubFunClass extends SuperFunClass implements AwesomeInterface{
public SubFunClass(){

}

@Override
public int getData() {
return 0;
}

@Override
public void setData(int someData) {

}
}
98 changes: 86 additions & 12 deletions src/main/res/layout/activity_initial.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:id="@+id/activity_initial"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="nyc.c4q.InitialActivity"
android:id="@+id/activity_initial">
android:orientation="vertical"
tools:context="nyc.c4q.InitialActivity">


<TextView
android:id="@+id/text"
<LinearLayout
android:id="@+id/counterLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="InitialActivity"
/>
</LinearLayout>
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="horizontal">

<LinearLayout
android:id="@+id/counterButtonsLayout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">

<Button
android:id="@+id/buttonPlus"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:onClick="addone"
android:text="+"
android:textSize="30dp" />

<Button
android:id="@+id/buttonMinus"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:onClick="subone"
android:text="-"
android:textSize="30dp" />


</LinearLayout>

<!--<LinearLayout-->
<!--android:orientation="vertical"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_weight="1"-->
<!--android:id="@+id/tvCounter">-->

<TextView
android:id="@+id/tvCounter"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="0"
android:textSize="30dp" />


<!--</LinearLayout>-->

</LinearLayout>

<Button
android:id="@+id/buttonTileActivity"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:onClick="toTile"
android:text="TileActivity"
android:textSize="30dp" />

<Button
android:id="@+id/buttonEmpty"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="Empty"
android:textSize="30dp" />


</LinearLayout>







68 changes: 64 additions & 4 deletions src/main/res/layout/activity_tile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,71 @@
android:layout_height="match_parent"
tools:context="nyc.c4q.TileActivity"
android:id="@+id/activity_tile"
android:orientation="horizontal"
>

<TextView
android:layout_height="match_parent"
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:text="TileActivity"/>
android:layout_height="match_parent"
android:layout_weight="1"
android:id="@+id/leftSide">



<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF0000"
android:textSize="30dp"
android:layout_weight="1.5"
android:id="@+id/redView"
/>

<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00FF00"
android:layout_weight="1"
android:id="@+id/gr"
/>

</LinearLayout>

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="@+id/rightSide">

<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFF00"
android:layout_gravity="right"
android:layout_weight="1.3"
android:id="@+id/yellow"/>
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:layout_gravity="right"
android:layout_weight="1"
android:id="@+id/white"
/>
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0000FF"
android:layout_gravity="right"
android:layout_weight="1.5"
android:id="@+id/blue"
/>


</LinearLayout>

</LinearLayout>


</LinearLayout>
1 change: 1 addition & 0 deletions src/test/java/nyc/c4q/Unit1AssessmentTestsJava.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

Expand Down