From 42ea67b5b8b24f800afa6049d60372c39850467f Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Mon, 24 Jun 2024 16:16:21 +0200 Subject: [PATCH] [Oztechan/CCC#3591] Remove set and get navigation results --- .../android/ui/mobile/util/ViewExtensions.kt | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/android/ui/mobile/src/main/kotlin/com/oztechan/ccc/android/ui/mobile/util/ViewExtensions.kt b/android/ui/mobile/src/main/kotlin/com/oztechan/ccc/android/ui/mobile/util/ViewExtensions.kt index cc5ba643d0..077759904a 100644 --- a/android/ui/mobile/src/main/kotlin/com/oztechan/ccc/android/ui/mobile/util/ViewExtensions.kt +++ b/android/ui/mobile/src/main/kotlin/com/oztechan/ccc/android/ui/mobile/util/ViewExtensions.kt @@ -19,9 +19,6 @@ import androidx.core.content.ContextCompat import androidx.core.view.children import androidx.core.view.isGone import androidx.core.view.isVisible -import androidx.fragment.app.Fragment -import androidx.navigation.fragment.findNavController -import co.touchlab.kermit.Logger import com.github.submob.scopemob.castTo import com.oztechan.ccc.android.core.ad.AdManager import com.oztechan.ccc.android.core.ad.BannerAdView @@ -73,32 +70,6 @@ fun View.animateHeight(startHeight: Int, endHeight: Int) { startAnimation(animation) } -fun Fragment.getNavigationResult( - key: String, - destinationId: Int -) = try { - findNavController() - .getBackStackEntry(destinationId) - .savedStateHandle - .getLiveData(key) -} catch (e: IllegalArgumentException) { - Logger.e(e) { "$destinationId is not found in the backstack when getting navigation result for key $key" } - null -} - -fun Fragment.setNavigationResult( - destinationId: Int, - result: T, - key: String -) = try { - findNavController() - .getBackStackEntry(destinationId) - .savedStateHandle - .set(key, result) -} catch (e: IllegalArgumentException) { - Logger.e(e) { "$destinationId is not found in the backstack when setting navigation result for key $key" } -} - fun View?.visibleIf(visible: Boolean, bringFront: Boolean = false) = this?.apply { if (visible) { isVisible = true