From 4e61b2aed6dbcad5c59cc11dc03f880195890a66 Mon Sep 17 00:00:00 2001 From: aminecmi Date: Tue, 3 Jan 2023 21:35:21 +0100 Subject: [PATCH] feat: Disable the failing source in the filter sheet. --- .../android/fragments/FilterSheetFragment.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/FilterSheetFragment.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/FilterSheetFragment.kt index 18f9f33..d08f241 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/FilterSheetFragment.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/FilterSheetFragment.kt @@ -4,6 +4,7 @@ import android.content.Context import android.graphics.Color import android.graphics.drawable.Drawable import android.graphics.drawable.GradientDrawable +import android.os.Build import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -165,6 +166,12 @@ class FilterSheetFragment : BottomSheetDialogFragment(), DIAware { selectedChip = c } + c.isEnabled = source.error.isBlank() + + if (source.error.isNotBlank() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + c.tooltipText = source.error + } + sourceGroup.addView(c) }