Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates #29

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion src/main/java/nyc/c4q/AbstractAwesomeClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public abstract class AbstractAwesomeClass implements AwesomeInterface {

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

@Override
Expand Down
20 changes: 16 additions & 4 deletions src/main/java/nyc/c4q/InitialActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ public class InitialActivity extends Activity {
public SharedPreferences preferences = null;
public final static String TAG = "C4QTAG";

public void loadState(){
public void loadState() {
Log.d(TAG, "loadState()");
counter = preferences.getInt("counter", 0);
Log.d(TAG, "loadState(): counter=="+counter);
Log.d(TAG, "loadState(): counter==" + counter);
}

public void saveState(){
public void saveState() {
Log.d(TAG, "saveState()");
Log.d(TAG, "saveState(): counter=="+counter);
Log.d(TAG, "saveState(): counter==" + counter);
SharedPreferences.Editor editor = preferences.edit();
editor.putInt("counter", counter);
editor.commit();
Expand All @@ -34,5 +34,17 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_initial);
preferences = getPreferences(Context.MODE_PRIVATE);

final Button buttonPlus = (Button) findViewById(R.id.buttonPlus);
final TextView tvCounter = (TextView) findViewById(R.id.tvCounter);

buttonPlus.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
counter=+1;
tvCounter.setText(counter+"");
}
});

}
}

15 changes: 13 additions & 2 deletions 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 SubFunClass(){
public class SubFunClass extends SuperFunClass implements AwesomeInterface{
public SubFunClass (){

}

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

@Override
public void setData(int someData) {

}
}
75 changes: 63 additions & 12 deletions src/main/res/layout/activity_initial.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,69 @@
<?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">

<LinearLayout
android:id="@+id/counterLayout"
android:layout_width="match_parent"
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="change"
android:text="+"
android:textSize="60sp" />

<TextView
android:id="@+id/text"
<Button
android:id="@+id/buttonMinus"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:onClick="change"
android:text="-"
android:textSize="60sp" />

</LinearLayout>

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

</LinearLayout>


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

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

</LinearLayout>
53 changes: 51 additions & 2 deletions src/main/res/layout/activity_tile.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,64 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="nyc.c4q.TileActivity"
android:id="@+id/activity_tile"
>

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

<TextView
android:id="@+id/redView"
android:layout_weight="40"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#ffff0000" />

<TextView
android:id="@+id/greenView"
android:layout_weight="60"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#ff00ff00" />

</LinearLayout>

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

<TextView
android:id="@+id/yellowView"
android:layout_weight="33"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#ffffff00" />

<TextView
android:layout_height="match_parent"
android:id="@+id/whiteView"
android:layout_weight="44"
android:layout_width="match_parent"
android:text="TileActivity"/>
android:layout_height="0dp"
android:background="#FFFFFF" />

<TextView
android:id="@+id/blueView"
android:layout_weight="22"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#ff0000ff" />

</LinearLayout>

</LinearLayout>
Loading