From 20387612dbde0f069337693c52362f184e967fec Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 28 Feb 2020 13:00:48 +0200 Subject: [PATCH] Journal entry list: mark malformed entries with a bug icon. This is an indication that an entry failed to parse. --- .../syncadapter/ui/journalviewer/ListEntriesFragment.kt | 6 ++++++ app/src/main/res/layout/journal_viewer_list_item.xml | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/app/src/main/java/com/etesync/syncadapter/ui/journalviewer/ListEntriesFragment.kt b/app/src/main/java/com/etesync/syncadapter/ui/journalviewer/ListEntriesFragment.kt index 16d5df9d..16cde046 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/journalviewer/ListEntriesFragment.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/journalviewer/ListEntriesFragment.kt @@ -104,6 +104,12 @@ class ListEntriesFragment : ListFragment(), AdapterView.OnItemClickListener { val info = journalEntity!!.info setJournalEntryView(v, info, entryEntity!!.content) + val entryError = data.select(EntryErrorEntity::class.java).where(EntryErrorEntity.ENTRY.eq(entryEntity)).limit(1).get().firstOrNull() + if (entryError != null) { + val errorIcon = v.findViewById(R.id.error) as ImageView + errorIcon.visibility = View.VISIBLE + } + return v } } diff --git a/app/src/main/res/layout/journal_viewer_list_item.xml b/app/src/main/res/layout/journal_viewer_list_item.xml index d8dbffc5..81cc3fb3 100644 --- a/app/src/main/res/layout/journal_viewer_list_item.xml +++ b/app/src/main/res/layout/journal_viewer_list_item.xml @@ -31,4 +31,11 @@ tools:text="Subtitle"/> + + \ No newline at end of file