diff --git a/app/build.gradle b/app/build.gradle index 382ed82..d7c78b3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "com.herbron.moodl" minSdkVersion 19 targetSdkVersion 27 - versionCode 4 - versionName "0.0.4" + versionCode 5 + versionName "0.0.5" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/java/com/herbron/moodl/Activities/HomeActivity.java b/app/src/main/java/com/herbron/moodl/Activities/HomeActivity.java index 9e7b3df..c394da6 100644 --- a/app/src/main/java/com/herbron/moodl/Activities/HomeActivity.java +++ b/app/src/main/java/com/herbron/moodl/Activities/HomeActivity.java @@ -59,8 +59,6 @@ protected void onCreate(Bundle savedInstanceState) { /**Interface setup**/ Window w = getWindow(); - w.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); - w.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); setContentView(R.layout.activity_currency_summary); diff --git a/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Summary.java b/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Summary.java index f97e596..2f7f70b 100644 --- a/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Summary.java +++ b/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Summary.java @@ -419,13 +419,29 @@ protected void updateTitle() if(preferencesManager.isBalanceHidden()) { - updateHideBalanceTitle(totalFluctuationPercentage); - balanceUpdateInterface.onBalanceUpdated(totalFluctuationPercentage); + if(Double.isNaN(totalFluctuationPercentage)) + { + updateHideBalanceTitle(0); + balanceUpdateInterface.onBalanceUpdated(0); + } + else + { + updateHideBalanceTitle(totalFluctuationPercentage); + balanceUpdateInterface.onBalanceUpdated(totalFluctuationPercentage); + } } else { - updateBalanceDisplayedTitle(totalFluctuationPercentage); - balanceUpdateInterface.onBalanceUpdated(totalValue); + if(Double.isNaN(totalFluctuation)) + { + updateBalanceDisplayedTitle(0); + balanceUpdateInterface.onBalanceUpdated(0); + } + else + { + updateBalanceDisplayedTitle(totalValue); + balanceUpdateInterface.onBalanceUpdated(totalValue); + } } } diff --git a/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionActivity.java b/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionActivity.java index 88a3727..23ac447 100644 --- a/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionActivity.java +++ b/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionActivity.java @@ -21,6 +21,7 @@ import com.herbron.moodl.DataManagers.PreferencesManager; import com.herbron.moodl.R; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Locale; @@ -96,7 +97,17 @@ public boolean onOptionsItemSelected(MenuItem item) { private boolean checkPriceText() { - if(purchasedPriceEditText.getText().toString().equals("")) + String purchasedPriceText = purchasedPriceEditText.getText().toString(); + + try { + Double.parseDouble(purchasedPriceText); + } catch (NumberFormatException e) { + purchasedPriceEditText.setError(getResources().getString(R.string.field_nan)); + + return false; + } + + if(purchasedPriceText.equals("")) { purchasedPriceEditText.setError(getResources().getString(R.string.field_empty)); @@ -108,7 +119,17 @@ private boolean checkPriceText() private boolean checkAmountText() { - if(amountTxtView.getText().toString().equals("")) + String amountText = amountTxtView.getText().toString(); + + try { + Double.parseDouble(amountText); + } catch (NumberFormatException e) { + amountTxtView.setError(getResources().getString(R.string.field_nan)); + + return false; + } + + if(amountText.equals("")) { amountTxtView.setError(getResources().getString(R.string.field_empty)); diff --git a/app/src/main/res/layout/activity_currency_summary.xml b/app/src/main/res/layout/activity_currency_summary.xml index e57d0be..089af02 100644 --- a/app/src/main/res/layout/activity_currency_summary.xml +++ b/app/src/main/res/layout/activity_currency_summary.xml @@ -5,7 +5,6 @@ android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" - android:fitsSystemWindows="true" tools:context="com.herbron.moodl.Activities.HomeActivity"> + android:layout_height="match_parent"> + android:layout_height="match_parent"> + android:layout_height="match_parent"> Vérifier votre empreinte digitale pour continuer Paramètres Edition + Ce champ en peut pas être vide + Ce champ doit être un nombre \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4ac31f0..daba12a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -187,5 +187,6 @@ Edition This field cannot be blank + This field must be a number