diff --git a/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Watchlist.java b/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Watchlist.java
index 48a9090..7368714 100644
--- a/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Watchlist.java
+++ b/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Watchlist.java
@@ -69,7 +69,7 @@ public class Watchlist extends Fragment implements CryptocompareNotifierInterfac
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
- view = inflater.inflate(R.layout.fragment_watchlist_homeactivity, container, false);
+ view = inflater.inflate(R.layout.homeactivity_fragment_watchlist, container, false);
refreshLayout = view.findViewById(R.id.swiperefreshwatchlist);
dragLinearLayout = view.findViewById(R.id.linearLayoutWatchlist);
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 0f51a94..71c460c 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
@@ -139,7 +139,7 @@ public class BuyFragment extends CustomRecordFragment {
context = getActivity().getApplicationContext();
calendar = Calendar.getInstance();
- sdf = new SimpleDateFormat(" HH:mm dd/MM/yyyy", Locale.UK);
+ sdf = new SimpleDateFormat("HH:mm dd/MM/yyyy", Locale.UK);
preferenceManager = new PreferencesManager(getContext());
@@ -243,6 +243,7 @@ public class BuyFragment extends CustomRecordFragment {
, note
, fragmentPair.getFrom().equals(fragmentCurrency.getSymbol()) ? fragmentPair.getTo() : fragmentPair.getFrom()
, feeCurrency
+ , ""
, fragmentExchange.getName()
, "b"
, feesCurrencySpinner.getSelectedItemPosition() % 2 == 0 ? "p" : "f");
@@ -261,8 +262,9 @@ public class BuyFragment extends CustomRecordFragment {
, note
, fragmentPair.getFrom().equals(fragmentCurrency.getSymbol()) ? fragmentPair.getTo() : fragmentPair.getFrom()
, feeCurrency
+ , ""
, fragmentExchange.getName()
- , "b"
+ ,"b"
, feesCurrencySpinner.getSelectedItemPosition() % 2 == 0 ? "p" : "f");
}
@@ -378,13 +380,9 @@ public class BuyFragment extends CustomRecordFragment {
private double getFees(String feeCurrency, double amount, double purchasedPrice)
{
- double fees;
+ double fees = 0;
- if(fees_editText.getText().toString().equals(""))
- {
- fees = 0;
- }
- else
+ if(!fees_editText.getText().toString().equals(""))
{
fees = Double.parseDouble(fees_editText.getText().toString());
@@ -534,11 +532,6 @@ public class BuyFragment extends CustomRecordFragment {
}
});
- if(preferenceManager == null)
- {
- preferenceManager = new PreferencesManager(getSecureContext());
- }
-
if(calendar == null)
{
calendar = Calendar.getInstance();
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 3700112..5360546 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
@@ -139,7 +139,7 @@ public class SellFragment extends CustomRecordFragment {
context = getActivity().getApplicationContext();
calendar = Calendar.getInstance();
- sdf = new SimpleDateFormat(" HH:mm dd/MM/yyyy", Locale.UK);
+ sdf = new SimpleDateFormat("HH:mm dd/MM/yyyy", Locale.UK);
preferenceManager = new PreferencesManager(getContext());
@@ -215,6 +215,7 @@ public class SellFragment extends CustomRecordFragment {
, note
, fragmentPair.getFrom().equals(fragmentCurrency.getSymbol()) ? fragmentPair.getTo() : fragmentPair.getFrom()
, feeCurrency
+ , ""
, fragmentExchange.getName()
, "s"
, feesCurrencySpinner.getSelectedItemPosition() % 2 == 0 ? "p" : "f");
@@ -233,8 +234,9 @@ public class SellFragment extends CustomRecordFragment {
, note
, fragmentPair.getFrom().equals(fragmentCurrency.getSymbol()) ? fragmentPair.getTo() : fragmentPair.getFrom()
, feeCurrency
+ , ""
, fragmentExchange.getName()
- , "s"
+ ,"s"
, feesCurrencySpinner.getSelectedItemPosition() % 2 == 0 ? "p" : "f");
}
@@ -350,13 +352,9 @@ public class SellFragment extends CustomRecordFragment {
private double getFees(String feeCurrency, double amount, double purchasedPrice)
{
- double fees;
+ double fees = 0;
- if(fees_editText.getText().toString().equals(""))
- {
- fees = 0;
- }
- else
+ if(!fees_editText.getText().toString().equals(""))
{
fees = Double.parseDouble(fees_editText.getText().toString());
diff --git a/app/src/main/java/com/herbron/moodl/DataManagers/BalanceManager.java b/app/src/main/java/com/herbron/moodl/DataManagers/BalanceManager.java
index b52b7e8..0ad3f03 100644
--- a/app/src/main/java/com/herbron/moodl/DataManagers/BalanceManager.java
+++ b/app/src/main/java/com/herbron/moodl/DataManagers/BalanceManager.java
@@ -79,7 +79,7 @@ public class BalanceManager implements BinanceUpdateNotifierInterface, HitBTCUpd
balanceCounter = 0;
- manualBalances = databaseManager.getAllCurrenciesFromManualCurrency();
+ manualBalances = databaseManager.getAllCurrenciesFromTransactions();
if(binanceManagers.size() > 0)
{
diff --git a/app/src/main/res/drawable/ic_arrow_drop_down_24dp.xml b/app/src/main/res/drawable/ic_arrow_drop_down_24dp.xml
new file mode 100644
index 0000000..d02cb23
--- /dev/null
+++ b/app/src/main/res/drawable/ic_arrow_drop_down_24dp.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_arrow_drop_up_24dp.xml b/app/src/main/res/drawable/ic_arrow_drop_up_24dp.xml
new file mode 100644
index 0000000..017b990
--- /dev/null
+++ b/app/src/main/res/drawable/ic_arrow_drop_up_24dp.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/spinner_background.xml b/app/src/main/res/drawable/spinner_background.xml
index 7246389..a0ea791 100644
--- a/app/src/main/res/drawable/spinner_background.xml
+++ b/app/src/main/res/drawable/spinner_background.xml
@@ -1,46 +1,19 @@
-
+
-
-
-
-
-
-
+
+
+
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
+ android:drawable="@drawable/ic_arrow_drop_down_24dp"/>
diff --git a/app/src/main/res/drawable/spinner_background_header.xml b/app/src/main/res/drawable/spinner_background_header.xml
new file mode 100644
index 0000000..7246389
--- /dev/null
+++ b/app/src/main/res/drawable/spinner_background_header.xml
@@ -0,0 +1,46 @@
+
+
+ -
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout-v21/fragment_watchlist_homeactivity.xml b/app/src/main/res/layout-v21/homeactivity_fragment_watchlist.xml
similarity index 100%
rename from app/src/main/res/layout-v21/fragment_watchlist_homeactivity.xml
rename to app/src/main/res/layout-v21/homeactivity_fragment_watchlist.xml
diff --git a/app/src/main/res/layout/activity_add_exchange.xml b/app/src/main/res/layout/activity_add_exchange.xml
index b0e956c..1b2c011 100644
--- a/app/src/main/res/layout/activity_add_exchange.xml
+++ b/app/src/main/res/layout/activity_add_exchange.xml
@@ -55,7 +55,7 @@
android:layout_marginEnd="12dp"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
- android:background="@drawable/spinner_background"
+ android:background="@drawable/spinner_background_header"
android:gravity="center"
android:textSize="18sp" />
diff --git a/app/src/main/res/layout/activity_record_transaction.xml b/app/src/main/res/layout/activity_record_transaction.xml
index f96a74e..699015d 100644
--- a/app/src/main/res/layout/activity_record_transaction.xml
+++ b/app/src/main/res/layout/activity_record_transaction.xml
@@ -58,7 +58,7 @@
android:id="@+id/coin_autoCompleteTextView"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@drawable/spinner_background"
+ android:background="@drawable/spinner_background_header"
android:textSize="18sp"
android:hint="@string/select_coin"
android:inputType="textNoSuggestions"
@@ -87,7 +87,7 @@
android:layout_weight="1.7"
android:layout_marginEnd="12dp"
android:layout_height="@dimen/spinner_toolbar_height"
- android:background="@drawable/spinner_background"
+ android:background="@drawable/spinner_background_header"
android:hint="@string/select_exchange"
android:inputType="textNoSuggestions"
android:gravity="center"
@@ -98,7 +98,7 @@
android:layout_width="0dp"
android:layout_height="@dimen/spinner_toolbar_height"
android:layout_weight="1.2"
- android:background="@drawable/spinner_background"
+ android:background="@drawable/spinner_background_header"
android:hint="@string/select_pair"
android:inputType="textNoSuggestions"
android:gravity="center"
diff --git a/app/src/main/res/layout/fragment_watchlist_homeactivity.xml b/app/src/main/res/layout/homeactivity_fragment_watchlist.xml
similarity index 100%
rename from app/src/main/res/layout/fragment_watchlist_homeactivity.xml
rename to app/src/main/res/layout/homeactivity_fragment_watchlist.xml