From 01ff3af63fd3bc3b572906eeb9ba9da87f0d4ebe Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 27 Dec 2020 10:44:08 -0500 Subject: [PATCH] Add error state to chapter download icons --- .../tachiyomi/ui/manga/chapter/ChapterDownloadView.kt | 7 ++++++- app/src/main/res/drawable/ic_error_outline_24dp.xml | 9 +++++++++ app/src/main/res/layout/chapter_download_view.xml | 10 +++++++--- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable/ic_error_outline_24dp.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterDownloadView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterDownloadView.kt index 15848c0f9..3e504d07d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterDownloadView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterDownloadView.kt @@ -19,11 +19,16 @@ class ChapterDownloadView @JvmOverloads constructor(context: Context, attrs: Att } fun setState(state: Download.State) { - binding.downloadIconBorder.isVisible = state == Download.State.NOT_DOWNLOADED || state == Download.State.ERROR + binding.downloadIconBorder.isVisible = state == Download.State.NOT_DOWNLOADED binding.downloadIcon.isVisible = state == Download.State.NOT_DOWNLOADED || state == Download.State.DOWNLOADING binding.downloadProgress.isVisible = state == Download.State.DOWNLOADING || state == Download.State.QUEUE + // TODO: show actual download progress binding.downloadedIcon.isVisible = state == Download.State.DOWNLOADED + + binding.errorIcon.isVisible = state == Download.State.ERROR } + + // TODO: onClick actions } diff --git a/app/src/main/res/drawable/ic_error_outline_24dp.xml b/app/src/main/res/drawable/ic_error_outline_24dp.xml new file mode 100644 index 000000000..99fa93de4 --- /dev/null +++ b/app/src/main/res/drawable/ic_error_outline_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout/chapter_download_view.xml b/app/src/main/res/layout/chapter_download_view.xml index 980b39232..236b0176c 100644 --- a/app/src/main/res/layout/chapter_download_view.xml +++ b/app/src/main/res/layout/chapter_download_view.xml @@ -43,8 +43,12 @@ app:tint="@color/material_on_surface_emphasis_medium" tools:ignore="ContentDescription" /> - - - +