Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rayacevedo45 committed May 27, 2015
1 parent 4d9419d commit 35e3779
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 72 deletions.
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: 29 additions & 11 deletions src/main/java/nyc/c4q/InitialActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import android.widget.TextView;

public class InitialActivity extends Activity {
int numtest = 0;

public int counter = 0;
public SharedPreferences preferences = null;
public final static String TAG = "C4QTAG";
Expand All @@ -31,23 +29,43 @@ 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){

numtest+=1;
TextView t = (TextView) findViewById(R.id.counter);
t.setText(numtest+"");
counter+=1;
TextView t = (TextView) findViewById(R.id.tvCounter);
t.setText(counter+"");
}
public void subone(View v){

numtest-=1;
TextView t = (TextView) findViewById(R.id.counter);
t.setText(numtest+"");
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);
Expand Down
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) {

}
}
88 changes: 43 additions & 45 deletions src/main/res/layout/activity_initial.xml
Original file line number Diff line number Diff line change
@@ -1,87 +1,85 @@
<?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:id="@+id/activity_initial"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="nyc.c4q.InitialActivity"
android:id="@+id/activity_initial">
tools:context="nyc.c4q.InitialActivity">


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

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

<Button
android:id="@+id/buttonPlus"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="+"
android:textSize="30dp"
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="match_parent"
android:text="-"
android:textSize="30dp"
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">
<!--<LinearLayout-->
<!--android:orientation="vertical"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_weight="1"-->
<!--android:id="@+id/tvCounter">-->

<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="0"
android:textSize="30dp"
android:paddingTop="10dp"
android:onClick="addone"
android:layout_gravity="right"
android:layout_weight="2"
android:id="@+id/counter"
/>
<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>-->

</LinearLayout>

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

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


</LinearLayout>
Expand Down
32 changes: 17 additions & 15 deletions src/main/res/layout/activity_tile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@
android:layout_height="match_parent"
tools:context="nyc.c4q.TileActivity"
android:id="@+id/activity_tile"
android:orientation="horizontal"
>

<LinearLayout
android:orientation="horizontal"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight=".5">
android:layout_weight="1"
android:id="@+id/leftSide">


<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">

<TextView
<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"
/>

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

</LinearLayout>
Expand All @@ -40,28 +40,31 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
android:layout_weight="1"
android:id="@+id/rightSide">

<TextView
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFF00"
android:layout_gravity="right"
android:layout_weight="1.3"
/>
<TextView
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"
/>
<TextView
<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"
/>


Expand All @@ -70,4 +73,3 @@
</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

0 comments on commit 35e3779

Please sign in to comment.