From db013dab1ed1001141529bc7d028a40baec51c45 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Wed, 9 May 2018 02:56:26 +0200 Subject: [PATCH] Hide blank categories in details activity --- .../nauk/moodl/Activities/CurrencyDetailsActivity.java | 3 +++ app/src/main/res/layout/activity_currency_details.xml | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/nauk/moodl/Activities/CurrencyDetailsActivity.java b/app/src/main/java/com/nauk/moodl/Activities/CurrencyDetailsActivity.java index 1e26997..c5f3185 100644 --- a/app/src/main/java/com/nauk/moodl/Activities/CurrencyDetailsActivity.java +++ b/app/src/main/java/com/nauk/moodl/Activities/CurrencyDetailsActivity.java @@ -270,16 +270,19 @@ public class CurrencyDetailsActivity extends AppCompatActivity { .setMovementMethod(LinkMovementMethod.getInstance()); ((TextView) findViewById(R.id.txtViewPercentageCoinEmited)) .setText("Percentage of coin emited : " + numberConformer(currency.getMinedCoinSupply() / currency.getMaxCoinSupply() * 100) + "%"); + if(currency.getMarketCapitalization() != 0) { ((TextView) findViewById(R.id.txtViewMarketCapitalization)) .setText(PlaceholderManager.getValueString(numberConformer(currency.getMarketCapitalization()), this)); + findViewById(R.id.linearMarketCap).setVisibility(View.VISIBLE); } if(currency.getRank() != 0) { ((TextView) findViewById(R.id.txtViewRank)) .setText(String.valueOf(currency.getRank())); + findViewById(R.id.linearRank).setVisibility(View.VISIBLE); } if(currency.getMaxCoinSupply() == 0) diff --git a/app/src/main/res/layout/activity_currency_details.xml b/app/src/main/res/layout/activity_currency_details.xml index 1049560..2fe170c 100644 --- a/app/src/main/res/layout/activity_currency_details.xml +++ b/app/src/main/res/layout/activity_currency_details.xml @@ -447,10 +447,12 @@ android:baselineAligned="false"> + android:layout_weight="0.5" + android:visibility="gone"> + android:layout_weight="0.5" + android:visibility="gone">