diff --git a/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java b/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java index b4207ea..e30689e 100644 --- a/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java +++ b/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java @@ -353,9 +353,9 @@ public class DrugListActivity extends AppCompatActivity { TextView title = dlg.findViewById(R.id.textView); TextView prompt = dlg.findViewById(R.id.startcip13); EditText editText = dlg.findViewById(R.id.edittext); - Button ok = (Button)dlg.findViewById(R.id.agreed); - Button notok = (Button)dlg.findViewById(R.id.notagreed); - ImageView icon = (ImageView)dlg.findViewById(R.id.head_icon); + Button ok = dlg.findViewById(R.id.agreed); + Button notok = dlg.findViewById(R.id.notagreed); + ImageView icon = dlg.findViewById(R.id.head_icon); title.setText(R.string.enter_cip_13); prompt.setText(R.string.enter_cip_13_here); ok.setEnabled(false); @@ -413,7 +413,7 @@ public class DrugListActivity extends AppCompatActivity { TextView cpl = dlg.findViewById(R.id.cpl); String cplString; ImageView icon = dlg.findViewById(R.id.image); - Button btn = (Button)dlg.findViewById(R.id.txtClose); + Button btn = dlg.findViewById(R.id.txtClose); dlg.show(); if (aMedicine != null) { @@ -464,20 +464,6 @@ public class DrugListActivity extends AppCompatActivity { dlg.show(); } - /** - * askForComprehensive - */ - private void askForComprehensive() { - AlertDialog.Builder dlg = new AlertDialog.Builder(this); - dlg.setTitle(getString(R.string.app_name)); - - dlg.setMessage(R.string.understood); - dlg.setPositiveButton(R.string.Yes, (dialog, which) -> { - // Nothing to do just dismiss dialog - }); - dlg.show(); - } - /** * Add New drug to the user database diff --git a/app/src/main/java/net/foucry/pilldroid/WelcomeActivity.java b/app/src/main/java/net/foucry/pilldroid/WelcomeActivity.java index fcea0de..327a725 100644 --- a/app/src/main/java/net/foucry/pilldroid/WelcomeActivity.java +++ b/app/src/main/java/net/foucry/pilldroid/WelcomeActivity.java @@ -146,7 +146,7 @@ public class WelcomeActivity extends AppCompatActivity { TextView cpl = dlg.findViewById(R.id.cpl); String cplString = ""; ImageView icon = dlg.findViewById(R.id.image); - Button btn = (Button)dlg.findViewById(R.id.txtClose); + Button btn = dlg.findViewById(R.id.txtClose); dlg.show(); msgString = getString(R.string.understood); diff --git a/app/src/main/java/net/foucry/pilldroid/models/Prescription.java b/app/src/main/java/net/foucry/pilldroid/models/Prescription.java index b4799b8..45e41dc 100644 --- a/app/src/main/java/net/foucry/pilldroid/models/Prescription.java +++ b/app/src/main/java/net/foucry/pilldroid/models/Prescription.java @@ -169,7 +169,7 @@ public class Prescription implements Serializable { double takeDuringPeriod = this.take * numberOfDays; currentStock = getStock(); newStock = (float) (currentStock - takeDuringPeriod); - setStock((float) newStock); + setStock(newStock); setLast_update(new Date().getTime()); } }