diff --git a/.idea/assetWizardSettings.xml b/.idea/assetWizardSettings.xml
index ddc44c0..b34e12f 100644
--- a/.idea/assetWizardSettings.xml
+++ b/.idea/assetWizardSettings.xml
@@ -71,7 +71,7 @@
@@ -82,7 +82,7 @@
diff --git a/app/src/main/java/com/herbron/moodl/Activities/DetailsActivityFragments/ChartsFragment.java b/app/src/main/java/com/herbron/moodl/Activities/DetailsActivityFragments/ChartsFragment.java
index 29af91d..8aedb3d 100644
--- a/app/src/main/java/com/herbron/moodl/Activities/DetailsActivityFragments/ChartsFragment.java
+++ b/app/src/main/java/com/herbron/moodl/Activities/DetailsActivityFragments/ChartsFragment.java
@@ -36,7 +36,7 @@ import com.herbron.moodl.DataManagers.CurrencyData.CurrencyDataChart;
import com.herbron.moodl.DataManagers.PreferencesManager;
import com.herbron.moodl.CustomLayouts.CustomViewPager;
import com.herbron.moodl.MoodlBox;
-import com.herbron.moodl.PlaceholderManager;
+import com.herbron.moodl.Utils.PlaceholderUtils;
import com.herbron.moodl.R;
import java.util.ArrayList;
@@ -252,8 +252,8 @@ public class ChartsFragment extends Fragment implements CurrencyInfoUpdateNotifi
updateFluctuation(start, end);
- ((TextView) view.findViewById(R.id.txtViewPriceStart)).setText(PlaceholderManager.getValueString(numberConformer(start), getActivity().getBaseContext()));
- ((TextView) view.findViewById(R.id.txtViewPriceNow)).setText(PlaceholderManager.getValueString(numberConformer(end), getActivity().getBaseContext()));
+ ((TextView) view.findViewById(R.id.txtViewPriceStart)).setText(PlaceholderUtils.getValueString(numberConformer(start), getActivity().getBaseContext()));
+ ((TextView) view.findViewById(R.id.txtViewPriceNow)).setText(PlaceholderUtils.getValueString(numberConformer(end), getActivity().getBaseContext()));
for(int i = 1; i < dataChartList.size(); i++)
{
@@ -270,9 +270,9 @@ public class ChartsFragment extends Fragment implements CurrencyInfoUpdateNotifi
}
}
- ((TextView) view.findViewById(R.id.totalVolume)).setText(PlaceholderManager.getValueString(numberConformer(totalVolume), getActivity().getBaseContext()));
- ((TextView) view.findViewById(R.id.highestPrice)).setText(PlaceholderManager.getValueString(numberConformer(highestPrice), getActivity().getBaseContext()));
- ((TextView) view.findViewById(R.id.lowestPrice)).setText(PlaceholderManager.getValueString(numberConformer(lowestPrice), getActivity().getBaseContext()));
+ ((TextView) view.findViewById(R.id.totalVolume)).setText(PlaceholderUtils.getValueString(numberConformer(totalVolume), getActivity().getBaseContext()));
+ ((TextView) view.findViewById(R.id.highestPrice)).setText(PlaceholderUtils.getValueString(numberConformer(highestPrice), getActivity().getBaseContext()));
+ ((TextView) view.findViewById(R.id.lowestPrice)).setText(PlaceholderUtils.getValueString(numberConformer(lowestPrice), getActivity().getBaseContext()));
}
private void updateFluctuation(float start, float end)
@@ -457,9 +457,9 @@ public class ChartsFragment extends Fragment implements CurrencyInfoUpdateNotifi
date = getDateFromTimestamp(dataChartList.get(index).getTimestamp() * 1000);
}
- volumePlaceholder = PlaceholderManager.getVolumeString(numberConformer(barChart.getData().getDataSets().get(0).getEntryForIndex(index).getY()), getActivity().getBaseContext());
- pricePlaceholder = PlaceholderManager.getPriceString(numberConformer((lineChart.getHighlighted())[0].getY()), getActivity().getBaseContext());
- timestampPlaceholder = PlaceholderManager.getTimestampString(date, getActivity().getBaseContext());
+ volumePlaceholder = PlaceholderUtils.getVolumeString(numberConformer(barChart.getData().getDataSets().get(0).getEntryForIndex(index).getY()), getActivity().getBaseContext());
+ pricePlaceholder = PlaceholderUtils.getPriceString(numberConformer((lineChart.getHighlighted())[0].getY()), getActivity().getBaseContext());
+ timestampPlaceholder = PlaceholderUtils.getTimestampString(date, getActivity().getBaseContext());
((TextView) view.findViewById(R.id.volumeHightlight)).setText(volumePlaceholder);
view.findViewById(R.id.volumeHightlight).setVisibility(View.VISIBLE);
diff --git a/app/src/main/java/com/herbron/moodl/Activities/DetailsActivityFragments/InformationFragment.java b/app/src/main/java/com/herbron/moodl/Activities/DetailsActivityFragments/InformationFragment.java
index 88ba247..f29c6f1 100644
--- a/app/src/main/java/com/herbron/moodl/Activities/DetailsActivityFragments/InformationFragment.java
+++ b/app/src/main/java/com/herbron/moodl/Activities/DetailsActivityFragments/InformationFragment.java
@@ -17,7 +17,7 @@ import android.widget.TextView;
import com.herbron.moodl.DataManagers.CurrencyData.Currency;
import com.herbron.moodl.DataManagers.PreferencesManager;
-import com.herbron.moodl.PlaceholderManager;
+import com.herbron.moodl.Utils.PlaceholderUtils;
import com.herbron.moodl.R;
import static com.herbron.moodl.MoodlBox.numberConformer;
@@ -74,12 +74,15 @@ public class InformationFragment extends Fragment {
{
if(isTickerUpdated && isSnapshotUpdated)
{
- getActivity().runOnUiThread(new Runnable() {
- @Override
- public void run() {
- refreshInfoTab();
- }
- });
+ if(getActivity() != null)
+ {
+ getActivity().runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ refreshInfoTab();
+ }
+ });
+ }
}
}
@@ -120,12 +123,12 @@ public class InformationFragment extends Fragment {
((TextView) view.findViewById(R.id.txtViewDescription))
.setMovementMethod(LinkMovementMethod.getInstance());
((TextView) view.findViewById(R.id.txtViewPercentageCoinEmited))
- .setText(PlaceholderManager.getEmitedPercentageString(numberConformer(currency.getMinedCoinSupply() / currency.getMaxCoinSupply() * 100), getActivity().getBaseContext()));
+ .setText(PlaceholderUtils.getEmitedPercentageString(numberConformer(currency.getMinedCoinSupply() / currency.getMaxCoinSupply() * 100), getActivity().getBaseContext()));
if(currency.getMarketCapitalization() != 0)
{
((TextView) view.findViewById(R.id.txtViewMarketCapitalization))
- .setText(PlaceholderManager.getValueString(numberConformer(currency.getMarketCapitalization()), getActivity().getBaseContext()));
+ .setText(PlaceholderUtils.getValueString(numberConformer(currency.getMarketCapitalization()), getActivity().getBaseContext()));
view.findViewById(R.id.linearMarketCap).setVisibility(View.VISIBLE);
}
@@ -139,15 +142,15 @@ public class InformationFragment extends Fragment {
if(currency.getMaxCoinSupply() == 0)
{
((TextView) view.findViewById(R.id.txtViewTotalSupply))
- .setText(PlaceholderManager.getSymbolString(getString(R.string.infinity), getActivity()));
+ .setText(PlaceholderUtils.getSymbolString(getString(R.string.infinity), getActivity()));
}
else
{
((TextView) view.findViewById(R.id.txtViewTotalSupply))
- .setText(PlaceholderManager.getSymbolString(numberConformer(currency.getMaxCoinSupply()), getActivity()));
+ .setText(PlaceholderUtils.getSymbolString(numberConformer(currency.getMaxCoinSupply()), getActivity()));
}
((TextView) view.findViewById(R.id.txtViewCirculatingSupply))
- .setText(PlaceholderManager.getSymbolString(numberConformer(currency.getMinedCoinSupply()), getActivity()));
+ .setText(PlaceholderUtils.getSymbolString(numberConformer(currency.getMinedCoinSupply()), getActivity()));
}
}
diff --git a/app/src/main/java/com/herbron/moodl/Activities/DetailsActivityFragments/TransactionsFragment.java b/app/src/main/java/com/herbron/moodl/Activities/DetailsActivityFragments/TransactionsFragment.java
index 61fba84..ecace94 100644
--- a/app/src/main/java/com/herbron/moodl/Activities/DetailsActivityFragments/TransactionsFragment.java
+++ b/app/src/main/java/com/herbron/moodl/Activities/DetailsActivityFragments/TransactionsFragment.java
@@ -1,20 +1,14 @@
package com.herbron.moodl.Activities.DetailsActivityFragments;
-import android.graphics.PorterDuff;
-import android.graphics.PorterDuffColorFilter;
-import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Looper;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.AbsListView;
import android.widget.ListView;
-import android.widget.ProgressBar;
import com.herbron.moodl.DataNotifiers.BinanceUpdateNotifierInterface;
import com.herbron.moodl.DataManagers.CurrencyData.Currency;
@@ -23,7 +17,6 @@ import com.herbron.moodl.DataManagers.CurrencyData.Transaction;
import com.herbron.moodl.DataManagers.DatabaseManager;
import com.herbron.moodl.DataManagers.ExchangeManager.BinanceManager;
import com.herbron.moodl.DataManagers.PreferencesManager;
-import com.herbron.moodl.CustomAdapters.TradeListAdapter;
import com.herbron.moodl.CustomAdapters.TransactionListAdapter;
import com.herbron.moodl.R;
@@ -46,7 +39,6 @@ public class TransactionsFragment extends Fragment {
private boolean flag_loading;
private List binanceManagerList;
private DatabaseManager databaseManager;
- private TradeListAdapter tradeListAdapter;
private ArrayList returnedTrades;
@Override
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 68e0d93..2174a5e 100644
--- a/app/src/main/java/com/herbron/moodl/Activities/HomeActivity.java
+++ b/app/src/main/java/com/herbron/moodl/Activities/HomeActivity.java
@@ -3,13 +3,11 @@ package com.herbron.moodl.Activities;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent;
-import android.graphics.Bitmap;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceActivity;
-import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
@@ -19,14 +17,12 @@ import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.app.AppCompatDelegate;
-import android.util.Log;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;
import android.view.WindowManager;
import android.widget.CompoundButton;
-import android.widget.ImageView;
import android.widget.Switch;
import android.widget.TextView;
@@ -38,7 +34,7 @@ import com.herbron.moodl.BalanceSwitchManagerInterface;
import com.herbron.moodl.BalanceUpdateInterface;
import com.herbron.moodl.DataManagers.DatabaseManager;
import com.herbron.moodl.DataManagers.PreferencesManager;
-import com.herbron.moodl.PlaceholderManager;
+import com.herbron.moodl.Utils.PlaceholderUtils;
import com.herbron.moodl.R;
import static com.herbron.moodl.MoodlBox.numberConformer;
@@ -247,11 +243,11 @@ public class HomeActivity extends AppCompatActivity implements BalanceUpdateInte
if(preferencesManager.isBalanceHidden())
{
- drawerBalanceTextView.setText(PlaceholderManager.getPercentageString(numberConformer(value), getApplicationContext()));
+ drawerBalanceTextView.setText(PlaceholderUtils.getPercentageString(numberConformer(value), getApplicationContext()));
}
else
{
- drawerBalanceTextView.setText(PlaceholderManager.getValueString(numberConformer(value), getApplicationContext()));
+ drawerBalanceTextView.setText(PlaceholderUtils.getValueString(numberConformer(value), getApplicationContext()));
}
}
}
diff --git a/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/MarketCapitalization.java b/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/MarketCapitalization.java
index 5cd2023..b3a56a4 100644
--- a/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/MarketCapitalization.java
+++ b/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/MarketCapitalization.java
@@ -37,7 +37,7 @@ import com.herbron.moodl.DataManagers.PreferencesManager;
import com.herbron.moodl.CustomLayouts.CustomPieChart;
import com.herbron.moodl.MoodlBox;
import com.herbron.moodl.DataNotifiers.MoodlboxNotifierInterface;
-import com.herbron.moodl.PlaceholderManager;
+import com.herbron.moodl.Utils.PlaceholderUtils;
import com.herbron.moodl.R;
import java.util.ArrayList;
@@ -391,13 +391,13 @@ public class MarketCapitalization extends Fragment implements CryptocompareNotif
private void updateDetails(double marketCap, double volume, String title, double percentage)
{
((TextView) view.findViewById(R.id.textViewMarketCap))
- .setText(PlaceholderManager.getValueString(MoodlBox.numberConformer(marketCap), getActivity().getBaseContext()));
+ .setText(PlaceholderUtils.getValueString(MoodlBox.numberConformer(marketCap), getActivity().getBaseContext()));
((TextView) view.findViewById(R.id.textViewVolume))
- .setText(PlaceholderManager.getValueString(MoodlBox.numberConformer(volume), getActivity().getBaseContext()));
+ .setText(PlaceholderUtils.getValueString(MoodlBox.numberConformer(volume), getActivity().getBaseContext()));
((TextView) view.findViewById(R.id.textViewTitle))
.setText(title);
((TextView) view.findViewById(R.id.textViewDominancePercentage))
- .setText(PlaceholderManager.getPercentageString(MoodlBox.numberConformer(percentage), getActivity().getBaseContext()));
+ .setText(PlaceholderUtils.getPercentageString(MoodlBox.numberConformer(percentage), getActivity().getBaseContext()));
}
private SpannableString generateCenterSpannableText() {
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 16dffde..22806f2 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
@@ -51,7 +51,7 @@ import com.herbron.moodl.BalanceSwitchManagerInterface;
import com.herbron.moodl.DataNotifiers.BalanceUpdateNotifierInterface;
import com.herbron.moodl.MoodlBox;
import com.herbron.moodl.DataNotifiers.MoodlboxNotifierInterface;
-import com.herbron.moodl.PlaceholderManager;
+import com.herbron.moodl.Utils.PlaceholderUtils;
import com.herbron.moodl.R;
import java.io.File;
@@ -500,7 +500,7 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface,
public void updateBalanceDisplayedTitle(float totalFluctuationPercentage)
{
- toolbarLayout.setTitle(PlaceholderManager.getValueString(numberConformer(totalValue), getActivity()));
+ toolbarLayout.setTitle(PlaceholderUtils.getValueString(numberConformer(totalValue), getActivity()));
toolbarLayout.setCollapsedTitleTextColor(Color.WHITE);
toolbarLayout.setExpandedTitleColor(Color.WHITE);
@@ -517,18 +517,18 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface,
if(totalFluctuation == 0)
{
- toolbarSubtitle.setText(PlaceholderManager.getValueString(numberConformer(totalValue), getActivity()));
+ toolbarSubtitle.setText(PlaceholderUtils.getValueString(numberConformer(totalValue), getActivity()));
toolbarSubtitle.setTextColor(-1275068417);
}
else
{
- toolbarSubtitle.setText(PlaceholderManager.getValuePercentageString(numberConformer(totalFluctuation), numberConformer(totalFluctuationPercentage), getActivity()));
+ toolbarSubtitle.setText(PlaceholderUtils.getValuePercentageString(numberConformer(totalFluctuation), numberConformer(totalFluctuationPercentage), getActivity()));
}
}
private void updateHideBalanceTitle(float totalFluctuationPercentage)
{
- toolbarLayout.setTitle(PlaceholderManager.getPercentageString(numberConformer(totalFluctuationPercentage), getActivity()));
+ toolbarLayout.setTitle(PlaceholderUtils.getPercentageString(numberConformer(totalFluctuationPercentage), getActivity()));
toolbarSubtitle.setVisibility(View.GONE);
if(totalFluctuation > 0)
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 4155211..c01e60d 100644
--- a/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionActivity.java
+++ b/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionActivity.java
@@ -3,34 +3,23 @@ package com.herbron.moodl.Activities;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
-import android.opengl.Visibility;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
-import android.support.design.widget.TextInputLayout;
-import android.support.v4.app.Fragment;
-import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
-import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.TextWatcher;
-import android.util.Log;
import android.view.View;
-import android.view.ViewTreeObserver;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.AutoCompleteTextView;
-import android.widget.Button;
-import android.widget.DatePicker;
-import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
-import android.widget.TimePicker;
import com.herbron.moodl.Activities.RecordTransactionFragments.BuyFragment;
import com.herbron.moodl.Activities.RecordTransactionFragments.SellFragment;
@@ -44,7 +33,6 @@ import com.herbron.moodl.DataManagers.ExchangeManager.Exchange;
import com.herbron.moodl.DataManagers.InfoAPIManagers.CryptocompareApiManager;
import com.herbron.moodl.DataManagers.DatabaseManager;
import com.herbron.moodl.DataManagers.InfoAPIManagers.Pair;
-import com.herbron.moodl.DataManagers.PreferencesManager;
import com.herbron.moodl.DataNotifiers.CryptocompareNotifierInterface;
import com.herbron.moodl.CustomAdapters.CoinRecordListAdapter;
import com.herbron.moodl.CustomLayouts.CustomTabLayout;
@@ -52,14 +40,11 @@ import com.herbron.moodl.CustomAdapters.ExchangeRecordListAdapter;
import com.herbron.moodl.CustomAdapters.RecordTransactionPageAdapter;
import com.herbron.moodl.MoodlBox;
import com.herbron.moodl.DataNotifiers.MoodlboxNotifierInterface;
-import com.herbron.moodl.PlaceholderManager;
+import com.herbron.moodl.Utils.PlaceholderUtils;
import com.herbron.moodl.R;
-import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Calendar;
import java.util.List;
-import java.util.Locale;
public class RecordTransactionActivity extends AppCompatActivity implements CurrencyInfoUpdateNotifierInterface, CryptocompareNotifierInterface {
@@ -187,7 +172,7 @@ public class RecordTransactionActivity extends AppCompatActivity implements Curr
IconDownloaderTask iconDownloaderTask = new IconDownloaderTask();
iconDownloaderTask.execute();
coin_autoCompleteTextView.removeTextChangedListener(coinTextWatcher);
- coin_autoCompleteTextView.setText(PlaceholderManager.getDenomination(currency.getName(), currency.getSymbol(), getBaseContext()));
+ coin_autoCompleteTextView.setText(PlaceholderUtils.getDenomination(currency.getName(), currency.getSymbol(), getBaseContext()));
coin_autoCompleteTextView.setEnabled(false);
if(globalTabLayouts.getVisibility() == View.GONE)
@@ -242,7 +227,7 @@ public class RecordTransactionActivity extends AppCompatActivity implements Curr
{
pair = pairList.get(index);
- pair_autoCompleteTextView.setText(PlaceholderManager.getPairString(pair.getFrom(), pair.getTo(), getBaseContext()));
+ pair_autoCompleteTextView.setText(PlaceholderUtils.getPairString(pair.getFrom(), pair.getTo(), getBaseContext()));
pair_autoCompleteTextView.setEnabled(true);
((BuyFragment) pageAdapter.getItem(0)).updatePair(pair);
@@ -291,7 +276,7 @@ public class RecordTransactionActivity extends AppCompatActivity implements Curr
{
pair = pairList.get(index);
- pair_autoCompleteTextView.setText(PlaceholderManager.getPairString(pair.getFrom(), pair.getTo(), getBaseContext()));
+ pair_autoCompleteTextView.setText(PlaceholderUtils.getPairString(pair.getFrom(), pair.getTo(), getBaseContext()));
pair_autoCompleteTextView.setEnabled(true);
((SellFragment) pageAdapter.getItem(1)).updatePair(pair);
@@ -435,7 +420,7 @@ public class RecordTransactionActivity extends AppCompatActivity implements Curr
public void onItemClick(AdapterView> parent, View view, int position, long id) {
pair = (Pair) pair_autoCompleteTextView.getAdapter().getItem(position);
- pair_autoCompleteTextView.setText(PlaceholderManager.getPairString(pair.getFrom(), pair.getTo(), getBaseContext()));
+ pair_autoCompleteTextView.setText(PlaceholderUtils.getPairString(pair.getFrom(), pair.getTo(), getBaseContext()));
toolbar.requestFocus();
hideSoftKeyboard(RecordTransactionActivity.this);
@@ -566,7 +551,7 @@ public class RecordTransactionActivity extends AppCompatActivity implements Curr
public void onItemClick(AdapterView> parent, View view, int position, long id) {
currency = (Currency) coin_autoCompleteTextView.getAdapter().getItem(position);
- coin_autoCompleteTextView.setText(PlaceholderManager.getDenomination(currency.getName(), currency.getSymbol(), getBaseContext()));
+ coin_autoCompleteTextView.setText(PlaceholderUtils.getDenomination(currency.getName(), currency.getSymbol(), getBaseContext()));
toolbar.requestFocus();
hideSoftKeyboard(RecordTransactionActivity.this);
@@ -685,7 +670,7 @@ public class RecordTransactionActivity extends AppCompatActivity implements Curr
/*if(transactionId != -1)
{
- setTitle(PlaceholderManager.getEditTransactionString(coin, getBaseContext()));
+ setTitle(PlaceholderUtils.getEditTransactionString(coin, getBaseContext()));
DatabaseManager databaseManager = new DatabaseManager(this);
Transaction transaction = databaseManager.getCurrencyTransactionById(transactionId);
diff --git a/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionFragments/BuyFragment.java b/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionFragments/BuyFragment.java
index 6d7a1c2..4bc3741 100644
--- a/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionFragments/BuyFragment.java
+++ b/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionFragments/BuyFragment.java
@@ -10,7 +10,6 @@ import android.support.design.widget.TextInputEditText;
import android.support.v7.widget.AppCompatButton;
import android.text.Editable;
import android.text.TextWatcher;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -28,7 +27,7 @@ import com.herbron.moodl.DataManagers.DatabaseManager;
import com.herbron.moodl.DataManagers.ExchangeManager.Exchange;
import com.herbron.moodl.DataManagers.InfoAPIManagers.Pair;
import com.herbron.moodl.DataManagers.PreferencesManager;
-import com.herbron.moodl.PlaceholderManager;
+import com.herbron.moodl.Utils.PlaceholderUtils;
import com.herbron.moodl.R;
import java.text.SimpleDateFormat;
@@ -452,8 +451,8 @@ public class BuyFragment extends CustomRecordFragment {
private void updateAdapter()
{
symbolStrings = new ArrayList<>();
- symbolStrings.addAll(PlaceholderManager.getFeeOptionsForSymbol(fragmentPair.getFrom(), getSecureContext()));
- symbolStrings.addAll(PlaceholderManager.getFeeOptionsForSymbol(fragmentPair.getTo(), getSecureContext()));
+ symbolStrings.addAll(PlaceholderUtils.getFeeOptionsForSymbol(fragmentPair.getFrom(), getSecureContext()));
+ symbolStrings.addAll(PlaceholderUtils.getFeeOptionsForSymbol(fragmentPair.getTo(), getSecureContext()));
currencyFeeAdapter.clear();
currencyFeeAdapter.addAll(symbolStrings);
@@ -530,8 +529,8 @@ public class BuyFragment extends CustomRecordFragment {
feesCurrencySpinner.setAdapter(currencyFeeAdapter);
symbolStrings = new ArrayList<>();
- symbolStrings.addAll(PlaceholderManager.getFeeOptionsForSymbol(pair.getFrom(), getSecureContext()));
- symbolStrings.addAll(PlaceholderManager.getFeeOptionsForSymbol(pair.getTo(), getSecureContext()));
+ symbolStrings.addAll(PlaceholderUtils.getFeeOptionsForSymbol(pair.getFrom(), getSecureContext()));
+ symbolStrings.addAll(PlaceholderUtils.getFeeOptionsForSymbol(pair.getTo(), getSecureContext()));
currencyFeeAdapter.addAll(symbolStrings);
currencyFeeAdapter.notifyDataSetChanged();
diff --git a/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionFragments/SellFragment.java b/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionFragments/SellFragment.java
index f91ce8b..c5d3caa 100644
--- a/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionFragments/SellFragment.java
+++ b/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionFragments/SellFragment.java
@@ -27,7 +27,7 @@ import com.herbron.moodl.DataManagers.DatabaseManager;
import com.herbron.moodl.DataManagers.ExchangeManager.Exchange;
import com.herbron.moodl.DataManagers.InfoAPIManagers.Pair;
import com.herbron.moodl.DataManagers.PreferencesManager;
-import com.herbron.moodl.PlaceholderManager;
+import com.herbron.moodl.Utils.PlaceholderUtils;
import com.herbron.moodl.R;
import java.text.SimpleDateFormat;
@@ -421,8 +421,8 @@ public class SellFragment extends CustomRecordFragment {
private void updateAdapter()
{
symbolStrings = new ArrayList<>();
- symbolStrings.addAll(PlaceholderManager.getFeeOptionsForSymbol(fragmentPair.getFrom(), getSecureContext()));
- symbolStrings.addAll(PlaceholderManager.getFeeOptionsForSymbol(fragmentPair.getTo(), getSecureContext()));
+ symbolStrings.addAll(PlaceholderUtils.getFeeOptionsForSymbol(fragmentPair.getFrom(), getSecureContext()));
+ symbolStrings.addAll(PlaceholderUtils.getFeeOptionsForSymbol(fragmentPair.getTo(), getSecureContext()));
currencyFeeAdapter.clear();
currencyFeeAdapter.addAll(symbolStrings);
@@ -529,8 +529,8 @@ public class SellFragment extends CustomRecordFragment {
feesCurrencySpinner.setAdapter(currencyFeeAdapter);
symbolStrings = new ArrayList<>();
- symbolStrings.addAll(PlaceholderManager.getFeeOptionsForSymbol(pair.getFrom(), getSecureContext()));
- symbolStrings.addAll(PlaceholderManager.getFeeOptionsForSymbol(pair.getTo(), getSecureContext()));
+ symbolStrings.addAll(PlaceholderUtils.getFeeOptionsForSymbol(pair.getFrom(), getSecureContext()));
+ symbolStrings.addAll(PlaceholderUtils.getFeeOptionsForSymbol(pair.getTo(), getSecureContext()));
currencyFeeAdapter.addAll(symbolStrings);
currencyFeeAdapter.notifyDataSetChanged();
diff --git a/app/src/main/java/com/herbron/moodl/Activities/SettingsActivity.java b/app/src/main/java/com/herbron/moodl/Activities/SettingsActivity.java
index 3a5abf0..984e30a 100644
--- a/app/src/main/java/com/herbron/moodl/Activities/SettingsActivity.java
+++ b/app/src/main/java/com/herbron/moodl/Activities/SettingsActivity.java
@@ -44,6 +44,7 @@ import com.applandeo.listeners.OnSelectFileListener;
import com.herbron.moodl.BuildConfig;
import com.herbron.moodl.DataManagers.DataCrypter;
import com.herbron.moodl.DataManagers.DatabaseManager;
+import com.herbron.moodl.DataManagers.PreferencesManager;
import com.herbron.moodl.FingerprintToolkit.FingerprintDialogFragment;
import com.herbron.moodl.FingerprintToolkit.FingerprintHandler;
import com.herbron.moodl.MoodlBox;
@@ -782,6 +783,9 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
}
}
}
+
+ PreferencesManager preferencesManager = new PreferencesManager(getContext());
+ preferencesManager.setMustUpdateSummary(true);
}
else
{
diff --git a/app/src/main/java/com/herbron/moodl/CustomAdapters/PairRecordListAdapter.java b/app/src/main/java/com/herbron/moodl/CustomAdapters/PairRecordListAdapter.java
index f91133d..c77dc76 100644
--- a/app/src/main/java/com/herbron/moodl/CustomAdapters/PairRecordListAdapter.java
+++ b/app/src/main/java/com/herbron/moodl/CustomAdapters/PairRecordListAdapter.java
@@ -11,7 +11,7 @@ import android.widget.Filter;
import android.widget.TextView;
import com.herbron.moodl.DataManagers.InfoAPIManagers.Pair;
-import com.herbron.moodl.PlaceholderManager;
+import com.herbron.moodl.Utils.PlaceholderUtils;
import com.herbron.moodl.R;
import java.util.ArrayList;
@@ -68,7 +68,7 @@ public class PairRecordListAdapter extends ArrayAdapter {
TextView pairTxtView = convertView.findViewById(R.id.textView);
pairTxtView.setTextColor(getContext().getResources().getColor(android.R.color.tab_indicator_text));
- pairTxtView.setText(PlaceholderManager.getPairString(pair.getFrom(), pair.getTo(), getContext()));
+ pairTxtView.setText(PlaceholderUtils.getPairString(pair.getFrom(), pair.getTo(), getContext()));
return convertView;
}
diff --git a/app/src/main/java/com/herbron/moodl/CustomAdapters/TradeListAdapter.java b/app/src/main/java/com/herbron/moodl/CustomAdapters/TradeListAdapter.java
deleted file mode 100644
index f113531..0000000
--- a/app/src/main/java/com/herbron/moodl/CustomAdapters/TradeListAdapter.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package com.herbron.moodl.CustomAdapters;
-
-import android.content.Context;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import android.widget.TextView;
-
-import com.herbron.moodl.DataManagers.CurrencyData.Trade;
-import com.herbron.moodl.R;
-
-import java.util.ArrayList;
-
-import static com.herbron.moodl.MoodlBox.getDateFromTimestamp;
-
-/**
- * Created by Guitoune on 24/04/2018.
- */
-
-public class TradeListAdapter extends ArrayAdapter {
-
- private Context context;
-
- public TradeListAdapter(Context context, ArrayList trades)
- {
- super(context, android.R.layout.simple_list_item_1, trades);
- this.context = context;
- }
-
- @NonNull
- @Override
- public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
- Trade trade = getItem(position);
-
- if(convertView == null)
- {
- convertView = LayoutInflater.from(getContext()).inflate(R.layout.custom_trade_row, parent, false);
- }
-
- TextView amountTxtView = convertView.findViewById(R.id.amountPurchased);
- TextView purchasedPrice = convertView.findViewById(R.id.purchasePrice);
- TextView tradePair = convertView.findViewById(R.id.pair);
- TextView dateTxtView = convertView.findViewById(R.id.tradeDate);
- View tradeIndicator = convertView.findViewById(R.id.tradeIndicator);
-
- amountTxtView.setText(String.valueOf(trade.getQty()));
- purchasedPrice.setText(trade.getPrice());
- dateTxtView.setText(getDateFromTimestamp(trade.getTime()));
- tradePair.setText(trade.getSymbol() + "/" + trade.getPairSymbol());
-
- if(trade.isBuyer())
- {
- tradeIndicator.setBackgroundColor(context.getResources().getColor(R.color.green));
- }
- else
- {
- tradeIndicator.setBackgroundColor(context.getResources().getColor(R.color.red));
- }
-
- return convertView;
- }
-}
diff --git a/app/src/main/java/com/herbron/moodl/CustomAdapters/TransactionListAdapter.java b/app/src/main/java/com/herbron/moodl/CustomAdapters/TransactionListAdapter.java
index 562e93c..1ec8278 100644
--- a/app/src/main/java/com/herbron/moodl/CustomAdapters/TransactionListAdapter.java
+++ b/app/src/main/java/com/herbron/moodl/CustomAdapters/TransactionListAdapter.java
@@ -20,6 +20,8 @@ import com.herbron.moodl.DataManagers.CurrencyData.Transaction;
import com.herbron.moodl.DataManagers.DatabaseManager;
import com.herbron.moodl.DataManagers.PreferencesManager;
import com.herbron.moodl.R;
+import com.herbron.moodl.Utils.PlaceholderUtils;
+import com.herbron.moodl.Utils.TransferUtils;
import java.util.ArrayList;
@@ -28,6 +30,8 @@ import static com.herbron.moodl.MoodlBox.getDateFromTimestamp;
import static com.herbron.moodl.MoodlBox.numberConformer;
import static java.lang.Math.abs;
+import static com.herbron.moodl.Utils.TransferUtils.isBalanceRelated;
+
/**
* Created by Guitoune on 24/04/2018.
*/
@@ -91,12 +95,12 @@ public class TransactionListAdapter extends ArrayAdapter