From b97b8e7645c337287020b6806f99d44db12f4162 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Wed, 29 Aug 2018 01:11:25 +0200 Subject: [PATCH] Add logos to exchange accounts list --- .idea/assetWizardSettings.xml | 40 ++++++++++++++++++- .../HomeActivityFragments/Summary.java | 4 +- .../ExchangeDescriptionListAdapter.java | 14 +++++++ .../res/drawable/exchange_logo_binance.xml | 13 ++++++ .../res/drawable/exchange_logo_hitbtc.xml | 23 +++++++++++ app/src/main/res/layout/exchange_cell.xml | 5 ++- app/src/main/res/layout/splash_screen.xml | 11 ++--- 7 files changed, 99 insertions(+), 11 deletions(-) create mode 100644 app/src/main/res/drawable/exchange_logo_binance.xml create mode 100644 app/src/main/res/drawable/exchange_logo_hitbtc.xml diff --git a/.idea/assetWizardSettings.xml b/.idea/assetWizardSettings.xml index b34e12f..62e00cc 100644 --- a/.idea/assetWizardSettings.xml +++ b/.idea/assetWizardSettings.xml @@ -13,6 +13,36 @@ + @@ -81,9 +116,10 @@ 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 595e631..9d5ab3f 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 @@ -306,8 +306,8 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface, } else { - TextView appNameTextView = splashLayout.findViewById(R.id.appNameTextView); - appNameTextView.setVisibility(View.VISIBLE); + /*ImageView appNameImageView = splashLayout.findViewById(R.id.appNameImageView); + appNameImageView.setVisibility(View.VISIBLE);*/ animatedLayout.setVisibility(View.GONE); } diff --git a/app/src/main/java/com/herbron/moodl/CustomAdapters/ExchangeDescriptionListAdapter.java b/app/src/main/java/com/herbron/moodl/CustomAdapters/ExchangeDescriptionListAdapter.java index bf33215..aa3fc74 100644 --- a/app/src/main/java/com/herbron/moodl/CustomAdapters/ExchangeDescriptionListAdapter.java +++ b/app/src/main/java/com/herbron/moodl/CustomAdapters/ExchangeDescriptionListAdapter.java @@ -18,6 +18,9 @@ import com.herbron.moodl.R; import java.util.ArrayList; +import static com.herbron.moodl.DataManagers.DatabaseManager.BINANCE_TYPE; +import static com.herbron.moodl.DataManagers.DatabaseManager.HITBTC_TYPE; + public class ExchangeDescriptionListAdapter extends ArrayAdapter { private Context context; @@ -42,10 +45,21 @@ public class ExchangeDescriptionListAdapter extends ArrayAdapter { TextView exchangeNameTextView = convertView.findViewById(R.id.exchange_name); TextView exchangeDescriptionTextView = convertView.findViewById(R.id.exchange_description); ImageView accountOffImageView = convertView.findViewById(R.id.exchange_account_off_imageView); + ImageView exchangeImageView = convertView.findViewById(R.id.exchange_icon_imageView); exchangeNameTextView.setText(exchange.getName()); exchangeDescriptionTextView.setText(exchange.getDescription()); + switch (exchange.getType()) + { + case BINANCE_TYPE: + exchangeImageView.setImageDrawable(context.getResources().getDrawable(R.drawable.exchange_logo_binance)); + break; + case HITBTC_TYPE: + exchangeImageView.setImageDrawable(context.getResources().getDrawable(R.drawable.exchange_logo_hitbtc)); + break; + } + if(!exchange.isEnabled()) { accountOffImageView.setVisibility(View.VISIBLE); diff --git a/app/src/main/res/drawable/exchange_logo_binance.xml b/app/src/main/res/drawable/exchange_logo_binance.xml new file mode 100644 index 0000000..b21e7b1 --- /dev/null +++ b/app/src/main/res/drawable/exchange_logo_binance.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/app/src/main/res/drawable/exchange_logo_hitbtc.xml b/app/src/main/res/drawable/exchange_logo_hitbtc.xml new file mode 100644 index 0000000..da03989 --- /dev/null +++ b/app/src/main/res/drawable/exchange_logo_hitbtc.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/layout/exchange_cell.xml b/app/src/main/res/layout/exchange_cell.xml index 4097a60..776f56e 100644 --- a/app/src/main/res/layout/exchange_cell.xml +++ b/app/src/main/res/layout/exchange_cell.xml @@ -62,7 +62,7 @@ android:id="@+id/exchange_icon_imageView" android:layout_width="56dp" android:layout_height="56dp" - android:layout_marginEnd="@dimen/margin"/> + android:layout_margin="5dp"/> + android:foregroundGravity="center_vertical" + android:layout_marginTop="5dp"> + android:background="@color/colorPrimaryDark" + android:orientation="vertical"> - + android:src="@mipmap/ic_launcher_moodl"/>