From 7cd9f3cf3a86edc8425a2775d59cab6ff98d9dab Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Sat, 19 May 2018 20:11:35 +0200
Subject: Initial design and functionality
---
app/src/main/AndroidManifest.xml | 21 ++
.../marvinborner/myapplication/MainActivity.java | 194 ++++++++++++++
.../res/drawable-v24/ic_launcher_foreground.xml | 34 +++
.../main/res/drawable/ic_launcher_background.xml | 170 ++++++++++++
app/src/main/res/layout/activity_main.xml | 296 +++++++++++++++++++++
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml | 5 +
.../res/mipmap-anydpi-v26/ic_launcher_round.xml | 5 +
app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3056 bytes
app/src/main/res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5024 bytes
app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2096 bytes
app/src/main/res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2858 bytes
app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4569 bytes
.../main/res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7098 bytes
app/src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 6464 bytes
.../main/res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10676 bytes
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 9250 bytes
.../main/res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 15523 bytes
app/src/main/res/values/colors.xml | 6 +
app/src/main/res/values/strings.xml | 3 +
app/src/main/res/values/styles.xml | 11 +
20 files changed, 745 insertions(+)
create mode 100644 app/src/main/AndroidManifest.xml
create mode 100644 app/src/main/java/me/marvinborner/myapplication/MainActivity.java
create mode 100644 app/src/main/res/drawable-v24/ic_launcher_foreground.xml
create mode 100644 app/src/main/res/drawable/ic_launcher_background.xml
create mode 100644 app/src/main/res/layout/activity_main.xml
create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.png
create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.png
create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.png
create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.png
create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.png
create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.png
create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
create mode 100644 app/src/main/res/values/colors.xml
create mode 100644 app/src/main/res/values/strings.xml
create mode 100644 app/src/main/res/values/styles.xml
(limited to 'app/src/main')
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..d2c5f0a
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/me/marvinborner/myapplication/MainActivity.java b/app/src/main/java/me/marvinborner/myapplication/MainActivity.java
new file mode 100644
index 0000000..921f0f1
--- /dev/null
+++ b/app/src/main/java/me/marvinborner/myapplication/MainActivity.java
@@ -0,0 +1,194 @@
+package me.marvinborner.myapplication;
+
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.text.method.ScrollingMovementMethod;
+import android.view.View;
+import android.widget.Button;
+import android.widget.TextView;
+
+public class MainActivity extends AppCompatActivity {
+
+ Button button0, button1, button2, button3, button4, button5, button6,
+ button7, button8, button9, buttonAdd, buttonSub, buttonDivision,
+ buttonMul, button10, buttonC, buttonEqual;
+ TextView ResultTextView;
+
+ float mValueOne, mValueTwo;
+
+ boolean Addition, Subtraction, Multiplication, Division;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ button0 = findViewById(R.id.button0);
+ button1 = findViewById(R.id.button1);
+ button2 = findViewById(R.id.button2);
+ button3 = findViewById(R.id.button3);
+ button4 = findViewById(R.id.button4);
+ button5 = findViewById(R.id.button5);
+ button6 = findViewById(R.id.button6);
+ button7 = findViewById(R.id.button7);
+ button8 = findViewById(R.id.button8);
+ button9 = findViewById(R.id.button9);
+ button10 = findViewById(R.id.button10);
+ buttonAdd = findViewById(R.id.buttonadd);
+ buttonSub = findViewById(R.id.buttonsub);
+ buttonMul = findViewById(R.id.buttonmul);
+ buttonDivision = findViewById(R.id.buttondiv);
+ buttonC = findViewById(R.id.buttonC);
+ buttonEqual = findViewById(R.id.buttoneql);
+ ResultTextView = findViewById(R.id.edt1);
+
+ ResultTextView.setMovementMethod(new ScrollingMovementMethod());
+
+
+ button1.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ResultTextView.setText(ResultTextView.getText() + "1");
+ }
+ });
+
+ button2.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ResultTextView.setText(ResultTextView.getText() + "2");
+ }
+ });
+
+ button3.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ResultTextView.setText(ResultTextView.getText() + "3");
+ }
+ });
+
+ button4.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ResultTextView.setText(ResultTextView.getText() + "4");
+ }
+ });
+
+ button5.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ResultTextView.setText(ResultTextView.getText() + "5");
+ }
+ });
+
+ button6.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ResultTextView.setText(ResultTextView.getText() + "6");
+ }
+ });
+
+ button7.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ResultTextView.setText(ResultTextView.getText() + "7");
+ }
+ });
+
+ button8.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ResultTextView.setText(ResultTextView.getText() + "8");
+ }
+ });
+
+ button9.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ResultTextView.setText(ResultTextView.getText() + "9");
+ }
+ });
+
+ button0.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ResultTextView.setText(ResultTextView.getText() + "0");
+ }
+ });
+
+ buttonAdd.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ if (ResultTextView == null) {
+ ResultTextView.setText("");
+ } else {
+ mValueOne = Float.parseFloat(ResultTextView.getText() + "");
+ Addition = true;
+ ResultTextView.setText(null);
+ }
+ }
+ });
+
+ buttonSub.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mValueOne = Float.parseFloat(ResultTextView.getText() + "");
+ Subtraction = true;
+ ResultTextView.setText(null);
+ }
+ });
+
+ buttonMul.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mValueOne = Float.parseFloat(ResultTextView.getText() + "");
+ Multiplication = true;
+ ResultTextView.setText(null);
+ }
+ });
+
+ buttonDivision.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mValueOne = Float.parseFloat(ResultTextView.getText() + "");
+ Division = true;
+ ResultTextView.setText(null);
+ }
+ });
+
+ buttonEqual.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mValueTwo = Float.parseFloat(ResultTextView.getText() + "");
+
+ if (Addition){
+ ResultTextView.setText(mValueOne + mValueTwo + "");
+ Addition = false;
+ } else if (Subtraction) {
+ ResultTextView.setText(mValueOne - mValueTwo + "");
+ Subtraction = false;
+ } else if (Multiplication) {
+ ResultTextView.setText(mValueOne * mValueTwo + "");
+ Multiplication = false;
+ } else if (Division) {
+ ResultTextView.setText(mValueOne / mValueTwo + "");
+ Division = false;
+ }
+ }
+ });
+
+ buttonC.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ResultTextView.setText("");
+ }
+ });
+
+ button10.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ResultTextView.setText(ResultTextView.getText() + ".");
+ }
+ });
+ }
+}
diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..c7bd21d
--- /dev/null
+++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..d5fccc5
--- /dev/null
+++ b/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..d39b400
--- /dev/null
+++ b/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,296 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a2f5908
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..1b52399
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..ff10afd
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..115a4c7
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..dcd3cd8
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..459ca60
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..8ca12fe
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..8e19b41
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b824ebd
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..4c19a13
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..3ab3e9c
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..a70d9f1
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ Simple Calculator
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..3d8448c
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
--
cgit v1.2.3