From: Damyan Ivanov Date: Fri, 29 Mar 2019 11:30:07 +0000 (+0200) Subject: hide all of the "Last update" text when there was never a successful update X-Git-Tag: v0.9~40 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=b0a3715e2675b4b02deb8697f00e747ce95f002b;p=mobile-ledger.git hide all of the "Last update" text when there was never a successful update --- 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 @@