From b0a3715e2675b4b02deb8697f00e747ce95f002b Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 29 Mar 2019 13:30:07 +0200 Subject: [PATCH] hide all of the "Last update" text when there was never a successful update --- .../java/net/ktnx/mobileledger/ui/activity/MainActivity.java | 4 +++- app/src/main/res/layout/activity_main.xml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java index dcf653fd..86463aac 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java @@ -298,15 +298,17 @@ public class MainActivity extends ProfileThemedActivity { }); } private void updateLastUpdateDisplay() { + LinearLayout l = findViewById(R.id.transactions_last_update_layout); TextView v = findViewById(R.id.transactions_last_update); Date date = Data.lastUpdateDate.get(); if (date == null) { - v.setText(R.string.transaction_last_update_never); + l.setVisibility(View.INVISIBLE); Log.d("main", "no last update date :("); } else { final String text = DateFormat.getDateTimeInstance().format(date); v.setText(text); + l.setVisibility(View.VISIBLE); Log.d("main", String.format("Date formatted: %s", text)); } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index eef1375e..cce9ad17 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -96,6 +96,7 @@