diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..767d982b Binary files /dev/null and b/.DS_Store differ diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 00000000..a8523149 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..e7bedf33 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/description.html b/.idea/description.html new file mode 100644 index 00000000..db5f1295 --- /dev/null +++ b/.idea/description.html @@ -0,0 +1 @@ +Simple Java application that includes a class with main() method \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 00000000..d8210482 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..b63395b0 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..7471dbc5 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/project-template.xml b/.idea/project-template.xml new file mode 100644 index 00000000..1f08b887 --- /dev/null +++ b/.idea/project-template.xml @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 00000000..922003b8 --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..738df303 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,385 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1431180405762 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Calculator/.gitignore b/Calculator/.gitignore new file mode 100644 index 00000000..afbdab33 --- /dev/null +++ b/Calculator/.gitignore @@ -0,0 +1,6 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build diff --git a/Calculator/.idea/.name b/Calculator/.idea/.name new file mode 100644 index 00000000..ca347468 --- /dev/null +++ b/Calculator/.idea/.name @@ -0,0 +1 @@ +Calculator \ No newline at end of file diff --git a/Calculator/.idea/compiler.xml b/Calculator/.idea/compiler.xml new file mode 100644 index 00000000..217af471 --- /dev/null +++ b/Calculator/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/Calculator/.idea/copyright/profiles_settings.xml b/Calculator/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..e7bedf33 --- /dev/null +++ b/Calculator/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Calculator/.idea/encodings.xml b/Calculator/.idea/encodings.xml new file mode 100644 index 00000000..e206d70d --- /dev/null +++ b/Calculator/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/Calculator/.idea/gradle.xml b/Calculator/.idea/gradle.xml new file mode 100644 index 00000000..736c7b5c --- /dev/null +++ b/Calculator/.idea/gradle.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/Calculator/.idea/misc.xml b/Calculator/.idea/misc.xml new file mode 100644 index 00000000..fdb926d5 --- /dev/null +++ b/Calculator/.idea/misc.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + localhost + 5050 + + + + + + + 1.7 + + + + + + + + + diff --git a/Calculator/.idea/modules.xml b/Calculator/.idea/modules.xml new file mode 100644 index 00000000..f8fed43f --- /dev/null +++ b/Calculator/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Calculator/.idea/scopes/scope_settings.xml b/Calculator/.idea/scopes/scope_settings.xml new file mode 100644 index 00000000..922003b8 --- /dev/null +++ b/Calculator/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/Calculator/.idea/vcs.xml b/Calculator/.idea/vcs.xml new file mode 100644 index 00000000..def6a6a1 --- /dev/null +++ b/Calculator/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Calculator/Calculator.iml b/Calculator/Calculator.iml new file mode 100644 index 00000000..0bb6048a --- /dev/null +++ b/Calculator/Calculator.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + diff --git a/Calculator/app/.gitignore b/Calculator/app/.gitignore new file mode 100644 index 00000000..796b96d1 --- /dev/null +++ b/Calculator/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/Calculator/app/app.iml b/Calculator/app/app.iml new file mode 100644 index 00000000..3e7a1761 --- /dev/null +++ b/Calculator/app/app.iml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Calculator/app/build.gradle b/Calculator/app/build.gradle new file mode 100644 index 00000000..58653a1b --- /dev/null +++ b/Calculator/app/build.gradle @@ -0,0 +1,25 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "eboves.c4q.nyc.calculator" + minSdkVersion 15 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile 'com.android.support:appcompat-v7:22.1.1' +} diff --git a/Calculator/app/proguard-rules.pro b/Calculator/app/proguard-rules.pro new file mode 100644 index 00000000..3f60f63b --- /dev/null +++ b/Calculator/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Users/elvisboves/Library/Android/sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/Calculator/app/src/androidTest/java/eboves/c4q/nyc/calculator/ApplicationTest.java b/Calculator/app/src/androidTest/java/eboves/c4q/nyc/calculator/ApplicationTest.java new file mode 100644 index 00000000..64378750 --- /dev/null +++ b/Calculator/app/src/androidTest/java/eboves/c4q/nyc/calculator/ApplicationTest.java @@ -0,0 +1,13 @@ +package eboves.c4q.nyc.calculator; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/Calculator/app/src/main/AndroidManifest.xml b/Calculator/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..9663a5c0 --- /dev/null +++ b/Calculator/app/src/main/AndroidManifest.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + diff --git a/Calculator/app/src/main/java/eboves/c4q/nyc/calculator/MainActivity.java b/Calculator/app/src/main/java/eboves/c4q/nyc/calculator/MainActivity.java new file mode 100644 index 00000000..e629c60b --- /dev/null +++ b/Calculator/app/src/main/java/eboves/c4q/nyc/calculator/MainActivity.java @@ -0,0 +1,267 @@ +package eboves.c4q.nyc.calculator; + +import android.support.v7.app.ActionBarActivity; +import android.os.Bundle; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.TextView; + + +public class MainActivity extends ActionBarActivity { + + private Button butSum; + private Button butSub; + private Button butMult; + private Button butDiv; + private Button butPercent; + private Button butEquals; + private Button butClr; + private Button butDot; + private Button but0; + private Button but1; + private Button but2; + private Button but3; + private Button but4; + private Button but5; + private Button but6; + private Button but7; + private Button but8; + private Button but9; + private String string; + + private TextView result; + private float saveText; + private String operators; + + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); +// +// int idsList[] = { +// R.id.but0, +// R.id.but1, +// R.id.but2, +// R.id.but3, +// R.id.but4, +// R.id.but5, +// R.id.but6, +// R.id.but7, +// R.id.but8, +// R.id.but9, +// R.id.butSub, +// R.id.butSum, +// R.id.butMult, +// R.id.butDelete, +// R.id.butDot, +// R.id.butDiv, +// R.id.butEquals, +// R.id.butClr,}; +// +// for (int id: idsList) + +// // associate buttons +// butSum = (Button) findViewById(R.id.butSum); +// butSub = (Button) findViewById(R.id.butSub); +// butMult = (Button) findViewById(R.id.butMult); +// butDiv = (Button) findViewById(R.id.butDiv); +// butEquals = (Button) findViewById(R.id.butEquals); +// butClr = (Button) findViewById(R.id.butClr); +// butDot = (Button) findViewById(R.id.butDot); +// +// // association numbers +// but0 = (Button) findViewById(R.id.but0); +// but0.setOnClickListener((View.OnClickListener) but0); +// +// but1 = (Button) findViewById(R.id.but1); +// but2 = (Button) findViewById(R.id.but2); +// but3 = (Button) findViewById(R.id.but3); +// but4 = (Button) findViewById(R.id.but4); +// but5 = (Button) findViewById(R.id.but5); +// but6 = (Button) findViewById(R.id.but6); +// but7 = (Button) findViewById(R.id.but7); +// but8 = (Button) findViewById(R.id.but8); +// but9 = (Button) findViewById(R.id.but9); + + } +// +// public void onClickNumbers(){ +// +// +// but1.setOnClickListener((View.OnClickListener) but1); +// but2.setOnClickListener((View.OnClickListener) but2); +// but3.setOnClickListener((View.OnClickListener) but3); +// but4.setOnClickListener((View.OnClickListener) but4); +// but5.setOnClickListener((View.OnClickListener) but5); +// but6.setOnClickListener((View.OnClickListener) but6); +// but7.setOnClickListener((View.OnClickListener) but7); +// but8.setOnClickListener((View.OnClickListener) but8); +// but9.setOnClickListener((View.OnClickListener) but9); +// +// } +// +// public void operationsSigns(){ +// +// butSum.setOnClickListener((View.OnClickListener) butSum); +// butSub.setOnClickListener((View.OnClickListener) butSub); +// butMult.setOnClickListener((View.OnClickListener) butMult); +// butDiv.setOnClickListener((View.OnClickListener) butDiv); +// butEquals.setOnClickListener((View.OnClickListener) butEquals); +// butClr.setOnClickListener((View.OnClickListener) butClr); +// butDot.setOnClickListener((View.OnClickListener) butDot); +// +// } +// +// public void onClick(View view){ +// +// // associate editText +// TextView result = (TextView) findViewById(R.id.textResult1); +// int click = view.getId(); +// String showOnScreen = result.getText().toString(); +// +// try { +// +// switch (click) { +// +// case R.id.but0: +// result.setText(showOnScreen+ "0"); +// break; +// case R.id.but1: +// result.setText(showOnScreen+ "1"); +// break; +// case R.id.but2: +// result.setText(showOnScreen+ "2"); +// break; +// case R.id.but3: +// result.setText(showOnScreen+ "3"); +// break; +// case R.id.but4: +// result.setText(showOnScreen+ "4"); +// break; +// case R.id.but5: +// result.setText(showOnScreen+ "5"); +// break; +// case R.id.but6: +// result.setText(showOnScreen+ "6"); +// break; +// case R.id.but7: +// result.setText(showOnScreen+ "7"); +// break; +// case R.id.but8: +// result.setText(showOnScreen+ "8"); +// break; +// case R.id.but9: +// result.setText(showOnScreen+ "9"); +// break; +// case R.id.butSum: +// break; +// case R.id.butSub: +// break; +// case R.id.butMult: +// break; +// case R.id.butDiv: +// break; +// case R.id.butDelete: +// break; +// case R.id.butDot: +// break; +// case R.id.butClr: +// break; +// case R.id.butEquals: +// break; +// } +// } +// +// catch(Exception ex) { +// +// result.setText("error"); +// } +// +// } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.menu_main, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + int id = item.getItemId(); + + //noinspection SimplifiableIfStatement + if (id == R.id.action_settings) { + return true; + } + + return super.onOptionsItemSelected(item); + } + + public void oneButtom (View v){ + string += "1"; + TextView t = (TextView) findViewById(R.id.textResult1); + t.setText(string); + } + + public void twoButtom (View v){ + string += "2"; + TextView t = (TextView) findViewById(R.id.textResult1); + t.setText(string); + } + public void threeButtom (View v){ + string += "3"; + TextView t = (TextView) findViewById(R.id.textResult1); + t.setText(string); + } + public void fourButtom (View v){ + string += "4"; + TextView t = (TextView) findViewById(R.id.textResult1); + t.setText(string); + } + public void fiveButtom (View v){ + string += "5"; + TextView t = (TextView) findViewById(R.id.textResult1); + t.setText(string); + } + public void sixButtom (View v){ + string += "6"; + TextView t = (TextView) findViewById(R.id.textResult1); + t.setText(string); + } + public void sevenButtom (View v){ + string += "7"; + TextView t = (TextView) findViewById(R.id.textResult1); + t.setText(string); + } + public void eightButtom (View v){ + string += "8"; + TextView t = (TextView) findViewById(R.id.textResult1); + t.setText(string); + } + public void nineButtom (View v){ + string += "9"; + TextView t = (TextView) findViewById(R.id.textResult1); + t.setText(string); + } + public void zeroButtom (View v){ + string += "0"; + TextView t = (TextView) findViewById(R.id.textResult1); + t.setText(string); + } + public void ClrButtom (View v){ + string = ""; + TextView t = (TextView) findViewById(R.id.textResult1); + t.setText(string); + } + + +} diff --git a/Calculator/app/src/main/res/layout-land/activity_main.xml b/Calculator/app/src/main/res/layout-land/activity_main.xml new file mode 100644 index 00000000..77474320 --- /dev/null +++ b/Calculator/app/src/main/res/layout-land/activity_main.xml @@ -0,0 +1,338 @@ + + + + + + + + + + +