Browse Source

basic functionality finished

Martin Herbers 6 years ago
parent
commit
b94c5ac53b

+ 0 - 3
app/build.gradle

@@ -16,9 +16,6 @@ android {
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
         }
     }
-	lintOptions {
-      abortOnError false
-  }
 }
 
 dependencies {

+ 4 - 3
app/src/main/AndroidManifest.xml

@@ -7,13 +7,13 @@
 
     <application
         android:allowBackup="true"
-        android:icon="@mipmap/ic_launcher"
+        android:icon="@drawable/vorschl1"
         android:label="@string/app_name"
         android:supportsRtl="true"
         android:theme="@style/Theme.AppCompat.Light.DarkActionBar">
         <activity
             android:name=".MainActivity"
-            android:label="Previous Objects">
+            android:label="OLIR">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 
@@ -23,7 +23,8 @@
         <activity
             android:name=".ObjectsActivity"
             android:label="@string/title_activity_objects" />
-        <activity android:name=".ReadingActivity"></activity>
+        <activity android:name=".ReadingActivity" />
+        <activity android:name=".ResultActivity"></activity>
     </application>
 
 </manifest>

+ 65 - 10
app/src/main/java/de/tu_darmstadt/informatik/tk/olir/DrawView.java

@@ -5,8 +5,11 @@ import android.content.res.Resources;
 import android.graphics.Canvas;
 import android.graphics.Color;
 import android.graphics.Paint;
+import android.os.Handler;
+import android.support.annotation.RequiresPermission;
 import android.util.AttributeSet;
 import android.util.TypedValue;
+import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
 
@@ -27,7 +30,15 @@ public class DrawView extends View {
     /**
      * millimeter * scale = pixel
      */
-    float scale;
+    private float scale;
+
+    private float electrodeX;
+    private float electrodeY;
+    private float electrodeWidth;
+    private float electrodeHeight;
+
+    private boolean statusDetected = false;
+    private Handler handler;
 
     public DrawView(Context context) {
         super(context);
@@ -44,17 +55,62 @@ public class DrawView extends View {
         clearShapes();
     }
 
+    @Override
+    public boolean onTouchEvent(MotionEvent event) {
+        if (event.getAction() == MotionEvent.ACTION_DOWN) {
+            float touchX = event.getX();
+            float touchY = event.getY();
+
+            float baseX = getWidth()/2.0f;
+            float baseY = getHeight()/2.0f;
+
+            //Looking for width and height instead of width/2 nad height/2 in both direction is intended.
+            //This functions as a larger area to catch the input if the user doesn't place the object perfectly
+            if (touchX > baseX + (electrodeX - electrodeWidth) * scale &&
+                    touchX < baseX + (electrodeX + electrodeWidth) * scale &&
+                    touchY > baseY + (electrodeY - electrodeHeight) * scale &&
+                    touchY < baseY + (electrodeY + electrodeHeight) * scale) {
+
+                statusDetected = true;
+            }
+        }
+
+        if (handler == null) {
+            handler = new Handler();
+            handler.postDelayed(new Runnable() {
+                @Override
+                public void run() {
+                    checkStatus();
+                }
+            }, 300);
+        }
+
+        return super.onTouchEvent(event);
+    }
+
+    private void checkStatus() {
+        ReadingActivity activity = (ReadingActivity) getContext();
+        if (statusDetected)
+            activity.onDetected(null);
+        else
+            activity.onNotDetected(null);
+
+    }
+
+
     @Override
     public void onDraw(Canvas canvas) {
+        scale = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_MM, 1,
+                getResources().getDisplayMetrics());
 
         //Middle point of the draw area
-        int baseX = this.getMeasuredHeight() / 2;
-        int baseY = baseX;
+        float baseX = canvas.getWidth()/2.0f;
+        float baseY = canvas.getHeight()/2.0f;
 
 
         Paint paint = new Paint();
         paint.setStyle(Paint.Style.FILL);
-        paint.setColor(Color.BLACK);
+        paint.setColor(Color.LTGRAY);
         for (String s: shapes) {
             //Circle
             if (s.charAt(1) == 'C') {
@@ -122,12 +178,11 @@ public class DrawView extends View {
         shapes.add(s);
     }
 
-    /**
-     * Set the scale to calculate millimeter to pixel
-     * @param s
-     */
-    public void setScale(float s) {
-        scale = s;
+    public void setPosition(float x, float y, float width, float height) {
+        electrodeX = x;
+        electrodeY = y;
+        electrodeWidth = width;
+        electrodeHeight = height;
     }
 
 }

+ 117 - 29
app/src/main/java/de/tu_darmstadt/informatik/tk/olir/MainActivity.java

@@ -1,62 +1,134 @@
 package de.tu_darmstadt.informatik.tk.olir;
 
+import android.content.ContextWrapper;
 import android.content.Intent;
+import android.graphics.Color;
 import android.support.v7.app.AppCompatActivity;
 import android.os.Bundle;
-import android.util.TypedValue;
 import android.view.KeyEvent;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
 import android.view.View;
+import android.widget.LinearLayout;
+import android.widget.TableLayout;
+import android.widget.TableRow;
+import android.widget.TextView;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.util.ArrayList;
 
-public class MainActivity extends AppCompatActivity {
 
+public class MainActivity extends AppCompatActivity {
 
-    public static String stringFalse = "";
-    public static String stringTrue = "";
-    private static DrawView drawView;
-    private float scale;
+    private ArrayList<String> lines;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_main);
 
+        getSupportActionBar().setTitle("Previous Sensors");
+
+        parseHistory();
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        MenuInflater inflater = getMenuInflater();
+        inflater.inflate(R.menu.menu, menu);
+        return true;
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+
+        if (item.getItemId() == R.id.clear_history) {
+            try {
+                OutputStreamWriter writer = new OutputStreamWriter(openFileOutput("history.txt", MODE_PRIVATE));
+                String content = "";
+                writer.write(content);
+                writer.flush();
+                writer.close();
+            } catch (FileNotFoundException e) {
+                e.printStackTrace();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+            TableLayout table = findViewById(R.id.tableLayout);
+            table.removeAllViews();
+        }
+
+        return true;
+    }
+
+    private void parseHistory() {
+        lines = new ArrayList<>();
+        ContextWrapper cw = new ContextWrapper(this);
+        File file = new File(cw.getFilesDir(), "history.txt");
 
+        TableLayout table = findViewById(R.id.tableLayout);
 
-        //FROM http://stackoverflow.com/questions/8656968/convert-mm-to-pixels 17.3.17 16.30
-        scale = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_MM, 1,
-                getResources().getDisplayMetrics());
+        try {
+            if (file.exists()) {
+                FileInputStream is = new FileInputStream(file);
 
-        /*drawView = (DrawView) this.findViewById(R.id.drawView);
-        drawView.setScale(scale);
-        drawView.setBackgroundColor(Color.WHITE);
-        this.findViewById(R.id.button2).setOnTouchListener(new View.OnTouchListener() {
+                BufferedReader reader = new BufferedReader(new InputStreamReader(is));
+                String line = reader.readLine();
+                while (line != null) {
+                    lines.add(line);
 
-            @Override
-            public boolean onTouch(View v, MotionEvent event) {
-                if (event.getAction() == MotionEvent.ACTION_DOWN ) {
-                    changeText(v);
-                    return true;
+                    line = reader.readLine();
                 }
-                return false;
             }
-        });*/
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        for (int i = lines.size()-1; i >= 0; i--) {
+            String line = lines.get(i);
+
+            String name = line.substring(line.indexOf("|")+1);
+            name = name.substring(0, name.indexOf("|"));
+
+            TableRow row = new TableRow(this);
+            row.setPadding(10,30,10,30);
+            row.setTag(i);
+            row.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    openHistoryEntry(v);
+                }
+            });
+            TextView textView = new TextView(this);
+            textView.setText(name);
+            textView.setTextSize(20);
+            row.addView(textView);
+            table.addView(row);
+
+            View v = new View(this);
+            v.setLayoutParams(new LinearLayout.LayoutParams(
+                    LinearLayout.LayoutParams.MATCH_PARENT,
+                    2
+            ));
+            v.setBackgroundColor(Color.parseColor("#000000"));
+            table.addView(v);
+        }
     }
 
+
     public void addObject(View view) {
         Intent intent = new Intent(this, ObjectsActivity.class);
         startActivity(intent);
     }
 
-
-
-
-    public void changeText(View view) {
-        /*TextView text = (TextView)this.findViewById(R.id.textView2);
-        text.setText(stringTrue);
-        text.setTextColor(Color.RED);*/
-    }
-
     @Override
     public boolean onKeyDown(int keyCode, KeyEvent event)  {
         if (keyCode == KeyEvent.KEYCODE_BACK
@@ -66,4 +138,20 @@ public class MainActivity extends AppCompatActivity {
         }
         return super.onKeyDown(keyCode, event);
     }
+
+    public void openHistoryEntry(View view) {
+        TableRow row = (TableRow) view;
+        int index = Integer.valueOf((Integer) row.getTag());
+        String line = lines.get(index);
+        String date = line.substring(0, line.indexOf("|"));
+        line = line.substring(line.indexOf("|") + 1);
+        String name = line.substring(0, line.indexOf("|"));
+        String result = line.substring(line.indexOf("|") + 1);
+
+        Intent intent = new Intent(this, ResultActivity.class);
+        intent.putExtra("time", date);
+        intent.putExtra("name", name);
+        intent.putExtra("result", Boolean.parseBoolean(result));
+        startActivity(intent);
+    }
 }

+ 1 - 11
app/src/main/java/de/tu_darmstadt/informatik/tk/olir/ObjectsActivity.java

@@ -27,6 +27,7 @@ public class ObjectsActivity extends AppCompatActivity {
         setContentView(R.layout.activity_objects);
 
         getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setTitle("1. Choose a Sensor");
     }
 
     @Override
@@ -45,12 +46,6 @@ public class ObjectsActivity extends AppCompatActivity {
         chooseFile.setType("*/*");
         chooseFile = Intent.createChooser(chooseFile, "Choose a file");
         startActivityForResult(chooseFile, FILE_SELECT_CODE);
-
-        // Create the ACTION_GET_CONTENT Intent
-        /*Intent getContentIntent = FileUtils.createGetContentIntent();
-
-        Intent intent = Intent.createChooser(getContentIntent, "1. Select a file");
-        startActivityForResult(intent, FILE_SELECT_CODE);*/
     }
 
     //FROM http://stackoverflow.com/questions/7856959/android-file-chooser 14.3.17 13:00
@@ -76,11 +71,6 @@ public class ObjectsActivity extends AppCompatActivity {
                             e.printStackTrace();
                         }
                     }
-
-                      /*  Parser.parseFile(file, drawView, (TextView) this.findViewById(R.id.textView), (Button) this.findViewById(R.id.button2), scale);
-                        TextView text = (TextView)this.findViewById(R.id.textView2);
-                        text.setText(stringFalse);
-                        text.setTextColor(Color.BLACK);*/
                 }
                 break;
         }

+ 9 - 34
app/src/main/java/de/tu_darmstadt/informatik/tk/olir/Parser.java

@@ -27,19 +27,16 @@ import java.util.Scanner;
 
 public class Parser {
 
-    //Save the first button position as the middle point and use it to reposition the button
-    private static boolean first = true;
-    private static int baseX;
-    private static int baseY;
 
-
-    public static void parseFile(String[] content, AppCompatActivity activity) {
+    public static void parseFile(String[] content, ReadingActivity activity) {
         //First line: Object title
         TextView textView = activity.findViewById(R.id.textView);
-        textView.setText(content[0].substring(content[0].indexOf(':')+1));
+        String title = content[0].substring(content[0].indexOf(':')+1);
+        textView.setText(title);
+        activity.name = title;
         //Set the two status strings
-        //TODO MainActivity.stringTrue = list.get(3).substring(list.get(3).indexOf(':')+1);
-        //TODO MainActivity.stringFalse = list.get(4).substring(list.get(4).indexOf(':')+1);
+        activity.stringTrue = content[3].substring(content[3].indexOf(':')+1);
+        activity.stringFalse = content[4].substring(content[4].indexOf(':')+1);
 
         DrawView background = activity.findViewById(R.id.drawView);
         //Outer shapes
@@ -55,17 +52,10 @@ public class Parser {
 
         background.invalidate();
 
-        Button button = activity.findViewById(R.id.button);
-        if (first) {
-            baseX = (int) button.getX();
-            baseY = (int) button.getY();
-            first = false;
-        }
+        DrawView drawView = activity.findViewById(R.id.drawView);
 
         //Button size and position
         String buttonText = content[2].substring(content[2].indexOf(':')+1);
-        float scale = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_MM, 1,
-                activity.getResources().getDisplayMetrics());
         if (buttonText.charAt(1) == 'C') {
 
             buttonText = buttonText.substring(3);
@@ -80,14 +70,7 @@ public class Parser {
             index = buttonText.length()-1;
             float diameter = Float.parseFloat(buttonText.substring(0, index));
 
-            int dia = (int) (diameter * scale) ;
-
-            ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) button.getLayoutParams();
-            layoutParams.horizontalBias = (baseX + x * scale) / (baseX * 2);
-            layoutParams.verticalBias = (baseY + y * scale) / (baseY * 2);
-            layoutParams.width = dia;
-            layoutParams.height = dia;
-            button.setLayoutParams(layoutParams);
+            drawView.setPosition(x, y, diameter, diameter);
 
         } else if (buttonText.charAt(1) == 'R') {
 
@@ -107,15 +90,7 @@ public class Parser {
             index = buttonText.length()-1;
             float height = Float.parseFloat(buttonText.substring(0, index));
 
-            int w = (int) (width * scale);
-            int h = (int) (height * scale);
-
-            ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) button.getLayoutParams();
-            layoutParams.horizontalBias = (baseX + x * scale) / (baseX * 2);
-            layoutParams.verticalBias = (baseY + y * scale) / (baseY * 2);
-            layoutParams.width = w;
-            layoutParams.height = h;
-            button.setLayoutParams(layoutParams);
+           drawView.setPosition(x, y, width, height);
         }
     }
 }

+ 21 - 0
app/src/main/java/de/tu_darmstadt/informatik/tk/olir/ReadingActivity.java

@@ -5,9 +5,14 @@ import android.support.v7.app.AppCompatActivity;
 import android.os.Bundle;
 import android.view.KeyEvent;
 import android.view.MenuItem;
+import android.view.View;
 
 public class ReadingActivity extends AppCompatActivity {
 
+    String stringTrue = "";
+    String stringFalse = "";
+    String name = "";
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -50,4 +55,20 @@ public class ReadingActivity extends AppCompatActivity {
         }
         return false;
     }
+
+    public void onDetected(View view) {
+        Intent intent = new Intent(this, ResultActivity.class);
+        intent.putExtra("information", stringTrue);
+        intent.putExtra("result", true);
+        intent.putExtra("name", name);
+        startActivity(intent);
+    }
+
+    public void onNotDetected(View view) {
+        Intent intent = new Intent(this, ResultActivity.class);
+        intent.putExtra("information", stringFalse);
+        intent.putExtra("result", false);
+        intent.putExtra("name", name);
+        startActivity(intent);
+    }
 }

+ 115 - 0
app/src/main/java/de/tu_darmstadt/informatik/tk/olir/ResultActivity.java

@@ -0,0 +1,115 @@
+package de.tu_darmstadt.informatik.tk.olir;
+
+import android.content.ContextWrapper;
+import android.content.Intent;
+import android.os.Handler;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.KeyEvent;
+import android.view.MenuItem;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOError;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public class ResultActivity extends AppCompatActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_result);
+
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+
+        String time = getIntent().getStringExtra("time");
+
+        if (time == null) {
+            getSupportActionBar().setTitle("3. Result");
+
+            TextView textView = findViewById(R.id.resultTextView);
+            textView.setText(getIntent().getStringExtra("information"));
+
+            ImageView imageView = findViewById(R.id.resultImageView);
+
+            final boolean result = getIntent().getExtras().getBoolean("result");
+            if (result) {
+                imageView.setImageResource(R.mipmap.checkmark);
+            } else {
+                imageView.setImageResource(R.mipmap.cross);
+            }
+            new Handler().post(new Runnable() {
+
+                @Override
+                public void run() {
+                    saveToHistory(result);
+                }
+            });
+        }
+        else {
+            getSupportActionBar().setTitle(getIntent().getStringExtra("name"));
+
+            ImageView imageView = findViewById(R.id.resultImageView);
+
+            final boolean result = getIntent().getExtras().getBoolean("result");
+            if (result) {
+                imageView.setImageResource(R.mipmap.checkmark);
+            } else {
+                imageView.setImageResource(R.mipmap.cross);
+            }
+            try {
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddhhmmss");
+                Date date = sdf.parse(time);
+                sdf.applyPattern("yyyy/MM/dd hh:mm:ss");
+
+                TextView textView = findViewById(R.id.resultTextView);
+                textView.setText("From: " + sdf.format(date));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private void saveToHistory(boolean result) {
+
+        ContextWrapper cw = new ContextWrapper(this);
+        Date date = new Date();
+        String dateFormat = new SimpleDateFormat("yyyyMMddhhmmss").format(date);
+        try {
+            OutputStreamWriter writer = new OutputStreamWriter(openFileOutput("history.txt", MODE_APPEND));
+            String content = dateFormat + "|" + getIntent().getStringExtra("name") + "|" + result + "\n";
+            writer.write(content);
+            writer.flush();
+            writer.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event)  {
+        if (keyCode == KeyEvent.KEYCODE_BACK
+                && event.getRepeatCount() == 0) {
+            Intent intent = new Intent(this, MainActivity.class);
+            startActivity(intent);
+            return true;
+        }
+        return super.onKeyDown(keyCode, event);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            Intent intent = new Intent(this, MainActivity.class);
+            startActivity(intent);
+            return true;
+        }
+        return false;
+    }
+}

BIN
app/src/main/res/drawable-xxxhdpi/vorschl1.PNG


+ 29 - 5
app/src/main/res/layout/activity_reading.xml

@@ -37,16 +37,40 @@
         app:layout_constraintVertical_bias="0.919" />
 
     <Button
-        android:id="@+id/button"
-        android:layout_width="30dp"
-        android:layout_height="30dp"
+        android:id="@+id/button2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
         android:layout_marginBottom="8dp"
         android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
         android:layout_marginStart="8dp"
         android:layout_marginTop="8dp"
-        android:background="@android:color/transparent"
+        android:onClick="onDetected"
+        android:text="TestDetected"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintHorizontal_bias="0.0"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintVertical_bias="1.0" />
+
+    <Button
+        android:id="@+id/button3"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="8dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:onClick="onNotDetected"
+        android:text="TestNotDetected"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintHorizontal_bias="1.0"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintVertical_bias="1.0" />
 </android.support.constraint.ConstraintLayout>

+ 43 - 0
app/src/main/res/layout/activity_result.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".ResultActivity">
+
+    <ImageView
+        android:id="@+id/resultImageView"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="8dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintVertical_bias="0.04000002"
+        app:srcCompat="@mipmap/checkmark" />
+
+    <TextView
+        android:id="@+id/resultTextView"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="8dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:text="TextView"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintVertical_bias="0.37" />
+
+</android.support.constraint.ConstraintLayout>

+ 7 - 0
app/src/main/res/menu/menu.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+    <item android:id="@+id/clear_history"
+        android:title="Remove History"
+        app:showAsAction="never"/>
+</menu>

BIN
app/src/main/res/mipmap-xxxhdpi/checkmark.png


BIN
app/src/main/res/mipmap-xxxhdpi/cross.png


+ 3 - 3
app/src/main/res/raw/object_specs_acceleration.txt

@@ -1,5 +1,5 @@
-Name:Acceleration 5.0m/s�
+Name:Acceleration
 Shape:[R;0;0;20;40][C;0;-10;6][C;0;10;6]
 Contact:[C;0;10;4.0]
-ButtonTrue:The object was accelerated with 5.0m/s�!
-ButtonFalse:The object was accelerated with less than 5.0m/s�.
+ButtonTrue:The object was accelerated above the limit!
+ButtonFalse:The object was accelerated with less than the limit.

+ 3 - 3
app/src/main/res/raw/object_specs_load.txt

@@ -1,5 +1,5 @@
-Name:Weight 5.4kg
+Name:Weight
 Shape:[R;0;0;20;61]
 Contact:[C;0;1;4.0]
-ButtonTrue:A weight of more than 5.4 Kg was applied!
-ButtonFalse:A weight of less than 5.4 Kg was applied.
+ButtonTrue:A weight of more than the limit was applied!
+ButtonFalse:A weight of less than the limit was applied.

+ 2 - 2
app/src/main/res/raw/object_specs_temp_falling.txt

@@ -1,5 +1,5 @@
 Name:Freeze
 Shape:[R;0;0;20;43][C;10;-8;6]
 Contact:[C;0;7;4.0]
-ButtonTrue:The object was stored below 0�C!
-ButtonFalse:The object was above 0�C the whole time.
+ButtonTrue:The object was stored below the limit!
+ButtonFalse:The object was above the limit the whole time.

+ 1 - 1
app/src/main/res/raw/object_specs_temp_rising.txt

@@ -1,5 +1,5 @@
 Name:Melt
 Shape:[R;0;0;20;42][R;0;-20;10;2]
 Contact:[C;0;3;4.0]
-ButtonTrue:The object was stored above 0�C!
+ButtonTrue:The object was stored above the limit!
 ButtonFalse:The object was cooled the whole time.