Updated on 2026-08-14

This commit is contained in:
Tangem 2024-02-15 14:16:47 +03:00
parent 894c5664b3
commit 3399ffbcd2
45 changed files with 101 additions and 70 deletions

View file

@ -7,6 +7,10 @@ plugins {
id("configuration")
}
android {
namespace = "com.tangem.feature.onboarding"
}
dependencies {
/** Core modules */
implementation(project(":common"))

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.tangem.feature.onboarding" />

View file

@ -6,6 +6,10 @@ plugins {
id("configuration")
}
android {
namespace = "com.tangem.feature.referral.data"
}
dependencies {
/** Project */

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.tangem.feature.referral.data" />

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.tangem.feature.referral.domain" />

View file

@ -6,6 +6,10 @@ plugins {
id("configuration")
}
android {
namespace = "com.tangem.feature.referral.presentation"
}
dependencies {
/** Core modules */
implementation(project(":core:analytics"))

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.tangem.feature.referral.presentation" />

View file

@ -7,6 +7,10 @@ plugins {
id("configuration")
}
android {
namespace = "com.tangem.feature.swap.api"
}
dependencies {
/** DI */
implementation(deps.hilt.android)

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.tangem.feature.swap.api" />

View file

@ -6,6 +6,10 @@ plugins {
id("configuration")
}
android {
namespace = "com.tangem.feature.swap.data"
}
dependencies {
/** AndroidX */

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.tangem.feature.swap.data" />

View file

@ -7,6 +7,10 @@ plugins {
id("configuration")
}
android {
namespace = "com.tangem.feature.swap.presentation"
}
dependencies {
/** Core modules */
implementation(projects.core.analytics)

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.tangem.feature.swap.presentation" />

View file

@ -2,4 +2,8 @@ plugins {
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
id("configuration")
}
android {
namespace = "com.tangem.features.tester.api"
}

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.tangem.features.tester.api" />

View file

@ -6,6 +6,10 @@ plugins {
id("configuration")
}
android {
namespace = "com.tangem.feature.tester.impl"
}
dependencies {
/** AndroidX */
implementation(deps.androidx.activity.compose)

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tangem.feature.tester.impl">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity

View file

@ -4,6 +4,10 @@ plugins {
id("configuration")
}
android {
namespace = "com.tangem.features.wallet.api"
}
dependencies {
/** AndroidX */
implementation(deps.androidx.fragment.ktx)

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.tangem.features.wallet.api" />

View file

@ -6,6 +6,10 @@ plugins {
id("configuration")
}
android {
namespace = "com.tangem.feature.wallet.impl"
}
dependencies {
/** AndroidX */
implementation(deps.androidx.activity.compose)

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tangem.feature.wallet.impl">
</manifest>

View file

@ -22,7 +22,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.tangem.core.ui.res.TangemTheme
import com.tangem.feature.wallet.presentation.common.WalletPreviewData
@ -31,8 +30,6 @@ import com.tangem.feature.wallet.presentation.wallet.ui.components.common.Wallet
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toPersistentList
private const val SHORT_SNAP_ELEMENT_COUNT = 50
/**
* Wallets list component
*
@ -56,7 +53,7 @@ internal fun WalletsList(
state = lazyListState,
contentPadding = PaddingValues(horizontal = TangemTheme.dimens.spacing16),
horizontalArrangement = Arrangement.spacedBy(TangemTheme.dimens.spacing8),
flingBehavior = rememberWalletsFlingBehaviour(lazyListState = lazyListState, itemWidth = itemWidth),
flingBehavior = rememberWalletsFlingBehaviour(lazyListState = lazyListState),
) {
items(
items = wallets,
@ -76,17 +73,14 @@ internal fun WalletsList(
/**
* Custom implementation of fling behaviour that overrides 'shortSnapVelocityThreshold'.
* Every user's drag action will similar to a short snap
* if drag offset is less than [SHORT_SNAP_ELEMENT_COUNT] * item width.
*
* @param lazyListState lazy list state
* @param itemWidth list item width
*
* @see rememberSnapFlingBehavior
*/
@OptIn(ExperimentalFoundationApi::class)
@Composable
private fun rememberWalletsFlingBehaviour(lazyListState: LazyListState, itemWidth: Dp): SnapFlingBehavior {
private fun rememberWalletsFlingBehaviour(lazyListState: LazyListState): SnapFlingBehavior {
val snappingLayout = remember(lazyListState) { SnapLayoutInfoProvider(lazyListState) }
val density = LocalDensity.current
val highVelocityApproachSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay()
@ -97,8 +91,6 @@ private fun rememberWalletsFlingBehaviour(lazyListState: LazyListState, itemWidt
lowVelocityAnimationSpec = tween(durationMillis = 1000, easing = LinearEasing),
highVelocityAnimationSpec = highVelocityApproachSpec,
snapAnimationSpec = spring(stiffness = Spring.StiffnessMediumLow),
density = density,
shortSnapVelocityThreshold = itemWidth * SHORT_SNAP_ELEMENT_COUNT,
)
}
}