Commit cbe0dc12 authored by Thiago M's avatar Thiago M

Bug fix

Cleanup
parent 665701cd
......@@ -8,8 +8,8 @@ android {
applicationId "tmendes.com.analyticalbalancedroid"
minSdkVersion 21
targetSdkVersion 25
versionCode 2
versionName '1.1'
versionCode 3
versionName '1.2'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
......
package tmendes.com.analyticalbalancedroid;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
......@@ -41,8 +41,8 @@ public class MainActivity extends AppCompatActivity {
prodList = new ArrayList<>();
price = Float.valueOf(0);
weight = Float.valueOf(0);
price = 0f;
weight = 0f;
prodKgPrice = (EditText) findViewById(R.id.editTextKgPrice);
prodName = (EditText) findViewById(R.id.editTextProdName);
......@@ -174,7 +174,7 @@ public class MainActivity extends AppCompatActivity {
}
private Float doTheMath() {
Float res = Float.valueOf(0);
Float res = 0f;
if ((price > 0) && (weight > 0)) {
res = price * weight;
}
......
......@@ -2,6 +2,7 @@ package tmendes.com.analyticalbalancedroid;
import android.content.Context;
@SuppressWarnings("ALL")
public class Product {
private String name = "";
private float weight;
......@@ -72,7 +73,7 @@ public class Product {
sb.append(ctx.getResources().getString(R.string.prod_to_pay_list));
sb.append(" ");
sb.append(this.getInd_price());
sb.append(String.format("%.02f", this.getInd_price()));
return sb.toString();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment