From 0077156856644dc42b7b98e751e614753510a926 Mon Sep 17 00:00:00 2001 From: therajanmaurya Date: Thu, 29 Sep 2022 17:47:48 +0530 Subject: [PATCH] fix: make title and subtitle nullable --- .../github/therajanmaurya/sweeterror/SweetUIErrorHandler.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sweet-Error/src/main/java/com/github/therajanmaurya/sweeterror/SweetUIErrorHandler.kt b/Sweet-Error/src/main/java/com/github/therajanmaurya/sweeterror/SweetUIErrorHandler.kt index b86492b..735dee1 100644 --- a/Sweet-Error/src/main/java/com/github/therajanmaurya/sweeterror/SweetUIErrorHandler.kt +++ b/Sweet-Error/src/main/java/com/github/therajanmaurya/sweeterror/SweetUIErrorHandler.kt @@ -146,7 +146,7 @@ class SweetUIErrorHandler(private val context: Context, private val view: View) * @param subFeatureName Sub Feature Name * @param featureImage Feature Image */ - fun showSweetCustomErrorUI(featureName: String, subFeatureName: String, + fun showSweetCustomErrorUI(featureName: String?, subFeatureName: String?, featureImage: Int?, featureLayoutUI: View, sweetErrorLayoutUI: View) { featureLayoutUI.visibility = View.GONE sweetErrorLayoutUI.visibility = View.VISIBLE @@ -154,8 +154,8 @@ class SweetUIErrorHandler(private val context: Context, private val view: View) llEmptyUI.visibility = View.GONE llCustomUI.visibility = View.VISIBLE ivCustomFeatureImage.setImageResource(featureImage!!) - tvCustomFeatureName.text = featureName - tvCustomSubFeatureName.text = subFeatureName + featureName?.let { tvCustomFeatureName.text = it } ?: run { tvCustomFeatureName.visibility = View.GONE } + subFeatureName?.let { tvCustomSubFeatureName.text = it } ?: run { tvCustomSubFeatureName.visibility = View.GONE } } /**