From 340e8ca82f9a6a1b6147054988998770d03b6d0f Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Tue, 5 Nov 2019 01:51:00 +0100 Subject: [PATCH] Show the header when the history is empty (#2148) --- .../vrbrowser/ui/views/HistoryView.java | 3 +- app/src/main/res/layout/bookmarks.xml | 58 ++++++++-------- app/src/main/res/layout/bookmarks_narrow.xml | 7 +- app/src/main/res/layout/bookmarks_wide.xml | 7 +- app/src/main/res/layout/history.xml | 66 +++++++++---------- app/src/main/res/layout/history_narrow.xml | 10 +-- app/src/main/res/layout/history_wide.xml | 10 +-- 7 files changed, 69 insertions(+), 92 deletions(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/HistoryView.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/HistoryView.java index e94e1c784..bcc344a22 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/HistoryView.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/HistoryView.java @@ -277,14 +277,13 @@ private void updateHistory() { date.set(Calendar.SECOND, 0); date.set(Calendar.MILLISECOND, 0); - long currentTime = System.currentTimeMillis(); long todayLimit = date.getTimeInMillis(); long yesterdayLimit = todayLimit - SystemUtils.ONE_DAY_MILLIS; long oneWeekLimit = todayLimit - SystemUtils.ONE_WEEK_MILLIS; SessionStore.get().getHistoryStore().getDetailedHistory().thenAcceptAsync((items) -> { List orderedItems = items.stream() - .sorted(Comparator.comparing((VisitInfo mps) -> mps.getVisitTime()) + .sorted(Comparator.comparing(VisitInfo::getVisitTime) .reversed()) .collect(Collectors.toList()); diff --git a/app/src/main/res/layout/bookmarks.xml b/app/src/main/res/layout/bookmarks.xml index dee36fd90..3e34adb8c 100644 --- a/app/src/main/res/layout/bookmarks.xml +++ b/app/src/main/res/layout/bookmarks.xml @@ -47,6 +47,34 @@ android:paddingTop="30dp" android:paddingBottom="30dp"> + + + + - - - - - - - @@ -41,7 +36,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - app:visibleGone="@{isNarrow && !isLoading && !isEmpty}"> + app:visibleGone="@{isNarrow}"> - - - @@ -40,7 +35,7 @@ + app:visibleGone="@{!isNarrow}"> + + + + - - - - - - - @@ -41,7 +36,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - app:visibleGone="@{isNarrow && !isLoading && !isEmpty}"> + app:visibleGone="@{isNarrow}"> + android:textStyle="bold" + android:enabled="@{!isEmpty}"/> - - - @@ -41,7 +36,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - app:visibleGone="@{!isNarrow && !isLoading && !isEmpty}"> + app:visibleGone="@{!isNarrow}"> + android:textStyle="bold" + android:enabled="@{!isEmpty}"/>