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

@ -9,6 +9,10 @@ plugins {
id("configuration") id("configuration")
} }
android {
namespace = "com.tangem.wallet"
}
configurations.all { configurations.all {
exclude(group = "org.bouncycastle", module = "bcprov-jdk15to18") exclude(group = "org.bouncycastle", module = "bcprov-jdk15to18")
exclude(group = "com.github.komputing.kethereum") exclude(group = "com.github.komputing.kethereum")

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools">
package="com.tangem.wallet">
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.NFC" /> <uses-permission android:name="android.permission.NFC" />

View file

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

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest package="com.tangem.datasource" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />

View file

@ -6,6 +6,10 @@ plugins {
id("configuration") id("configuration")
} }
android {
namespace = "com.tangem.core.featuretoggles"
}
dependencies { dependencies {
/** DI */ /** DI */

View file

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

View file

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

View file

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

View file

@ -4,6 +4,10 @@ plugins {
id("configuration") id("configuration")
} }
android {
namespace = "com.tangem.core.ui"
}
dependencies { dependencies {
/** Project - Common */ /** Project - Common */
implementation(projects.common) implementation(projects.common)

View file

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

View file

@ -5,6 +5,10 @@ plugins {
id("configuration") id("configuration")
} }
android {
namespace = "com.tangem.data.source.preferences"
}
dependencies { dependencies {
implementation(deps.androidx.core.ktx) implementation(deps.androidx.core.ktx)
implementation(deps.moshi) implementation(deps.moshi)

View file

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

View file

@ -4,6 +4,10 @@ plugins {
id("configuration") id("configuration")
} }
android {
namespace = "com.tangem.domain.features"
}
dependencies { dependencies {
implementation(project(":core:datasource")) implementation(project(":core:datasource"))
implementation(project(":core:utils")) implementation(project(":core:utils"))

View file

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

View file

@ -7,6 +7,10 @@ plugins {
id("configuration") id("configuration")
} }
android {
namespace = "com.tangem.feature.onboarding"
}
dependencies { dependencies {
/** Core modules */ /** Core modules */
implementation(project(":common")) 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") id("configuration")
} }
android {
namespace = "com.tangem.feature.referral.data"
}
dependencies { dependencies {
/** Project */ /** 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") id("configuration")
} }
android {
namespace = "com.tangem.feature.referral.presentation"
}
dependencies { dependencies {
/** Core modules */ /** Core modules */
implementation(project(":core:analytics")) 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") id("configuration")
} }
android {
namespace = "com.tangem.feature.swap.api"
}
dependencies { dependencies {
/** DI */ /** DI */
implementation(deps.hilt.android) 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") id("configuration")
} }
android {
namespace = "com.tangem.feature.swap.data"
}
dependencies { dependencies {
/** AndroidX */ /** 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") id("configuration")
} }
android {
namespace = "com.tangem.feature.swap.presentation"
}
dependencies { dependencies {
/** Core modules */ /** Core modules */
implementation(projects.core.analytics) 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.android.library)
alias(deps.plugins.kotlin.android) alias(deps.plugins.kotlin.android)
id("configuration") 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") id("configuration")
} }
android {
namespace = "com.tangem.feature.tester.impl"
}
dependencies { dependencies {
/** AndroidX */ /** AndroidX */
implementation(deps.androidx.activity.compose) implementation(deps.androidx.activity.compose)

View file

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

View file

@ -4,6 +4,10 @@ plugins {
id("configuration") id("configuration")
} }
android {
namespace = "com.tangem.features.wallet.api"
}
dependencies { dependencies {
/** AndroidX */ /** AndroidX */
implementation(deps.androidx.fragment.ktx) 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") id("configuration")
} }
android {
namespace = "com.tangem.feature.wallet.impl"
}
dependencies { dependencies {
/** AndroidX */ /** AndroidX */
implementation(deps.androidx.activity.compose) 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.LocalConfiguration
import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemTheme
import com.tangem.feature.wallet.presentation.common.WalletPreviewData 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.ImmutableList
import kotlinx.collections.immutable.toPersistentList import kotlinx.collections.immutable.toPersistentList
private const val SHORT_SNAP_ELEMENT_COUNT = 50
/** /**
* Wallets list component * Wallets list component
* *
@ -56,7 +53,7 @@ internal fun WalletsList(
state = lazyListState, state = lazyListState,
contentPadding = PaddingValues(horizontal = TangemTheme.dimens.spacing16), contentPadding = PaddingValues(horizontal = TangemTheme.dimens.spacing16),
horizontalArrangement = Arrangement.spacedBy(TangemTheme.dimens.spacing8), horizontalArrangement = Arrangement.spacedBy(TangemTheme.dimens.spacing8),
flingBehavior = rememberWalletsFlingBehaviour(lazyListState = lazyListState, itemWidth = itemWidth), flingBehavior = rememberWalletsFlingBehaviour(lazyListState = lazyListState),
) { ) {
items( items(
items = wallets, items = wallets,
@ -76,17 +73,14 @@ internal fun WalletsList(
/** /**
* Custom implementation of fling behaviour that overrides 'shortSnapVelocityThreshold'. * 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 lazyListState lazy list state
* @param itemWidth list item width
* *
* @see rememberSnapFlingBehavior * @see rememberSnapFlingBehavior
*/ */
@OptIn(ExperimentalFoundationApi::class) @OptIn(ExperimentalFoundationApi::class)
@Composable @Composable
private fun rememberWalletsFlingBehaviour(lazyListState: LazyListState, itemWidth: Dp): SnapFlingBehavior { private fun rememberWalletsFlingBehaviour(lazyListState: LazyListState): SnapFlingBehavior {
val snappingLayout = remember(lazyListState) { SnapLayoutInfoProvider(lazyListState) } val snappingLayout = remember(lazyListState) { SnapLayoutInfoProvider(lazyListState) }
val density = LocalDensity.current val density = LocalDensity.current
val highVelocityApproachSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay() val highVelocityApproachSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay()
@ -97,8 +91,6 @@ private fun rememberWalletsFlingBehaviour(lazyListState: LazyListState, itemWidt
lowVelocityAnimationSpec = tween(durationMillis = 1000, easing = LinearEasing), lowVelocityAnimationSpec = tween(durationMillis = 1000, easing = LinearEasing),
highVelocityAnimationSpec = highVelocityApproachSpec, highVelocityAnimationSpec = highVelocityApproachSpec,
snapAnimationSpec = spring(stiffness = Spring.StiffnessMediumLow), snapAnimationSpec = spring(stiffness = Spring.StiffnessMediumLow),
density = density,
shortSnapVelocityThreshold = itemWidth * SHORT_SNAP_ELEMENT_COUNT,
) )
} }
} }

View file

@ -15,3 +15,4 @@ org.gradle.daemon = true
android.useAndroidX = true android.useAndroidX = true
android.enableJetifier = true android.enableJetifier = true
org.gradle.unsafe.configuration-cache = true org.gradle.unsafe.configuration-cache = true
android.nonTransitiveRClass = false

View file

@ -3,10 +3,10 @@
[versions] [versions]
# region Classpath # region Classpath
androidGradlePlugin = "7.4.2" androidGradlePlugin = "8.2.2"
firebaseCrashlytics = "2.9.4" firebaseCrashlytics = "2.9.4"
googleServices = "4.3.10" googleServices = "4.3.10"
kotlin = "1.8.21" kotlin = "1.9.22"
# endregion Classpath # endregion Classpath
# region AndroidX # region AndroidX
@ -24,17 +24,17 @@ androidx-datastore = "1.0.0"
# endregion AndroidX # endregion AndroidX
# region Compose # region Compose
compose-compiler = "1.4.7" compose-compiler = "1.5.9"
compose-runtime = "1.5.3" compose-runtime = "1.6.1"
compose-foundation = "1.5.3" compose-foundation = "1.6.1"
compose-material = "1.5.3" compose-material = "1.6.1"
compose-material3 = "1.1.2" compose-material3 = "1.2.0"
compose-constraint = "1.0.1" compose-constraint = "1.0.1"
compose-navigation = "2.7.4" compose-navigation = "2.7.7"
compose-accompanist = "0.30.1" compose-accompanist = "0.30.1"
compose-paging = "3.2.1" compose-paging = "3.2.1"
compose-reorderable = "0.9.6" compose-reorderable = "0.9.6"
compose-lifecycle-runtime = "2.6.2" compose-lifecycle-runtime = "2.7.0"
# endregion Compose # endregion Compose
# region Other libraries # region Other libraries
@ -50,7 +50,7 @@ googleMaterialComponent = "1.6.1"
googlePlayCore = "1.10.3" googlePlayCore = "1.10.3"
googlePlayCoreKtx = "1.8.1" googlePlayCoreKtx = "1.8.1"
googlePlayServicesWallet = "19.1.0" googlePlayServicesWallet = "19.1.0"
hilt = "2.44" hilt = "2.46"
hilt-navigation = "1.0.0" hilt-navigation = "1.0.0"
jodatime = "2.12.1" jodatime = "2.12.1"
kotlin-immutable-collections = "0.3.5" kotlin-immutable-collections = "0.3.5"

View file

@ -1,6 +1,6 @@
#Tue Mar 07 14:45:01 MSK 2023 #Tue Feb 13 17:04:37 MSK 2024
distributionBase = GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl = https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip distributionPath=wrapper/dists
distributionPath = wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStorePath = wrapper/dists zipStoreBase=GRADLE_USER_HOME
zipStoreBase = GRADLE_USER_HOME zipStorePath=wrapper/dists

View file

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

View file

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

View file

@ -6,6 +6,10 @@ plugins {
id("configuration") id("configuration")
} }
android {
namespace = "com.tangem.lib.crypto"
}
dependencies { dependencies {
/** Coroutines */ /** Coroutines */

View file

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

View file

@ -35,6 +35,8 @@ private fun AppExtension.configureDefaultConfig(project: Project) {
AppConfig.versionName AppConfig.versionName
} }
buildFeatures.buildConfig = true
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
} }
} }

View file

@ -21,6 +21,7 @@ private fun LibraryExtension.configureDefaultConfig() {
vectorDrawables { vectorDrawables {
useSupportLibrary = true useSupportLibrary = true
} }
buildFeatures.buildConfig = true
} }
} }