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 dcf653f..86463aa 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 eef1375..cce9ad1 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"