diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index c7baaf7..ce3de47 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ 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 8d8b967..595e631 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 @@ -228,7 +228,7 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface, for(int i = 0; i < renderedCurrencies.size(); i++) { //currencyLayout.addView(currencyView.get(i)); - currencyLayout.addView(new CurrencyCardview(getActivity(), renderedCurrencies.get(i), getActivity(), totalValue, preferencesManager.isBalanceHidden())); + currencyLayout.addView(new CurrencyCardview(getActivity(), renderedCurrencies.get(i), getActivity(), preferencesManager.isBalanceHidden())); } if(loadingDialog.isShowing()) @@ -478,6 +478,14 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface, totalFluctuation += ((CurrencyCardview) currencyLayout.getChildAt(i)).getFluctuation(); } } + + for(int i = 0; i < currencyLayout.getChildCount(); i++) + { + if(currencyLayout.getChildAt(i) instanceof CurrencyCardview) + { + ((CurrencyCardview) currencyLayout.getChildAt(i)).updateCardViewInfos(totalValue, preferencesManager.isBalanceHidden()); + } + } } protected void updateTitle() diff --git a/app/src/main/java/com/herbron/moodl/DataManagers/CurrencyData/CurrencyCardview.java b/app/src/main/java/com/herbron/moodl/DataManagers/CurrencyData/CurrencyCardview.java index 6fdee83..e84c227 100644 --- a/app/src/main/java/com/herbron/moodl/DataManagers/CurrencyData/CurrencyCardview.java +++ b/app/src/main/java/com/herbron/moodl/DataManagers/CurrencyData/CurrencyCardview.java @@ -126,7 +126,7 @@ public class CurrencyCardview extends CardView implements CurrencyInfoUpdateNoti updateColor(currency); } - public CurrencyCardview(@NonNull final Context context, final Currency currency, Activity activity, float totalValue, boolean isBalanceHidden) + public CurrencyCardview(@NonNull final Context context, final Currency currency, Activity activity, boolean isBalanceHidden) { super(context); @@ -166,8 +166,6 @@ public class CurrencyCardview extends CardView implements CurrencyInfoUpdateNoti } }); - updateCardViewInfos(currency, totalValue, isBalanceHidden); - findViewById(R.id.linearLayoutSubCharts).setOnClickListener(detailsClickListener); findViewById(R.id.LineChartView).setOnClickListener(detailsClickListener); @@ -250,7 +248,7 @@ public class CurrencyCardview extends CardView implements CurrencyInfoUpdateNoti } } - private void updateCardViewInfos(Currency currency, float totalValue, boolean isBalanceHidden) + public void updateCardViewInfos(float totalValue, boolean isBalanceHidden) { double value = currency.getValue() * currency.getBalance(); double percentage = value / totalValue * 100;