From dd9f4d21419e6aff6a9c869a8d3695e65813bd88 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Wed, 22 Aug 2018 21:27:58 +0200 Subject: [PATCH] Rework labels in transaction history - Summary now updates after importing data - Fix crash when exiting the details activity too quickly --- .idea/assetWizardSettings.xml | 4 +- .../ChartsFragment.java | 18 ++--- .../InformationFragment.java | 27 ++++--- .../TransactionsFragment.java | 8 -- .../moodl/Activities/HomeActivity.java | 10 +-- .../MarketCapitalization.java | 8 +- .../HomeActivityFragments/Summary.java | 10 +-- .../Activities/RecordTransactionActivity.java | 29 ++----- .../BuyFragment.java | 11 ++- .../SellFragment.java | 10 +-- .../moodl/Activities/SettingsActivity.java | 4 + .../CustomAdapters/PairRecordListAdapter.java | 4 +- .../CustomAdapters/TradeListAdapter.java | 65 ---------------- .../TransactionListAdapter.java | 42 ++++++++++- .../CurrencyData/CurrencyCardview.java | 25 +++---- .../moodl/DataManagers/DatabaseManager.java | 8 +- .../PlaceholderUtils.java} | 25 ++++++- .../herbron/moodl/Utils/TransferUtils.java | 42 +++++++++++ .../drawable/ic_arrow_downward_white_24dp.xml | 5 ++ .../drawable/ic_arrow_upward_white_24dp.xml | 5 ++ app/src/main/res/layout/custom_trade_row.xml | 75 +++++++++---------- .../res/layout/custom_transaction_row.xml | 22 ++++-- app/src/main/res/values-fr/strings.xml | 10 +-- app/src/main/res/values/strings.xml | 6 ++ 24 files changed, 250 insertions(+), 223 deletions(-) delete mode 100644 app/src/main/java/com/herbron/moodl/CustomAdapters/TradeListAdapter.java rename app/src/main/java/com/herbron/moodl/{PlaceholderManager.java => Utils/PlaceholderUtils.java} (89%) create mode 100644 app/src/main/java/com/herbron/moodl/Utils/TransferUtils.java create mode 100644 app/src/main/res/drawable/ic_arrow_downward_white_24dp.xml create mode 100644 app/src/main/res/drawable/ic_arrow_upward_white_24dp.xml 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 { View convertView = LayoutInflater.from(getContext()).inflate(R.layout.custom_transaction_row, parent, false); - TextView amountTxtView = convertView.findViewById(R.id.amountPurchased); - TextView valueTxtView = convertView.findViewById(R.id.puchasedValue); - TextView dateTxtView = convertView.findViewById(R.id.purchaseDate); + TextView topLeftTextView = convertView.findViewById(R.id.transactionTLTV); + TextView bottomLeftTextView = convertView.findViewById(R.id.transactionBLTV); + TextView dateTxtView = convertView.findViewById(R.id.transactionDateTextView); + TextView amountTxtView = convertView.findViewById(R.id.transactionAmountTextView); amountTxtView.setText(String.valueOf(transaction.getAmount())); - valueTxtView.setText(numberConformer(transaction.getPrice() * transaction.getAmount())); dateTxtView.setText(getDateFromTimestamp(transaction.getTimestamp())); LinearLayout deleteLayout = convertView.findViewById(R.id.deleteTransactionLayout); @@ -135,12 +139,40 @@ public class TransactionListAdapter extends ArrayAdapter { { case "b": transactionIndicator.setBackgroundColor(context.getResources().getColor(R.color.increaseCandle)); + topLeftTextView.setText(transaction.getSource()); + bottomLeftTextView.setText(PlaceholderUtils.getToPairString(transaction.getSymbol(), transaction.getSymPair(), context)); break; case "s": transactionIndicator.setBackgroundColor(context.getResources().getColor(R.color.decreaseCandle)); + topLeftTextView.setText(transaction.getSource()); + bottomLeftTextView.setText(PlaceholderUtils.getToPairString(transaction.getSymPair(), transaction.getSymbol(), context)); break; case "t": transactionIndicator.setBackgroundColor(context.getResources().getColor(R.color.blue)); + + if(isBalanceRelated(transaction.getDestination()) && isBalanceRelated(transaction.getSource())) + { + topLeftTextView.setText(context.getString(R.string.transferText)); + + bottomLeftTextView.setText(PlaceholderUtils.getFromToString(TransferUtils.getLabelFor(context, transaction.getSource()), TransferUtils.getLabelFor(context, transaction.getDestination()), context)); + } + else + { + if(isBalanceRelated(transaction.getDestination())) + { + topLeftTextView.setText(context.getString(R.string.depositText)); + bottomLeftTextView.setText(PlaceholderUtils.getFromString(TransferUtils.getLabelFor(context, transaction.getSource()), context)); + } + else + { + if(isBalanceRelated(transaction.getSource())) + { + topLeftTextView.setText(context.getString(R.string.withdrawText)); + bottomLeftTextView.setText(PlaceholderUtils.getToString(TransferUtils.getLabelFor(context, transaction.getDestination()), context)); + } + } + } + break; } @@ -149,6 +181,8 @@ public class TransactionListAdapter extends ArrayAdapter { return convertView; } + + private void setupSwipeView(View view) { SwipeLayout swipeLayout = view.findViewById(R.id.swipeLayout); 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 f660b1b..87f3e94 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 @@ -14,7 +14,6 @@ import android.support.v4.content.ContextCompat; import android.support.v7.widget.CardView; import android.view.LayoutInflater; import android.view.View; -import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; @@ -29,7 +28,7 @@ import com.herbron.moodl.CurrencyInfoUpdateNotifierInterface; import com.herbron.moodl.DataManagers.DatabaseManager; import com.herbron.moodl.DataManagers.PreferencesManager; 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; @@ -219,18 +218,18 @@ public class CurrencyCardview extends CardView implements CurrencyInfoUpdateNoti private void updateCardViewInfos(Currency currency) { ((TextView) findViewById(R.id.currencyFluctuationTextView)) - .setText(PlaceholderManager.getValueParenthesisString(numberConformer(currency.getDayFluctuation()), getContext())); + .setText(PlaceholderUtils.getValueParenthesisString(numberConformer(currency.getDayFluctuation()), getContext())); ((TextView) findViewById(R.id.currencyValueTextView)) - .setText(PlaceholderManager.getValueString(numberConformer(currency.getValue()), getContext())); + .setText(PlaceholderUtils.getValueString(numberConformer(currency.getValue()), getContext())); ((ImageView) findViewById(R.id.currencyIcon)) .setImageBitmap(currency.getIcon()); ((TextView) findViewById(R.id.currencyNameTextView)) .setText(currency.getName()); ((TextView) findViewById(R.id.currencySymbolTextView)) - .setText(PlaceholderManager.getSymbolString(currency.getSymbol(), getContext())); + .setText(PlaceholderUtils.getSymbolString(currency.getSymbol(), getContext())); ((TextView) findViewById(R.id.currencyFluctuationPercentageTextView)) - .setText(PlaceholderManager.getPercentageString(numberConformer(currency.getDayFluctuationPercentage()), getContext())); + .setText(PlaceholderUtils.getPercentageString(numberConformer(currency.getDayFluctuationPercentage()), getContext())); Drawable arrowDrawable = ((ImageView) findViewById(R.id.detailsArrow)).getDrawable(); @@ -257,22 +256,22 @@ public class CurrencyCardview extends CardView implements CurrencyInfoUpdateNoti double percentage = value / totalValue * 100; ((TextView) findViewById(R.id.currencyValueOwnedTextView)) - .setText(PlaceholderManager.getValueParenthesisString(numberConformer(currency.getValue() * currency.getBalance()), getContext())); + .setText(PlaceholderUtils.getValueParenthesisString(numberConformer(currency.getValue() * currency.getBalance()), getContext())); ((TextView) findViewById(R.id.currencyFluctuationTextView)) - .setText(PlaceholderManager.getValueParenthesisString(numberConformer(currency.getDayFluctuation()), getContext())); + .setText(PlaceholderUtils.getValueParenthesisString(numberConformer(currency.getDayFluctuation()), getContext())); ((TextView) findViewById(R.id.currencyValueTextView)) - .setText(PlaceholderManager.getValueString(numberConformer(currency.getValue()), getContext())); + .setText(PlaceholderUtils.getValueString(numberConformer(currency.getValue()), getContext())); ((ImageView) findViewById(R.id.currencyIcon)) .setImageBitmap(currency.getIcon()); ((TextView) findViewById(R.id.currencyNameTextView)) .setText(currency.getName()); ((TextView) findViewById(R.id.currencySymbolTextView)) - .setText(PlaceholderManager.getSymbolString(currency.getSymbol(), getContext())); + .setText(PlaceholderUtils.getSymbolString(currency.getSymbol(), getContext())); ((TextView) findViewById(R.id.currencyOwnedTextView)) - .setText(PlaceholderManager.getBalanceString(numberConformer(currency.getBalance()), currency.getSymbol(), getContext())); + .setText(PlaceholderUtils.getBalanceString(numberConformer(currency.getBalance()), currency.getSymbol(), getContext())); ((TextView) findViewById(R.id.currencyFluctuationPercentageTextView)) - .setText(PlaceholderManager.getPercentageString(numberConformer(currency.getDayFluctuationPercentage()), getContext())); + .setText(PlaceholderUtils.getPercentageString(numberConformer(currency.getDayFluctuationPercentage()), getContext())); Drawable arrowDrawable = ((ImageView) findViewById(R.id.detailsArrow)).getDrawable(); arrowDrawable.mutate(); @@ -290,7 +289,7 @@ public class CurrencyCardview extends CardView implements CurrencyInfoUpdateNoti progressBarDrawable.invalidateSelf(); ((ProgressBar) findViewById(R.id.currencyPortfolioDominance)).setProgress((int) Math.round(percentage)); - ((TextView) findViewById(R.id.percentageOwnedTextView)).setText(PlaceholderManager.getPercentageString(numberConformer(percentage), getContext())); + ((TextView) findViewById(R.id.percentageOwnedTextView)).setText(PlaceholderUtils.getPercentageString(numberConformer(percentage), getContext())); if(isBalanceHidden) { diff --git a/app/src/main/java/com/herbron/moodl/DataManagers/DatabaseManager.java b/app/src/main/java/com/herbron/moodl/DataManagers/DatabaseManager.java index 45bfa28..7f50807 100644 --- a/app/src/main/java/com/herbron/moodl/DataManagers/DatabaseManager.java +++ b/app/src/main/java/com/herbron/moodl/DataManagers/DatabaseManager.java @@ -26,6 +26,8 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import static com.herbron.moodl.Utils.TransferUtils.isBalanceRelated; + /** * Created by Guitoune on 14/01/2018. */ @@ -672,12 +674,6 @@ public class DatabaseManager extends SQLiteOpenHelper{ return currencyList; } - private boolean isBalanceRelated(String str) - { - Set set = new HashSet<>(Arrays.asList(TransferFragment.EXCHANGE_CODE, TransferFragment.WALLET_CODE)); - return set.contains(str); - } - public Transaction getCurrencyTransactionById(int id) { String searchQuerry = "SELECT * FROM " + TABLE_MANUAL_TRANSACTIONS + " WHERE " + KEY_TRANSACTION_ID + "='" + id + "'"; diff --git a/app/src/main/java/com/herbron/moodl/PlaceholderManager.java b/app/src/main/java/com/herbron/moodl/Utils/PlaceholderUtils.java similarity index 89% rename from app/src/main/java/com/herbron/moodl/PlaceholderManager.java rename to app/src/main/java/com/herbron/moodl/Utils/PlaceholderUtils.java index b3ad52a..085b67c 100644 --- a/app/src/main/java/com/herbron/moodl/PlaceholderManager.java +++ b/app/src/main/java/com/herbron/moodl/Utils/PlaceholderUtils.java @@ -1,8 +1,9 @@ -package com.herbron.moodl; +package com.herbron.moodl.Utils; import android.content.Context; import com.herbron.moodl.DataManagers.PreferencesManager; +import com.herbron.moodl.R; import java.util.ArrayList; import java.util.List; @@ -11,7 +12,7 @@ import java.util.List; * Created by Tiji on 19/04/2018. */ -public class PlaceholderManager { +public class PlaceholderUtils { public static String getValueString(String value, android.content.Context context) { @@ -182,4 +183,24 @@ public class PlaceholderManager { { return context.getResources().getString(R.string.timestampPlaceholder, date); } + + public static String getToString(String to, android.content.Context context) + { + return context.getResources().getString(R.string.toPlaceholder, to); + } + + public static String getFromString(String from, android.content.Context context) + { + return context.getResources().getString(R.string.fromPlaceholder, from); + } + + public static String getFromToString(String from, String to, android.content.Context context) + { + return context.getResources().getString(R.string.fromToPlaceholder, from, to); + } + + public static String getToPairString(String from, String to, Context context) + { + return context.getResources().getString(R.string.toPairPlaceholder, from, to); + } } diff --git a/app/src/main/java/com/herbron/moodl/Utils/TransferUtils.java b/app/src/main/java/com/herbron/moodl/Utils/TransferUtils.java new file mode 100644 index 0000000..93854af --- /dev/null +++ b/app/src/main/java/com/herbron/moodl/Utils/TransferUtils.java @@ -0,0 +1,42 @@ +package com.herbron.moodl.Utils; + +import android.content.Context; + +import com.herbron.moodl.Activities.RecordTransactionFragments.TransferFragment; +import com.herbron.moodl.R; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class TransferUtils { + + public static boolean isBalanceRelated(String str) + { + Set set = new HashSet<>(Arrays.asList(TransferFragment.EXCHANGE_CODE, TransferFragment.WALLET_CODE)); + return set.contains(str); + } + + public static String getLabelFor(Context context, String str) + { + switch (str) + { + case "stra:e": + return context.getResources().getStringArray(R.array.from_transfer_options_string_array)[0].toLowerCase(); + case "stra:mw": + return context.getResources().getStringArray(R.array.from_transfer_options_string_array)[1].toLowerCase(); + case "stra:m": + return context.getResources().getStringArray(R.array.from_transfer_options_string_array)[2].toLowerCase(); + case "stra:smew": + return context.getResources().getStringArray(R.array.from_transfer_options_string_array)[3].toLowerCase(); + case "stra:a": + return context.getResources().getStringArray(R.array.from_transfer_options_string_array)[4].toLowerCase(); + case "stra:unk": + return context.getResources().getStringArray(R.array.from_transfer_options_string_array)[5].toLowerCase(); + case "stra:fo": + return context.getResources().getStringArray(R.array.from_transfer_options_string_array)[6].toLowerCase(); + } + + return null; + } +} diff --git a/app/src/main/res/drawable/ic_arrow_downward_white_24dp.xml b/app/src/main/res/drawable/ic_arrow_downward_white_24dp.xml new file mode 100644 index 0000000..4c58652 --- /dev/null +++ b/app/src/main/res/drawable/ic_arrow_downward_white_24dp.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_arrow_upward_white_24dp.xml b/app/src/main/res/drawable/ic_arrow_upward_white_24dp.xml new file mode 100644 index 0000000..fee89d2 --- /dev/null +++ b/app/src/main/res/drawable/ic_arrow_upward_white_24dp.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/layout/custom_trade_row.xml b/app/src/main/res/layout/custom_trade_row.xml index 3298b26..46e247e 100644 --- a/app/src/main/res/layout/custom_trade_row.xml +++ b/app/src/main/res/layout/custom_trade_row.xml @@ -2,7 +2,8 @@ + android:orientation="vertical" + android:background="#ffffffff"> - + android:layout_height="match_parent" + android:orientation="horizontal" + android:padding="5dp"> - - + android:layout_height="match_parent" + android:layout_weight="0.5" + android:orientation="vertical"> - + - + - - + + - + - + - diff --git a/app/src/main/res/layout/custom_transaction_row.xml b/app/src/main/res/layout/custom_transaction_row.xml index 67e3c1b..ca0f10c 100644 --- a/app/src/main/res/layout/custom_transaction_row.xml +++ b/app/src/main/res/layout/custom_transaction_row.xml @@ -79,13 +79,13 @@ android:orientation="vertical"> @@ -99,10 +99,20 @@ android:orientation="vertical"> + android:id="@+id/transactionAmountTextView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end" + android:gravity="end" + android:textSize="15dp"/> + + diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 117f162..6fbc86f 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -6,7 +6,7 @@ Monnaie par défaut Achat Vente - Transfère + Transfert Enregistrer Réglages des échanges Activer la synchronisation @@ -118,19 +118,19 @@ - Site d'échange + Site d\'échange Mon portefeuille Minage - Le portefeuille de quelqu'un d'autre + Le portefeuille de quelqu\'un d\'autre Airdrop Autre / Inconnu Fork - Site d'échange + Site d\'échange Mon portefeuille - Le portefeuille de quelqu'un d'autre + Le portefeuille de quelqu\'un d\'autre Autre / Inconnu diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e45d473..581f285 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -299,5 +299,11 @@ This transaction is not valid Deduct from holdings Add to holdings + Withdraw + Deposit + From %1$s to %2$s + From %1$s + To %1$s + %1$s to %2$s