Skip to content

Commit

Permalink
Minor fixs
Browse files Browse the repository at this point in the history
- Fix crash when fields in the Record activity are field with unexpected infos
- Fix soft buttons being overlapped by some activities
- Fix NaN bug displayed in the drawer when hiding balance while having 0$
- Fix activities action bar not being displayed properly
  • Loading branch information
TanguyHerbron committed Jun 8, 2018
1 parent 75da1ee commit cff73da
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 22 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));

Expand All @@ -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));

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/activity_currency_summary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">

<FrameLayout
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/res/layout/fragment_marketcap_homeactivity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
android:layout_height="match_parent">

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/fragment_padding"
android:background="@drawable/gradient_background">

<android.support.v7.widget.Toolbar
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/res/layout/fragment_overview_homeactivity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
android:layout_height="match_parent">

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/fragment_padding"
android:background="@drawable/gradient_background">

<android.support.v7.widget.Toolbar
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/layout/fragment_summary_homeactivity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
android:id="@+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.herbron.moodl.Activities.HomeActivity">

<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
android:theme="@style/AppTheme.AppBarOverlay"
android:paddingTop="@dimen/fragment_padding"
android:background="@drawable/gradient_background">

<android.support.design.widget.CollapsingToolbarLayout
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/res/layout/fragment_watchlist_homeactivity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
android:layout_height="match_parent">

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/fragment_padding"
android:background="@drawable/gradient_background">

<android.support.v7.widget.Toolbar
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,6 @@
<string name="fingerprint_dialog_title">Vérifier votre empreinte digitale pour continuer</string>
<string name="action_settings">Paramètres</string>
<string name="action_edit_mode">Edition</string>
<string name="field_empty">Ce champ en peut pas être vide</string>
<string name="field_nan">Ce champ doit être un nombre</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,6 @@
<string name="action_edit_mode">Edition</string>

<string name="field_empty">This field cannot be blank</string>
<string name="field_nan">This field must be a number</string>

</resources>

0 comments on commit cff73da

Please sign in to comment.