From 8538a8c07da313da48cc510cb84e19e2729db4ff Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Thu, 23 Jul 2026 17:09:27 -0400 Subject: [PATCH] chore: remove unused libs/network/exchange module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The legacy libs/network/exchange module is dead — nothing depends on it now that exchange logic lives in the opencode services. Drop the module, its settings include, and the stale ui:components dependency on it. Also migrate BottomBarContainer's delay() calls to the Duration-based overload to clear the deprecation on the Long form. --- libs/network/exchange/.gitignore | 1 - libs/network/exchange/build.gradle.kts | 19 ------ .../com/getcode/network/exchange/Exchange.kt | 63 ------------------- settings.gradle.kts | 1 - ui/components/build.gradle.kts | 1 - .../ui/components/bars/BottomBarContainer.kt | 7 ++- 6 files changed, 4 insertions(+), 88 deletions(-) delete mode 100644 libs/network/exchange/.gitignore delete mode 100644 libs/network/exchange/build.gradle.kts delete mode 100644 libs/network/exchange/src/main/kotlin/com/getcode/network/exchange/Exchange.kt diff --git a/libs/network/exchange/.gitignore b/libs/network/exchange/.gitignore deleted file mode 100644 index 42afabfd2a..0000000000 --- a/libs/network/exchange/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/libs/network/exchange/build.gradle.kts b/libs/network/exchange/build.gradle.kts deleted file mode 100644 index 650284d0cc..0000000000 --- a/libs/network/exchange/build.gradle.kts +++ /dev/null @@ -1,19 +0,0 @@ -plugins { - alias(libs.plugins.flipcash.android.library.compose) -} - -android { - namespace = "${Gradle.codeNamespace}.libs.exchange" -} - -dependencies { - implementation(project(":libs:currency")) - - implementation(libs.bundles.kotlinx.serialization) - implementation(libs.kotlinx.datetime) - implementation(libs.bundles.hilt) - - androidTestImplementation(libs.androidx.junit) - androidTestImplementation(libs.junit) - androidTestImplementation(libs.androidx.test.runner) -} diff --git a/libs/network/exchange/src/main/kotlin/com/getcode/network/exchange/Exchange.kt b/libs/network/exchange/src/main/kotlin/com/getcode/network/exchange/Exchange.kt deleted file mode 100644 index 9331fa80b1..0000000000 --- a/libs/network/exchange/src/main/kotlin/com/getcode/network/exchange/Exchange.kt +++ /dev/null @@ -1,63 +0,0 @@ -package com.getcode.network.exchange - -import androidx.compose.runtime.ProvidableCompositionLocal -import androidx.compose.runtime.staticCompositionLocalOf -import com.getcode.model.CurrencyCode -import com.getcode.model.Rate -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.emptyFlow - -val LocalExchange: ProvidableCompositionLocal = staticCompositionLocalOf { ExchangeNull() } - -interface Exchange { - val localRate: Rate - fun observeLocalRate(): Flow - - val entryRate: Rate - fun observeEntryRate(): Flow - - fun rates(): Map - fun observeRates(): Flow> - - suspend fun fetchRatesIfNeeded() - - fun rateFor(currencyCode: CurrencyCode): Rate? - - fun rateForUsd(): Rate? -} - -class ExchangeNull : Exchange { - override val localRate: Rate - get() = Rate.oneToOne - - override val entryRate: Rate - get() = Rate.oneToOne - - - override fun observeLocalRate(): Flow { - return emptyFlow() - } - - override fun observeEntryRate(): Flow { - return emptyFlow() - } - - override fun rates(): Map { - return emptyMap() - } - - override fun observeRates(): Flow> { - return emptyFlow() - } - - override suspend fun fetchRatesIfNeeded() = Unit - - override fun rateFor(currencyCode: CurrencyCode): Rate? { - return null - } - - override fun rateForUsd(): Rate? { - return null - } - -} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index bc5f01db30..33d3091fc5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -153,7 +153,6 @@ include( ":libs:logging", ":libs:messaging", ":libs:models", - ":libs:network:exchange", ":libs:opengraph", ":libs:network:coinbase:onramp", diff --git a/ui/components/build.gradle.kts b/ui/components/build.gradle.kts index 8b30a1f903..08cc1d2383 100644 --- a/ui/components/build.gradle.kts +++ b/ui/components/build.gradle.kts @@ -19,7 +19,6 @@ dependencies { implementation(project(":libs:currency")) implementation(project(":libs:messaging")) implementation(project(":libs:models")) - implementation(project(":libs:network:exchange")) implementation(project(":libs:network:connectivity:public")) implementation(project(":libs:opengraph")) implementation(project(":libs:vibrator:public")) diff --git a/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt b/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt index a34113f46d..eb98d8a08a 100644 --- a/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt +++ b/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt @@ -66,6 +66,7 @@ import com.getcode.ui.theme.CodeButton import com.getcode.util.resources.R import kotlinx.coroutines.delay import kotlinx.coroutines.launch +import kotlin.time.Duration.Companion.milliseconds @Composable fun BottomBarContainer(barMessages: BarMessages, onShown: (BottomBarManager.BottomBarMessage) -> Unit = {}) { @@ -82,7 +83,7 @@ fun BottomBarContainer(barMessages: BarMessages, onShown: (BottomBarManager.Bott BottomBarManager.setMessageShown(bottomBarMessageDismissId) bottomBarVisibleState.targetState = false - delay(300.scaled(animationScale)) + delay(300.scaled(animationScale).milliseconds) if (fromTimeout) { dismissingMessage?.onTimeout?.invoke() } else { @@ -93,7 +94,7 @@ fun BottomBarContainer(barMessages: BarMessages, onShown: (BottomBarManager.Bott // handle changes in visible state LaunchedEffect(bottomBarVisibleState) { if (!bottomBarVisibleState.targetState && !bottomBarVisibleState.currentState) { - delay(50.scaled(animationScale)) + delay(50.scaled(animationScale).milliseconds) bottomBarVisibleState.targetState = bottomBarMessage != null if (bottomBarMessageDismissId == bottomBarMessage?.id) { @@ -105,7 +106,7 @@ fun BottomBarContainer(barMessages: BarMessages, onShown: (BottomBarManager.Bott // handle provided timeout duration; triggering onClose with no action LaunchedEffect(bottomBarMessage) { bottomBarMessage?.timeoutSeconds?.let { - delay(it * 1000L) + delay((it * 1000L).milliseconds) onClose(SelectedBottomBarAction(-1), true) } }