From 414b1a8344c573d47eece0e35f0bed04cce79159 Mon Sep 17 00:00:00 2001 From: Stypox Date: Thu, 21 Nov 2024 13:14:19 +0100 Subject: [PATCH] Remove unused methods in EmptyStateUtil --- .../newpipe/ui/emptystate/EmptyStateUtil.kt | 42 ------------------- 1 file changed, 42 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/ui/emptystate/EmptyStateUtil.kt b/app/src/main/java/org/schabi/newpipe/ui/emptystate/EmptyStateUtil.kt index 765ef2e6b..422fb69fc 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/emptystate/EmptyStateUtil.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/emptystate/EmptyStateUtil.kt @@ -2,14 +2,9 @@ package org.schabi.newpipe.ui.emptystate -import androidx.annotation.StringRes -import androidx.compose.runtime.MutableState -import androidx.compose.runtime.State import androidx.compose.ui.platform.ComposeView import androidx.compose.ui.platform.ViewCompositionStrategy -import androidx.compose.ui.res.stringResource import org.schabi.newpipe.ui.theme.AppTheme -import androidx.compose.runtime.mutableStateOf as composeRuntimeMutableStateOf @JvmOverloads fun ComposeView.setEmptyStateComposable( @@ -25,40 +20,3 @@ fun ComposeView.setEmptyStateComposable( } } } - -@JvmOverloads -fun ComposeView.setEmptyStateComposable( - spec: State, - strategy: ViewCompositionStrategy = ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed, -) = apply { - setViewCompositionStrategy(strategy) - setContent { - AppTheme { - EmptyStateComposable( - spec = spec.value, - ) - } - } -} - -/** - * Used in Java land to bridge the [MutableState] API. - */ -fun mutableStateOf(param: T): MutableState { - return composeRuntimeMutableStateOf(param) -} - -/** - * Used in Java land to modify [EmptyStateSpec] properties. - * TODO: remove after Kotlin migration - */ -class EmptyStateSpecBuilder(private var spec: EmptyStateSpec) { - - fun descriptionText(@StringRes stringRes: Int) = apply { - spec = spec.copy( - descriptionText = { stringResource(id = stringRes) } - ) - } - - fun build() = spec -}