]> git.ktnx.net Git - mobile-ledger.git/commitdiff
hide all of the "Last update" text when there was never a successful update
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 29 Mar 2019 11:30:07 +0000 (13:30 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 29 Mar 2019 11:30:07 +0000 (13:30 +0200)
app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
app/src/main/res/layout/activity_main.xml

index dcf653fd4fc761ada654ba852181f5b9d8308d29..86463aac20c22bc34d7f50ec4cec5fc00ee74541 100644 (file)
@@ -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));
         }
     }
index eef1375e453fa1fd16fcae0725bbbbd4a684c325..cce9ad17949b4911359b71090b9b3eccf4347f05 100644 (file)
@@ -96,6 +96,7 @@
                     </LinearLayout>
 
                     <LinearLayout
+                        android:id="@+id/transactions_last_update_layout"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:elevation="24dp"