From ab968cb2df8385f718b7e859cf79a220b8248121 Mon Sep 17 00:00:00 2001 From: arvifox Date: Sun, 24 Sep 2023 18:51:47 +0300 Subject: [PATCH 1/3] mwr-651 --- android-foundation | 2 +- app/build.gradle | 20 +++++++----- app/src/main/AndroidManifest.xml | 3 +- build.gradle | 32 +++++++++---------- common/build.gradle | 25 +++++++++------ common/src/main/AndroidManifest.xml | 3 +- .../soramitsu/common/base/SoraBaseFragment.kt | 8 ++--- .../compose/components/AnimatedComposable.kt | 2 +- .../compose/webview/WebViewFragment.kt | 2 +- common_wallet/build.gradle | 22 +++++++------ common_wallet/src/main/AndroidManifest.xml | 3 +- core_db/build.gradle | 20 +++++++----- core_db/src/main/AndroidManifest.xml | 2 +- core_di/build.gradle | 20 +++++++----- core_di/src/main/AndroidManifest.xml | 3 +- demeter/build.gradle | 18 +++++++---- feature_account_api/build.gradle | 20 +++++++----- .../src/main/AndroidManifest.xml | 3 +- feature_account_impl/build.gradle | 20 +++++++----- .../src/main/AndroidManifest.xml | 3 +- feature_assets_api/build.gradle | 22 +++++++------ .../src/main/AndroidManifest.xml | 3 +- feature_assets_impl/build.gradle | 22 +++++++------ .../src/main/AndroidManifest.xml | 3 +- .../receiverequest/QRCodeMainScreen.kt | 14 +++++--- .../receiverequest/RequestTokenScreen.kt | 7 +++- .../assetdetails/AssetDetailsFragment.kt | 2 +- .../fullassetlist/FullAssetListFragment.kt | 2 +- .../FullAssetSettingsFragment.kt | 2 +- .../receiverequest/QRCodeFlowFragment.kt | 2 +- .../screens/send/TransferAmountFragment.kt | 2 +- .../screens/txlist/TxListFragment.kt | 2 +- feature_blockexplorer_api/build.gradle | 21 ++++++------ feature_blockexplorer_impl/build.gradle | 21 ++++++------ .../presentation/screen/ActivitiesFragment.kt | 2 +- .../txdetails/TxDetailsFragment.kt | 2 +- feature_ecosystem_api/build.gradle | 20 +++++++----- .../src/main/AndroidManifest.xml | 3 +- feature_ecosystem_impl/build.gradle | 22 +++++++------ .../src/main/AndroidManifest.xml | 3 +- .../presentation/explore/ExploreFragment.kt | 2 +- feature_ethereum_api/build.gradle | 20 +++++++----- .../src/main/AndroidManifest.xml | 3 +- feature_ethereum_impl/build.gradle | 20 +++++++----- .../src/main/AndroidManifest.xml | 3 +- feature_main_api/build.gradle | 20 +++++++----- feature_main_api/src/main/AndroidManifest.xml | 3 +- feature_main_impl/build.gradle | 22 +++++++------ .../src/main/AndroidManifest.xml | 3 +- .../language/SelectLanguageFragment.kt | 2 +- .../presentation/pincode/PincodeFragment.kt | 2 +- .../presentation/profile/ProfileFragment.kt | 2 +- .../appsettings/AppSettingsFragment.kt | 2 +- .../profile/debugmenu/DebugMenuFragment.kt | 2 +- .../information/InformationFragment.kt | 2 +- .../profile/login/LoginSecurityFragment.kt | 2 +- feature_multiaccount_api/build.gradle | 20 +++++++----- .../src/main/AndroidManifest.xml | 2 +- feature_multiaccount_impl/build.gradle | 22 +++++++------ .../src/main/AndroidManifest.xml | 3 +- .../presentation/OnboardingActivity.kt | 8 ++--- .../account_list/AccountListFragment.kt | 2 +- .../export_account/backup/BackupFragment.kt | 2 +- .../backup/json/BackupJsonFragment.kt | 2 +- .../protection/ExportProtectionFragment.kt | 2 +- feature_polkaswap_api/build.gradle | 20 +++++++----- .../src/main/AndroidManifest.xml | 3 +- feature_polkaswap_impl/build.gradle | 22 +++++++------ .../src/main/AndroidManifest.xml | 3 +- .../fullpoollist/FullPoolListFragment.kt | 2 +- .../FullPoolSettingsFragment.kt | 2 +- .../liquidityadd/LiquidityAddFragment.kt | 2 +- .../LiquidityRemoveFragment.kt | 2 +- .../pooldetails/PoolDetailsFragment.kt | 2 +- .../presentation/screens/swap/SwapFragment.kt | 2 +- feature_referral_api/build.gradle | 20 +++++++----- .../src/main/AndroidManifest.xml | 3 +- feature_referral_impl/build.gradle | 22 +++++++------ .../src/main/AndroidManifest.xml | 3 +- feature_select_node_api/build.gradle | 20 +++++++----- .../src/main/AndroidManifest.xml | 2 +- feature_select_node_impl/build.gradle | 22 +++++++------ .../src/main/AndroidManifest.xml | 2 +- .../details/NodeDetailsFragment.kt | 2 +- .../presentation/select/SelectNodeFragment.kt | 2 +- feature_sora_card_api/build.gradle | 20 +++++++----- .../src/main/AndroidManifest.xml | 2 +- feature_sora_card_impl/build.gradle | 22 +++++++------ .../src/main/AndroidManifest.xml | 2 +- .../get/card/GetSoraCardFragment.kt | 2 +- .../card/details/SoraCardDetailsFragment.kt | 2 +- feature_wallet_api/build.gradle | 20 +++++++----- .../src/main/AndroidManifest.xml | 3 +- feature_wallet_impl/build.gradle | 22 +++++++------ .../src/main/AndroidManifest.xml | 3 +- .../buycrypto/BuyCryptoFragment.kt | 2 +- .../presentation/cardshub/CardsHubFragment.kt | 2 +- .../presentation/claim/ClaimFragment.kt | 2 +- .../presentation/contacts/ContactsFragment.kt | 2 +- .../editcardshub/EditCardsHubFragment.kt | 2 +- gradle.properties | 2 ++ gradle/wrapper/gradle-wrapper.properties | 2 +- jacoco.gradle | 8 ++--- network/build.gradle | 20 +++++++----- network/src/main/AndroidManifest.xml | 2 +- soracrypro/build.gradle | 19 +++++++---- soracrypro/src/main/AndroidManifest.xml | 3 +- sorasubstrate/build.gradle | 19 +++++++---- sorasubstrate/src/main/AndroidManifest.xml | 3 +- test_data/build.gradle | 20 +++++++----- test_data/src/main/AndroidManifest.xml | 3 +- test_shared/build.gradle | 20 +++++++----- test_shared/src/main/AndroidManifest.xml | 3 +- 113 files changed, 549 insertions(+), 422 deletions(-) diff --git a/android-foundation b/android-foundation index 3ed681704..ead7e75bf 160000 --- a/android-foundation +++ b/android-foundation @@ -1 +1 @@ -Subproject commit 3ed681704a011be7513d5eb66e0d6e0512e3cb6f +Subproject commit ead7e75bfdba7b00cac5f3e69f5c34295d64d78b diff --git a/app/build.gradle b/app/build.gradle index e05c52578..4ca155727 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,6 +10,10 @@ apply plugin: 'com.google.firebase.crashlytics' apply plugin: 'com.github.triplet.play' apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion flavorDimensions "default" @@ -68,14 +72,13 @@ android { } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildFeatures { viewBinding true @@ -134,6 +137,7 @@ android { configurations { all*.exclude module: 'bcprov-jdk15on' } + namespace 'jp.co.soramitsu.sora' } hilt { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ce02f1617..ed7f9ab2c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools"> diff --git a/build.gradle b/build.gradle index ce4d002d7..268da1a74 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,9 @@ buildscript { ext.versions = [ - kotlin : '1.8.20', - coroutines : '1.6.4', - dagger : '2.45', + kotlin : '1.9.10', + coroutines : '1.7.3', + dagger : '2.48', hiltWorkManager : '1.0.0', hiltCompose : '1.0.0', timber : '5.0.1', @@ -29,7 +29,7 @@ buildscript { archCoreTest : '2.1.0', archFragmentTest : '1.4.1', archComponents : '2.6.1', - room : '2.5.1', + room : '2.6.0-rc01', datastore : '1.0.0', biometric : '1.1.0', workManager : '2.8.1', @@ -40,12 +40,12 @@ buildscript { truth : '1.1.5', lottie : '4.2.0', xNetworking : '0.0.61', - compose : '1.4.3', + compose : '1.5.1', composeMaterial : '1.4.3', - composeCompiler : '1.4.6', + composeCompiler : '1.5.3', composeConstraintLayout: '1.1.0-alpha05', - uiCore : '0.1.4', - soraCard : '0.1.41', + uiCore : '0.2.0', + soraCard : '0.1.45', lazySodium : '5.0.2', jna : '5.8.0', accompanist : '0.30.1', @@ -60,9 +60,9 @@ buildscript { appVersionCode = Integer.valueOf(System.env.CI_BUILD_ID ?: 110) appVersionName = '3.4.0.4' - compileVersion = 33 + compileVersion = 34 minVersion = 24 - targetVersion = 33 + targetVersion = 34 soraMinifyRelease = true //kotlinDep = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$versions.kotlin" @@ -75,8 +75,8 @@ buildscript { cardViewDep = "androidx.cardview:cardview:1.0.0" constraintDep = "androidx.constraintlayout:constraintlayout:$versions.constraint" activityKtxDep = "androidx.activity:activity-ktx:1.7.1" - fragmentKtxDep = "androidx.fragment:fragment-ktx:1.5.7" - coreKtxDep = "androidx.core:core-ktx:1.10.1" + fragmentKtxDep = "androidx.fragment:fragment-ktx:1.6.1" + coreKtxDep = "androidx.core:core-ktx:1.12.0" workManagerDep = "androidx.work:work-runtime-ktx:$versions.workManager" coroutineDep = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$versions.coroutines" @@ -138,7 +138,7 @@ buildscript { navigationFragmentDep = "androidx.navigation:navigation-fragment-ktx:$versions.navigation" navigationUiDep = "androidx.navigation:navigation-ui-ktx:$versions.navigation" - navigationComposeDep = "androidx.navigation:navigation-compose:$versions.navigation" + navigationComposeDep = "androidx.navigation:navigation-compose:2.7.2" zXingCoreDep = "com.google.zxing:core:$versions.zXing" zXingEmbeddedDep = "com.journeyapps:zxing-android-embedded:$versions.zXingEmbedded" @@ -197,7 +197,7 @@ buildscript { composeLiveDataDep = "androidx.compose.runtime:runtime-livedata:$versions.compose" composeFoundationDep = "androidx.compose.foundation:foundation:$versions.compose" composeRuntimeDep = "androidx.compose.runtime:runtime:$versions.compose" - composeMaterialDep = "androidx.compose.material:material:$versions.composeMaterial" + composeMaterialDep = "androidx.compose.material:material:$versions.compose" composeThemeAdapterDep = "com.google.accompanist:accompanist-themeadapter-material:$versions.accompanist" composeAnimationDep = "androidx.compose.animation:animation:$versions.compose" composeAnimationGraphicsDep = "androidx.compose.animation:animation-graphics:$versions.compose" @@ -221,11 +221,11 @@ buildscript { dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}" classpath "org.jetbrains.kotlin:kotlin-serialization:${versions.kotlin}" - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.2.0-beta05' classpath 'com.google.gms:google-services:4.3.15' classpath 'com.google.firebase:firebase-appdistribution-gradle:3.2.0' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.4' - classpath 'com.google.dagger:hilt-android-gradle-plugin:2.45' + classpath 'com.google.dagger:hilt-android-gradle-plugin:2.48' classpath "com.github.triplet.gradle:play-publisher:3.8.4" } } diff --git a/common/build.gradle b/common/build.gradle index 7900b592a..b7d63f577 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -7,8 +7,12 @@ apply plugin: 'kotlinx-serialization' apply from: '../tests.gradle' apply from: '../secrets.gradle' +kotlin { + jvmToolchain(11) +} + android { - compileSdkVersion compileVersion + compileSdk compileVersion defaultConfig { minSdkVersion minVersion @@ -24,14 +28,13 @@ android { } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } composeOptions { kotlinCompilerExtensionVersion versions.composeCompiler @@ -110,6 +113,7 @@ android { buildConfigField "String", "GOOGLE_API_TOKEN", readSecretInQuotes("SORA_GOOGLE_TOKEN_PROD") } } + namespace 'jp.co.soramitsu.common' } dependencies { @@ -178,7 +182,8 @@ dependencies { implementation composeConstraintLayoutDep implementation composeAnimationGraphicsDep implementation composeToolingPreviewDep - implementation accompanistNavAnimationDep + //implementation accompanistNavAnimationDep + implementation navigationComposeDep debugImplementation composeToolingDep testImplementation project(":test_shared") diff --git a/common/src/main/AndroidManifest.xml b/common/src/main/AndroidManifest.xml index dee175570..972c3a837 100644 --- a/common/src/main/AndroidManifest.xml +++ b/common/src/main/AndroidManifest.xml @@ -1,4 +1,3 @@ - + \ No newline at end of file diff --git a/common/src/main/java/jp/co/soramitsu/common/base/SoraBaseFragment.kt b/common/src/main/java/jp/co/soramitsu/common/base/SoraBaseFragment.kt index 9ef589751..134524a0a 100644 --- a/common/src/main/java/jp/co/soramitsu/common/base/SoraBaseFragment.kt +++ b/common/src/main/java/jp/co/soramitsu/common/base/SoraBaseFragment.kt @@ -62,9 +62,9 @@ import androidx.fragment.app.Fragment import androidx.lifecycle.LiveData import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.rememberNavController import androidx.navigation.findNavController -import com.google.accompanist.navigation.animation.AnimatedNavHost -import com.google.accompanist.navigation.animation.rememberAnimatedNavController import javax.inject.Inject import jp.co.soramitsu.common.R import jp.co.soramitsu.common.domain.BarsColorhandler @@ -116,7 +116,7 @@ abstract class SoraBaseFragment : Fragment() { val coroutineScope = rememberCoroutineScope() val openAlertDialog = remember { mutableStateOf(AlertDialogData()) } - val navController = rememberAnimatedNavController() + val navController = rememberNavController() LaunchedEffect(Unit) { navController.addOnDestinationChangedListener { _, destination, _ -> destination.route?.let { @@ -200,7 +200,7 @@ abstract class SoraBaseFragment : Fragment() { BackHandler { onBack() } - AnimatedNavHost( + NavHost( modifier = Modifier .padding(padding) .fillMaxSize(), diff --git a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/AnimatedComposable.kt b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/AnimatedComposable.kt index 826e59c54..68378ce7c 100644 --- a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/AnimatedComposable.kt +++ b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/AnimatedComposable.kt @@ -42,7 +42,7 @@ import androidx.navigation.NamedNavArgument import androidx.navigation.NavBackStackEntry import androidx.navigation.NavDeepLink import androidx.navigation.NavGraphBuilder -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable private const val TRANSITION_DURATION = 300 diff --git a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/webview/WebViewFragment.kt b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/webview/WebViewFragment.kt index 2532b972d..09cebdf3e 100644 --- a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/webview/WebViewFragment.kt +++ b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/webview/WebViewFragment.kt @@ -37,7 +37,7 @@ import androidx.compose.foundation.ScrollState import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/common_wallet/build.gradle b/common_wallet/build.gradle index cd7cce144..4c1a0ac97 100644 --- a/common_wallet/build.gradle +++ b/common_wallet/build.gradle @@ -3,6 +3,10 @@ apply plugin: 'dagger.hilt.android.plugin' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -20,14 +24,13 @@ android { } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } composeOptions { kotlinCompilerExtensionVersion versions.composeCompiler @@ -57,6 +60,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.common_wallet' } dependencies { @@ -118,7 +122,7 @@ dependencies { implementation composeConstraintLayoutDep implementation composeAnimationGraphicsDep implementation composeToolingPreviewDep - implementation accompanistNavAnimationDep + //implementation accompanistNavAnimationDep debugImplementation composeToolingDep testImplementation project(":test_shared") diff --git a/common_wallet/src/main/AndroidManifest.xml b/common_wallet/src/main/AndroidManifest.xml index a70d90fdd..97330b776 100644 --- a/common_wallet/src/main/AndroidManifest.xml +++ b/common_wallet/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/core_db/build.gradle b/core_db/build.gradle index 02735d480..f92b277c1 100644 --- a/core_db/build.gradle +++ b/core_db/build.gradle @@ -4,6 +4,10 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -29,14 +33,13 @@ android { } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } flavorDimensions "default" @@ -57,6 +60,7 @@ android { dimension 'default' } } + namespace 'com.example.core_db' } dependencies { diff --git a/core_db/src/main/AndroidManifest.xml b/core_db/src/main/AndroidManifest.xml index 54806c3e5..cc947c567 100644 --- a/core_db/src/main/AndroidManifest.xml +++ b/core_db/src/main/AndroidManifest.xml @@ -1 +1 @@ - + diff --git a/core_di/build.gradle b/core_di/build.gradle index 19c0d29ec..a6daa6cee 100644 --- a/core_di/build.gradle +++ b/core_di/build.gradle @@ -1,6 +1,10 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -11,14 +15,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } flavorDimensions "default" @@ -46,6 +49,7 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } + namespace 'jp.co.soramitsu.core_di' } dependencies { diff --git a/core_di/src/main/AndroidManifest.xml b/core_di/src/main/AndroidManifest.xml index cd6641461..94cbbcfc3 100644 --- a/core_di/src/main/AndroidManifest.xml +++ b/core_di/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/demeter/build.gradle b/demeter/build.gradle index 63cda8620..39548390f 100644 --- a/demeter/build.gradle +++ b/demeter/build.gradle @@ -3,6 +3,10 @@ apply plugin: 'dagger.hilt.android.plugin' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' +kotlin { + jvmToolchain(11) +} + android { namespace 'jp.co.soramitsu.demeter' compileSdk compileVersion @@ -21,13 +25,13 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = '1.8' - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = '1.8' +// } composeOptions { kotlinCompilerExtensionVersion versions.composeCompiler } diff --git a/feature_account_api/build.gradle b/feature_account_api/build.gradle index b5e1e393c..3cd9be1c8 100644 --- a/feature_account_api/build.gradle +++ b/feature_account_api/build.gradle @@ -3,6 +3,10 @@ apply plugin: 'dagger.hilt.android.plugin' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -13,14 +17,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildTypes { release { @@ -48,6 +51,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_account_api' } dependencies { diff --git a/feature_account_api/src/main/AndroidManifest.xml b/feature_account_api/src/main/AndroidManifest.xml index 243827fca..94cbbcfc3 100644 --- a/feature_account_api/src/main/AndroidManifest.xml +++ b/feature_account_api/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/feature_account_impl/build.gradle b/feature_account_impl/build.gradle index f5081012f..7d3b6ea9d 100644 --- a/feature_account_impl/build.gradle +++ b/feature_account_impl/build.gradle @@ -4,6 +4,10 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -21,14 +25,13 @@ android { } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } flavorDimensions "default" @@ -49,6 +52,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_account_impl' } dependencies { diff --git a/feature_account_impl/src/main/AndroidManifest.xml b/feature_account_impl/src/main/AndroidManifest.xml index 977b8a438..94cbbcfc3 100644 --- a/feature_account_impl/src/main/AndroidManifest.xml +++ b/feature_account_impl/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/feature_assets_api/build.gradle b/feature_assets_api/build.gradle index d2a560f92..b0692bd1a 100644 --- a/feature_assets_api/build.gradle +++ b/feature_assets_api/build.gradle @@ -5,6 +5,10 @@ apply plugin: 'kotlinx-serialization' apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-parcelize' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -15,14 +19,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildTypes { release { @@ -59,6 +62,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_assets_api' } dependencies { @@ -88,7 +92,7 @@ dependencies { implementation composeLifecycleDep debugImplementation composeToolingDep implementation navigationComposeDep - implementation accompanistNavAnimationDep + //implementation accompanistNavAnimationDep implementation xNetworkingDep diff --git a/feature_assets_api/src/main/AndroidManifest.xml b/feature_assets_api/src/main/AndroidManifest.xml index 615fca951..97330b776 100644 --- a/feature_assets_api/src/main/AndroidManifest.xml +++ b/feature_assets_api/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/feature_assets_impl/build.gradle b/feature_assets_impl/build.gradle index f905f5d94..975ad8a24 100644 --- a/feature_assets_impl/build.gradle +++ b/feature_assets_impl/build.gradle @@ -5,6 +5,10 @@ apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-parcelize' apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -15,14 +19,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildTypes { release { @@ -59,6 +62,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_assets_impl' } dependencies { @@ -135,7 +139,7 @@ dependencies { implementation composeLifecycleDep debugImplementation composeToolingDep implementation navigationComposeDep - implementation accompanistNavAnimationDep + //implementation accompanistNavAnimationDep implementation xNetworkingDep diff --git a/feature_assets_impl/src/main/AndroidManifest.xml b/feature_assets_impl/src/main/AndroidManifest.xml index 000fe5d94..97330b776 100644 --- a/feature_assets_impl/src/main/AndroidManifest.xml +++ b/feature_assets_impl/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/receiverequest/QRCodeMainScreen.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/receiverequest/QRCodeMainScreen.kt index 1c1cbf0d3..3c2ddb101 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/receiverequest/QRCodeMainScreen.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/receiverequest/QRCodeMainScreen.kt @@ -76,10 +76,6 @@ fun QrCodeMainScreen( requestToken_onCreateRequestClick: () -> Unit, requestToken_onTryAgainClick: () -> Unit, ) { - val pagerState = rememberPagerState() - - val coroutineScope = rememberCoroutineScope() - val qrCodeMainScreenPages = remember { mutableListOf().apply { add(QrCodeMainScreenPage.RECEIVE) @@ -87,6 +83,15 @@ fun QrCodeMainScreen( }.toList() } + val pagerState = rememberPagerState( + initialPage = 0, + initialPageOffsetFraction = 0f + ) { + qrCodeMainScreenPages.size + } + + val coroutineScope = rememberCoroutineScope() + Column( modifier = Modifier .fillMaxSize() @@ -114,7 +119,6 @@ fun QrCodeMainScreen( HorizontalPager( state = pagerState, - pageCount = qrCodeMainScreenPages.size ) { when (qrCodeMainScreenPages[it]) { QrCodeMainScreenPage.RECEIVE -> { diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/receiverequest/RequestTokenScreen.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/receiverequest/RequestTokenScreen.kt index 418b4445a..290371d6d 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/receiverequest/RequestTokenScreen.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/receiverequest/RequestTokenScreen.kt @@ -236,7 +236,12 @@ fun RequestTokenScreen( private fun PreviewRequestTokenScreen() { RequestTokenScreen( index = 0, - pagerState = rememberPagerState(), + pagerState = rememberPagerState( + initialPage = 0, + initialPageOffsetFraction = 0f + ) { + 2 + }, scrollState = rememberScrollState(), state = RequestTokenScreenState( screenStatus = ScreenStatus.READY_TO_RENDER, diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/assetdetails/AssetDetailsFragment.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/assetdetails/AssetDetailsFragment.kt index 2afc76232..f8c4541cc 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/assetdetails/AssetDetailsFragment.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/assetdetails/AssetDetailsFragment.kt @@ -52,7 +52,7 @@ import androidx.compose.ui.Modifier import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/fullassetlist/FullAssetListFragment.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/fullassetlist/FullAssetListFragment.kt index b5aac4c1e..de232de42 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/fullassetlist/FullAssetListFragment.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/fullassetlist/FullAssetListFragment.kt @@ -65,7 +65,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.R import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/fullassetsettings/FullAssetSettingsFragment.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/fullassetsettings/FullAssetSettingsFragment.kt index 9b1d91592..0c2e0482b 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/fullassetsettings/FullAssetSettingsFragment.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/fullassetsettings/FullAssetSettingsFragment.kt @@ -53,9 +53,9 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController +import androidx.navigation.compose.composable import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.ItemTouchHelper -import com.google.accompanist.navigation.animation.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.R import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/receiverequest/QRCodeFlowFragment.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/receiverequest/QRCodeFlowFragment.kt index e36df3a0e..175dc4caf 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/receiverequest/QRCodeFlowFragment.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/receiverequest/QRCodeFlowFragment.kt @@ -42,7 +42,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import com.journeyapps.barcodescanner.ScanOptions import com.permissionx.guolindev.PermissionX import dagger.hilt.android.AndroidEntryPoint diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/send/TransferAmountFragment.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/send/TransferAmountFragment.kt index 20dd39bc7..ac90b74cd 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/send/TransferAmountFragment.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/send/TransferAmountFragment.kt @@ -48,7 +48,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.R diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/txlist/TxListFragment.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/txlist/TxListFragment.kt index 56e9aad13..4e14c5e54 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/txlist/TxListFragment.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/txlist/TxListFragment.kt @@ -42,7 +42,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_blockexplorer_api/build.gradle b/feature_blockexplorer_api/build.gradle index d0febe01c..a26e4f790 100644 --- a/feature_blockexplorer_api/build.gradle +++ b/feature_blockexplorer_api/build.gradle @@ -5,6 +5,10 @@ apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-parcelize' apply plugin: 'kotlinx-serialization' +kotlin { + jvmToolchain(11) +} + android { namespace 'jp.co.soramitsu.feature_blockexplorer_api' compileSdk compileVersion @@ -17,14 +21,13 @@ android { consumerProguardFiles "consumer-rules.pro" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildFeatures { viewBinding true @@ -97,7 +100,7 @@ dependencies { implementation composeLiveDataDep debugImplementation composeToolingDep - implementation accompanistNavAnimationDep + //implementation accompanistNavAnimationDep implementation roomDep implementation roomKtxDep diff --git a/feature_blockexplorer_impl/build.gradle b/feature_blockexplorer_impl/build.gradle index 4b9e6d4af..f79de6c26 100644 --- a/feature_blockexplorer_impl/build.gradle +++ b/feature_blockexplorer_impl/build.gradle @@ -5,6 +5,10 @@ apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-parcelize' apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { namespace 'jp.co.soramitsu.feature_blockexplorer_impl' compileSdk compileVersion @@ -17,14 +21,13 @@ android { consumerProguardFiles "consumer-rules.pro" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildFeatures { viewBinding true @@ -105,7 +108,7 @@ dependencies { implementation composeLifecycleDep debugImplementation composeToolingDep - implementation accompanistNavAnimationDep + //implementation accompanistNavAnimationDep implementation timberDep implementation sharedUtilsDep diff --git a/feature_blockexplorer_impl/src/main/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/screen/ActivitiesFragment.kt b/feature_blockexplorer_impl/src/main/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/screen/ActivitiesFragment.kt index 49e223864..f5ce74368 100644 --- a/feature_blockexplorer_impl/src/main/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/screen/ActivitiesFragment.kt +++ b/feature_blockexplorer_impl/src/main/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/screen/ActivitiesFragment.kt @@ -48,7 +48,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.R import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_blockexplorer_impl/src/main/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/txdetails/TxDetailsFragment.kt b/feature_blockexplorer_impl/src/main/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/txdetails/TxDetailsFragment.kt index 28657041e..78991d968 100644 --- a/feature_blockexplorer_impl/src/main/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/txdetails/TxDetailsFragment.kt +++ b/feature_blockexplorer_impl/src/main/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/txdetails/TxDetailsFragment.kt @@ -44,7 +44,7 @@ import androidx.compose.ui.Modifier import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_ecosystem_api/build.gradle b/feature_ecosystem_api/build.gradle index 2f2da5726..26366d49e 100644 --- a/feature_ecosystem_api/build.gradle +++ b/feature_ecosystem_api/build.gradle @@ -5,6 +5,10 @@ apply plugin: 'kotlinx-serialization' apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-parcelize' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -15,14 +19,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildTypes { release { @@ -50,6 +53,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_ecosystem_api' } dependencies { diff --git a/feature_ecosystem_api/src/main/AndroidManifest.xml b/feature_ecosystem_api/src/main/AndroidManifest.xml index 234a64c3a..97330b776 100644 --- a/feature_ecosystem_api/src/main/AndroidManifest.xml +++ b/feature_ecosystem_api/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/feature_ecosystem_impl/build.gradle b/feature_ecosystem_impl/build.gradle index df18cf041..fca4ef242 100644 --- a/feature_ecosystem_impl/build.gradle +++ b/feature_ecosystem_impl/build.gradle @@ -5,6 +5,10 @@ apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-parcelize' apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -22,14 +26,13 @@ android { } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildFeatures { viewBinding true @@ -59,6 +62,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_ecosystem_impl' } dependencies { @@ -123,7 +127,7 @@ dependencies { implementation composeLifecycleDep debugImplementation composeToolingDep implementation navigationComposeDep - implementation accompanistNavAnimationDep + //implementation accompanistNavAnimationDep implementation xNetworkingDep diff --git a/feature_ecosystem_impl/src/main/AndroidManifest.xml b/feature_ecosystem_impl/src/main/AndroidManifest.xml index 42d1ab3c6..97330b776 100644 --- a/feature_ecosystem_impl/src/main/AndroidManifest.xml +++ b/feature_ecosystem_impl/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/explore/ExploreFragment.kt b/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/explore/ExploreFragment.kt index 0cdd12399..0eba54c9e 100644 --- a/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/explore/ExploreFragment.kt +++ b/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/explore/ExploreFragment.kt @@ -38,7 +38,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.base.SoraBaseFragment import jp.co.soramitsu.common.domain.BottomBarController diff --git a/feature_ethereum_api/build.gradle b/feature_ethereum_api/build.gradle index ba07d59dd..d0cc4708e 100644 --- a/feature_ethereum_api/build.gradle +++ b/feature_ethereum_api/build.gradle @@ -4,6 +4,10 @@ apply plugin: 'kotlin-android' apply plugin: "kotlin-kapt" apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -20,14 +24,13 @@ android { } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } flavorDimensions "default" @@ -48,6 +51,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_ethereum_api' } dependencies { diff --git a/feature_ethereum_api/src/main/AndroidManifest.xml b/feature_ethereum_api/src/main/AndroidManifest.xml index 5649e3c98..94cbbcfc3 100644 --- a/feature_ethereum_api/src/main/AndroidManifest.xml +++ b/feature_ethereum_api/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/feature_ethereum_impl/build.gradle b/feature_ethereum_impl/build.gradle index 5fabcbabf..0bc2bc6a2 100644 --- a/feature_ethereum_impl/build.gradle +++ b/feature_ethereum_impl/build.gradle @@ -4,6 +4,10 @@ apply plugin: 'kotlin-android' apply plugin: "kotlin-kapt" apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -20,14 +24,13 @@ android { } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } flavorDimensions "default" @@ -48,6 +51,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_ethereum_impl' } dependencies { diff --git a/feature_ethereum_impl/src/main/AndroidManifest.xml b/feature_ethereum_impl/src/main/AndroidManifest.xml index 9e6e4145c..972c3a837 100644 --- a/feature_ethereum_impl/src/main/AndroidManifest.xml +++ b/feature_ethereum_impl/src/main/AndroidManifest.xml @@ -1,4 +1,3 @@ - + \ No newline at end of file diff --git a/feature_main_api/build.gradle b/feature_main_api/build.gradle index 10c0dc41a..2cb96d4d5 100644 --- a/feature_main_api/build.gradle +++ b/feature_main_api/build.gradle @@ -3,6 +3,10 @@ apply plugin: 'dagger.hilt.android.plugin' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -13,14 +17,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildTypes { release { @@ -48,6 +51,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_main_api' } dependencies { diff --git a/feature_main_api/src/main/AndroidManifest.xml b/feature_main_api/src/main/AndroidManifest.xml index e9274bf85..94cbbcfc3 100644 --- a/feature_main_api/src/main/AndroidManifest.xml +++ b/feature_main_api/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/feature_main_impl/build.gradle b/feature_main_impl/build.gradle index f8379594a..5e26c0235 100644 --- a/feature_main_impl/build.gradle +++ b/feature_main_impl/build.gradle @@ -4,6 +4,10 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -21,14 +25,13 @@ android { } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } flavorDimensions "default" @@ -58,6 +61,7 @@ android { composeOptions { kotlinCompilerExtensionVersion versions.composeCompiler } + namespace 'jp.co.soramitsu.feature_main_impl' } dependencies { @@ -111,7 +115,7 @@ dependencies { implementation composeLifecycleDep debugImplementation composeToolingDep implementation navigationComposeDep - implementation accompanistNavAnimationDep + //implementation accompanistNavAnimationDep implementation gsonDep implementation webSocketLibDep diff --git a/feature_main_impl/src/main/AndroidManifest.xml b/feature_main_impl/src/main/AndroidManifest.xml index 07bd4ba78..aac4b947f 100644 --- a/feature_main_impl/src/main/AndroidManifest.xml +++ b/feature_main_impl/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools"> diff --git a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/language/SelectLanguageFragment.kt b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/language/SelectLanguageFragment.kt index ff14ed998..2b1bcc244 100644 --- a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/language/SelectLanguageFragment.kt +++ b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/language/SelectLanguageFragment.kt @@ -49,7 +49,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.base.SoraBaseFragment import jp.co.soramitsu.common.base.theOnlyRoute diff --git a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/pincode/PincodeFragment.kt b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/pincode/PincodeFragment.kt index 9098220f3..7e689156b 100644 --- a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/pincode/PincodeFragment.kt +++ b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/pincode/PincodeFragment.kt @@ -47,7 +47,7 @@ import androidx.compose.ui.unit.LayoutDirection import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import com.google.android.material.bottomsheet.BottomSheetDialog import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/ProfileFragment.kt b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/ProfileFragment.kt index dd90641c0..78d03d85c 100644 --- a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/ProfileFragment.kt +++ b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/ProfileFragment.kt @@ -48,7 +48,7 @@ import androidx.compose.ui.res.stringResource import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.R import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/appsettings/AppSettingsFragment.kt b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/appsettings/AppSettingsFragment.kt index d97c9bf61..e36f68de8 100644 --- a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/appsettings/AppSettingsFragment.kt +++ b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/appsettings/AppSettingsFragment.kt @@ -48,7 +48,7 @@ import androidx.compose.ui.res.stringResource import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.R import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/debugmenu/DebugMenuFragment.kt b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/debugmenu/DebugMenuFragment.kt index 290366b9c..daf803d2a 100644 --- a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/debugmenu/DebugMenuFragment.kt +++ b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/debugmenu/DebugMenuFragment.kt @@ -54,8 +54,8 @@ import androidx.compose.ui.graphics.Color import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController +import androidx.navigation.compose.composable import androidx.work.WorkInfo -import com.google.accompanist.navigation.animation.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.base.SoraBaseFragment import jp.co.soramitsu.common.base.theOnlyRoute diff --git a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/information/InformationFragment.kt b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/information/InformationFragment.kt index 36e00479c..613749ef8 100644 --- a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/information/InformationFragment.kt +++ b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/information/InformationFragment.kt @@ -45,7 +45,7 @@ import androidx.compose.ui.Modifier import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.androidfoundation.intent.ShareUtil.sendEmail import jp.co.soramitsu.common.R diff --git a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/login/LoginSecurityFragment.kt b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/login/LoginSecurityFragment.kt index 968dd022c..7f7a3b5f8 100644 --- a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/login/LoginSecurityFragment.kt +++ b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/login/LoginSecurityFragment.kt @@ -42,7 +42,7 @@ import androidx.compose.ui.Modifier import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.base.SoraBaseFragment import jp.co.soramitsu.common.base.theOnlyRoute diff --git a/feature_multiaccount_api/build.gradle b/feature_multiaccount_api/build.gradle index 38dba6ffc..e26a92f5a 100644 --- a/feature_multiaccount_api/build.gradle +++ b/feature_multiaccount_api/build.gradle @@ -3,6 +3,10 @@ apply plugin: 'dagger.hilt.android.plugin' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -13,14 +17,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildTypes { release { @@ -48,6 +51,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_multiaccount_api' } dependencies { diff --git a/feature_multiaccount_api/src/main/AndroidManifest.xml b/feature_multiaccount_api/src/main/AndroidManifest.xml index e2b1d881c..8072ee00d 100644 --- a/feature_multiaccount_api/src/main/AndroidManifest.xml +++ b/feature_multiaccount_api/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - + diff --git a/feature_multiaccount_impl/build.gradle b/feature_multiaccount_impl/build.gradle index 453c235f7..b46cb4b6b 100644 --- a/feature_multiaccount_impl/build.gradle +++ b/feature_multiaccount_impl/build.gradle @@ -5,6 +5,10 @@ apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-parcelize' apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -15,14 +19,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } composeOptions { kotlinCompilerExtensionVersion versions.composeCompiler @@ -59,6 +62,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_multiaccount_impl' } dependencies { @@ -114,7 +118,7 @@ dependencies { implementation composeConstraintLayoutDep implementation composeLiveDataDep implementation navigationComposeDep - implementation accompanistNavAnimationDep + //implementation accompanistNavAnimationDep implementation sharedFeaturesBackupDep implementation sharedFeaturesModelsDep debugImplementation composeToolingDep diff --git a/feature_multiaccount_impl/src/main/AndroidManifest.xml b/feature_multiaccount_impl/src/main/AndroidManifest.xml index 79e87c1be..b80fa30c0 100644 --- a/feature_multiaccount_impl/src/main/AndroidManifest.xml +++ b/feature_multiaccount_impl/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + diff --git a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/OnboardingActivity.kt b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/OnboardingActivity.kt index bbb5bbd58..b64d21df2 100644 --- a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/OnboardingActivity.kt +++ b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/OnboardingActivity.kt @@ -65,8 +65,8 @@ import androidx.compose.ui.unit.ExperimentalUnitApi import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavController import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.AnimatedNavHost -import com.google.accompanist.navigation.animation.rememberAnimatedNavController +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.rememberNavController import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.R @@ -168,7 +168,7 @@ class OnboardingActivity : SoraBaseActivity() { ) @Composable override fun Content(padding: PaddingValues, scrollState: ScrollState) { - navController = rememberAnimatedNavController() + navController = rememberNavController() LaunchedEffect(Unit) { navController.addOnDestinationChangedListener { _, destination, _ -> viewModel.onDestinationChanged(destination.route ?: "") @@ -216,7 +216,7 @@ class OnboardingActivity : SoraBaseActivity() { } } - AnimatedNavHost( + NavHost( modifier = Modifier .padding(padding) .fillMaxSize() diff --git a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountListFragment.kt b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountListFragment.kt index 79e31c67c..602a4c0af 100644 --- a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountListFragment.kt +++ b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountListFragment.kt @@ -50,7 +50,7 @@ import androidx.compose.ui.res.painterResource import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.R import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/backup/BackupFragment.kt b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/backup/BackupFragment.kt index cf4125b84..6a38d254f 100644 --- a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/backup/BackupFragment.kt +++ b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/backup/BackupFragment.kt @@ -38,7 +38,7 @@ import androidx.compose.runtime.livedata.observeAsState import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/backup/json/BackupJsonFragment.kt b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/backup/json/BackupJsonFragment.kt index dc4d57370..6447e6e5e 100644 --- a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/backup/json/BackupJsonFragment.kt +++ b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/backup/json/BackupJsonFragment.kt @@ -42,7 +42,7 @@ import androidx.compose.runtime.livedata.observeAsState import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.androidfoundation.intent.ShareUtil.shareFile diff --git a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/protection/ExportProtectionFragment.kt b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/protection/ExportProtectionFragment.kt index f7356ad90..5bde0bc31 100644 --- a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/protection/ExportProtectionFragment.kt +++ b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/protection/ExportProtectionFragment.kt @@ -38,7 +38,7 @@ import androidx.compose.runtime.livedata.observeAsState import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_polkaswap_api/build.gradle b/feature_polkaswap_api/build.gradle index 2f2da5726..d87aa6c02 100644 --- a/feature_polkaswap_api/build.gradle +++ b/feature_polkaswap_api/build.gradle @@ -5,6 +5,10 @@ apply plugin: 'kotlinx-serialization' apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-parcelize' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -15,14 +19,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildTypes { release { @@ -50,6 +53,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_polkaswap_api' } dependencies { diff --git a/feature_polkaswap_api/src/main/AndroidManifest.xml b/feature_polkaswap_api/src/main/AndroidManifest.xml index 96e67b670..97330b776 100644 --- a/feature_polkaswap_api/src/main/AndroidManifest.xml +++ b/feature_polkaswap_api/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/feature_polkaswap_impl/build.gradle b/feature_polkaswap_impl/build.gradle index 0a08a9c0a..cf10f89b4 100644 --- a/feature_polkaswap_impl/build.gradle +++ b/feature_polkaswap_impl/build.gradle @@ -5,6 +5,10 @@ apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-parcelize' apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -22,14 +26,13 @@ android { } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildFeatures { viewBinding true @@ -59,6 +62,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_polkaswap_impl' } dependencies { @@ -130,7 +134,7 @@ dependencies { implementation composeLifecycleDep debugImplementation composeToolingDep implementation navigationComposeDep - implementation accompanistNavAnimationDep + //implementation accompanistNavAnimationDep implementation xNetworkingDep diff --git a/feature_polkaswap_impl/src/main/AndroidManifest.xml b/feature_polkaswap_impl/src/main/AndroidManifest.xml index 4371b38f7..97330b776 100644 --- a/feature_polkaswap_impl/src/main/AndroidManifest.xml +++ b/feature_polkaswap_impl/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/fullpoollist/FullPoolListFragment.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/fullpoollist/FullPoolListFragment.kt index 312e985e3..d0c8054d8 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/fullpoollist/FullPoolListFragment.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/fullpoollist/FullPoolListFragment.kt @@ -57,7 +57,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.R import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/fullpoolsettings/FullPoolSettingsFragment.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/fullpoolsettings/FullPoolSettingsFragment.kt index b1dc5ef74..cb4070ba7 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/fullpoolsettings/FullPoolSettingsFragment.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/fullpoolsettings/FullPoolSettingsFragment.kt @@ -53,9 +53,9 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController +import androidx.navigation.compose.composable import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.ItemTouchHelper -import com.google.accompanist.navigation.animation.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.R import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityadd/LiquidityAddFragment.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityadd/LiquidityAddFragment.kt index 5b0718d10..b67d5d4d2 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityadd/LiquidityAddFragment.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityadd/LiquidityAddFragment.kt @@ -52,7 +52,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.R diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityremove/LiquidityRemoveFragment.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityremove/LiquidityRemoveFragment.kt index 06aced9c8..b77286f6d 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityremove/LiquidityRemoveFragment.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityremove/LiquidityRemoveFragment.kt @@ -52,7 +52,7 @@ import androidx.core.os.bundleOf import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.R diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/pooldetails/PoolDetailsFragment.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/pooldetails/PoolDetailsFragment.kt index 6611b5b26..b4158569f 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/pooldetails/PoolDetailsFragment.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/pooldetails/PoolDetailsFragment.kt @@ -47,7 +47,7 @@ import androidx.core.os.bundleOf import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.R diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/swap/SwapFragment.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/swap/SwapFragment.kt index 81d270c67..8795e39d4 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/swap/SwapFragment.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/swap/SwapFragment.kt @@ -48,7 +48,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.R diff --git a/feature_referral_api/build.gradle b/feature_referral_api/build.gradle index 25bb07081..431482e7f 100644 --- a/feature_referral_api/build.gradle +++ b/feature_referral_api/build.gradle @@ -3,6 +3,10 @@ apply plugin: 'dagger.hilt.android.plugin' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -13,14 +17,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildTypes { release { @@ -48,6 +51,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_referral_api' } dependencies { diff --git a/feature_referral_api/src/main/AndroidManifest.xml b/feature_referral_api/src/main/AndroidManifest.xml index 79cfce562..a5918e68a 100644 --- a/feature_referral_api/src/main/AndroidManifest.xml +++ b/feature_referral_api/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + \ No newline at end of file diff --git a/feature_referral_impl/build.gradle b/feature_referral_impl/build.gradle index b2972c337..54b252730 100644 --- a/feature_referral_impl/build.gradle +++ b/feature_referral_impl/build.gradle @@ -4,6 +4,10 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -14,14 +18,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildFeatures { viewBinding true @@ -58,6 +61,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_referral_impl' } dependencies { @@ -99,7 +103,7 @@ dependencies { implementation composeLiveDataDep debugImplementation composeToolingDep - implementation accompanistNavAnimationDep + //implementation accompanistNavAnimationDep implementation roomDep implementation roomKtxDep diff --git a/feature_referral_impl/src/main/AndroidManifest.xml b/feature_referral_impl/src/main/AndroidManifest.xml index 98f419f1e..a5918e68a 100644 --- a/feature_referral_impl/src/main/AndroidManifest.xml +++ b/feature_referral_impl/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + \ No newline at end of file diff --git a/feature_select_node_api/build.gradle b/feature_select_node_api/build.gradle index 288abe495..e5cce0841 100644 --- a/feature_select_node_api/build.gradle +++ b/feature_select_node_api/build.gradle @@ -3,6 +3,10 @@ apply plugin: 'dagger.hilt.android.plugin' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -13,14 +17,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildTypes { release { @@ -50,6 +53,7 @@ android { } flavorDimensions "default" + namespace 'jp.co.soramitsu.feature_select_node_api' productFlavors { develop { diff --git a/feature_select_node_api/src/main/AndroidManifest.xml b/feature_select_node_api/src/main/AndroidManifest.xml index fff779633..8072ee00d 100644 --- a/feature_select_node_api/src/main/AndroidManifest.xml +++ b/feature_select_node_api/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - + diff --git a/feature_select_node_impl/build.gradle b/feature_select_node_impl/build.gradle index 8409355ac..75ff96f3d 100644 --- a/feature_select_node_impl/build.gradle +++ b/feature_select_node_impl/build.gradle @@ -4,6 +4,10 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -14,14 +18,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } composeOptions { kotlinCompilerExtensionVersion versions.composeCompiler @@ -58,6 +61,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_select_node_impl' } dependencies { @@ -107,7 +111,7 @@ dependencies { implementation composeLifecycleDep debugImplementation composeToolingDep implementation navigationComposeDep - implementation accompanistNavAnimationDep + //implementation accompanistNavAnimationDep implementation daggerDep kapt daggerKaptDep diff --git a/feature_select_node_impl/src/main/AndroidManifest.xml b/feature_select_node_impl/src/main/AndroidManifest.xml index 1d2646af9..8072ee00d 100644 --- a/feature_select_node_impl/src/main/AndroidManifest.xml +++ b/feature_select_node_impl/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - + diff --git a/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsFragment.kt b/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsFragment.kt index 564dbfa45..661108aea 100644 --- a/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsFragment.kt +++ b/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsFragment.kt @@ -39,8 +39,8 @@ import androidx.compose.foundation.ScrollState import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController +import androidx.navigation.compose.composable import androidx.navigation.fragment.findNavController -import com.google.accompanist.navigation.animation.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/select/SelectNodeFragment.kt b/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/select/SelectNodeFragment.kt index 8998af987..a01e75db5 100644 --- a/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/select/SelectNodeFragment.kt +++ b/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/select/SelectNodeFragment.kt @@ -39,8 +39,8 @@ import androidx.compose.foundation.ScrollState import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController +import androidx.navigation.compose.composable import androidx.navigation.fragment.findNavController -import com.google.accompanist.navigation.animation.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.base.SoraBaseFragment import jp.co.soramitsu.common.base.theOnlyRoute diff --git a/feature_sora_card_api/build.gradle b/feature_sora_card_api/build.gradle index 5bf8519b8..b261be80f 100644 --- a/feature_sora_card_api/build.gradle +++ b/feature_sora_card_api/build.gradle @@ -4,6 +4,10 @@ apply plugin: 'kotlinx-serialization' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -14,14 +18,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildTypes { release { @@ -49,6 +52,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_sora_card_api' } dependencies { diff --git a/feature_sora_card_api/src/main/AndroidManifest.xml b/feature_sora_card_api/src/main/AndroidManifest.xml index e7d5d8fbc..8072ee00d 100644 --- a/feature_sora_card_api/src/main/AndroidManifest.xml +++ b/feature_sora_card_api/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - + diff --git a/feature_sora_card_impl/build.gradle b/feature_sora_card_impl/build.gradle index 8df98b635..853315378 100644 --- a/feature_sora_card_impl/build.gradle +++ b/feature_sora_card_impl/build.gradle @@ -5,6 +5,10 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -15,14 +19,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } composeOptions { kotlinCompilerExtensionVersion versions.composeCompiler @@ -59,6 +62,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_sora_card_impl' } dependencies { @@ -109,7 +113,7 @@ dependencies { implementation composeLifecycleDep debugImplementation composeToolingDep implementation navigationComposeDep - implementation accompanistNavAnimationDep + //implementation accompanistNavAnimationDep implementation daggerDep kapt daggerKaptDep diff --git a/feature_sora_card_impl/src/main/AndroidManifest.xml b/feature_sora_card_impl/src/main/AndroidManifest.xml index 0386f2add..8072ee00d 100644 --- a/feature_sora_card_impl/src/main/AndroidManifest.xml +++ b/feature_sora_card_impl/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - + diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardFragment.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardFragment.kt index 1db06ff4a..1aee9379f 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardFragment.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardFragment.kt @@ -39,7 +39,7 @@ import androidx.compose.foundation.ScrollState import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardDetailsFragment.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardDetailsFragment.kt index a6b68165c..966f2540a 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardDetailsFragment.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardDetailsFragment.kt @@ -49,7 +49,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.androidfoundation.intent.ShareUtil.shareText import jp.co.soramitsu.common.R diff --git a/feature_wallet_api/build.gradle b/feature_wallet_api/build.gradle index 2f2da5726..6de82bffe 100644 --- a/feature_wallet_api/build.gradle +++ b/feature_wallet_api/build.gradle @@ -5,6 +5,10 @@ apply plugin: 'kotlinx-serialization' apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-parcelize' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -15,14 +19,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildTypes { release { @@ -50,6 +53,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_wallet_api' } dependencies { diff --git a/feature_wallet_api/src/main/AndroidManifest.xml b/feature_wallet_api/src/main/AndroidManifest.xml index 2b3f6873c..94cbbcfc3 100644 --- a/feature_wallet_api/src/main/AndroidManifest.xml +++ b/feature_wallet_api/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/feature_wallet_impl/build.gradle b/feature_wallet_impl/build.gradle index 567639836..7a7b445ac 100644 --- a/feature_wallet_impl/build.gradle +++ b/feature_wallet_impl/build.gradle @@ -5,6 +5,10 @@ apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-parcelize' apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -22,14 +26,13 @@ android { } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildFeatures { viewBinding true @@ -59,6 +62,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.feature_wallet_impl' } dependencies { @@ -137,7 +141,7 @@ dependencies { implementation composeLifecycleDep debugImplementation composeToolingDep implementation navigationComposeDep - implementation accompanistNavAnimationDep + //implementation accompanistNavAnimationDep implementation xNetworkingDep diff --git a/feature_wallet_impl/src/main/AndroidManifest.xml b/feature_wallet_impl/src/main/AndroidManifest.xml index ef3e4e360..94cbbcfc3 100644 --- a/feature_wallet_impl/src/main/AndroidManifest.xml +++ b/feature_wallet_impl/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/buycrypto/BuyCryptoFragment.kt b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/buycrypto/BuyCryptoFragment.kt index 7c402958e..1f402c213 100644 --- a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/buycrypto/BuyCryptoFragment.kt +++ b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/buycrypto/BuyCryptoFragment.kt @@ -40,7 +40,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubFragment.kt b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubFragment.kt index e6e916b1f..a90aa4da4 100644 --- a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubFragment.kt +++ b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubFragment.kt @@ -54,7 +54,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.R import jp.co.soramitsu.common.base.SoraBaseFragment diff --git a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/claim/ClaimFragment.kt b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/claim/ClaimFragment.kt index 98fc62ba1..faf3f78d5 100644 --- a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/claim/ClaimFragment.kt +++ b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/claim/ClaimFragment.kt @@ -50,7 +50,7 @@ import androidx.compose.ui.unit.ExperimentalUnitApi import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import com.permissionx.guolindev.PermissionX import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.androidfoundation.intent.ShareUtil diff --git a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/contacts/ContactsFragment.kt b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/contacts/ContactsFragment.kt index 3c543756c..b09c240a7 100644 --- a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/contacts/ContactsFragment.kt +++ b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/contacts/ContactsFragment.kt @@ -49,7 +49,7 @@ import androidx.compose.ui.text.input.TextFieldValue import androidx.fragment.app.viewModels import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.base.SoraBaseFragment import jp.co.soramitsu.common.base.theOnlyRoute diff --git a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/editcardshub/EditCardsHubFragment.kt b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/editcardshub/EditCardsHubFragment.kt index f9b7eaf3c..7d206dd20 100644 --- a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/editcardshub/EditCardsHubFragment.kt +++ b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/editcardshub/EditCardsHubFragment.kt @@ -40,7 +40,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController -import com.google.accompanist.navigation.animation.composable +import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.common.base.SoraBaseFragment import jp.co.soramitsu.common.base.theOnlyRoute diff --git a/gradle.properties b/gradle.properties index f2fefe386..a342d197a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -40,3 +40,5 @@ android.defaults.buildfeatures.aidl=false android.defaults.buildfeatures.renderscript=false #android.defaults.buildfeatures.resvalues = false android.defaults.buildfeatures.shaders=false +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1f5060ef2..047e874db 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Jan 13 13:13:48 MSK 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/jacoco.gradle b/jacoco.gradle index 06cadd571..496826540 100644 --- a/jacoco.gradle +++ b/jacoco.gradle @@ -37,10 +37,10 @@ afterEvaluate { if (!file.exists()) file.mkdirs() reports { - xml.enabled = true - html.enabled = true - html.setDestination(new File(outputFileNameHtml)) - xml.setDestination(new File(outputFileName)) +// xml.enabled = true +// html.enabled = true +// html.setDestination(new File(outputFileNameHtml)) +// xml.setDestination(new File(outputFileName)) } outputs.upToDateWhen { false } diff --git a/network/build.gradle b/network/build.gradle index 4c43bf8a6..6ffb98e6f 100644 --- a/network/build.gradle +++ b/network/build.gradle @@ -3,6 +3,10 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply plugin: 'kotlinx-serialization' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -20,14 +24,13 @@ android { } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } flavorDimensions "default" @@ -48,6 +51,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.network' } dependencies { diff --git a/network/src/main/AndroidManifest.xml b/network/src/main/AndroidManifest.xml index 93e736602..8072ee00d 100644 --- a/network/src/main/AndroidManifest.xml +++ b/network/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - + diff --git a/soracrypro/build.gradle b/soracrypro/build.gradle index b4d978523..35a74c4f9 100644 --- a/soracrypro/build.gradle +++ b/soracrypro/build.gradle @@ -4,6 +4,10 @@ plugins { } apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdk compileVersion @@ -21,13 +25,13 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = '1.8' - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = '1.8' +// } flavorDimensions "default" productFlavors { @@ -47,6 +51,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.soracrypro' } dependencies { diff --git a/soracrypro/src/main/AndroidManifest.xml b/soracrypro/src/main/AndroidManifest.xml index 09dbb727d..a5918e68a 100644 --- a/soracrypro/src/main/AndroidManifest.xml +++ b/soracrypro/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + \ No newline at end of file diff --git a/sorasubstrate/build.gradle b/sorasubstrate/build.gradle index 7634a15bd..5c2b7acac 100644 --- a/sorasubstrate/build.gradle +++ b/sorasubstrate/build.gradle @@ -7,6 +7,10 @@ plugins { } apply from: '../tests.gradle' +kotlin { + jvmToolchain(11) +} + android { compileSdk compileVersion @@ -24,13 +28,13 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = '1.8' - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = '1.8' +// } flavorDimensions "default" productFlavors { @@ -50,6 +54,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.sora.substrate' } dependencies { diff --git a/sorasubstrate/src/main/AndroidManifest.xml b/sorasubstrate/src/main/AndroidManifest.xml index eea882837..a5918e68a 100644 --- a/sorasubstrate/src/main/AndroidManifest.xml +++ b/sorasubstrate/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + \ No newline at end of file diff --git a/test_data/build.gradle b/test_data/build.gradle index 9dfcbe55d..2690422a6 100644 --- a/test_data/build.gradle +++ b/test_data/build.gradle @@ -1,6 +1,10 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -11,14 +15,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildTypes { release { @@ -46,6 +49,7 @@ android { dimension 'default' } } + namespace 'jp.co.soramitsu.test_data' } dependencies { diff --git a/test_data/src/main/AndroidManifest.xml b/test_data/src/main/AndroidManifest.xml index bf1f57194..94cbbcfc3 100644 --- a/test_data/src/main/AndroidManifest.xml +++ b/test_data/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/test_shared/build.gradle b/test_shared/build.gradle index 6a2e588db..a50f56ceb 100644 --- a/test_shared/build.gradle +++ b/test_shared/build.gradle @@ -1,6 +1,10 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' +kotlin { + jvmToolchain(11) +} + android { compileSdkVersion compileVersion @@ -11,14 +15,13 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +// compileOptions { +// sourceCompatibility JavaVersion.VERSION_1_8 +// targetCompatibility JavaVersion.VERSION_1_8 +// } +// kotlinOptions { +// jvmTarget = JavaVersion.VERSION_1_8 +// } buildTypes { release { @@ -26,6 +29,7 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + namespace 'jp.co.soramitsu.test_shared' } dependencies { diff --git a/test_shared/src/main/AndroidManifest.xml b/test_shared/src/main/AndroidManifest.xml index 806554a13..94cbbcfc3 100644 --- a/test_shared/src/main/AndroidManifest.xml +++ b/test_shared/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + From f5ca00c3d3019be5e0e4e282032f7891d4a38674 Mon Sep 17 00:00:00 2001 From: arvifox Date: Tue, 26 Sep 2023 17:58:50 +0300 Subject: [PATCH 2/3] mwr-651 jenkins --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1190e4294..e9e134671 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,6 +13,6 @@ def pipeline = new org.android.AppPipeline(steps: this, jobParams: jobParams, appPushNoti: true, gitUpdateSubmodule: true, - dockerImage: 'build-tools/android-build-box-jdk11:latest', + dockerImage: 'build-tools/android-build-box:jdk17', gpgFiles: ['app/google-services.json']) pipeline.runPipeline('sora') From 2449f70c9ea91f6806d976f1ffa5895d5075258b Mon Sep 17 00:00:00 2001 From: arvifox Date: Thu, 28 Sep 2023 20:11:31 +0300 Subject: [PATCH 3/3] mwr-651 --- app/proguard-rules.pro | 115 +++++++++++++ build.gradle | 12 +- .../soramitsu/common/base/SoraBaseFragment.kt | 29 +++- .../common/data/network/dto/SwapFeeDto.kt | 5 +- .../jp/co/soramitsu/common/domain/Asset.kt | 7 +- .../common/domain/BottomBarController.kt | 2 +- .../common/domain/WhitelistTokensManager.kt | 6 +- .../common/inappupdate/InAppUpdateManager.kt | 17 +- .../common/presentation/compose/TokenIcon.kt | 22 ++- .../compose/components/AccountWithIcon.kt | 5 +- .../compose/components/AssetAmount.kt | 123 ++++++++++---- .../compose/components/ContentCardEndless.kt | 108 ------------ .../compose/components/DetailsItem.kt | 4 +- .../compose/components/PolkaswapDisclaimer.kt | 24 ++- .../compose/theme/tokens/NightThemeColors.kt | 4 +- .../presentation/viewmodel/BaseViewModel.kt | 3 + .../java/jp/co/soramitsu/common/util/Const.kt | 2 + .../ic_polkaswap_full_title.png | Bin 0 -> 3430 bytes .../ic_polkaswap_full_title.png | Bin 0 -> 2070 bytes .../ic_polkaswap_full_title.png | Bin 0 -> 4759 bytes .../ic_polkaswap_full_title.png | Bin 0 -> 7422 bytes .../ic_polkaswap_full_title.png | Bin 0 -> 10470 bytes .../res/layout/polkaswap_disclaimer_view.xml | 9 + common/src/main/res/values-night/styles.xml | 4 +- common/src/main/res/values/colors.xml | 1 + .../presentation/compose/BasicPoolListItem.kt | 5 +- .../compose/components/AssetItem.kt | 5 +- .../presentation/compose/states/CardState.kt | 3 +- .../compose/states/PoolsListState.kt | 5 +- core_db/build.gradle | 49 ++++-- .../jp/co/soramitsu/core_db/dao/AssetDao.kt | 7 + demeter/build.gradle | 2 +- .../repository/CredentialsRepositoryTest.kt | 159 ++++++------------ .../data/AssetsRepository.kt | 6 +- .../domain/AssetsInteractor.kt | 2 - .../selectsearchtoken/SelectSearchToken.kt | 5 +- .../data/AssetsRepositoryImpl.kt | 14 +- .../domain/AssetsInteractorImpl.kt | 5 - .../AssetDetailsTokenPriceCard.kt | 6 +- .../compose/receive/ReceiveScreen.kt | 6 +- .../presentation/states/AssetCardState.kt | 3 +- .../data/AssetsRepositoryTest.kt | 6 +- .../domain/AssetsInteractorTest.kt | 6 - .../AssetSettingsViewModelTest.kt | 11 +- .../send/TransferAmountViewModelTest.kt | 7 - .../screen/TxHistoryListScreen.kt | 2 +- .../txdetails/TxDetailsLiquidity.kt | 5 +- .../txdetails/TxDetailsReferralAndTransfer.kt | 3 +- .../txdetails/TxDetailsScreenState.kt | 5 +- .../presentation/txdetails/TxDetailsSwap.kt | 5 +- .../presentation/txhistory/SoraTransaction.kt | 19 +-- .../TransactionMappersTest.kt | 5 +- .../domain/TransactionHistoryHandlerTest.kt | 146 +++++++++------- .../screen/ActivitiesViewModelTest.kt | 53 +++--- .../txdetails/TxDetailsViewModelTest.kt | 8 +- .../allcurrencies/AllCurrenciesScreen.kt | 2 +- .../presentation/allpools/AllPoolsScreen.kt | 2 +- feature_ethereum_impl/build.gradle | 2 +- .../presentation/MainActivity.kt | 14 +- .../domain/MainInteractorTest.kt | 32 ++-- .../presentation/MainViewModelTest.kt | 51 +++--- feature_multiaccount_impl/build.gradle | 5 +- .../account_details/AccountDetailsScreen.kt | 63 ++++--- .../AccountDetailsScreenBasic.kt | 89 +++++++--- .../account_list/AccountListMenu.kt | 51 +++--- .../account_list/AccountListScreen.kt | 118 +++++++++---- .../account_list/AccountWithIcon.kt | 4 +- .../ImportAccountPasswordScreen.kt | 6 +- .../OnboardingViewModelTest.kt | 27 +-- .../components/compose/SwapAmountSquare.kt | 3 +- .../components/compose/SwapMarketsScreen.kt | 1 + .../components/compose/SwapSlippageScreen.kt | 43 +++-- .../liquidityadd/LiquidityAddFragment.kt | 2 +- .../LiquidityRemoveFragment.kt | 2 +- .../presentation/screens/swap/SwapFragment.kt | 3 +- .../presentation/states/PoolDetailsState.kt | 10 +- .../presentation/states/PoolSettingsState.kt | 5 +- .../polkaswap/SwapViewModelTest.kt | 13 -- .../add/AddLiquidityViewModelTest.kt | 10 -- .../presentation/ReferralBondUnbondXor.kt | 73 +++++--- .../presentation/ReferralFragment.kt | 20 ++- .../presentation/ReferralViewModel.kt | 16 +- .../data/ReferralRepositoryTest.kt | 36 ++-- .../presentation/ReferralViewModelTest.kt | 126 ++++++-------- .../presentation/details/NodeDetailsScreen.kt | 9 - .../details/NodeDetailsViewModel.kt | 17 -- .../details/NodeDetailsViewModelTest.kt | 19 --- .../get/card/GetSoraCardViewModelTest.kt | 2 +- feature_wallet_impl/build.gradle | 5 +- .../presentation/cardshub/BuyXorCard.kt | 27 ++- .../presentation/cardshub/SoraCard.kt | 37 +++- .../data/repository/WalletRepositoryTest.kt | 3 +- .../wallet/CardsHubViewModelTest.kt | 10 -- .../sora/substrate/models/BlockResponse.kt | 8 +- .../substrate/response/BalanceResponse.kt | 5 +- .../substrate/response/ChainHeaderResponse.kt | 5 +- .../sora/substrate/response/FeeResponse.kt | 5 +- .../sora/substrate/response/FeeResponse2.kt | 8 +- .../substrate/response/StateQueryResponse.kt | 5 +- .../sora/substrate/SubstrateApiTest.kt | 51 +++--- 100 files changed, 1127 insertions(+), 983 deletions(-) delete mode 100644 common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/ContentCardEndless.kt create mode 100644 common/src/main/res/drawable-night-hdpi/ic_polkaswap_full_title.png create mode 100644 common/src/main/res/drawable-night-mdpi/ic_polkaswap_full_title.png create mode 100644 common/src/main/res/drawable-night-xhdpi/ic_polkaswap_full_title.png create mode 100644 common/src/main/res/drawable-night-xxhdpi/ic_polkaswap_full_title.png create mode 100644 common/src/main/res/drawable-night-xxxhdpi/ic_polkaswap_full_title.png diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index f6de8d9d5..caadaf61d 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -10,6 +10,121 @@ #Firebase Crashlytics -keep,includedescriptorclasses public class * extends java.lang.Exception +########### +-keep public class * extends jp.co.soramitsu.common.util.ParseModel { + ; + ; + } + + # This is generated automatically by the Android Gradle plugin. + -dontwarn build.IgnoreJava8API + -dontwarn java.awt.Component + -dontwarn java.awt.GraphicsEnvironment + -dontwarn java.awt.HeadlessException + -dontwarn java.awt.Window + -dontwarn java.beans.ConstructorProperties + -dontwarn java.beans.Transient + -dontwarn java.lang.management.ManagementFactory + -dontwarn java.lang.management.RuntimeMXBean + -dontwarn java.lang.management.ThreadMXBean + -dontwarn javax.servlet.ServletContextListener + -dontwarn lombok.NonNull + -dontwarn org.apache.avalon.framework.logger.Logger + -dontwarn org.apache.log.Hierarchy + -dontwarn org.apache.log.Logger + -dontwarn org.apache.log4j.Level + -dontwarn org.apache.log4j.Logger + -dontwarn org.apache.log4j.Priority + -dontwarn org.apache.xml.resolver.Catalog + -dontwarn org.apache.xml.resolver.CatalogManager + -dontwarn org.apache.xml.resolver.readers.CatalogReader + -dontwarn org.apache.xml.resolver.readers.SAXCatalogReader + -dontwarn org.ietf.jgss.GSSContext + -dontwarn org.ietf.jgss.GSSCredential + -dontwarn org.ietf.jgss.GSSException + -dontwarn org.ietf.jgss.GSSManager + -dontwarn org.ietf.jgss.GSSName + -dontwarn org.ietf.jgss.Oid + -dontwarn org.slf4j.impl.StaticLoggerBinder + -dontwarn org.slf4j.impl.StaticMDCBinder + -dontwarn org.slf4j.impl.StaticMarkerBinder + -dontwarn org.w3c.dom.events.DocumentEvent + -dontwarn org.w3c.dom.events.Event + -dontwarn org.w3c.dom.events.EventException + -dontwarn org.w3c.dom.events.EventListener + -dontwarn org.w3c.dom.events.EventTarget + -dontwarn org.w3c.dom.events.MouseEvent + -dontwarn org.w3c.dom.events.MutationEvent + -dontwarn org.w3c.dom.events.UIEvent + -dontwarn org.w3c.dom.html.HTMLAnchorElement + -dontwarn org.w3c.dom.html.HTMLAppletElement + -dontwarn org.w3c.dom.html.HTMLAreaElement + -dontwarn org.w3c.dom.html.HTMLBRElement + -dontwarn org.w3c.dom.html.HTMLBaseElement + -dontwarn org.w3c.dom.html.HTMLBaseFontElement + -dontwarn org.w3c.dom.html.HTMLBodyElement + -dontwarn org.w3c.dom.html.HTMLButtonElement + -dontwarn org.w3c.dom.html.HTMLCollection + -dontwarn org.w3c.dom.html.HTMLDListElement + -dontwarn org.w3c.dom.html.HTMLDirectoryElement + -dontwarn org.w3c.dom.html.HTMLDivElement + -dontwarn org.w3c.dom.html.HTMLDocument + -dontwarn org.w3c.dom.html.HTMLElement + -dontwarn org.w3c.dom.html.HTMLFieldSetElement + -dontwarn org.w3c.dom.html.HTMLFontElement + -dontwarn org.w3c.dom.html.HTMLFormElement + -dontwarn org.w3c.dom.html.HTMLFrameElement + -dontwarn org.w3c.dom.html.HTMLFrameSetElement + -dontwarn org.w3c.dom.html.HTMLHRElement + -dontwarn org.w3c.dom.html.HTMLHeadElement + -dontwarn org.w3c.dom.html.HTMLHeadingElement + -dontwarn org.w3c.dom.html.HTMLHtmlElement + -dontwarn org.w3c.dom.html.HTMLIFrameElement + -dontwarn org.w3c.dom.html.HTMLImageElement + -dontwarn org.w3c.dom.html.HTMLInputElement + -dontwarn org.w3c.dom.html.HTMLIsIndexElement + -dontwarn org.w3c.dom.html.HTMLLIElement + -dontwarn org.w3c.dom.html.HTMLLabelElement + -dontwarn org.w3c.dom.html.HTMLLegendElement + -dontwarn org.w3c.dom.html.HTMLLinkElement + -dontwarn org.w3c.dom.html.HTMLMapElement + -dontwarn org.w3c.dom.html.HTMLMenuElement + -dontwarn org.w3c.dom.html.HTMLMetaElement + -dontwarn org.w3c.dom.html.HTMLModElement + -dontwarn org.w3c.dom.html.HTMLOListElement + -dontwarn org.w3c.dom.html.HTMLObjectElement + -dontwarn org.w3c.dom.html.HTMLOptGroupElement + -dontwarn org.w3c.dom.html.HTMLOptionElement + -dontwarn org.w3c.dom.html.HTMLParagraphElement + -dontwarn org.w3c.dom.html.HTMLParamElement + -dontwarn org.w3c.dom.html.HTMLPreElement + -dontwarn org.w3c.dom.html.HTMLQuoteElement + -dontwarn org.w3c.dom.html.HTMLScriptElement + -dontwarn org.w3c.dom.html.HTMLSelectElement + -dontwarn org.w3c.dom.html.HTMLStyleElement + -dontwarn org.w3c.dom.html.HTMLTableCaptionElement + -dontwarn org.w3c.dom.html.HTMLTableCellElement + -dontwarn org.w3c.dom.html.HTMLTableColElement + -dontwarn org.w3c.dom.html.HTMLTableElement + -dontwarn org.w3c.dom.html.HTMLTableRowElement + -dontwarn org.w3c.dom.html.HTMLTableSectionElement + -dontwarn org.w3c.dom.html.HTMLTextAreaElement + -dontwarn org.w3c.dom.html.HTMLTitleElement + -dontwarn org.w3c.dom.html.HTMLUListElement + -dontwarn org.w3c.dom.ls.LSSerializerFilter + -dontwarn org.w3c.dom.ranges.DocumentRange + -dontwarn org.w3c.dom.ranges.Range + -dontwarn org.w3c.dom.ranges.RangeException + -dontwarn org.w3c.dom.traversal.DocumentTraversal + -dontwarn org.w3c.dom.traversal.NodeFilter + -dontwarn org.w3c.dom.traversal.NodeIterator + -dontwarn org.w3c.dom.traversal.TreeWalker + -dontwarn org.web3j.abi.datatypes.generated.AbiTypes + -dontwarn org.webrtc.Dav1dDecoder + -dontwarn sun.security.x509.X509Key + +-dontwarn java.lang.invoke.StringConcatFactory + # Gson -keep,allowobfuscation,allowoptimization class * { @com.google.gson.annotations.SerializedName ; diff --git a/build.gradle b/build.gradle index 268da1a74..e79c92346 100644 --- a/build.gradle +++ b/build.gradle @@ -44,7 +44,7 @@ buildscript { composeMaterial : '1.4.3', composeCompiler : '1.5.3', composeConstraintLayout: '1.1.0-alpha05', - uiCore : '0.2.0', + uiCore : '0.2.6', soraCard : '0.1.45', lazySodium : '5.0.2', jna : '5.8.0', @@ -90,9 +90,6 @@ buildscript { daggerDep = "com.google.dagger:hilt-android:$versions.dagger" daggerKaptDep = "com.google.dagger:hilt-compiler:$versions.dagger" hiltUiTestDep = "com.google.dagger:hilt-android-testing:$versions.dagger" - hiltUiTestKaptDep = "com.google.dagger:hilt-compiler:$versions.dagger" - hiltUnitTestDep = "com.google.dagger:hilt-android-testing:$versions.dagger" - hiltUnitTestKaptDep = "com.google.dagger:hilt-compiler:$versions.dagger" hiltNavComposeDep = "androidx.hilt:hilt-navigation-compose:$versions.hiltCompose" hiltWorkManagerDep = "androidx.hilt:hilt-work:$versions.hiltWorkManager" hiltWorkManagerKaptDep = "androidx.hilt:hilt-compiler:$versions.hiltWorkManager" @@ -154,10 +151,10 @@ buildscript { jUnitDep = "junit:junit:$versions.jUnit" mockitoDep = "org.mockito:mockito-inline:$versions.mockito" - mockitoKotlinDep = "org.mockito.kotlin:mockito-kotlin:4.1.0" + mockitoKotlinDep = "org.mockito.kotlin:mockito-kotlin:5.1.0" // https://github.com/mockk/mockk/issues/243 - mockkDep = "io.mockk:mockk:1.13.5" + mockkDep = "io.mockk:mockk:1.13.8" // powerMockDep = "org.powermock:powermock-module-junit4:2.0.2" // powerMockMockitoDep = "org.powermock:powermock-api-mockito2:2.0.2" @@ -221,7 +218,7 @@ buildscript { dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}" classpath "org.jetbrains.kotlin:kotlin-serialization:${versions.kotlin}" - classpath 'com.android.tools.build:gradle:8.2.0-beta05' + classpath 'com.android.tools.build:gradle:8.2.0-beta06' classpath 'com.google.gms:google-services:4.3.15' classpath 'com.google.firebase:firebase-appdistribution-gradle:3.2.0' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.4' @@ -232,6 +229,7 @@ buildscript { plugins { id "org.sonarqube" version "2.7" + id 'com.google.devtools.ksp' version '1.9.10-1.0.13' apply false } apply from: 'secrets.gradle' diff --git a/common/src/main/java/jp/co/soramitsu/common/base/SoraBaseFragment.kt b/common/src/main/java/jp/co/soramitsu/common/base/SoraBaseFragment.kt index b69bf8d29..479a637cd 100644 --- a/common/src/main/java/jp/co/soramitsu/common/base/SoraBaseFragment.kt +++ b/common/src/main/java/jp/co/soramitsu/common/base/SoraBaseFragment.kt @@ -39,7 +39,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.Toast -import androidx.activity.compose.BackHandler +import androidx.activity.addCallback import androidx.compose.animation.ExperimentalAnimationApi import androidx.compose.foundation.ScrollState import androidx.compose.foundation.layout.fillMaxSize @@ -69,7 +69,7 @@ import androidx.navigation.compose.rememberNavController import androidx.navigation.findNavController import javax.inject.Inject import jp.co.soramitsu.common.R -import jp.co.soramitsu.common.domain.BarsColorhandler +import jp.co.soramitsu.common.domain.BarsColorHandler import jp.co.soramitsu.common.domain.DarkThemeManager import jp.co.soramitsu.common.presentation.compose.components.AlertDialogContent import jp.co.soramitsu.common.presentation.compose.components.Toolbar @@ -94,9 +94,16 @@ abstract class SoraBaseFragment : Fragment() { @Inject lateinit var darkThemeManager: DarkThemeManager + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + activity?.onBackPressedDispatcher?.addCallback(this) { + onBack() + } + } + override fun onResume() { super.onResume() - activity?.safeCast()?.setColor(backgroundColor()) + activity?.safeCast()?.setColor(backgroundColor()) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -149,6 +156,19 @@ abstract class SoraBaseFragment : Fragment() { it.second.invoke(this) } } + viewModel.navToStart.observe { + with(navController) { + popBackStack(graph.startDestinationId, true) + graph.setStartDestination(it) + navigate(it) + } +// with(navController) { +// navigate(it) { +// popUpTo(graph.startDestinationId) {inclusive = true} +// } +// graph.setStartDestination(it) +// } + } viewModel.errorLiveData.observe { openAlertDialog.value = AlertDialogData( title = R.string.common_error_general_title, @@ -208,9 +228,6 @@ abstract class SoraBaseFragment : Fragment() { ) } ) { padding -> - BackHandler { - onBack() - } NavHost( modifier = Modifier .padding(padding) diff --git a/common/src/main/java/jp/co/soramitsu/common/data/network/dto/SwapFeeDto.kt b/common/src/main/java/jp/co/soramitsu/common/data/network/dto/SwapFeeDto.kt index f2cde61e6..396c1aa7f 100644 --- a/common/src/main/java/jp/co/soramitsu/common/data/network/dto/SwapFeeDto.kt +++ b/common/src/main/java/jp/co/soramitsu/common/data/network/dto/SwapFeeDto.kt @@ -32,12 +32,11 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common.data.network.dto -import androidx.annotation.Keep import java.math.BigInteger +import jp.co.soramitsu.common.util.ParseModel -@Keep data class SwapFeeDto( val amount: BigInteger, val fee: BigInteger, val route: List? = null, -) +) : ParseModel() diff --git a/common/src/main/java/jp/co/soramitsu/common/domain/Asset.kt b/common/src/main/java/jp/co/soramitsu/common/domain/Asset.kt index 54a779f75..3e8f7a474 100644 --- a/common/src/main/java/jp/co/soramitsu/common/domain/Asset.kt +++ b/common/src/main/java/jp/co/soramitsu/common/domain/Asset.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common.domain -import android.net.Uri import android.os.Parcelable import java.math.BigDecimal import jp.co.soramitsu.common.R @@ -87,7 +86,7 @@ data class Token( val symbol: String, val precision: Int, val isHidable: Boolean, - val iconFile: Uri?, + val iconFile: String?, val fiatPrice: Double?, val fiatPriceChange: Double?, val fiatSymbol: String?, @@ -136,7 +135,7 @@ fun List.getByIdOrEmpty(id: String): Token = it.id == id } ?: AssetHolder.emptyToken -fun Token.iconUri(): Uri = this.iconFile ?: DEFAULT_ICON_URI +fun Token.iconUri(): String = this.iconFile ?: DEFAULT_ICON_URI fun Token.isMatchFilter(filter: String): Boolean = name.lowercase().contains(filter.lowercase()) || @@ -144,4 +143,4 @@ fun Token.isMatchFilter(filter: String): Boolean = id.lowercase().contains(filter.lowercase()) val DEFAULT_ICON: Int = R.drawable.ic_token_default -val DEFAULT_ICON_URI = Uri.parse("file:///android_asset/ic_token_default.png") +val DEFAULT_ICON_URI = "file:///android_asset/ic_token_default.png" diff --git a/common/src/main/java/jp/co/soramitsu/common/domain/BottomBarController.kt b/common/src/main/java/jp/co/soramitsu/common/domain/BottomBarController.kt index 95b65cd6e..0dcfe4294 100644 --- a/common/src/main/java/jp/co/soramitsu/common/domain/BottomBarController.kt +++ b/common/src/main/java/jp/co/soramitsu/common/domain/BottomBarController.kt @@ -43,7 +43,7 @@ interface BottomBarController { fun isBottomBarVisible(): Boolean } -interface BarsColorhandler { +interface BarsColorHandler { fun setColor(@AttrRes color: Int) } diff --git a/common/src/main/java/jp/co/soramitsu/common/domain/WhitelistTokensManager.kt b/common/src/main/java/jp/co/soramitsu/common/domain/WhitelistTokensManager.kt index 76e5953e2..256fdbb83 100644 --- a/common/src/main/java/jp/co/soramitsu/common/domain/WhitelistTokensManager.kt +++ b/common/src/main/java/jp/co/soramitsu/common/domain/WhitelistTokensManager.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common.domain -import android.net.Uri import javax.inject.Inject import javax.inject.Singleton import jp.co.soramitsu.common.io.FileManager @@ -78,13 +77,14 @@ class WhitelistTokensManager @Inject constructor( } } - fun getTokenIconUri(tokenId: String): Uri { + fun getTokenIconUri(tokenId: String): String { val type = curWhitelist.find { it.id == tokenId }?.type - return if (type == null) { + val u = if (type == null) { DEFAULT_ICON_URI } else { fileManager.readInternalCacheFileAsUri("$tokenId.$type") ?: DEFAULT_ICON_URI } + return u.toString() } suspend fun updateWhitelistStorage() { diff --git a/common/src/main/java/jp/co/soramitsu/common/inappupdate/InAppUpdateManager.kt b/common/src/main/java/jp/co/soramitsu/common/inappupdate/InAppUpdateManager.kt index c63a2d88f..371508eb6 100644 --- a/common/src/main/java/jp/co/soramitsu/common/inappupdate/InAppUpdateManager.kt +++ b/common/src/main/java/jp/co/soramitsu/common/inappupdate/InAppUpdateManager.kt @@ -35,9 +35,8 @@ package jp.co.soramitsu.common.inappupdate import android.app.Activity import android.content.Context import androidx.lifecycle.Lifecycle -import androidx.lifecycle.LifecycleObserver +import androidx.lifecycle.LifecycleEventObserver import androidx.lifecycle.LifecycleOwner -import androidx.lifecycle.OnLifecycleEvent import com.google.android.play.core.appupdate.AppUpdateInfo import com.google.android.play.core.appupdate.AppUpdateManagerFactory import com.google.android.play.core.install.InstallStateUpdatedListener @@ -54,7 +53,7 @@ import kotlin.coroutines.suspendCoroutine class InAppUpdateManager( context: Context, private val soraPreferences: SoraPreferences -) : LifecycleObserver { +) : LifecycleEventObserver { interface UpdateManagerListener : LifecycleOwner { fun readyToShowFlexible(): Int? @@ -74,6 +73,7 @@ class InAppUpdateManager( InstallStatus.DOWNLOADED -> { mainActivity?.askUserToInstall() } + else -> { } } @@ -127,6 +127,7 @@ class InAppUpdateManager( ) } } + AppUpdateType.IMMEDIATE -> { soraPreferences.putLong(ARG_TIME, now) googleUpdateManager.startUpdateFlowForResult( @@ -136,6 +137,7 @@ class InAppUpdateManager( 1 ) } + else -> { } } @@ -171,9 +173,10 @@ class InAppUpdateManager( ) == true } - @OnLifecycleEvent(Lifecycle.Event.ON_STOP) - fun onStop() { - mainActivity?.lifecycle?.removeObserver(this) - mainActivity = null + override fun onStateChanged(source: LifecycleOwner, event: Lifecycle.Event) { + if (event == Lifecycle.Event.ON_STOP) { + mainActivity?.lifecycle?.removeObserver(this) + mainActivity = null + } } } diff --git a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/TokenIcon.kt b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/TokenIcon.kt index 2cd314f4c..a96d5ea58 100644 --- a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/TokenIcon.kt +++ b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/TokenIcon.kt @@ -32,6 +32,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common.presentation.compose +import android.graphics.drawable.Drawable import androidx.compose.foundation.layout.size import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -40,16 +41,33 @@ import androidx.compose.ui.unit.Dp import coil.compose.AsyncImage import coil.imageLoader import coil.request.ImageRequest +import jp.co.soramitsu.common.R @Composable fun TokenIcon( modifier: Modifier = Modifier, - uri: Any, + uri: String?, size: Dp, ) { AsyncImage( model = ImageRequest.Builder(LocalContext.current) - .data(uri).build(), + .data(uri ?: R.drawable.ic_token_default).build(), + modifier = modifier + .size(size = size), + contentDescription = null, + imageLoader = LocalContext.current.imageLoader, + ) +} + +@Composable +fun AccountIcon( + modifier: Modifier = Modifier, + drawable: Drawable?, + size: Dp, +) { + AsyncImage( + model = ImageRequest.Builder(LocalContext.current) + .data(drawable ?: R.drawable.ic_token_default).build(), modifier = modifier .size(size = size), contentDescription = null, diff --git a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/AccountWithIcon.kt b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/AccountWithIcon.kt index a5a7505f7..6282d99f6 100644 --- a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/AccountWithIcon.kt +++ b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/AccountWithIcon.kt @@ -48,8 +48,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import jp.co.soramitsu.common.R -import jp.co.soramitsu.common.domain.DEFAULT_ICON_URI -import jp.co.soramitsu.common.presentation.compose.TokenIcon +import jp.co.soramitsu.common.presentation.compose.AccountIcon import jp.co.soramitsu.ui_core.component.button.properties.Size import jp.co.soramitsu.ui_core.resources.Dimens import jp.co.soramitsu.ui_core.theme.customColors @@ -75,7 +74,7 @@ fun AccountWithIcon( ), verticalAlignment = Alignment.CenterVertically, ) { - TokenIcon(uri = accountIcon ?: DEFAULT_ICON_URI, size = Size.Small) + AccountIcon(drawable = accountIcon, size = Size.Small) Text( modifier = Modifier .weight(1f) diff --git a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/AssetAmount.kt b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/AssetAmount.kt index 4b5e59a01..af7ca89f3 100644 --- a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/AssetAmount.kt +++ b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/AssetAmount.kt @@ -32,6 +32,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common.presentation.compose.components +import android.content.res.Configuration import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.background import androidx.compose.foundation.border @@ -68,6 +69,7 @@ import jp.co.soramitsu.common.R import jp.co.soramitsu.common.domain.AssetAmountInputState import jp.co.soramitsu.common.domain.OptionsProvider import jp.co.soramitsu.common.presentation.compose.TokenIcon +import jp.co.soramitsu.common.presentation.compose.theme.SoraAppTheme import jp.co.soramitsu.common.util.ext.orZero import jp.co.soramitsu.common.util.ext.testTagAsId import jp.co.soramitsu.ui_core.component.button.properties.Size @@ -108,7 +110,7 @@ fun AssetAmountInput( verticalAlignment = Alignment.CenterVertically, ) { TokenIcon( - uri = state?.token?.iconFile ?: R.drawable.ic_token_default, + uri = state?.token?.iconFile, size = Size.Small, modifier = Modifier .testTagAsId("TokenIcon") @@ -156,7 +158,7 @@ fun AssetAmountInput( focusedInput.value = it onFocusChange.invoke(it) }, - textStyle = MaterialTheme.customTypography.displayS.copy(textAlign = TextAlign.End), + textStyle = MaterialTheme.customTypography.displayS.copy(textAlign = TextAlign.End, color = MaterialTheme.customColors.fgPrimary), enabled = state?.let { it.enabled && !it.readOnly } ?: false, precision = state?.token?.precision ?: OptionsProvider.defaultScale, defaultCursorPosition = DefaultCursorPosition.START, @@ -224,45 +226,92 @@ val previewAssetAmountInputState = AssetAmountInputState( errorHint = "", ) -@Preview(showBackground = true) +@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO) @Composable -private fun PreviewAssetAmountInput() { - Column( - modifier = Modifier - .fillMaxWidth() - .wrapContentHeight() - .background(color = Color.Red) - .padding(10.dp) - ) { - val bb = remember { mutableStateOf(BigDecimal.valueOf(12345.67890988765)) } - val state = remember { mutableStateOf(previewAssetAmountInputState) } - Button(onClick = { - state.value = state.value.copy( - amount = bb.value, +private fun PreviewAssetAmountInput01() { + SoraAppTheme { + Column( + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight() + .background(color = MaterialTheme.customColors.bgPage) + .padding(10.dp) + ) { + val bb = remember { mutableStateOf(BigDecimal.valueOf(12345.67890988765)) } + val state = remember { mutableStateOf(previewAssetAmountInputState) } + Button(onClick = { + state.value = state.value.copy( + amount = bb.value, + ) + bb.value = bb.value.plus(BigDecimal.ONE) + }) { + Text(text = "click") + } + AssetAmountInput( + modifier = Modifier, + state = state.value, + onAmountChange = { + state.value = state.value.copy( + amount = it, + ) + }, + onSelectToken = {}, + onFocusChange = {}, + ) + Spacer(modifier = Modifier.size(10.dp)) + Text(text = state.value.amount.orZero().toPlainString()) + AssetAmountInput( + modifier = Modifier, + state = previewAssetAmountInputState, + onAmountChange = {}, + onSelectToken = {}, + onFocusChange = {}, ) - bb.value = bb.value.plus(BigDecimal.ONE) - }) { - Text(text = "click") } - AssetAmountInput( - modifier = Modifier, - state = state.value, - onAmountChange = { + } +} + +@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES) +@Composable +private fun PreviewAssetAmountInput02() { + SoraAppTheme { + Column( + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight() + .background(color = MaterialTheme.customColors.bgPage) + .padding(10.dp) + ) { + val bb = remember { mutableStateOf(BigDecimal.valueOf(12345.67890988765)) } + val state = remember { mutableStateOf(previewAssetAmountInputState) } + Button(onClick = { state.value = state.value.copy( - amount = it, + amount = bb.value, ) - }, - onSelectToken = {}, - onFocusChange = {}, - ) - Spacer(modifier = Modifier.size(10.dp)) - Text(text = state.value.amount.orZero().toPlainString()) - AssetAmountInput( - modifier = Modifier, - state = previewAssetAmountInputState, - onAmountChange = {}, - onSelectToken = {}, - onFocusChange = {}, - ) + bb.value = bb.value.plus(BigDecimal.ONE) + }) { + Text(text = "click") + } + AssetAmountInput( + modifier = Modifier, + state = state.value, + onAmountChange = { + state.value = state.value.copy( + amount = it, + ) + }, + onSelectToken = {}, + onFocusChange = {}, + ) + Spacer(modifier = Modifier.size(10.dp)) + Text(text = state.value.amount.orZero().toPlainString()) + AssetAmountInput( + modifier = Modifier, + state = previewAssetAmountInputState, + onAmountChange = {}, + onSelectToken = {}, + onFocusChange = {}, + ) + } } } diff --git a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/ContentCardEndless.kt b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/ContentCardEndless.kt deleted file mode 100644 index e141967c2..000000000 --- a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/ContentCardEndless.kt +++ /dev/null @@ -1,108 +0,0 @@ -/* -This file is part of the SORA network and Polkaswap app. - -Copyright (c) 2020, 2021, Polka Biome Ltd. All rights reserved. -SPDX-License-Identifier: BSD-4-Clause - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list -of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, this -list of conditions and the following disclaimer in the documentation and/or other -materials provided with the distribution. - -All advertising materials mentioning features or use of this software must display -the following acknowledgement: This product includes software developed by Polka Biome -Ltd., SORA, and Polkaswap. - -Neither the name of the Polka Biome Ltd. nor the names of its contributors may be used -to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Polka Biome Ltd. AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Polka Biome Ltd. BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package jp.co.soramitsu.common.presentation.compose.components - -import androidx.compose.foundation.background -import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.PaddingValues -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.Card -import androidx.compose.material.MaterialTheme -import androidx.compose.material.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.draw.shadow -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp -import jp.co.soramitsu.ui_core.modifier.applyIf -import jp.co.soramitsu.ui_core.resources.Dimens -import jp.co.soramitsu.ui_core.theme.borderRadius -import jp.co.soramitsu.ui_core.theme.customColors - -@Composable -fun ContentCardEndless( - modifier: Modifier = Modifier, - innerPadding: PaddingValues = PaddingValues(0.dp), - onClick: (() -> Unit)? = null, - content: @Composable () -> Unit, -) { - Card( - modifier = modifier - .shadow( - elevation = Dimens.x4, - ambientColor = Color(0xFF999999), - spotColor = Color(0xFF999999), - shape = RoundedCornerShape( - topStart = MaterialTheme.borderRadius.xl, - topEnd = MaterialTheme.borderRadius.xl, - ), - ) - .clip( - RoundedCornerShape( - topStart = MaterialTheme.borderRadius.xl, - topEnd = MaterialTheme.borderRadius.xl, - ) - ) - .applyIf(onClick != null) { - clickable { onClick?.invoke() } - } - .background(MaterialTheme.customColors.bgSurface) - .padding(innerPadding), - elevation = 0.dp, - content = content, - ) -} - -@Preview(showBackground = true) -@Composable -private fun Preview() { - Box( - modifier = Modifier.fillMaxSize() - ) { - ContentCardEndless( - modifier = Modifier.padding(8.dp), - innerPadding = PaddingValues(18.dp), - ) { - Text( - text = "df\nfgfg", - modifier = Modifier.fillMaxWidth() - ) - } - } -} diff --git a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/DetailsItem.kt b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/DetailsItem.kt index ce8e322aa..c167cff9a 100644 --- a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/DetailsItem.kt +++ b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/DetailsItem.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common.presentation.compose.components -import android.net.Uri import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -79,7 +78,7 @@ fun DetailsItem( value1: String, value2: String? = null, value1Bold: Boolean = false, - value1Uri: Uri? = null, + value1Uri: String? = null, value1Percent: Float? = null, hint: String? = null, valueColor: Color = MaterialTheme.customColors.fgPrimary, @@ -93,6 +92,7 @@ fun DetailsItem( ) { if (hintVisible && hint != null) { AlertDialog( + backgroundColor = MaterialTheme.customColors.bgPage, title = { Text( text = text, diff --git a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/PolkaswapDisclaimer.kt b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/PolkaswapDisclaimer.kt index 2414160c0..7f9f1f5eb 100644 --- a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/PolkaswapDisclaimer.kt +++ b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/PolkaswapDisclaimer.kt @@ -32,6 +32,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common.presentation.compose.components +import android.content.res.Configuration import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.fillMaxWidth @@ -46,6 +47,7 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.viewinterop.AndroidView import jp.co.soramitsu.common.R +import jp.co.soramitsu.common.presentation.compose.theme.SoraAppTheme import jp.co.soramitsu.common.presentation.view.PolkaswapDisclaimerView import jp.co.soramitsu.common.util.ext.testTagAsId import jp.co.soramitsu.ui_core.component.button.TonalButton @@ -102,10 +104,22 @@ fun PolkaswapDisclaimer( } } -@Preview(showBackground = true) +@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_NO) @Composable -private fun PreviewPolkaswapDisclaimer() { - PolkaswapDisclaimer( - onDisclaimerClose = {}, - ) +private fun PreviewPolkaswapDisclaimer01() { + SoraAppTheme { + PolkaswapDisclaimer( + onDisclaimerClose = {}, + ) + } +} + +@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES) +@Composable +private fun PreviewPolkaswapDisclaimer02() { + SoraAppTheme { + PolkaswapDisclaimer( + onDisclaimerClose = {}, + ) + } } diff --git a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/theme/tokens/NightThemeColors.kt b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/theme/tokens/NightThemeColors.kt index 9237eb289..4013523e0 100644 --- a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/theme/tokens/NightThemeColors.kt +++ b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/theme/tokens/NightThemeColors.kt @@ -33,11 +33,11 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common.presentation.compose.theme.tokens import jp.co.soramitsu.common.presentation.compose.theme.tokens.Colors.Brown30 -import jp.co.soramitsu.common.presentation.compose.theme.tokens.Colors.Brown5 import jp.co.soramitsu.common.presentation.compose.theme.tokens.Colors.Green40 import jp.co.soramitsu.common.presentation.compose.theme.tokens.Colors.Green5 import jp.co.soramitsu.common.presentation.compose.theme.tokens.Colors.Grey5 import jp.co.soramitsu.common.presentation.compose.theme.tokens.Colors.Grey50 +import jp.co.soramitsu.common.presentation.compose.theme.tokens.Colors.Grey60 import jp.co.soramitsu.common.presentation.compose.theme.tokens.Colors.Grey70 import jp.co.soramitsu.common.presentation.compose.theme.tokens.Colors.Grey80 import jp.co.soramitsu.common.presentation.compose.theme.tokens.Colors.Grey90 @@ -78,7 +78,7 @@ object NightThemeColors { val FgInverted = Grey90 - val FgOutline = Brown5 + val FgOutline = Grey60 val StatusSuccess = Green40 diff --git a/common/src/main/java/jp/co/soramitsu/common/presentation/viewmodel/BaseViewModel.kt b/common/src/main/java/jp/co/soramitsu/common/presentation/viewmodel/BaseViewModel.kt index 26c4b3d22..fd3cd8c10 100644 --- a/common/src/main/java/jp/co/soramitsu/common/presentation/viewmodel/BaseViewModel.kt +++ b/common/src/main/java/jp/co/soramitsu/common/presentation/viewmodel/BaseViewModel.kt @@ -63,6 +63,9 @@ open class BaseViewModel : ViewModel() { protected val _navEvent = SingleLiveEvent Unit>>() val navEvent: LiveData Unit>> = _navEvent + protected val _navToStart = SingleLiveEvent() + val navToStart: LiveData = _navToStart + protected var currentDestination: String = "" get() = field.ifEmpty { startScreen() } diff --git a/common/src/main/java/jp/co/soramitsu/common/util/Const.kt b/common/src/main/java/jp/co/soramitsu/common/util/Const.kt index d92fd6efa..6d037115e 100644 --- a/common/src/main/java/jp/co/soramitsu/common/util/Const.kt +++ b/common/src/main/java/jp/co/soramitsu/common/util/Const.kt @@ -32,6 +32,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common.util +open class ParseModel + object Const { const val SORA = "SORA" diff --git a/common/src/main/res/drawable-night-hdpi/ic_polkaswap_full_title.png b/common/src/main/res/drawable-night-hdpi/ic_polkaswap_full_title.png new file mode 100644 index 0000000000000000000000000000000000000000..0969c6254f7cb98430b6385d0fef77d5e4b945c1 GIT binary patch literal 3430 zcmV-s4Vm(ZP)d4E&-zB z2>zKt2Z*3Yj}5{S`tHhnR3a+_c={@W=@K4@0rcpxQRpM65*lpUmjpUMPwF0&;fc<_t-E7X-(c7x~Ktq^w=nV4-hxXx(ez2 z1$y-87#hYy6UjI*A9oE|jSqcy9>H%j%!^>Q)bKVnrD7qLmUaA`7@PaXd@{PC`8sjz z-ctAI6gCe1<;HxRm}_Lo8=V;Ky&dfDh2TA=nolh(NM1iTd3QIbVb z^xy+0>%g=@nL4w!={>$JG$e*Ef4!)86$U#twD;uJhVp*hqJvJ0uuPN!{Iu8Rz*EIi z8?waaIx!bkU@8UtkEg0|MSE+~Z_IUu<=`vA=sz-7UO%?QT)QmqjHQpE$Nvp5WM@cf zNITd^!um_;T`Xsb>Oy(JMIe&+5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=L~xE__ITo5yN+e-cmm@=xRi33Evrd zQa?WMh1oLt4u7((C-vilVxPY|Lic!t(8UH4#-i8SG5)jQe+=4imgZBi@Bjb+07*qo IM6N<$g4xKM)Bpeg literal 0 HcmV?d00001 diff --git a/common/src/main/res/drawable-night-mdpi/ic_polkaswap_full_title.png b/common/src/main/res/drawable-night-mdpi/ic_polkaswap_full_title.png new file mode 100644 index 0000000000000000000000000000000000000000..b18e2f701f370468b0f157e2149e86c395350ff8 GIT binary patch literal 2070 zcmV+x2&}ConV9#+|-II)UU9SbpiWd69eq+b58G0x2hudIG64 zP1qr1chaS4L9oH`kGtZxQ^uvjcWEcOSa6VVnM4MRUA{O^EE%FQX!&dZ2?nXWs& zL0fD%Oc%-(G>JZ*(;cu?@Wx}MT!+M3^?KMUc;gZI?syr|uX9=xTLo`CK3$dD(c1A> zutQsH3=FknqCYdXJFXi;YpFY|&}+?gSRarZ2b=TiVX9 zWYJ8UaU%ialIeS)?0V~>Hw2tGrBqUGPVL${8l#?D<^GsapKek8 zQ?kjFSXFLyTxKd(I`qi8SLtukdPq^9!kXQ<1oiLqAYra*I+k$P9kxymV~=;a%`W)W zNj{2RwX7>{9N2z|*K}dWg%Djd(5V?ju?cyn43>6@=B*0GAxO|1Q=#m!VjI&vLt;J> z!xn8QIGO5^4Tn>!(CAcNYOq3|Mf980L$+QHXYVAuaWdL?Ywx}vn77fjaX8Oy_+I?x zfXfp*UJgdCaFNS0qK?F1Hurq<^Vq7|9cR@JsxMEBaMh8GOvoOR3vub-m4hNDPuhGE zX#&0u=z=}euhA#tkNpi{St;50-NZa+aQQx;OXvj02rVI=82wAo60+e$LdL1$)#1zW z##paAKuh#b)i~GR!CX!3!_@6h2=?{k`)<|sinWTn7K{FCU|skMQ?cmU4-m3>#$tr_ z0`1h}OH`j+samS-uyF1hS1!Q?u1N;htyJ+3Ocj|oZ-{3Wc#fv)L*2iD#~5|(lfwww z#N#)5FStH5(5|Ie_lx_JbrSkoEC4ox73fr65% zDDh|?QvBYxiB{+qvqnhrtV=LLS*R21k}$zQjg7T+cycCg!%Sh>g0>p#WM-gcKA$(f z9ay)Uqs|MhyoyJ6bGK^tLa%QU;F&2}&`Y3i;;((x$9Ln9_1eCp5oil><6$d4s(37c z|1R1;St+SZm~1SSb^_YUlDz9q=>&7%uCf?6b|^6(n=k@>s$#3VVqJQww{<_AFV5-TW&nvODrFae$Pb;t%$F~f`Ten9QFNqkcJX8Mq@z_untH0{t-+wo) z6`NC!H>lte_+k4vVdrSafm7&sMjlmAcsj-=F9j5RWnlDyz zolI?!X+Y+}TjvP$fhnxle`ZJTE7~B$>+#pRQ_hx~)s>rHJ^BM4!|3GeJR~VFTtzRnl8B{sMwUrEquPaTc}!JaayJx z7vRx%YrWC2DJ$7v&Za5PEx!}UY6s?#{vPDTfw?A-xd@EQZh4lrDIXfa(A49zK8>c$Pyv!Y}R z#yh7C!B)Zdiv;zQHU!)M*>Jy@%RlS>Nz>QBziWrnUw9Cv>i_@%07*qoM6N<$g2?p+ A7ytkO literal 0 HcmV?d00001 diff --git a/common/src/main/res/drawable-night-xhdpi/ic_polkaswap_full_title.png b/common/src/main/res/drawable-night-xhdpi/ic_polkaswap_full_title.png new file mode 100644 index 0000000000000000000000000000000000000000..3eae3095d0aebf3c634098ed6785a53fb3848666 GIT binary patch literal 4759 zcmV;I5@_v-P)9*ld8HWMw=FzA8#0*ld6R8r^6#s0?Mc>2VA%{`ZmFyGzJ;A9Cq!X6|fBy0=~|4`=hBtT*`^ZNuIMgudqS+Wph!YaF!kvc^L`HyrNkW{Ea66%Yilf_0LY$CrJE5Z- zRvG;J0(OKX#0d#oAuDc%W^*JVPDt1aABqT~x3EJbAx=ox0vXKFobE7{bpbm>65@n} z2-x*t@6|UD#N9&XIT?ic#vw&)B_w!2fgGn!D5XI*H^(f4@5(jZQ?phKuVgM+k-_)- zjBjo}kIj)&iqYnK3xK~KZ4%j)G;uSa`?(b~H<&|@jZmL8HE3{N{IbZc(*rbKW5QPs4 zdLRjL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dY@1Xj%ATG46Oy9Vn-wdoCmIL17(4&`l%jDuh$* z)KyO&
l;oY!ZRAioWy*aQfF{bWTpce;pZup0f4WaU;uqAZ7z#vetRe;w>Z-$)l z!H##?anGf03dk@bpQ%HC5}=!GQCFfcIXuoH?jJk!U0Pn#vkbOumvKZHtFmcX&@Xj2 zkY?usym}6Jb`}=mZ$DaD)`eUh48DSH}mKju3RJeLyc;nI`enU3rO+TX@49zq!#Wz%gFy&Bx< zo-5C@c?Y&#fnLEQnblVs{@HtO-xrzhg0>?jdUxO4v|~WqIUtTs_b3UMUeILk{kJN5 z{qi+zIK2152Wb~s_e=` literal 0 HcmV?d00001 diff --git a/common/src/main/res/drawable-night-xxhdpi/ic_polkaswap_full_title.png b/common/src/main/res/drawable-night-xxhdpi/ic_polkaswap_full_title.png new file mode 100644 index 0000000000000000000000000000000000000000..6b8e61c744dbf42df864d62454fac6bafd3b4edc GIT binary patch literal 7422 zcmX|GbyyV6)2EJ(qnjf{P`dl@XauAi4vsDf>6Y%2ZV(hfx(4{KNL3DgjkMd35 zEj4Eh5iL^df4JrSg&PSC*(MK%Lbk|Tb%ow&omtoeGW5*%toK*8AV=hK(2y*0187Jx zxj}jR>C&%(zCru<%TB_st|;}a?VdrpjkC|NPtfl+*VewGK!D-?p^+etvtw_YMFDA* zmRpjdFQZ;YJ*(vL@n{$jAOe-9EBNh$1Y@X4?osRe!Z+q}(MouswHJ0*>mzp()|k?C zsTy(rB(rutr&CI%A9sUJOW!|sh7j|$jpV^H)nA-afI2ICcr^} zCBcg(R|i~8|{15O^Y-J=!#qtQsH`Xo4 zd}}2Y*jOM9MRDOyCM6wW!VkZCiVc+z4OBIRZ9>Vu>PYwM{*&x|iL?b%Z+_)o57|rV z>5?1be;eH*tC{NC6fALv9V3E=MZLM=WAFyWbUn-ngl5bC#ie90<}J=oGKQ1@R|e_h zgFmG6JjsOZikNku<^L@r&~^sNJYc@AQPThR5g{zTLrHRW-tDiKe2#qu-IM4u_Eh~?9o1Zu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VF>Q=6ohf9ALrNv-)S>05@T{kmkk$8Vq~|$o zJOThkRzjPjJJMLcwx)K3WTT`PN1F=jB#TOpLdeq*O(A zK7_|8o`=7$VyeI_UTV-b6=|V|arjn5Syr>$7zAm0Ek(~tzy|a=ioGjS%W>iI9uvvh z_~wbnOnKAsc5-UUX~#V>oc>t8xpzJkXxd{;A}-Rv!`Z!V@VeA{{k+?-R*A2yh?xib zyaNDIiPj`Gx+kduZM?1#+f=7AArex-G$Q3i*JcdolGVFT(nI%HeW38>OXUg+m0vR^u16+Z zFjL;S*PIZ^{k_`AdH2vzyj&d?Ru*8hwm*k8$~HBA~)>y@8)5!jkKYS=)iqQ;zQ z&D_-N^I}zV<%gA7y%`d1DbfzA#)VncJ`|ZV>GP`WoC`Kl*63uZ>1Xat4Dy90H*>x@ zmnGfMu>(uPgHMBkp>spG???2Xph9T)#r?<8aph>ZWj^X%z4Geg$OL^m&$Z!1`nW;Y zpLP_dRXz%D9;hJ2`NXknlR23GvU5xohj{8Xg&wA0LnSu{$Ijb!am%&I>hC%Vm57-8 zWyU#J*7Ad(?P>o2hLcm2cyfM3wtlQ0-w1WL!az67;0=w6>Z4Y~4JrkVS ze9hVFH}8pcjZ}@fpc|80m;M1e2(XBp-!$euYOxfZL#S_zuM8#Io^5v?B_2XikD_^+nJx+X|0NE&fw z-HDige|qcJhN?pNuge}b`$Ma!Cth9=`(bxr&)HS=(JQ>C$`kb?j@W!#HYpa-0nSGu dVTpRgNH0z2pCo*1|3phf(ooS>u2i&%`hRCX{uKZK literal 0 HcmV?d00001 diff --git a/common/src/main/res/layout/polkaswap_disclaimer_view.xml b/common/src/main/res/layout/polkaswap_disclaimer_view.xml index e7108c03b..fc86f6554 100644 --- a/common/src/main/res/layout/polkaswap_disclaimer_view.xml +++ b/common/src/main/res/layout/polkaswap_disclaimer_view.xml @@ -26,6 +26,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:letterSpacing="-0.02" + android:textColor="?attr/redesignTokenName" app:layout_constraintEnd_toEndOf="@id/glPolkaswapRight" app:layout_constraintStart_toStartOf="@id/glPolkaswapLeft" app:layout_constraintTop_toTopOf="parent" @@ -40,6 +41,7 @@ android:layout_marginTop="@dimen/x2" android:letterSpacing="-0.02" android:text="@string/polkaswap_info_text_2" + android:textColor="?attr/redesignTokenName" app:layout_constraintEnd_toEndOf="@id/glPolkaswapRight" app:layout_constraintStart_toStartOf="@id/glPolkaswapLeft" app:layout_constraintTop_toBottomOf="@id/tvPolkaswapText1" @@ -60,6 +62,7 @@ android:layout_marginTop="@dimen/x2" android:letterSpacing="-0.02" android:text="1." + android:textColor="?attr/redesignTokenName" app:layout_constraintStart_toStartOf="@id/glPolkaswapLeft" app:layout_constraintTop_toBottomOf="@id/tvPolkaswapText2" tools:textSize="12sp" /> @@ -72,6 +75,7 @@ android:layout_marginStart="@dimen/x1" android:letterSpacing="-0.02" android:text="@string/polkaswap_info_text_3" + android:textColor="?attr/redesignTokenName" app:layout_constraintEnd_toEndOf="@id/glPolkaswapRight" app:layout_constraintStart_toStartOf="@id/brPolkaswapInfo" app:layout_constraintTop_toTopOf="@id/tvPolkaswapTextItem1" @@ -85,6 +89,7 @@ android:layout_marginTop="@dimen/x2" android:letterSpacing="-0.02" android:text="2." + android:textColor="?attr/redesignTokenName" app:layout_constraintStart_toStartOf="@id/glPolkaswapLeft" app:layout_constraintTop_toBottomOf="@id/tvPolkaswapText3" tools:textSize="12sp" /> @@ -97,6 +102,7 @@ android:layout_marginStart="@dimen/x1" android:letterSpacing="-0.02" android:text="@string/polkaswap_info_text_4" + android:textColor="?attr/redesignTokenName" app:layout_constraintEnd_toEndOf="@id/glPolkaswapRight" app:layout_constraintStart_toStartOf="@id/brPolkaswapInfo" app:layout_constraintTop_toTopOf="@id/tvPolkaswapTextItem2" @@ -110,6 +116,7 @@ android:layout_marginTop="@dimen/x2" android:letterSpacing="-0.02" android:text="3." + android:textColor="?attr/redesignTokenName" app:layout_constraintStart_toStartOf="@id/glPolkaswapLeft" app:layout_constraintTop_toBottomOf="@id/tvPolkaswapText4" tools:textSize="12sp" /> @@ -122,6 +129,7 @@ android:layout_marginStart="@dimen/x1" android:letterSpacing="-0.02" android:text="@string/polkaswap_info_text_5" + android:textColor="?attr/redesignTokenName" app:layout_constraintEnd_toEndOf="@id/glPolkaswapRight" app:layout_constraintStart_toStartOf="@id/brPolkaswapInfo" app:layout_constraintTop_toTopOf="@id/tvPolkaswapTextItem3" @@ -136,6 +144,7 @@ android:layout_marginTop="@dimen/x2" android:letterSpacing="-0.02" android:text="@string/polkaswap_info_text_6" + android:textColor="?attr/redesignTokenName" app:layout_constraintEnd_toEndOf="@id/glPolkaswapRight" app:layout_constraintStart_toStartOf="@id/brPolkaswapInfo" app:layout_constraintTop_toBottomOf="@id/tvPolkaswapText5" diff --git a/common/src/main/res/values-night/styles.xml b/common/src/main/res/values-night/styles.xml index 8e73a84a9..e5907cde0 100644 --- a/common/src/main/res/values-night/styles.xml +++ b/common/src/main/res/values-night/styles.xml @@ -55,8 +55,8 @@ @color/neu_positive @color/neu_negative @color/neu_fiat_balance_color - @color/neu_tint_dark - @color/neu_bottom_menu_inactive + @color/neu_bottom_menu_inactive_night + @color/neu_bottom_menu_inactive_night @color/neu_tint_light @color/neu_on_background @color/neu_selected_primary diff --git a/common/src/main/res/values/colors.xml b/common/src/main/res/values/colors.xml index 706ea2fdd..500d4bfb7 100644 --- a/common/src/main/res/values/colors.xml +++ b/common/src/main/res/values/colors.xml @@ -69,6 +69,7 @@ #DD0066 #9D8181 #443333 + #808080 #f0ecec #d0c5c5 #efe9e9 diff --git a/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/BasicPoolListItem.kt b/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/BasicPoolListItem.kt index 5be15dd8b..60cd6034e 100644 --- a/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/BasicPoolListItem.kt +++ b/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/BasicPoolListItem.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common_wallet.presentation.compose -import android.net.Uri import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement @@ -68,8 +67,8 @@ import jp.co.soramitsu.ui_core.theme.customTypography data class BasicPoolListItemState( val ids: StringPair, val number: String, - val token1Icon: Uri, - val token2Icon: Uri, + val token1Icon: String, + val token2Icon: String, val text1: String, val text2: String, val text3: String, diff --git a/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/components/AssetItem.kt b/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/components/AssetItem.kt index 463d94d0c..91ccb82f9 100644 --- a/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/components/AssetItem.kt +++ b/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/components/AssetItem.kt @@ -32,6 +32,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common_wallet.presentation.compose.components +import android.net.Uri import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding @@ -63,7 +64,7 @@ fun AssetItem( modifier = Modifier .testTagAsId(testTag) .padding(horizontal = Dimens.x3), - icon = assetState.tokenIcon, + icon = Uri.parse(assetState.tokenIcon), name = assetState.tokenName, balance = assetState.assetAmount, symbol = "", @@ -100,7 +101,7 @@ fun AssetItemEnumerated( Asset( modifier = Modifier .testTagAsId(testTag), - icon = assetState.tokenIcon, + icon = Uri.parse(assetState.tokenIcon), name = assetState.tokenName, balance = assetState.assetAmount, symbol = "", diff --git a/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/states/CardState.kt b/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/states/CardState.kt index bb5ad7453..1084ddb4b 100644 --- a/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/states/CardState.kt +++ b/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/states/CardState.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common_wallet.presentation.compose.states -import android.net.Uri import androidx.annotation.StringRes import java.math.BigDecimal import jp.co.soramitsu.androidfoundation.format.formatFiatSuffix @@ -70,7 +69,7 @@ class FavoriteAssetsCardState( ) : AssetCardState data class AssetItemCardState( - val tokenIcon: Uri, + val tokenIcon: String, val tokenId: String, val tokenName: String, val tokenSymbol: String, diff --git a/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/states/PoolsListState.kt b/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/states/PoolsListState.kt index 366172e8e..739dfdd8c 100644 --- a/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/states/PoolsListState.kt +++ b/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/states/PoolsListState.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common_wallet.presentation.compose.states -import android.net.Uri import jp.co.soramitsu.common.domain.AssetHolder import jp.co.soramitsu.common.domain.formatFiat import jp.co.soramitsu.common.domain.formatFiatChange @@ -47,8 +46,8 @@ class PoolsListState( ) data class PoolsListItemState( - val token1Icon: Uri, - val token2Icon: Uri, + val token1Icon: String, + val token2Icon: String, val poolName: String, val poolAmounts: String, val fiat: String, diff --git a/core_db/build.gradle b/core_db/build.gradle index f92b277c1..7e75b6e3c 100644 --- a/core_db/build.gradle +++ b/core_db/build.gradle @@ -1,7 +1,10 @@ -apply plugin: 'com.android.library' -apply plugin: 'dagger.hilt.android.plugin' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' +plugins { + id 'com.android.library' + id 'dagger.hilt.android.plugin' + id 'kotlin-android' + id 'kotlin-kapt' + id 'com.google.devtools.ksp' +} apply from: '../tests.gradle' kotlin { @@ -15,13 +18,13 @@ android { minSdkVersion minVersion targetSdkVersion targetVersion - javaCompileOptions { - annotationProcessorOptions { - arguments += [ - "room.schemaLocation":"$projectDir/schemas".toString(), - "room.incremental":"true"] - } - } +// javaCompileOptions { +// annotationProcessorOptions { +// arguments += [ +// "room.schemaLocation":"$projectDir/schemas".toString(), +// "room.incremental":"true"] +// } +// } testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -63,6 +66,28 @@ android { namespace 'com.example.core_db' } +class RoomSchemaArgProvider implements CommandLineArgumentProvider { + + @InputDirectory + @PathSensitive(PathSensitivity.RELATIVE) + File schemaDir + + RoomSchemaArgProvider(File schemaDir) { + this.schemaDir = schemaDir + } + + @Override + Iterable asArguments() { + // Note: If you're using KSP, change the line below to return + // ["room.schemaLocation=${schemaDir.path}".toString()]. + return ["room.schemaLocation=${schemaDir.path}".toString()] + } +} + +ksp { + arg(new RoomSchemaArgProvider(new File(projectDir, "schemas"))) +} + dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) @@ -76,7 +101,7 @@ dependencies { implementation roomDep implementation roomKtxDep - kapt roomKaptDep + ksp roomKaptDep androidTestImplementation project(":test_shared") androidTestImplementation project(":test_data") diff --git a/core_db/src/main/java/jp/co/soramitsu/core_db/dao/AssetDao.kt b/core_db/src/main/java/jp/co/soramitsu/core_db/dao/AssetDao.kt index 3e1602f7d..d38d01c1d 100644 --- a/core_db/src/main/java/jp/co/soramitsu/core_db/dao/AssetDao.kt +++ b/core_db/src/main/java/jp/co/soramitsu/core_db/dao/AssetDao.kt @@ -101,6 +101,13 @@ interface AssetDao { whitelist: String = AssetHolder.DEFAULT_WHITE_LIST_NAME ): List + @Query(QUERY_ASSET_TOKEN_ACTIVE) + suspend fun getAssetsActive( + address: String, + isoCode: String, + whitelist: String = AssetHolder.DEFAULT_WHITE_LIST_NAME + ): List + @Query(QUERY_ASSET_TOKEN_VISIBLE) fun subscribeAssetsVisible( address: String, diff --git a/demeter/build.gradle b/demeter/build.gradle index 39548390f..2c210e430 100644 --- a/demeter/build.gradle +++ b/demeter/build.gradle @@ -81,7 +81,7 @@ dependencies { implementation roomDep implementation roomKtxDep - kapt roomKaptDep + //kapt roomKaptDep implementation sharedUtilsDep implementation xNetworkingDep diff --git a/feature_account_impl/src/test/java/jp/co/soramitsu/feature_account_impl/data/repository/CredentialsRepositoryTest.kt b/feature_account_impl/src/test/java/jp/co/soramitsu/feature_account_impl/data/repository/CredentialsRepositoryTest.kt index 173a5d3c0..22a69f875 100644 --- a/feature_account_impl/src/test/java/jp/co/soramitsu/feature_account_impl/data/repository/CredentialsRepositoryTest.kt +++ b/feature_account_impl/src/test/java/jp/co/soramitsu/feature_account_impl/data/repository/CredentialsRepositoryTest.kt @@ -32,31 +32,25 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_account_impl.data.repository -import androidx.arch.core.executor.testing.InstantTaskExecutorRule -import io.mockk.coEvery -import io.mockk.coVerify import io.mockk.every -import io.mockk.impl.annotations.MockK -import io.mockk.junit4.MockKRule +import io.mockk.just import io.mockk.mockk import io.mockk.mockkObject import io.mockk.mockkStatic +import io.mockk.runs import jp.co.soramitsu.common.account.SoraAccount import jp.co.soramitsu.common.logger.FirebaseWrapper import jp.co.soramitsu.common.util.CryptoAssistant import jp.co.soramitsu.common.util.json_decoder.JsonAccountsEncoder +import jp.co.soramitsu.feature_account_api.domain.interfaces.CredentialsDatasource +import jp.co.soramitsu.feature_blockexplorer_api.data.SoraConfigManager import jp.co.soramitsu.shared_utils.encrypt.keypair.substrate.Sr25519Keypair import jp.co.soramitsu.shared_utils.encrypt.keypair.substrate.SubstrateKeypairFactory import jp.co.soramitsu.shared_utils.encrypt.mnemonic.Mnemonic import jp.co.soramitsu.shared_utils.encrypt.mnemonic.MnemonicCreator import jp.co.soramitsu.shared_utils.encrypt.seed.SeedFactory import jp.co.soramitsu.shared_utils.encrypt.seed.substrate.SubstrateSeedFactory -import jp.co.soramitsu.shared_utils.extensions.fromHex -import jp.co.soramitsu.shared_utils.extensions.toHexString -import jp.co.soramitsu.feature_account_api.domain.interfaces.CredentialsDatasource -import jp.co.soramitsu.feature_blockexplorer_api.data.SoraConfigManager import jp.co.soramitsu.sora.substrate.runtime.RuntimeManager -import jp.co.soramitsu.sora.substrate.runtime.SubstrateOptionsProvider import jp.co.soramitsu.sora.substrate.substrate.deriveSeed32 import jp.co.soramitsu.test_shared.MainCoroutineRule import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -67,55 +61,66 @@ import org.junit.Assert.assertTrue import org.junit.Before import org.junit.Rule import org.junit.Test -import org.junit.rules.TestRule -import java.security.KeyPair -import java.security.PublicKey +import org.junit.runner.RunWith +import org.mockito.Mock +import org.mockito.junit.MockitoJUnitRunner +import org.mockito.kotlin.any +import org.mockito.kotlin.verify +import org.mockito.kotlin.whenever @ExperimentalCoroutinesApi +@RunWith(MockitoJUnitRunner::class) class CredentialsRepositoryTest { - @get:Rule - val rule: TestRule = InstantTaskExecutorRule() - @get:Rule var mainCoroutineRule = MainCoroutineRule() - @get:Rule - val mockkRule = MockKRule(this) - private lateinit var credentialsRepository: CredentialsRepositoryImpl - @MockK + @Mock lateinit var datasource: CredentialsDatasource - @MockK + @Mock lateinit var cryptoAssistant: CryptoAssistant - @MockK + @Mock lateinit var runtimeManager: RuntimeManager - @MockK + @Mock lateinit var soraConfigManager: SoraConfigManager - @MockK + @Mock lateinit var jsonAccountsEncoder: JsonAccountsEncoder + @Mock + lateinit var keypair: Sr25519Keypair + + private val fooaddress = "fooaddress" + @Before fun setup() { - credentialsRepository = - CredentialsRepositoryImpl( - datasource, - cryptoAssistant, - runtimeManager, - jsonAccountsEncoder, - soraConfigManager, - ) + mockkObject(MnemonicCreator) + mockkObject(SubstrateKeypairFactory) + mockkObject(FirebaseWrapper) + mockkStatic(SubstrateSeedFactory::deriveSeed32) + val derivationResult = mockk() + every { SubstrateSeedFactory.deriveSeed32(any(), any()) } returns derivationResult + every { SubstrateKeypairFactory.generate(any(), any()) } returns keypair + every { SubstrateKeypairFactory.generate(any(), any(), any()) } returns keypair + every { FirebaseWrapper.log("Keys were created") } just runs + every { derivationResult.seed } returns "seed".toByteArray() + credentialsRepository = CredentialsRepositoryImpl( + datasource, + cryptoAssistant, + runtimeManager, + jsonAccountsEncoder, + soraConfigManager, + ) } @Test fun `is mnemonic valid returns true`() = runTest { val mnemonic = "mnemonic" - mockkObject(MnemonicCreator) every { MnemonicCreator.fromWords(any()) } returns Mnemonic( "", emptyList(), @@ -126,7 +131,6 @@ class CredentialsRepositoryTest { @Test fun `is mnemonic valid returns false`() = runTest { val mnemonic = "mnemonic2" - mockkObject(MnemonicCreator) every { MnemonicCreator.fromWords(any()) } throws IllegalArgumentException() assertFalse(credentialsRepository.isMnemonicValid(mnemonic)) } @@ -148,30 +152,17 @@ class CredentialsRepositoryTest { val mnemonic = "airport wish wish loan width country acoustic country ceiling good enact penalty" val entropy = mnemonic.toByteArray() - val seed = "seed".toByteArray() val publicKey = "publicKey".toByteArray() - val keypair = mockk() - every { keypair.publicKey } returns publicKey - val derivationResult = mockk() - every { derivationResult.seed } returns seed + whenever(keypair.publicKey).thenReturn(publicKey) val mnmnc = Mnemonic(mnemonic, mnemonic.split(" "), entropy) - mockkObject(MnemonicCreator) every { MnemonicCreator.randomMnemonic(any()) } returns mnmnc - mockkObject(SubstrateKeypairFactory) - every { SubstrateKeypairFactory.generate(any(), any()) } returns keypair - mockkStatic(SubstrateSeedFactory::deriveSeed32) - mockkObject(FirebaseWrapper) - every { FirebaseWrapper.log("Keys were created") } returns Unit - every { SubstrateSeedFactory.deriveSeed32(any(), any()) } returns derivationResult - every { runtimeManager.toSoraAddress(any()) } returns "fooaddress" - coEvery { datasource.saveKeys(any(), any()) } returns Unit - coEvery { datasource.retrieveKeys(any()) } returns null - coEvery { datasource.saveMnemonic(any(), any()) } returns Unit + whenever(runtimeManager.toSoraAddress(any())).thenReturn(fooaddress) + whenever(datasource.retrieveKeys(any())).thenReturn(null) credentialsRepository.generateUserCredentials("") - coVerify { datasource.saveKeys(keypair, "fooaddress") } - coVerify { datasource.saveMnemonic(mnemonic, "fooaddress") } + verify(datasource).saveKeys(keypair, fooaddress) + verify(datasource).saveMnemonic(mnemonic, fooaddress) } @Test @@ -179,90 +170,48 @@ class CredentialsRepositoryTest { val mnemonic = "airport wish wish loan width country acoustic country ceiling good enact penalty" val entropy = mnemonic.toByteArray() - val seed = "seed".toByteArray() val publicKeyBytes = "publicKeyBytespublicKeyBytespublicKeyBytes".toByteArray() - val irohaKeypair = mockk() - val irohaAddress = "did_sora_7075626c69634b657942@sora" - val message = irohaAddress + publicKeyBytes.toHexString() - val signature = irohaAddress.toByteArray() - val keypair = mockk() - every { keypair.publicKey } returns publicKeyBytes - every { runtimeManager.toSoraAddress(any()) } returns "fooaddress" - val publicKey = mockk() - val derivationResult = mockk() - every { derivationResult.seed } returns seed + whenever(keypair.publicKey).thenReturn(publicKeyBytes) val mnmnc = Mnemonic(mnemonic, mnemonic.split(" "), entropy) - mockkObject(MnemonicCreator) every { MnemonicCreator.fromWords(mnemonic) } returns mnmnc - mockkObject(SubstrateKeypairFactory) - every { SubstrateKeypairFactory.generate(any(), any()) } returns keypair - mockkStatic(SubstrateSeedFactory::deriveSeed32) - every { SubstrateSeedFactory.deriveSeed32(any(), any()) } returns derivationResult - mockkObject(FirebaseWrapper) - every { FirebaseWrapper.log("Keys were created") } returns Unit - every { runtimeManager.toSoraAddress(any()) } returns "fooaddress" - coEvery { datasource.saveKeys(any(), any()) } returns Unit - coEvery { datasource.saveMnemonic(any(), any()) } returns Unit - coEvery { datasource.retrieveKeys(any()) } returns null + whenever(runtimeManager.toSoraAddress(any())).thenReturn(fooaddress) + whenever(datasource.retrieveKeys(any())).thenReturn(null) credentialsRepository.restoreUserCredentialsFromMnemonic(mnemonic, "") - - coVerify { datasource.saveMnemonic(mnemonic, "fooaddress") } + verify(datasource).saveMnemonic(mnemonic, fooaddress) } @Test fun `restore user credentials from seed called`() = runTest { val rawSeed = "0xcf0010cf0010cf0010cf0010cf0010cfcf0010cf0010cf0010cf0010cf0010cf" - val rawSeedBytes = rawSeed.fromHex() val publicKeyBytes = "publicKeyBytespublicKeyBytespublicKeyBytes".toByteArray() - every { runtimeManager.toSoraAddress(any()) } returns "fooaddress" - - val keypair = mockk() - every { keypair.publicKey } returns publicKeyBytes - mockkObject(SubstrateKeypairFactory) - every { - SubstrateKeypairFactory.generate( - SubstrateOptionsProvider.encryptionType, - rawSeedBytes, - emptyList() - ) - } returns keypair - mockkObject(FirebaseWrapper) - every { FirebaseWrapper.log("Keys were created") } returns Unit - every { runtimeManager.toSoraAddress(any()) } returns "fooaddress" - coEvery { datasource.saveKeys(any(), any()) } returns Unit - coEvery { datasource.saveMnemonic(any(), any()) } returns Unit - coEvery { datasource.saveSeed(any(), any()) } returns Unit - coEvery { datasource.retrieveKeys(any()) } returns null + whenever(keypair.publicKey).thenReturn(publicKeyBytes) + whenever(runtimeManager.toSoraAddress(any())).thenReturn(fooaddress) + whenever(datasource.retrieveKeys(any())).thenReturn(null) credentialsRepository.restoreUserCredentialsFromRawSeed(rawSeed, "") - - coVerify { datasource.saveKeys(keypair, "fooaddress") } + verify(datasource).saveKeys(keypair, fooaddress) } @Test fun `save mnemonic called`() = runTest { val mnemonic = "airport wish wish loan width country acoustic country ceiling good enact penalty" - coEvery { datasource.saveMnemonic(any(), any()) } returns Unit credentialsRepository.saveMnemonic(mnemonic, SoraAccount("", "")) - coVerify { datasource.saveMnemonic(mnemonic, "") } + verify(datasource).saveMnemonic(mnemonic, "") } @Test fun `retrieve mnemonic called`() = runTest { val mnemonic = "airport wish wish loan width country acoustic country ceiling good enact penalty" - coEvery { datasource.retrieveMnemonic("") } returns mnemonic - + whenever(datasource.retrieveMnemonic("")).thenReturn(mnemonic) assertEquals(credentialsRepository.retrieveMnemonic(SoraAccount("", "")), mnemonic) } @Test fun `retrieve keypair called`() = runTest { - val keypair = mockk() - coEvery { datasource.retrieveKeys("") } returns keypair - + whenever(datasource.retrieveKeys("")).thenReturn(keypair) assertEquals(keypair, credentialsRepository.retrieveKeyPair(SoraAccount("", ""))) } } diff --git a/feature_assets_api/src/main/java/jp/co/soramitsu/feature_assets_api/data/AssetsRepository.kt b/feature_assets_api/src/main/java/jp/co/soramitsu/feature_assets_api/data/AssetsRepository.kt index f72d2408a..2773f20ac 100644 --- a/feature_assets_api/src/main/java/jp/co/soramitsu/feature_assets_api/data/AssetsRepository.kt +++ b/feature_assets_api/src/main/java/jp/co/soramitsu/feature_assets_api/data/AssetsRepository.kt @@ -60,11 +60,7 @@ interface AssetsRepository { suspend fun getAsset(assetId: String, address: String): Asset? - suspend fun getAssetsFavorite(address: String,): List - - suspend fun getAssetsVisible( - address: String, - ): List + suspend fun getAssetsActive(address: String,): List suspend fun getAssetsWhitelist(address: String): List diff --git a/feature_assets_api/src/main/java/jp/co/soramitsu/feature_assets_api/domain/AssetsInteractor.kt b/feature_assets_api/src/main/java/jp/co/soramitsu/feature_assets_api/domain/AssetsInteractor.kt index 8b8eed006..79f98c78c 100644 --- a/feature_assets_api/src/main/java/jp/co/soramitsu/feature_assets_api/domain/AssetsInteractor.kt +++ b/feature_assets_api/src/main/java/jp/co/soramitsu/feature_assets_api/domain/AssetsInteractor.kt @@ -56,8 +56,6 @@ interface AssetsInteractor { suspend fun getPublicKeyHex(withPrefix: Boolean = false): String - suspend fun getVisibleAssets(): List - suspend fun getWhitelistAssets(): List suspend fun getXorBalance(precision: Int): XorAssetBalance diff --git a/feature_assets_api/src/main/java/jp/co/soramitsu/feature_assets_api/presentation/selectsearchtoken/SelectSearchToken.kt b/feature_assets_api/src/main/java/jp/co/soramitsu/feature_assets_api/presentation/selectsearchtoken/SelectSearchToken.kt index 54f8ba94a..6142fdfce 100644 --- a/feature_assets_api/src/main/java/jp/co/soramitsu/feature_assets_api/presentation/selectsearchtoken/SelectSearchToken.kt +++ b/feature_assets_api/src/main/java/jp/co/soramitsu/feature_assets_api/presentation/selectsearchtoken/SelectSearchToken.kt @@ -32,6 +32,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_assets_api.presentation.selectsearchtoken +import android.content.res.Configuration import androidx.compose.foundation.ScrollState import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -56,10 +57,10 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import jp.co.soramitsu.common.R -import jp.co.soramitsu.common.presentation.compose.components.ContentCardEndless import jp.co.soramitsu.common_wallet.presentation.compose.components.AssetItem import jp.co.soramitsu.common_wallet.presentation.compose.states.AssetItemCardState import jp.co.soramitsu.common_wallet.presentation.compose.states.previewAssetItemCardStateList +import jp.co.soramitsu.ui_core.component.card.ContentCardEndless import jp.co.soramitsu.ui_core.resources.Dimens import jp.co.soramitsu.ui_core.theme.customColors import jp.co.soramitsu.ui_core.theme.customTypography @@ -149,7 +150,7 @@ private fun PreviewSelectSearchTokenCard1() { } @Composable -@Preview +@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO) private fun PreviewSelectSearchTokenCard2() { SelectSearchTokenCard( scrollState = rememberScrollState(), diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryImpl.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryImpl.kt index b7e92b224..d8fa08d54 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryImpl.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryImpl.kt @@ -147,17 +147,9 @@ class AssetsRepositoryImpl @Inject constructor( } } - override suspend fun getAssetsFavorite(address: String): List { + override suspend fun getAssetsActive(address: String): List { val selectedCurrency = soraConfigManager.getSelectedCurrency() - return db.assetDao().getAssetsFavorite(address, selectedCurrency.code) - .map { - assetLocalToAssetMapper.map(it) - } - } - - override suspend fun getAssetsVisible(address: String): List { - val selectedCurrency = soraConfigManager.getSelectedCurrency() - return db.assetDao().getAssetsVisible(address, selectedCurrency.code) + return db.assetDao().getAssetsActive(address, selectedCurrency.code) .map { assetLocalToAssetMapper.map(it) } @@ -352,7 +344,7 @@ class AssetsRepositoryImpl @Inject constructor( tokensDeferred.await() val selectedCurrency = soraConfigManager.getSelectedCurrency() checkDefaultNeed(address, selectedCurrency.code) - val assets = db.assetDao().getAssetsVisible(address, selectedCurrency.code) + val assets = db.assetDao().getAssetsActive(address, selectedCurrency.code) insertAssetsInternal(address, assets, true) } } diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorImpl.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorImpl.kt index 1115d0b59..1b34597da 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorImpl.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorImpl.kt @@ -104,11 +104,6 @@ class AssetsInteractorImpl constructor( .toHexString(withPrefix) } - override suspend fun getVisibleAssets(): List { - val address = userRepository.getCurSoraAccount().substrateAddress - return assetsRepository.getAssetsFavorite(address) - } - override suspend fun getWhitelistAssets(): List { val address = userRepository.getCurSoraAccount().substrateAddress return assetsRepository.getAssetsWhitelist(address) diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/assetdetails/AssetDetailsTokenPriceCard.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/assetdetails/AssetDetailsTokenPriceCard.kt index c628d5d1c..fd007ea3b 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/assetdetails/AssetDetailsTokenPriceCard.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/assetdetails/AssetDetailsTokenPriceCard.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_assets_impl.presentation.components.compose.assetdetails -import android.net.Uri import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues @@ -53,6 +52,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import jp.co.soramitsu.common.domain.DEFAULT_ICON_URI import jp.co.soramitsu.common.presentation.compose.TokenIcon import jp.co.soramitsu.ui_core.component.asset.changePriceColor import jp.co.soramitsu.ui_core.component.card.ContentCard @@ -66,7 +66,7 @@ internal fun AssetDetailsTokenPriceCard( tokenSymbol: String, tokenPrice: String, tokenPriceChange: String, - iconUri: Uri, + iconUri: String, ) { Box( modifier = Modifier @@ -141,6 +141,6 @@ private fun PreviewAssetDetailsTokenPriceCard() { tokenSymbol = "XOR", tokenPrice = "$12.34", tokenPriceChange = "+4.5%", - iconUri = Uri.EMPTY, + iconUri = DEFAULT_ICON_URI, ) } diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/receive/ReceiveScreen.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/receive/ReceiveScreen.kt index 2c170cb15..567b14150 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/receive/ReceiveScreen.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/receive/ReceiveScreen.kt @@ -58,7 +58,7 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import jp.co.soramitsu.common.R -import jp.co.soramitsu.common.presentation.compose.TokenIcon +import jp.co.soramitsu.common.presentation.compose.AccountIcon import jp.co.soramitsu.common.presentation.compose.previewDrawable import jp.co.soramitsu.ui_core.component.button.FilledButton import jp.co.soramitsu.ui_core.component.button.properties.Order @@ -112,8 +112,8 @@ internal fun ReceiveScreen( .wrapContentHeight(), verticalAlignment = Alignment.CenterVertically, ) { - TokenIcon( - uri = avatar, + AccountIcon( + drawable = avatar, size = Size.Small, ) Spacer(modifier = Modifier.size(Dimens.x1)) diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/states/AssetCardState.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/states/AssetCardState.kt index baf8b027b..7ccc665aa 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/states/AssetCardState.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/states/AssetCardState.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_assets_impl.presentation.states -import android.net.Uri import jp.co.soramitsu.common.domain.DEFAULT_ICON_URI import jp.co.soramitsu.common_wallet.presentation.compose.states.PoolsListState import jp.co.soramitsu.feature_blockexplorer_api.presentation.txhistory.EventUiModel @@ -45,7 +44,7 @@ internal data class AssetCardState( internal data class AssetCardStateData( val tokenId: String, val tokenName: String, - val tokenIcon: Uri, + val tokenIcon: String, val tokenSymbol: String, val price: String, val priceChange: String, diff --git a/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryTest.kt b/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryTest.kt index 02937d1b1..9bb4e77ca 100644 --- a/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryTest.kt +++ b/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryTest.kt @@ -99,7 +99,7 @@ class AssetsRepositoryTest { @Mock private lateinit var soraConfigManager: SoraConfigManager - private val mockedUri = Mockito.mock(Uri::class.java) + private val mockedUri = DEFAULT_ICON_URI private lateinit var assetsRepository: AssetsRepository @@ -134,7 +134,7 @@ class AssetsRepositoryTest { @Test fun `get assets`() = runTest { BDDMockito.given( - assetDao.getAssetsFavorite( + assetDao.getAssetsActive( BDDMockito.anyString(), BDDMockito.anyString(), BDDMockito.anyString() @@ -142,7 +142,7 @@ class AssetsRepositoryTest { ).willReturn( assetTokenList() ) - val assets = assetsRepository.getAssetsFavorite("address") + val assets = assetsRepository.getAssetsActive("address") val expected = assetList().subList(0, 2) Assert.assertEquals(expected.size, assets.size) repeat(2) { diff --git a/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorTest.kt b/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorTest.kt index 3e4eec481..46a27c98e 100644 --- a/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorTest.kt +++ b/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorTest.kt @@ -116,12 +116,6 @@ class AssetsInteractorTest { ) } - @Test - fun `get assets`() = runTest { - coEvery { assetsRepository.getAssetsFavorite("address") } returns assetList() - Assert.assertEquals(assetList(), interactor.getVisibleAssets()) - } - @Test fun `just transfer`() = runTest { val kp = Sr25519Keypair(ByteArray(32), ByteArray(32), ByteArray(32)) diff --git a/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/presentation/assetsettings/AssetSettingsViewModelTest.kt b/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/presentation/assetsettings/AssetSettingsViewModelTest.kt index a6fdbba3f..cf5ef200f 100644 --- a/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/presentation/assetsettings/AssetSettingsViewModelTest.kt +++ b/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/presentation/assetsettings/AssetSettingsViewModelTest.kt @@ -39,6 +39,7 @@ import io.mockk.mockkObject import io.mockk.mockkStatic import jp.co.soramitsu.common.domain.Asset import jp.co.soramitsu.common.domain.AssetHolder +import jp.co.soramitsu.common.domain.DEFAULT_ICON_URI import jp.co.soramitsu.common.domain.Token import jp.co.soramitsu.common.domain.iconUri import jp.co.soramitsu.common.util.NumbersFormatter @@ -90,7 +91,7 @@ class AssetSettingsViewModelTest { @Mock private lateinit var router: AssetsRouter - private val mockedUri = Mockito.mock(Uri::class.java) + private val mockedUri = DEFAULT_ICON_URI private val nf = NumbersFormatter() @@ -98,16 +99,8 @@ class AssetSettingsViewModelTest { @Before fun setUp() = runTest { - mockkStatic(Uri::parse) - every { Uri.parse(any()) } returns mockedUri - mockkStatic(Token::iconUri) mockkObject(AssetHolder) every { AssetHolder.knownCount() } returns 5 - every { xorToken.iconUri() } returns mockedUri - every { valToken.iconUri() } returns mockedUri - every { pswapToken.iconUri() } returns mockedUri - every { xstusdToken.iconUri() } returns mockedUri - every { xstToken.iconUri() } returns mockedUri } private suspend fun setUpStartList( diff --git a/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/presentation/send/TransferAmountViewModelTest.kt b/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/presentation/send/TransferAmountViewModelTest.kt index e577df282..ab6af2ff8 100644 --- a/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/presentation/send/TransferAmountViewModelTest.kt +++ b/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/presentation/send/TransferAmountViewModelTest.kt @@ -101,8 +101,6 @@ class TransferAmountViewModelTest { @MockK private lateinit var avatarGenerator: AccountAvatarGenerator - private val mockedUri = mockk() - @MockK private lateinit var clipboardManager: BasicClipboardManager @@ -114,11 +112,6 @@ class TransferAmountViewModelTest { @Before fun setUp() = runTest { - mockkStatic(Uri::parse) - every { Uri.parse(any()) } returns mockedUri - mockkStatic(Token::iconUri) - every { TestTokens.xorToken.iconUri() } returns mockedUri - every { TestTokens.valToken.iconUri() } returns mockedUri every { resourceManager.getString(R.string.error_transaction_fee_title) } returns "Not enough funds" every { avatarGenerator.createAvatar(any(), any()) } returns drawable coEvery { diff --git a/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/screen/TxHistoryListScreen.kt b/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/screen/TxHistoryListScreen.kt index 2ac455184..b7bf66a86 100644 --- a/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/screen/TxHistoryListScreen.kt +++ b/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/screen/TxHistoryListScreen.kt @@ -57,7 +57,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import jp.co.soramitsu.common.R -import jp.co.soramitsu.common.presentation.compose.components.ContentCardEndless import jp.co.soramitsu.common.util.ext.safeCast import jp.co.soramitsu.common.view.LoadMoreHandler import jp.co.soramitsu.feature_blockexplorer_api.domain.HistoryState @@ -65,6 +64,7 @@ import jp.co.soramitsu.feature_blockexplorer_api.presentation.txhistory.EventUiM import jp.co.soramitsu.ui_core.component.button.FilledButton import jp.co.soramitsu.ui_core.component.button.properties.Order import jp.co.soramitsu.ui_core.component.button.properties.Size +import jp.co.soramitsu.ui_core.component.card.ContentCardEndless import jp.co.soramitsu.ui_core.resources.Dimens import jp.co.soramitsu.ui_core.theme.customColors import jp.co.soramitsu.ui_core.theme.customTypography diff --git a/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsLiquidity.kt b/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsLiquidity.kt index 691f6c1ab..f3fe9e10a 100644 --- a/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsLiquidity.kt +++ b/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsLiquidity.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_blockexplorer_api.presentation.txdetails -import android.net.Uri import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding @@ -63,8 +62,8 @@ fun TxDetailsLiquidity( isAmountGreen: Boolean, amount1: String, amount2: String, - icon1: Uri, - icon2: Uri, + icon1: String, + icon2: String, onCloseClick: () -> Unit, onCopyClick: (String) -> Unit, ) { diff --git a/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsReferralAndTransfer.kt b/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsReferralAndTransfer.kt index 88acc5ec9..c611d7f3e 100644 --- a/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsReferralAndTransfer.kt +++ b/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsReferralAndTransfer.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_blockexplorer_api.presentation.txdetails -import android.net.Uri import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.wrapContentHeight @@ -53,7 +52,7 @@ import jp.co.soramitsu.ui_core.theme.customTypography fun TxDetailsReferralOrTransferScreen( modifier: Modifier, state: BasicTxDetailsState, - icon: Uri, + icon: String, isAmountGreen: Boolean = false, amount: String, onCloseClick: () -> Unit, diff --git a/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsScreenState.kt b/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsScreenState.kt index fc8d8118a..c14c17e85 100644 --- a/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsScreenState.kt +++ b/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsScreenState.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_blockexplorer_api.presentation.txdetails -import android.net.Uri import jp.co.soramitsu.common.R import jp.co.soramitsu.common.domain.DEFAULT_ICON_URI import jp.co.soramitsu.feature_blockexplorer_api.presentation.txhistory.TransactionStatus @@ -64,8 +63,8 @@ data class TxDetailsScreenState( val amount1: String, val amount2: String? = null, val amountFiat: String, - val icon1: Uri, - val icon2: Uri? = null, + val icon1: String, + val icon2: String? = null, val isAmountGreen: Boolean = false, val txType: TxType ) diff --git a/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsSwap.kt b/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsSwap.kt index 85a124c7c..559688a05 100644 --- a/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsSwap.kt +++ b/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txdetails/TxDetailsSwap.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_blockexplorer_api.presentation.txdetails -import android.net.Uri import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding @@ -62,8 +61,8 @@ fun TxDetailsSwap( state: BasicTxDetailsState, amount1: String, amount2: String, - icon1: Uri, - icon2: Uri, + icon1: String, + icon2: String, onCloseClick: () -> Unit, onCopyClick: (String) -> Unit, ) { diff --git a/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txhistory/SoraTransaction.kt b/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txhistory/SoraTransaction.kt index a3a10a6c2..2145aa191 100644 --- a/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txhistory/SoraTransaction.kt +++ b/feature_blockexplorer_api/src/main/java/jp/co/soramitsu/feature_blockexplorer_api/presentation/txhistory/SoraTransaction.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_blockexplorer_api.presentation.txhistory -import android.net.Uri import androidx.annotation.StringRes sealed class EventUiModel { @@ -49,7 +48,7 @@ sealed class EventUiModel { hash: String, timestamp: Long, status: TransactionStatus, - val tokenIcon: Uri, + val tokenIcon: String, @StringRes val title: Int, val description: String, val plusAmount: Boolean, @@ -61,8 +60,8 @@ sealed class EventUiModel { hash: String, timestamp: Long, status: TransactionStatus, - val tokenUri: Uri, - val ethTokenUri: Uri, + val tokenUri: String, + val ethTokenUri: String, val dateTime: String, val amountFormatted: String, val fiatFormatted: String, @@ -72,7 +71,7 @@ sealed class EventUiModel { class EventTransferInUiModel( hash: String, - val tokenIcon: Uri, + val tokenIcon: String, val peerAddress: String, val dateTime: String, timestamp: Long, @@ -83,7 +82,7 @@ sealed class EventUiModel { class EventTransferOutUiModel( hash: String, - val tokenIcon: Uri, + val tokenIcon: String, val peerAddress: String, val dateTime: String, timestamp: Long, @@ -94,8 +93,8 @@ sealed class EventUiModel { class EventLiquiditySwapUiModel( hash: String, - val iconFrom: Uri, - val iconTo: Uri, + val iconFrom: String, + val iconTo: String, val amountFrom: String, val amountTo: String, val tickers: String, @@ -110,8 +109,8 @@ sealed class EventUiModel { timestamp: Long, status: TransactionStatus, val dateTime: String, - val icon1: Uri, - val icon2: Uri, + val icon1: String, + val icon2: String, val amounts: String, val type: String, val tickers: String, diff --git a/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/TransactionMappersTest.kt b/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/TransactionMappersTest.kt index e01f05671..ded101198 100644 --- a/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/TransactionMappersTest.kt +++ b/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/TransactionMappersTest.kt @@ -37,6 +37,7 @@ import com.google.common.truth.Truth.assertThat import io.mockk.every import io.mockk.mockkStatic import jp.co.soramitsu.common.date.DateTimeFormatter +import jp.co.soramitsu.common.domain.DEFAULT_ICON_URI import jp.co.soramitsu.common.domain.Token import jp.co.soramitsu.common.resourses.ResourceManager import jp.co.soramitsu.common.util.NumbersFormatter @@ -75,7 +76,7 @@ class TransactionMappersTest { "token symbol", 18, true, - mockedUri, + DEFAULT_ICON_URI, null, null, null @@ -100,7 +101,7 @@ class TransactionMappersTest { private val transactionsWithHeaders = listOf( EventUiModel.EventTxUiModel.EventTransferInUiModel( "", - mockedUri, + DEFAULT_ICON_URI, "peerId", "01 Jan 1970 00:00", 1000000, diff --git a/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/domain/TransactionHistoryHandlerTest.kt b/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/domain/TransactionHistoryHandlerTest.kt index 778f99c15..74b55ff14 100644 --- a/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/domain/TransactionHistoryHandlerTest.kt +++ b/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/domain/TransactionHistoryHandlerTest.kt @@ -33,16 +33,13 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_blockexplorer_impl.domain import android.net.Uri -import androidx.arch.core.executor.testing.InstantTaskExecutorRule -import io.mockk.coEvery import io.mockk.every -import io.mockk.impl.annotations.MockK -import io.mockk.junit4.MockKRule import io.mockk.mockk import io.mockk.mockkStatic -import io.mockk.verify import jp.co.soramitsu.common.date.DateTimeFormatter +import jp.co.soramitsu.common.domain.Asset import jp.co.soramitsu.common.domain.CoroutineManager +import jp.co.soramitsu.common.domain.DEFAULT_ICON_URI import jp.co.soramitsu.common.domain.Token import jp.co.soramitsu.common.domain.iconUri import jp.co.soramitsu.common.resourses.LanguagesHolder @@ -67,7 +64,6 @@ import jp.co.soramitsu.test_shared.MainCoroutineRule import jp.co.soramitsu.test_shared.test import junit.framework.TestCase.assertEquals import junit.framework.TestCase.assertTrue -import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.flow @@ -77,51 +73,54 @@ import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Rule import org.junit.Test -import org.junit.rules.TestRule -import java.util.Locale +import org.junit.runner.RunWith +import org.mockito.Mock +import org.mockito.Mockito +import org.mockito.junit.MockitoJUnitRunner +import org.mockito.kotlin.any +import org.mockito.kotlin.anyOrNull +import org.mockito.kotlin.doReturn +import org.mockito.kotlin.mock +import org.mockito.kotlin.stub +import org.mockito.kotlin.verify +import org.mockito.kotlin.whenever @ExperimentalCoroutinesApi +@RunWith(MockitoJUnitRunner::class) class TransactionHistoryHandlerTest { - @Rule - @JvmField - val rule: TestRule = InstantTaskExecutorRule() - @get:Rule var mainCoroutineRule = MainCoroutineRule() - @get:Rule - val mockkRule = MockKRule(this) +// @get:Rule +// val mockkRule = MockKRule(this) - @MockK + @Mock private lateinit var assetsRepository: AssetsRepository - @MockK + @Mock private lateinit var transactionHistoryRepository: TransactionHistoryRepository - @MockK + @Mock private lateinit var resourceManager: ResourceManager - @MockK + @Mock private lateinit var userRepository: UserRepository - @MockK + @Mock private lateinit var language: LanguagesHolder - @MockK + @Mock private lateinit var coroutineManager: CoroutineManager - @MockK - private lateinit var coroutineScope: CoroutineScope - - @MockK + @Mock private lateinit var dateTimeFormatter: DateTimeFormatter private val txMapper: TransactionMappers by lazy { TransactionMappersImpl(resourceManager, NumbersFormatter(), dateTimeFormatter) } - private val mockedUri = mockk() + private var mockedUri = DEFAULT_ICON_URI private val tokens = listOf(TestTokens.xorToken) private val txHash = "txHash" @@ -154,43 +153,71 @@ class TransactionHistoryHandlerTest { @Before fun setUp() = runTest { - mockkStatic(Uri::parse) - every { Uri.parse(any()) } returns mockedUri - mockkStatic(Token::iconUri) - every { TestTokens.xorToken.iconUri() } returns mockedUri - every { TestTokens.valToken.iconUri() } returns mockedUri - every { language.getCurrentLocale() } returns Locale.ENGLISH - every { dateTimeFormatter.formatTimeWithoutSeconds(any()) } returns "01 Feb 1970" - every { dateTimeFormatter.dateToDayWithoutCurrentYear(any(), any(), any()) } returns "01 Feb 1970" - every { resourceManager.getString(any()) } returns "" - every { transactionHistoryRepository.state } returns flowOf(true) - every { coroutineManager.applicationScope } returns coroutineScope - every { coroutineScope.coroutineContext } returns coroutineContext - every { transactionHistoryRepository.onSoraAccountChange() } returns Unit - coEvery { assetsRepository.tokensList() } returns tokens - every { userRepository.flowCurSoraAccount() } returns flow { +// mockkStatic(Uri::parse) +// every { Uri.parse(any()) } returns mockedUri +// mockkStatic(Token::iconUri) +// every { TestTokens.xorToken.iconUri() } returns mockedUri +// every { TestTokens.valToken.iconUri() } returns mockedUri + +// Mockito.mockStatic(Token::class.java).use { mocked -> +// mocked.`when` { Token.iconUri() }.thenReturn(mockedUri) +// } + + //whenever(language.getCurrentLocale()).thenReturn(Locale.ENGLISH) + whenever(dateTimeFormatter.formatTimeWithoutSeconds(any())).thenReturn("01 Feb 1970") + whenever( + dateTimeFormatter.dateToDayWithoutCurrentYear( + any(), + any(), + any() + ) + ).thenReturn("01 Feb 1970") + whenever(resourceManager.getString(any())).thenReturn("") + whenever(transactionHistoryRepository.state).thenReturn(flowOf(true)) + whenever(coroutineManager.applicationScope).thenReturn(this) + //whenever(transactionHistoryRepository.onSoraAccountChange()).thenReturn(Unit) + assetsRepository.stub { + onBlocking { tokensList() } doReturn tokens + } + whenever(userRepository.flowCurSoraAccount()).thenReturn(flow { emit(TestAccounts.soraAccount) emit(TestAccounts.soraAccount2) + }) + transactionHistoryRepository.stub { + onBlocking { + getTransaction( + txHash, + tokens, + TestAccounts.soraAccount + ) + } doReturn TestTransactions.sendSuccessfulTx } - coEvery { - transactionHistoryRepository.getTransaction(txHash, tokens, TestAccounts.soraAccount) - } returns TestTransactions.sendSuccessfulTx - coEvery { userRepository.getCurSoraAccount() } returns TestAccounts.soraAccount - coEvery { - transactionHistoryRepository.getTransactionHistory(any(), any(), any(), any()) - } returns TransactionsInfo( - listOf(TestTransactions.sendSuccessfulTx), - true - ) - coEvery { - transactionHistoryRepository.getLastTransactions( - TestAccounts.soraAccount, - listOf(TestTokens.xorToken), - 1, - null + userRepository.stub { + onBlocking { getCurSoraAccount() } doReturn TestAccounts.soraAccount + } + transactionHistoryRepository.stub { + onBlocking { + getTransactionHistory( + anyOrNull(), + anyOrNull(), + anyOrNull(), + anyOrNull(), + ) + } doReturn TransactionsInfo( + listOf(TestTransactions.sendSuccessfulTx), + true ) - } returns listOf(TestTransactions.sendFailedTx) - + } + transactionHistoryRepository.stub { + onBlocking { + getLastTransactions( + TestAccounts.soraAccount, + listOf(TestTokens.xorToken), + 1, + null + ) + } doReturn listOf(TestTransactions.sendFailedTx) + } transactionHistoryHandler = TransactionHistoryHandlerImpl( assetsRepository, txMapper, @@ -227,7 +254,8 @@ class TransactionHistoryHandlerTest { @Test fun `init successful`() = runTest { - verify { transactionHistoryRepository.onSoraAccountChange() } + advanceUntilIdle() + verify(transactionHistoryRepository).onSoraAccountChange() } @Test diff --git a/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/screen/ActivitiesViewModelTest.kt b/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/screen/ActivitiesViewModelTest.kt index a84828bc8..f64598f39 100644 --- a/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/screen/ActivitiesViewModelTest.kt +++ b/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/screen/ActivitiesViewModelTest.kt @@ -33,11 +33,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_blockexplorer_impl.presentation.screen import androidx.arch.core.executor.testing.InstantTaskExecutorRule -import io.mockk.coEvery -import io.mockk.coVerify -import io.mockk.every -import io.mockk.impl.annotations.MockK -import io.mockk.junit4.MockKRule import jp.co.soramitsu.feature_assets_api.domain.AssetsInteractor import jp.co.soramitsu.feature_assets_api.presentation.AssetsRouter import jp.co.soramitsu.feature_blockexplorer_api.domain.HistoryState @@ -45,7 +40,6 @@ import jp.co.soramitsu.feature_blockexplorer_api.domain.TransactionHistoryHandle import jp.co.soramitsu.feature_main_api.launcher.MainRouter import jp.co.soramitsu.feature_wallet_api.domain.interfaces.WalletInteractor import jp.co.soramitsu.test_data.TestAccounts -import jp.co.soramitsu.test_data.TestTokens import jp.co.soramitsu.test_shared.MainCoroutineRule import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.MutableStateFlow @@ -57,7 +51,11 @@ import org.junit.Rule import org.junit.Test import org.junit.rules.TestRule import org.junit.runner.RunWith +import org.mockito.Mock import org.mockito.junit.MockitoJUnitRunner +import org.mockito.kotlin.times +import org.mockito.kotlin.verify +import org.mockito.kotlin.whenever @ExperimentalCoroutinesApi @RunWith(MockitoJUnitRunner::class) @@ -70,64 +68,57 @@ class ActivitiesViewModelTest { @get:Rule var mainCoroutineRule = MainCoroutineRule() - @get:Rule - val mockkRule = MockKRule(this) - - @MockK + @Mock private lateinit var assetsInteractor: AssetsInteractor - @MockK + @Mock private lateinit var walletInteractor: WalletInteractor - @MockK + @Mock private lateinit var transactionHistoryHandler: TransactionHistoryHandler - @MockK + @Mock private lateinit var assetsRouter: AssetsRouter - @MockK + @Mock private lateinit var router: MainRouter private lateinit var viewModel: ActivitiesViewModel @Before fun setUp() = runTest { - every { assetsRouter.showTxDetails(any()) } returns Unit - every { assetsInteractor.flowCurSoraAccount() } returns flowOf(TestAccounts.soraAccount) - coEvery { walletInteractor.getFeeToken() } returns TestTokens.xorToken - coEvery { transactionHistoryHandler.refreshHistoryEvents() } returns Unit - coEvery { transactionHistoryHandler.onMoreHistoryEventsRequested() } returns Unit - coEvery { transactionHistoryHandler.flowLocalTransactions() } returns flowOf(true) - coEvery { transactionHistoryHandler.historyState } returns MutableStateFlow(HistoryState.Loading) + whenever(assetsInteractor.flowCurSoraAccount()).thenReturn(flowOf(TestAccounts.soraAccount)) + whenever(transactionHistoryHandler.flowLocalTransactions()).thenReturn(flowOf(true)) + whenever(transactionHistoryHandler.historyState).thenReturn(MutableStateFlow(HistoryState.Loading)) viewModel = ActivitiesViewModel( - assetsInteractor, - assetsRouter, - walletInteractor, - transactionHistoryHandler, - router + assetsInteractor, + assetsRouter, + walletInteractor, + transactionHistoryHandler, + router, ) } @Test fun `init successful`() = runTest { - coVerify { transactionHistoryHandler.refreshHistoryEvents() } + advanceUntilIdle() + verify(transactionHistoryHandler, times(2)).refreshHistoryEvents() } @Test fun `onTxHistoryItemClick() called`() = runTest { + advanceUntilIdle() val txHash = "txHash" - viewModel.onTxHistoryItemClick(txHash) - assetsRouter.showTxDetails(txHash) } @Test fun `onMoreHistoryEventsRequested() called`() = runTest { + advanceUntilIdle() viewModel.onMoreHistoryEventsRequested() advanceUntilIdle() - - coVerify { transactionHistoryHandler.onMoreHistoryEventsRequested() } + verify(transactionHistoryHandler).onMoreHistoryEventsRequested() } } diff --git a/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/txdetails/TxDetailsViewModelTest.kt b/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/txdetails/TxDetailsViewModelTest.kt index 16adbf192..fb252fe8a 100644 --- a/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/txdetails/TxDetailsViewModelTest.kt +++ b/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/presentation/txdetails/TxDetailsViewModelTest.kt @@ -44,6 +44,7 @@ import io.mockk.verify import jp.co.soramitsu.androidfoundation.phone.BasicClipboardManager import jp.co.soramitsu.common.R import jp.co.soramitsu.common.date.DateTimeFormatter +import jp.co.soramitsu.common.domain.DEFAULT_ICON_URI import jp.co.soramitsu.common.domain.Token import jp.co.soramitsu.common.domain.iconUri import jp.co.soramitsu.common.domain.printFiat @@ -110,7 +111,7 @@ class TxDetailsViewModelTest { private val nf = NumbersFormatter() - private val mockedUri = mockk() + private val mockedUri = DEFAULT_ICON_URI private val txHash = "txHash" private val date = "10 Jan. 2021 12:12" @@ -155,11 +156,6 @@ class TxDetailsViewModelTest { @Before fun setUp() = runTest { - mockkStatic(Uri::parse) - every { Uri.parse(any()) } returns mockedUri - mockkStatic(Token::iconUri) - every { TestTokens.xorToken.iconUri() } returns mockedUri - every { TestTokens.valToken.iconUri() } returns mockedUri coEvery { assetsInteractor.getCurSoraAccount() } returns TestAccounts.soraAccount coEvery { walletInteractor.getFeeToken() } returns TestTokens.xorToken coEvery { router.popBackStackFragment() } returns Unit diff --git a/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allcurrencies/AllCurrenciesScreen.kt b/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allcurrencies/AllCurrenciesScreen.kt index 43aa31694..6b31f5087 100644 --- a/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allcurrencies/AllCurrenciesScreen.kt +++ b/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allcurrencies/AllCurrenciesScreen.kt @@ -44,10 +44,10 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle -import jp.co.soramitsu.common.presentation.compose.components.ContentCardEndless import jp.co.soramitsu.common_wallet.presentation.compose.components.AssetItemEnumerated import jp.co.soramitsu.common_wallet.presentation.compose.states.previewAssetItemCardStateList import jp.co.soramitsu.feature_ecosystem_impl.presentation.EcoSystemTokensState +import jp.co.soramitsu.ui_core.component.card.ContentCardEndless import jp.co.soramitsu.ui_core.resources.Dimens @Composable diff --git a/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allpools/AllPoolsScreen.kt b/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allpools/AllPoolsScreen.kt index 00e2e4c99..06cdd1e23 100644 --- a/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allpools/AllPoolsScreen.kt +++ b/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allpools/AllPoolsScreen.kt @@ -44,11 +44,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle -import jp.co.soramitsu.common.presentation.compose.components.ContentCardEndless import jp.co.soramitsu.common.util.StringPair import jp.co.soramitsu.common_wallet.presentation.compose.BasicPoolListItem import jp.co.soramitsu.common_wallet.presentation.compose.previewBasicPoolListItemState import jp.co.soramitsu.feature_ecosystem_impl.presentation.EcoSystemPoolsState +import jp.co.soramitsu.ui_core.component.card.ContentCardEndless import jp.co.soramitsu.ui_core.resources.Dimens @Composable diff --git a/feature_ethereum_impl/build.gradle b/feature_ethereum_impl/build.gradle index 0bc2bc6a2..2ac930c20 100644 --- a/feature_ethereum_impl/build.gradle +++ b/feature_ethereum_impl/build.gradle @@ -75,7 +75,7 @@ dependencies { //implementation irohaDep implementation roomDep - kapt roomKaptDep + //kapt roomKaptDep testImplementation project(":test_shared") } \ No newline at end of file diff --git a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/MainActivity.kt b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/MainActivity.kt index 1d71335f1..c30d18203 100644 --- a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/MainActivity.kt +++ b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/MainActivity.kt @@ -58,7 +58,7 @@ import dev.chrisbanes.insetter.applyInsetter import dev.chrisbanes.insetter.windowInsetTypesOf import java.util.Date import javax.inject.Inject -import jp.co.soramitsu.common.domain.BarsColorhandler +import jp.co.soramitsu.common.domain.BarsColorHandler import jp.co.soramitsu.common.domain.BottomBarController import jp.co.soramitsu.common.domain.DarkThemeManager import jp.co.soramitsu.common.inappupdate.InAppUpdateManager @@ -83,7 +83,7 @@ import kotlinx.coroutines.launch class MainActivity : ToolbarActivity(), BottomBarController, - BarsColorhandler, + BarsColorHandler, OnboardingNavigator, InAppUpdateManager.UpdateManagerListener { @@ -292,15 +292,6 @@ class MainActivity : } } - override fun onNewIntent(intent: Intent?) { - super.onNewIntent(intent) - intent?.let { -// if (ACTION_INVITE == it.action) { -// viewModel.startedWithInviteAction() -// } - } - } - override fun setColor(@AttrRes color: Int) { curBarsColor = color window.statusBarColor = attrColor(color) @@ -381,6 +372,7 @@ class MainActivity : } override fun onTrimMemory(i: Int) { + super.onTrimMemory(i) if (i == ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) { timeInBackground = Date() } diff --git a/feature_main_impl/src/test/java/jp/co/soramitsu/feature_main_impl/domain/MainInteractorTest.kt b/feature_main_impl/src/test/java/jp/co/soramitsu/feature_main_impl/domain/MainInteractorTest.kt index 96c7f6fb5..7f3ac49ad 100644 --- a/feature_main_impl/src/test/java/jp/co/soramitsu/feature_main_impl/domain/MainInteractorTest.kt +++ b/feature_main_impl/src/test/java/jp/co/soramitsu/feature_main_impl/domain/MainInteractorTest.kt @@ -37,7 +37,6 @@ import io.mockk.mockkObject import jp.co.soramitsu.common.account.SoraAccount import jp.co.soramitsu.common.domain.OptionsProvider import jp.co.soramitsu.common.resourses.Language -import jp.co.soramitsu.feature_account_api.domain.interfaces.CredentialsRepository import jp.co.soramitsu.feature_account_api.domain.interfaces.UserRepository import jp.co.soramitsu.feature_select_node_api.data.SelectNodeRepository import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -60,9 +59,6 @@ class MainInteractorTest { @Mock private lateinit var userRepository: UserRepository - @Mock - private lateinit var credentialsRepository: CredentialsRepository - @Mock private lateinit var selectNodeRepository: SelectNodeRepository @@ -71,7 +67,12 @@ class MainInteractorTest { private val soraAccount = SoraAccount("a", "n") @Before - fun setUp() = runTest { + fun setUp() { + mockkObject(OptionsProvider) + every { OptionsProvider.CURRENT_VERSION_NAME } returns "version" + } + + private suspend fun setUpModel() { given(userRepository.getCurSoraAccount()).willReturn(soraAccount) interactor = MainInteractor( userRepository, @@ -81,6 +82,7 @@ class MainInteractorTest { @Test fun `getCurUserAddress is called`() = runTest { + setUpModel() val actualUser = SoraAccount("address", "user") given(userRepository.getCurSoraAccount()).willReturn(actualUser) @@ -90,6 +92,7 @@ class MainInteractorTest { @Test fun `getAvailableLanguagesWithSelected is called`() = runTest { + setUpModel() val actual = Pair(listOf(Language("ru_Ru", 0, 0)), 0) given(userRepository.getAvailableLanguages()).willReturn(actual) @@ -99,6 +102,7 @@ class MainInteractorTest { @Test fun `changeLanguage is called`() = runTest { + setUpModel() val language = "ru_Ru" interactor.changeLanguage(language) @@ -108,6 +112,7 @@ class MainInteractorTest { @Test fun `set biometry enabled is called`() = runTest { + setUpModel() val biometetryEnabled = false interactor.setBiometryEnabled(biometetryEnabled) @@ -117,6 +122,7 @@ class MainInteractorTest { @Test fun `is biometry enabled is called`() = runTest { + setUpModel() val biometetryEnabled = false given(userRepository.isBiometryEnabled()).willReturn(biometetryEnabled) @@ -126,6 +132,7 @@ class MainInteractorTest { @Test fun `is biometry available is called`() = runTest { + setUpModel() val biometetryAvailable = false given(userRepository.isBiometryAvailable()).willReturn(biometetryAvailable) @@ -135,6 +142,7 @@ class MainInteractorTest { @Test fun `save account name is called`() = runTest { + setUpModel() val accountname = "accountName" val curUser = SoraAccount("address", "user") given(userRepository.getCurSoraAccount()).willReturn(curUser) @@ -146,6 +154,7 @@ class MainInteractorTest { @Test fun `get account name is called`() = runTest { + setUpModel() val curUser = SoraAccount("address", "user") given(userRepository.getCurSoraAccount()).willReturn(curUser) @@ -155,6 +164,7 @@ class MainInteractorTest { @Test fun `get sora account list is called`() = runTest { + setUpModel() val accounts = listOf(SoraAccount("address", "user"), SoraAccount("address2", "user2")) given(userRepository.soraAccountsList()).willReturn(accounts) @@ -164,6 +174,7 @@ class MainInteractorTest { @Test fun `get sora accounts count is called`() = runTest { + setUpModel() val count = 3 given(userRepository.getSoraAccountsCount()).willReturn(count) @@ -173,6 +184,7 @@ class MainInteractorTest { @Test fun `flow selected sora account is called`() = runTest { + setUpModel() val curUser = SoraAccount("address", "user") given(userRepository.flowCurSoraAccount()).willReturn(flow { emit(curUser) }) @@ -182,14 +194,13 @@ class MainInteractorTest { @Test fun `getAppVersion() calls userRepository getAppVersion()`() = runTest { - val expectedResult = "version" - mockkObject(OptionsProvider) - every { OptionsProvider.CURRENT_VERSION_NAME } returns expectedResult - assertEquals(expectedResult, interactor.getAppVersion()) + setUpModel() + assertEquals("version", interactor.getAppVersion()) } @Test fun `set cur sora account is called`() = runTest { + setUpModel() val accountAddress = SoraAccount("acc", "nam") interactor.setCurSoraAccount(accountAddress) @@ -198,7 +209,8 @@ class MainInteractorTest { } @Test - fun `flowSelectedNode() calls selectedNodeRepository getSelectedNode()`() { + fun `flowSelectedNode() calls selectedNodeRepository getSelectedNode()`() = runTest { + setUpModel() interactor.flowSelectedNode() verify(selectNodeRepository).getSelectedNode() diff --git a/feature_main_impl/src/test/java/jp/co/soramitsu/feature_main_impl/presentation/MainViewModelTest.kt b/feature_main_impl/src/test/java/jp/co/soramitsu/feature_main_impl/presentation/MainViewModelTest.kt index 9a1644174..0de8cd32f 100644 --- a/feature_main_impl/src/test/java/jp/co/soramitsu/feature_main_impl/presentation/MainViewModelTest.kt +++ b/feature_main_impl/src/test/java/jp/co/soramitsu/feature_main_impl/presentation/MainViewModelTest.kt @@ -33,21 +33,16 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_main_impl.presentation import androidx.arch.core.executor.testing.InstantTaskExecutorRule -import io.mockk.coEvery -import io.mockk.coVerify import io.mockk.every -import io.mockk.impl.annotations.MockK -import io.mockk.junit4.MockKRule import io.mockk.mockkObject -import io.mockk.verify import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.RepeatStrategy import jp.co.soramitsu.common.domain.RepeatStrategyBuilder import jp.co.soramitsu.feature_assets_api.domain.AssetsInteractor +import jp.co.soramitsu.feature_blockexplorer_api.data.BlockExplorerManager import jp.co.soramitsu.feature_main_impl.domain.PinCodeInteractor import jp.co.soramitsu.feature_main_impl.domain.subs.GlobalSubscriptionManager import jp.co.soramitsu.feature_select_node_api.NodeManager -import jp.co.soramitsu.feature_blockexplorer_api.data.BlockExplorerManager import jp.co.soramitsu.test_data.TestAccounts import jp.co.soramitsu.test_shared.MainCoroutineRule import jp.co.soramitsu.test_shared.getOrAwaitValue @@ -61,8 +56,15 @@ import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.rules.TestRule +import org.junit.runner.RunWith +import org.mockito.Mock +import org.mockito.junit.MockitoJUnitRunner +import org.mockito.kotlin.times +import org.mockito.kotlin.verify +import org.mockito.kotlin.whenever @ExperimentalCoroutinesApi +@RunWith(MockitoJUnitRunner::class) class MainViewModelTest { @Rule @@ -72,25 +74,22 @@ class MainViewModelTest { @get:Rule var mainCoroutineRule = MainCoroutineRule() - @get:Rule - val mockkRule = MockKRule(this) - - @MockK + @Mock private lateinit var nodeManager: NodeManager - @MockK + @Mock private lateinit var assetsInteractor: AssetsInteractor - @MockK + @Mock private lateinit var pinCodeInteractor: PinCodeInteractor - @MockK + @Mock private lateinit var globalSubscriptionManager: GlobalSubscriptionManager - @MockK + @Mock private lateinit var blockExplorerManager: BlockExplorerManager - @MockK + @Mock private lateinit var coroutineManager: CoroutineManager private lateinit var mainViewModel: MainViewModel @@ -98,15 +97,13 @@ class MainViewModelTest { @OptIn(ExperimentalStdlibApi::class) @Before fun setUp() = runTest { - every { globalSubscriptionManager.start() } returns flowOf("") - every { nodeManager.connectionState } returns flowOf(true) - every { assetsInteractor.flowCurSoraAccount() } returns flowOf(TestAccounts.soraAccount) - coEvery { assetsInteractor.getCurSoraAccount() } returns TestAccounts.soraAccount - every { coroutineManager.io } returns this.coroutineContext[CoroutineDispatcher]!! - coEvery { blockExplorerManager.updateFiat() } returns Unit - coEvery { assetsInteractor.updateWhitelistBalances() } returns Unit - coEvery { assetsInteractor.getTokensList() } returns emptyList() - coEvery { blockExplorerManager.getTokensLiquidity(emptyList()) } returns emptyList() + whenever(globalSubscriptionManager.start()).thenReturn(flowOf("")) + whenever(nodeManager.connectionState).thenReturn(flowOf(true)) + whenever(assetsInteractor.flowCurSoraAccount()).thenReturn(flowOf(TestAccounts.soraAccount)) + whenever(coroutineManager.io).thenReturn(this.coroutineContext[CoroutineDispatcher]!!) + whenever(assetsInteractor.getTokensList()).thenReturn(emptyList()) + whenever(blockExplorerManager.getTokensLiquidity(emptyList())).thenReturn(emptyList()) + mockkObject(RepeatStrategyBuilder) every { RepeatStrategyBuilder.infinite() } returns object : RepeatStrategy { override suspend fun repeat(block: suspend () -> Unit) { @@ -128,9 +125,9 @@ class MainViewModelTest { coroutineManager ) advanceTimeBy(22000) - verify { globalSubscriptionManager.start() } - coVerify { assetsInteractor.updateWhitelistBalances() } - coVerify(exactly = 3) { blockExplorerManager.updateFiat() } + verify(globalSubscriptionManager).start() + verify(assetsInteractor).updateWhitelistBalances() + verify(blockExplorerManager, times(3)).updateFiat() assertFalse(mainViewModel.badConnectionVisibilityLiveData.getOrAwaitValue()) } } diff --git a/feature_multiaccount_impl/build.gradle b/feature_multiaccount_impl/build.gradle index b46cb4b6b..a3cf4fb43 100644 --- a/feature_multiaccount_impl/build.gradle +++ b/feature_multiaccount_impl/build.gradle @@ -23,9 +23,10 @@ android { // sourceCompatibility JavaVersion.VERSION_1_8 // targetCompatibility JavaVersion.VERSION_1_8 // } -// kotlinOptions { + kotlinOptions { // jvmTarget = JavaVersion.VERSION_1_8 -// } + freeCompilerArgs += ["-Xstring-concat=inline"] + } composeOptions { kotlinCompilerExtensionVersion versions.composeCompiler diff --git a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_details/AccountDetailsScreen.kt b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_details/AccountDetailsScreen.kt index 7e5895fab..102d42aab 100644 --- a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_details/AccountDetailsScreen.kt +++ b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_details/AccountDetailsScreen.kt @@ -32,21 +32,21 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_multiaccount_impl.presentation.export_account.account_details -import androidx.compose.foundation.background +import android.content.res.Configuration import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.wrapContentHeight -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material.MaterialTheme import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color +import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource @@ -56,6 +56,7 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import jp.co.soramitsu.common.R import jp.co.soramitsu.common.presentation.compose.components.Option +import jp.co.soramitsu.common.presentation.compose.theme.SoraAppTheme import jp.co.soramitsu.common.util.ext.testTagAsId import jp.co.soramitsu.ui_core.component.button.LoaderWrapper import jp.co.soramitsu.ui_core.component.button.properties.Size @@ -63,7 +64,6 @@ import jp.co.soramitsu.ui_core.component.card.ContentCard import jp.co.soramitsu.ui_core.component.input.InputText import jp.co.soramitsu.ui_core.component.input.InputTextState import jp.co.soramitsu.ui_core.resources.Dimens -import jp.co.soramitsu.ui_core.theme.borderRadius import jp.co.soramitsu.ui_core.theme.customColors import jp.co.soramitsu.ui_core.theme.customTypography @@ -73,20 +73,15 @@ internal fun AccountName( onValueChanged: (TextFieldValue) -> Unit, ) { val focusManager = LocalFocusManager.current + val focusRequester = remember { FocusRequester() } InputText( - modifier = Modifier - .background( - color = MaterialTheme.customColors.bgSurface, - shape = RoundedCornerShape(MaterialTheme.borderRadius.ml) - ) - .fillMaxWidth() - .wrapContentHeight(), + modifier = Modifier.fillMaxWidth(), maxLines = 1, singleLine = true, state = inputTextState, onValueChange = onValueChanged, - onFocusChanged = { if (!it.isFocused) focusManager.clearFocus() }, + focusRequester = focusRequester, keyboardActions = KeyboardActions( onDone = { focusManager.clearFocus() @@ -173,7 +168,7 @@ internal fun BackupOptions( icon = painterResource(R.drawable.ic_arrow_up_rectangle_24), label = stringResource(R.string.export_protection_json_title), onClick = onExportJson, - bottomDivider = false, + bottomDivider = isBackupAvailable != null, ) isBackupAvailable?.let { @@ -193,7 +188,7 @@ internal fun BackupOptions( icon = painterResource(R.drawable.ic_arrow_up_rectangle_24), label = text, onClick = onBackupGoogle, - textColor = if (isBackupAvailable) MaterialTheme.customColors.statusError else Color.Unspecified, + textColor = if (isBackupAvailable) MaterialTheme.customColors.statusError else MaterialTheme.customColors.fgPrimary, enabled = !isBackupLoading, bottomDivider = false, ) @@ -210,16 +205,34 @@ internal fun BackupOptions( } } -@Preview +@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO) @Composable -private fun PreviewBackup() { - BackupOptions( - isMnemonicAvailable = true, - isBackupAvailable = true, - isBackupLoading = false, - onShowPassphrase = { }, - onShowRawSeed = { }, - onExportJson = { }, - onBackupGoogle = {} - ) +private fun PreviewBackup01() { + SoraAppTheme { + BackupOptions( + isMnemonicAvailable = true, + isBackupAvailable = true, + isBackupLoading = false, + onShowPassphrase = { }, + onShowRawSeed = { }, + onExportJson = { }, + onBackupGoogle = {} + ) + } +} + +@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES) +@Composable +private fun PreviewBackup02() { + SoraAppTheme { + BackupOptions( + isMnemonicAvailable = true, + isBackupAvailable = true, + isBackupLoading = false, + onShowPassphrase = { }, + onShowRawSeed = { }, + onExportJson = { }, + onBackupGoogle = {} + ) + } } diff --git a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_details/AccountDetailsScreenBasic.kt b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_details/AccountDetailsScreenBasic.kt index 2be6db8b2..537711e52 100644 --- a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_details/AccountDetailsScreenBasic.kt +++ b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_details/AccountDetailsScreenBasic.kt @@ -32,6 +32,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_multiaccount_impl.presentation.export_account.account_details +import android.content.res.Configuration +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth @@ -39,10 +41,12 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.TextFieldValue import androidx.compose.ui.tooling.preview.Preview import jp.co.soramitsu.common.R +import jp.co.soramitsu.common.presentation.compose.theme.SoraAppTheme import jp.co.soramitsu.common.util.ext.testTagAsId import jp.co.soramitsu.feature_multiaccount_impl.presentation.export_account.model.AccountDetailsScreenState import jp.co.soramitsu.ui_core.component.button.TonalButton @@ -93,29 +97,68 @@ internal fun AccountDetailsScreenBasic( ) } -@Preview(showBackground = true) +@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO) @Composable -private fun PreviewAccountDetailsScreenBasic() { - Column( - modifier = Modifier - .fillMaxWidth() - .wrapContentHeight() - ) { - AccountDetailsScreenBasic( - state = AccountDetailsScreenState( - accountNameState = InputTextState(value = TextFieldValue("bla"), label = "Name"), - isMnemonicAvailable = false, - isBackupLoading = false, - isBackupAvailable = false, - "cnVkoGs3rEMqLqY27c2nfVXJRGdzNJk2ns78DcqtppaSRe8qm", - ), - onValueChanged = {}, - onShowPassphrase = {}, - onShowRawSeed = {}, - onExportJson = {}, - onLogout = {}, - onAddressClick = {}, - onBackupClicked = {} - ) +private fun PreviewAccountDetailsScreenBasic01() { + SoraAppTheme { + Column( + modifier = Modifier + .background(Color.White) + .fillMaxWidth() + .wrapContentHeight() + ) { + AccountDetailsScreenBasic( + state = AccountDetailsScreenState( + accountNameState = InputTextState( + value = TextFieldValue("bla"), + label = "Name" + ), + isMnemonicAvailable = false, + isBackupLoading = false, + isBackupAvailable = false, + "cnVkoGs3rEMqLqY27c2nfVXJRGdzNJk2ns78DcqtppaSRe8qm", + ), + onValueChanged = {}, + onShowPassphrase = {}, + onShowRawSeed = {}, + onExportJson = {}, + onLogout = {}, + onAddressClick = {}, + onBackupClicked = {} + ) + } + } +} + +@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES) +@Composable +private fun PreviewAccountDetailsScreenBasic02() { + SoraAppTheme { + Column( + modifier = Modifier + .background(Color.White) + .fillMaxWidth() + .wrapContentHeight() + ) { + AccountDetailsScreenBasic( + state = AccountDetailsScreenState( + accountNameState = InputTextState( + value = TextFieldValue("bla"), + label = "Name" + ), + isMnemonicAvailable = false, + isBackupLoading = false, + isBackupAvailable = false, + "cnVkoGs3rEMqLqY27c2nfVXJRGdzNJk2ns78DcqtppaSRe8qm", + ), + onValueChanged = {}, + onShowPassphrase = {}, + onShowRawSeed = {}, + onExportJson = {}, + onLogout = {}, + onAddressClick = {}, + onBackupClicked = {} + ) + } } } diff --git a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountListMenu.kt b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountListMenu.kt index f77901eb5..9ebc361aa 100644 --- a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountListMenu.kt +++ b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountListMenu.kt @@ -33,7 +33,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_multiaccount_impl.presentation.export_account.account_list import androidx.compose.foundation.background -import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.material.DropdownMenu import androidx.compose.material.DropdownMenuItem import androidx.compose.material.MaterialTheme @@ -41,10 +41,11 @@ import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextOverflow import jp.co.soramitsu.common.util.ext.testTagAsId import jp.co.soramitsu.feature_multiaccount_impl.R -import jp.co.soramitsu.ui_core.resources.Dimens import jp.co.soramitsu.ui_core.theme.customColors +import jp.co.soramitsu.ui_core.theme.customTypography @Composable internal fun AccountMenu( @@ -54,25 +55,37 @@ internal fun AccountMenu( address: String, expanded: Boolean, ) { - MaterialTheme(shapes = MaterialTheme.shapes.copy(medium = RoundedCornerShape(Dimens.x3))) { - DropdownMenu( - modifier = Modifier.background(MaterialTheme.customColors.bgSurface), - expanded = expanded, - onDismissRequest = onDismissMenu, + DropdownMenu( + modifier = Modifier.background(MaterialTheme.customColors.bgSurface), + expanded = expanded, + onDismissRequest = onDismissMenu, + ) { + DropdownMenuItem( + modifier = Modifier.testTagAsId("SelectAccountForBatchExport"), + onClick = { onSelectOptionsClicked(address) } ) { - DropdownMenuItem( - modifier = Modifier.testTagAsId("SelectAccountForBatchExport"), - onClick = { onSelectOptionsClicked(address) } - ) { - Text(stringResource(id = R.string.export_select_account)) - } + Text( + modifier = Modifier.wrapContentHeight(), + color = MaterialTheme.customColors.fgPrimary, + style = MaterialTheme.customTypography.textM, + text = stringResource(id = R.string.export_select_account), + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) + } - DropdownMenuItem( - modifier = Modifier.testTagAsId("OpenAccountOptions"), - onClick = { onAccountOptionsClicked(address) } - ) { - Text(stringResource(id = R.string.export_account_options)) - } + DropdownMenuItem( + modifier = Modifier.testTagAsId("OpenAccountOptions"), + onClick = { onAccountOptionsClicked(address) } + ) { + Text( + modifier = Modifier.wrapContentHeight(), + color = MaterialTheme.customColors.fgPrimary, + style = MaterialTheme.customTypography.textM, + text = stringResource(id = R.string.export_account_options), + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) } } } diff --git a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountListScreen.kt b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountListScreen.kt index a11df830d..5e789d5db 100644 --- a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountListScreen.kt +++ b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountListScreen.kt @@ -32,9 +32,11 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_multiaccount_impl.presentation.export_account.account_list +import android.content.res.Configuration import android.graphics.drawable.Drawable import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.ScrollState +import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.layout.Arrangement @@ -56,9 +58,11 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp import jp.co.soramitsu.common.R import jp.co.soramitsu.common.account.SoraAccount import jp.co.soramitsu.common.presentation.compose.previewDrawable +import jp.co.soramitsu.common.presentation.compose.theme.SoraAppTheme import jp.co.soramitsu.common.util.ext.testTagAsId import jp.co.soramitsu.feature_multiaccount_impl.presentation.export_account.model.AccountListScreenState import jp.co.soramitsu.feature_multiaccount_impl.presentation.export_account.model.ExportAccountData @@ -190,38 +194,88 @@ private fun AccountListItem( } } -@Preview(showBackground = true, backgroundColor = 0xffffff) +@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO) @Composable -private fun PreviewList() { - Column { - AccountList( - state = AccountListScreenState( - isActionMode = false, - accountList = listOf( - ExportAccountData( - isSelected = false, - isSelectedAction = false, - icon = previewDrawable, - account = SoraAccount("cnFjl....sllkj", "name 1"), - ), - ExportAccountData( - isSelected = true, - isSelectedAction = false, - icon = previewDrawable, - account = SoraAccount("cnFjl....sllkj", "name 2"), - ), - ExportAccountData( - isSelected = false, - isSelectedAction = true, - icon = previewDrawable, - account = SoraAccount("cnFjl....sllkj", "name 3"), - ), - ) - ), - onAccountClicked = {}, - onAccountLongClicked = {}, - onSelectOptionsClicked = {}, - onAccountOptionsClicked = {}, - ) +private fun PreviewList01() { + SoraAppTheme { + Column( + modifier = Modifier + .background(MaterialTheme.customColors.bgSurface) + .fillMaxWidth() + .padding(12.dp) + ) { + AccountList( + state = AccountListScreenState( + isActionMode = false, + accountList = listOf( + ExportAccountData( + isSelected = false, + isSelectedAction = false, + icon = previewDrawable, + account = SoraAccount("cnFjl....sllkj", "name 1"), + ), + ExportAccountData( + isSelected = true, + isSelectedAction = false, + icon = previewDrawable, + account = SoraAccount("cnFjl....sllkj", "name 2"), + ), + ExportAccountData( + isSelected = false, + isSelectedAction = true, + icon = previewDrawable, + account = SoraAccount("cnFjl....sllkj", "name 3"), + ), + ) + ), + onAccountClicked = {}, + onAccountLongClicked = {}, + onSelectOptionsClicked = {}, + onAccountOptionsClicked = {}, + ) + } + } +} + +@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES) +@Composable +private fun PreviewList02() { + SoraAppTheme { + Column( + modifier = Modifier + .background(MaterialTheme.customColors.bgSurface) + .fillMaxWidth() + .padding(12.dp) + ) { + AccountList( + state = AccountListScreenState( + isActionMode = false, + accountList = listOf( + ExportAccountData( + isSelected = false, + isSelectedAction = false, + icon = previewDrawable, + account = SoraAccount("cnFjl....sllkj", "name 1"), + ), + ExportAccountData( + isSelected = true, + isSelectedAction = false, + icon = previewDrawable, + account = SoraAccount("cnFjl....sllkj", "name 2"), + ), + ExportAccountData( + isSelected = false, + isSelectedAction = true, + icon = previewDrawable, + account = SoraAccount("cnFjl....sllkj", "name 3"), + ), + ) + ), + onAccountClicked = {}, + onAccountLongClicked = {}, + onSelectOptionsClicked = {}, + onAccountOptionsClicked = {}, + ) + } } } diff --git a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountWithIcon.kt b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountWithIcon.kt index 0ef2b35b4..7dad7a6c1 100644 --- a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountWithIcon.kt +++ b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_list/AccountWithIcon.kt @@ -49,7 +49,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp -import jp.co.soramitsu.common.presentation.compose.TokenIcon +import jp.co.soramitsu.common.presentation.compose.AccountIcon import jp.co.soramitsu.common.util.ext.truncateUserAddress import jp.co.soramitsu.ui_core.resources.Dimens import jp.co.soramitsu.ui_core.theme.customColors @@ -96,7 +96,7 @@ private fun AccountWithIcon( accountIcon: Drawable, ) { Row { - TokenIcon(uri = accountIcon, size = 40.dp, modifier = Modifier.padding(start = Dimens.x2)) + AccountIcon(drawable = accountIcon, size = 40.dp, modifier = Modifier.padding(start = Dimens.x2)) Column( modifier = Modifier diff --git a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/import_account_list/import_account_password/ImportAccountPasswordScreen.kt b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/import_account_list/import_account_password/ImportAccountPasswordScreen.kt index e141c3a8c..dc963a6c0 100644 --- a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/import_account_list/import_account_password/ImportAccountPasswordScreen.kt +++ b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/import_account_list/import_account_password/ImportAccountPasswordScreen.kt @@ -57,7 +57,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import jp.co.soramitsu.backup.domain.models.BackupAccountMeta import jp.co.soramitsu.common.R -import jp.co.soramitsu.common.presentation.compose.TokenIcon +import jp.co.soramitsu.common.presentation.compose.AccountIcon import jp.co.soramitsu.feature_multiaccount_impl.presentation.BackupAccountMetaWithIcon import jp.co.soramitsu.feature_multiaccount_impl.presentation.ImportAccountPasswordState import jp.co.soramitsu.ui_core.component.button.FilledButton @@ -159,8 +159,8 @@ fun AccountWithIcon( modifier = modifier, verticalAlignment = Alignment.CenterVertically ) { - TokenIcon( - uri = accountIcon ?: R.drawable.ic_token_default, + AccountIcon( + drawable = accountIcon, size = 40.dp, ) diff --git a/feature_multiaccount_impl/src/test/java/jp/co/soramitsu/feature_multiaccount_impl/OnboardingViewModelTest.kt b/feature_multiaccount_impl/src/test/java/jp/co/soramitsu/feature_multiaccount_impl/OnboardingViewModelTest.kt index d3a0c48b0..c20054941 100644 --- a/feature_multiaccount_impl/src/test/java/jp/co/soramitsu/feature_multiaccount_impl/OnboardingViewModelTest.kt +++ b/feature_multiaccount_impl/src/test/java/jp/co/soramitsu/feature_multiaccount_impl/OnboardingViewModelTest.kt @@ -36,7 +36,6 @@ import android.content.Intent import androidx.activity.result.ActivityResultLauncher import androidx.arch.core.executor.testing.InstantTaskExecutorRule import androidx.navigation.NavController -import io.mockk.mockk import jp.co.soramitsu.backup.BackupService import jp.co.soramitsu.common.R import jp.co.soramitsu.common.account.AccountAvatarGenerator @@ -60,9 +59,9 @@ import org.junit.Rule import org.junit.Test import org.junit.rules.TestRule import org.junit.runner.RunWith -import org.mockito.BDDMockito.given import org.mockito.Mock import org.mockito.junit.MockitoJUnitRunner +import org.mockito.kotlin.whenever @ExperimentalCoroutinesApi @RunWith(MockitoJUnitRunner::class) @@ -91,18 +90,16 @@ class OnboardingViewModelTest { private lateinit var backupService: BackupService @Mock - private lateinit var avatarGenerator: AccountAvatarGenerator + private lateinit var navController: NavController @Mock - private lateinit var coroutineManager: CoroutineManager + private lateinit var avatarGenerator: AccountAvatarGenerator @Mock - private lateinit var accountResultLauncher: ActivityResultLauncher + private lateinit var coroutineManager: CoroutineManager private lateinit var onboardingViewModel: OnboardingViewModel - private val account = SoraAccount("address", "accountName") - @Before fun setUp() = runTest { onboardingViewModel = OnboardingViewModel( @@ -118,7 +115,7 @@ class OnboardingViewModelTest { @Test fun `onRecoveryClicked() called test`() = runTest { - given(resourceManager.getString(R.string.recovery_mnemonic_passphrase)).willReturn("passphrase label") + whenever(resourceManager.getString(R.string.recovery_mnemonic_passphrase)).thenReturn("passphrase label") val passphraseRecoveryState = RecoveryState( title = R.string.recovery_enter_passphrase_title, @@ -127,15 +124,10 @@ class OnboardingViewModelTest { label = resourceManager.getString(R.string.recovery_mnemonic_passphrase) ) ) - - val navController: NavController = mockk(relaxed = true) - onboardingViewModel.onRecoveryClicked(navController, 1) + assertEquals(onboardingViewModel.recoveryState?.value, passphraseRecoveryState) - assertEquals(onboardingViewModel?.recoveryState?.value, passphraseRecoveryState) - - - given(resourceManager.getString(R.string.recovery_input_raw_seed_hint)).willReturn("raw label") + whenever(resourceManager.getString(R.string.recovery_input_raw_seed_hint)).thenReturn("raw label") val seedRecoveryState = RecoveryState( title = R.string.recovery_enter_seed_title, @@ -144,14 +136,9 @@ class OnboardingViewModelTest { label = resourceManager.getString(R.string.recovery_input_raw_seed_hint) ) ) - onboardingViewModel.onRecoveryClicked(navController, 2) - assertEquals(onboardingViewModel?.recoveryState?.value, seedRecoveryState) - - onboardingViewModel.onRecoveryClicked(navController, 0) - assertNull(onboardingViewModel?.recoveryState?.value) } } diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/components/compose/SwapAmountSquare.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/components/compose/SwapAmountSquare.kt index de4b651a9..095eb30a7 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/components/compose/SwapAmountSquare.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/components/compose/SwapAmountSquare.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_polkaswap_impl.presentation.components.compose -import android.net.Uri import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row @@ -60,7 +59,7 @@ import jp.co.soramitsu.ui_core.theme.customTypography @Composable internal fun SwapAmountSquare( modifier: Modifier, - icon: Uri, + icon: String, amount: String, amountFiat: String, ) { diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/components/compose/SwapMarketsScreen.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/components/compose/SwapMarketsScreen.kt index c8c2e3f5b..b80465174 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/components/compose/SwapMarketsScreen.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/components/compose/SwapMarketsScreen.kt @@ -117,6 +117,7 @@ private fun MarketScreenItem( var hintVisible by remember { mutableStateOf(false) } if (hintVisible) { AlertDialog( + backgroundColor = MaterialTheme.customColors.bgPage, title = { Text( text = stringResource(id = market.titleResource), diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/components/compose/SwapSlippageScreen.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/components/compose/SwapSlippageScreen.kt index 65e8814f5..fc6a5a772 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/components/compose/SwapSlippageScreen.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/components/compose/SwapSlippageScreen.kt @@ -30,8 +30,9 @@ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package jp.co.soramitsu.feature_polkaswap_impl.presentation.screens.swap +package jp.co.soramitsu.feature_polkaswap_impl.presentation.components.compose +import android.content.res.Configuration import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.background import androidx.compose.foundation.border @@ -47,6 +48,7 @@ import androidx.compose.material.MaterialTheme import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableDoubleStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue @@ -63,6 +65,7 @@ import java.math.BigDecimal import java.text.DecimalFormatSymbols import java.util.Locale import jp.co.soramitsu.common.R +import jp.co.soramitsu.common.presentation.compose.theme.SoraAppTheme import jp.co.soramitsu.ui_core.component.button.FilledButton import jp.co.soramitsu.ui_core.component.button.properties.Order import jp.co.soramitsu.ui_core.component.button.properties.Size @@ -84,7 +87,7 @@ internal fun SwapSlippageScreen( value: Double, onDone: (Double) -> Unit, ) { - var currentValueLocalStorage by remember { mutableStateOf(value) } + var currentValueLocalStorage by remember { mutableDoubleStateOf(value) } val desc = remember { mutableStateOf(null) } val frontrun = stringResource(id = R.string.polkaswap_slippage_frontrun) @@ -142,17 +145,20 @@ internal fun SwapSlippageScreen( .focusRequester(focusRequester) .onFocusChanged { focused.value = it.isFocused - }.border( + } + .border( border = BorderStroke( width = 1.dp, color = if (focused.value) MaterialTheme.customColors.fgPrimary else MaterialTheme.customColors.fgOutline ), shape = RoundedCornerShape(MaterialTheme.borderRadius.ml) - ).background( + ) + .background( color = MaterialTheme.customColors.bgSurface, shape = RoundedCornerShape(MaterialTheme.borderRadius.ml) - ).clip(RoundedCornerShape(MaterialTheme.borderRadius.ml)) + ) + .clip(RoundedCornerShape(MaterialTheme.borderRadius.ml)) .padding(vertical = Dimens.x1_2, horizontal = Dimens.x2) .defaultMinSize(minHeight = Dimens.InputHeight) .wrapContentHeight() @@ -160,7 +166,7 @@ internal fun SwapSlippageScreen( ) { BasicNumberInput( modifier = Modifier, - textStyle = MaterialTheme.customTypography.textM, + textStyle = MaterialTheme.customTypography.textM.copy(color = MaterialTheme.customColors.fgPrimary), initial = value.toBigDecimal(), // input value is used; no locally stored data!!! precision = 2, enabled = true, @@ -208,11 +214,24 @@ internal fun SwapSlippageScreen( } } -@Preview(showBackground = true) +@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_NO) +@Composable +private fun PreviewSwapSlippageScreen01() { + SoraAppTheme { + SwapSlippageScreen( + value = 0.5, + onDone = {}, + ) + } +} + +@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES) @Composable -private fun PreviewSwapSlippageScreen() { - SwapSlippageScreen( - value = 0.5, - onDone = {}, - ) +private fun PreviewSwapSlippageScreen02() { + SoraAppTheme { + SwapSlippageScreen( + value = 0.5, + onDone = {}, + ) + } } diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityadd/LiquidityAddFragment.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityadd/LiquidityAddFragment.kt index 955594b49..414aea682 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityadd/LiquidityAddFragment.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityadd/LiquidityAddFragment.kt @@ -63,7 +63,7 @@ import jp.co.soramitsu.core_di.viewmodel.CustomViewModelFactory import jp.co.soramitsu.feature_assets_api.presentation.selectsearchtoken.SelectSearchTokenScreen import jp.co.soramitsu.feature_polkaswap_impl.presentation.components.compose.LiquidityAddConfirmScreen import jp.co.soramitsu.feature_polkaswap_impl.presentation.components.compose.LiquidityAddScreen -import jp.co.soramitsu.feature_polkaswap_impl.presentation.screens.swap.SwapSlippageScreen +import jp.co.soramitsu.feature_polkaswap_impl.presentation.components.compose.SwapSlippageScreen import jp.co.soramitsu.ui_core.theme.customColors import jp.co.soramitsu.ui_core.theme.customTypography import kotlinx.coroutines.ExperimentalCoroutinesApi diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityremove/LiquidityRemoveFragment.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityremove/LiquidityRemoveFragment.kt index 1b3c5743b..29543ab1b 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityremove/LiquidityRemoveFragment.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityremove/LiquidityRemoveFragment.kt @@ -63,7 +63,7 @@ import jp.co.soramitsu.common.util.ext.getColorFromAttrs import jp.co.soramitsu.core_di.viewmodel.CustomViewModelFactory import jp.co.soramitsu.feature_polkaswap_impl.presentation.components.compose.LiquidityRemoveConfirmScreen import jp.co.soramitsu.feature_polkaswap_impl.presentation.components.compose.LiquidityRemoveScreen -import jp.co.soramitsu.feature_polkaswap_impl.presentation.screens.swap.SwapSlippageScreen +import jp.co.soramitsu.feature_polkaswap_impl.presentation.components.compose.SwapSlippageScreen import jp.co.soramitsu.ui_core.theme.customColors import jp.co.soramitsu.ui_core.theme.customTypography diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/swap/SwapFragment.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/swap/SwapFragment.kt index 5f1ba4335..efd8dbbbe 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/swap/SwapFragment.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/swap/SwapFragment.kt @@ -34,7 +34,6 @@ package jp.co.soramitsu.feature_polkaswap_impl.presentation.screens.swap import android.os.Bundle import android.view.View -import androidx.compose.animation.ExperimentalAnimationApi import androidx.compose.foundation.ScrollState import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize @@ -66,6 +65,7 @@ import jp.co.soramitsu.feature_assets_api.presentation.selectsearchtoken.SelectS import jp.co.soramitsu.feature_polkaswap_impl.presentation.components.compose.SwapConfirmScreen import jp.co.soramitsu.feature_polkaswap_impl.presentation.components.compose.SwapMainScreen import jp.co.soramitsu.feature_polkaswap_impl.presentation.components.compose.SwapMarketsScreen +import jp.co.soramitsu.feature_polkaswap_impl.presentation.components.compose.SwapSlippageScreen import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.FlowPreview @@ -101,7 +101,6 @@ class SwapFragment : SoraBaseFragment() { override fun backgroundColor(): Int = R.attr.polkaswapBackground - @OptIn(ExperimentalAnimationApi::class) override fun NavGraphBuilder.content( scrollState: ScrollState, navController: NavHostController diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/states/PoolDetailsState.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/states/PoolDetailsState.kt index a533a4675..f48c50527 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/states/PoolDetailsState.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/states/PoolDetailsState.kt @@ -32,12 +32,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_polkaswap_impl.presentation.states -import android.net.Uri - internal data class PoolDetailsState( - val token1Icon: Uri, - val token2Icon: Uri, - val rewardsUri: Uri, + val token1Icon: String, + val token2Icon: String, + val rewardsUri: String, val rewardsTokenSymbol: String, val symbol1: String, val symbol2: String, @@ -52,7 +50,7 @@ internal data class PoolDetailsState( ) internal data class PoolDetailsDemeterState( - val rewardsUri: Uri, + val rewardsUri: String, val rewardsTokenSymbol: String, val percent: Float, ) diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/states/PoolSettingsState.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/states/PoolSettingsState.kt index fd8b4032c..9ed4bd609 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/states/PoolSettingsState.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/states/PoolSettingsState.kt @@ -32,13 +32,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_polkaswap_impl.presentation.states -import android.net.Uri import jp.co.soramitsu.common.util.StringPair data class PoolSettingsState( val id: StringPair, - val token1Icon: Uri, - val token2Icon: Uri, + val token1Icon: String, + val token2Icon: String, val tokenName: String, val tokenSymbol: String, val assetAmount: String, diff --git a/feature_polkaswap_impl/src/test/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/polkaswap/SwapViewModelTest.kt b/feature_polkaswap_impl/src/test/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/polkaswap/SwapViewModelTest.kt index de953617c..8acdc0387 100644 --- a/feature_polkaswap_impl/src/test/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/polkaswap/SwapViewModelTest.kt +++ b/feature_polkaswap_impl/src/test/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/polkaswap/SwapViewModelTest.kt @@ -32,10 +32,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_polkaswap_impl.presentation.polkaswap -import android.net.Uri import androidx.arch.core.executor.testing.InstantTaskExecutorRule -import io.mockk.every -import io.mockk.mockkStatic import jp.co.soramitsu.common.R import jp.co.soramitsu.common.domain.Asset import jp.co.soramitsu.common.domain.Market @@ -66,7 +63,6 @@ import kotlinx.coroutines.test.advanceUntilIdle import kotlinx.coroutines.test.runTest import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse -import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.rules.TestRule @@ -74,7 +70,6 @@ import org.junit.runner.RunWith import org.mockito.ArgumentMatchers.anyDouble import org.mockito.BDDMockito.given import org.mockito.Mock -import org.mockito.Mockito import org.mockito.junit.MockitoJUnitRunner import org.mockito.kotlin.any import org.mockito.kotlin.anyOrNull @@ -105,8 +100,6 @@ class SwapViewModelTest { @Mock private lateinit var swapInteractor: SwapInteractor - private val mockedUri = Mockito.mock(Uri::class.java) - private val numbersFormatter: NumbersFormatter = NumbersFormatter() @Mock @@ -128,12 +121,6 @@ class SwapViewModelTest { mapAssetsToCardState(assets, numbersFormatter) } - @Before - fun setUp() = runTest { - mockkStatic(Uri::parse) - every { Uri.parse(any()) } returns mockedUri - } - private suspend fun initViewModel( xorBalance: BigDecimal = BigDecimal.ONE, valBalance: BigDecimal = BigDecimal.ONE, diff --git a/feature_polkaswap_impl/src/test/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/polkaswap/liquidity/add/AddLiquidityViewModelTest.kt b/feature_polkaswap_impl/src/test/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/polkaswap/liquidity/add/AddLiquidityViewModelTest.kt index 8e6311278..ae83e9535 100644 --- a/feature_polkaswap_impl/src/test/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/polkaswap/liquidity/add/AddLiquidityViewModelTest.kt +++ b/feature_polkaswap_impl/src/test/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/polkaswap/liquidity/add/AddLiquidityViewModelTest.kt @@ -117,8 +117,6 @@ class AddLiquidityViewModelTest { @Mock private lateinit var router: WalletRouter - private val mockedUri = Mockito.mock(Uri::class.java) - private lateinit var viewModel: LiquidityAddViewModel private fun setUpViewModel( @@ -143,14 +141,6 @@ class AddLiquidityViewModelTest { @Before fun setUp() = runTest { mockkObject(FirebaseWrapper) - mockkStatic(Uri::parse) - every { Uri.parse(any()) } returns mockedUri - mockkStatic(Token::iconUri) - every { TestTokens.xorToken.iconUri() } returns mockedUri - every { TestTokens.valToken.iconUri() } returns mockedUri - every { TestTokens.pswapToken.iconUri() } returns mockedUri - every { TestTokens.xstusdToken.iconUri() } returns mockedUri - every { TestTokens.xstToken.iconUri() } returns mockedUri given( assetsInteractor.isNotEnoughXorLeftAfterTransaction( networkFeeInXor = any(), diff --git a/feature_referral_impl/src/main/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralBondUnbondXor.kt b/feature_referral_impl/src/main/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralBondUnbondXor.kt index 57ea3851e..b9b6b67f9 100644 --- a/feature_referral_impl/src/main/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralBondUnbondXor.kt +++ b/feature_referral_impl/src/main/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralBondUnbondXor.kt @@ -32,6 +32,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_referral_impl.presentation +import android.content.res.Configuration import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.clickable @@ -62,6 +63,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import jp.co.soramitsu.common.R import jp.co.soramitsu.common.presentation.compose.components.DetailsItemNetworkFee +import jp.co.soramitsu.common.presentation.compose.theme.SoraAppTheme import jp.co.soramitsu.common.view.WarningTextCard import jp.co.soramitsu.ui_core.component.button.FilledButton import jp.co.soramitsu.ui_core.component.button.LoaderWrapper @@ -297,6 +299,7 @@ fun InvitationsEnterField( maxLines = 1, keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number), colors = TextFieldDefaults.textFieldColors( + textColor = MaterialTheme.customColors.fgPrimary, cursorColor = MaterialTheme.customColors.fgPrimary, backgroundColor = Color.Transparent, focusedIndicatorColor = Color.Transparent, @@ -343,25 +346,53 @@ fun InvitationsEnterField( } @Composable -@Preview -fun PreviewReferralBondXor() { - ReferralBondXor( - common = ReferralCommonState( - activate = true, - progress = false, - referrer = "address", - referrerFee = "0.005 XOR", - extrinsicFee = "0.002 XOR", - extrinsicFeeFiat = "$12" - ), - state = ReferralBondState( - invitationsCount = 2, - invitationsAmount = "0.098 XOR", - balance = "123.56743 XOR" - ), - onBondInvitationsCountChange = {}, - onBondMinus = {}, - onBondPlus = {}, - onBondClick = {} - ) +@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO) +fun PreviewReferralBondXor01() { + SoraAppTheme { + ReferralBondXor( + common = ReferralCommonState( + activate = true, + progress = false, + referrer = "address", + referrerFee = "0.005 XOR", + extrinsicFee = "0.002 XOR", + extrinsicFeeFiat = "$12" + ), + state = ReferralBondState( + invitationsCount = 2, + invitationsAmount = "0.098 XOR", + balance = "123.56743 XOR" + ), + onBondInvitationsCountChange = {}, + onBondMinus = {}, + onBondPlus = {}, + onBondClick = {} + ) + } +} + +@Composable +@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES) +fun PreviewReferralBondXor02() { + SoraAppTheme { + ReferralBondXor( + common = ReferralCommonState( + activate = true, + progress = false, + referrer = "address", + referrerFee = "0.005 XOR", + extrinsicFee = "0.002 XOR", + extrinsicFeeFiat = "$12" + ), + state = ReferralBondState( + invitationsCount = 2, + invitationsAmount = "0.098 XOR", + balance = "123.56743 XOR" + ), + onBondInvitationsCountChange = {}, + onBondMinus = {}, + onBondPlus = {}, + onBondClick = {} + ) + } } diff --git a/feature_referral_impl/src/main/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralFragment.kt b/feature_referral_impl/src/main/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralFragment.kt index 9c85f924c..d2999f526 100644 --- a/feature_referral_impl/src/main/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralFragment.kt +++ b/feature_referral_impl/src/main/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralFragment.kt @@ -34,6 +34,7 @@ package jp.co.soramitsu.feature_referral_impl.presentation import android.os.Bundle import android.view.View +import androidx.activity.compose.BackHandler import androidx.compose.animation.ExperimentalAnimationApi import androidx.compose.foundation.ScrollState import androidx.compose.foundation.layout.Box @@ -82,14 +83,14 @@ class ReferralFragment : SoraBaseFragment() { animatedComposable( route = ReferralFeatureRoutes.WELCOME_PROGRESS ) { - FooWrapper(scrollState) { + ReferralWrapper(scrollState) { WelcomeProgress() } } animatedComposable( route = ReferralFeatureRoutes.WELCOME_PAGE ) { - FooWrapper(scrollState) { + ReferralWrapper(scrollState) { ReferralWelcomePageScreen( state = viewModel.referralScreenState.collectAsStateWithLifecycle().value, onStartInviting = { @@ -107,7 +108,7 @@ class ReferralFragment : SoraBaseFragment() { animatedComposable( route = ReferralFeatureRoutes.REFERRAL_PROGRAM ) { - FooWrapper(scrollState) { + ReferralWrapper(scrollState) { ReferralProgramPage( state = viewModel.referralScreenState.collectAsStateWithLifecycle().value, onGetMoreInvitations = { @@ -133,7 +134,7 @@ class ReferralFragment : SoraBaseFragment() { animatedComposable( route = ReferralFeatureRoutes.BOND_XOR ) { - FooWrapper(scrollState) { + ReferralWrapper(scrollState) { val state = viewModel.referralScreenState.collectAsStateWithLifecycle().value ReferralBondXor( common = state.common, @@ -149,7 +150,7 @@ class ReferralFragment : SoraBaseFragment() { animatedComposable( route = ReferralFeatureRoutes.UNBOND_XOR ) { - FooWrapper(scrollState) { + ReferralWrapper(scrollState) { val state = viewModel.referralScreenState.collectAsStateWithLifecycle().value ReferralUnbondXor( common = state.common, @@ -165,7 +166,7 @@ class ReferralFragment : SoraBaseFragment() { animatedComposable( route = ReferralFeatureRoutes.REFERRER_INPUT ) { - FooWrapper(scrollState) { + ReferralWrapper(scrollState) { ReferrerInput( common = viewModel.referralScreenState.collectAsStateWithLifecycle().value.common, state = viewModel.referralScreenState.collectAsStateWithLifecycle().value.referrerInputState, @@ -180,7 +181,7 @@ class ReferralFragment : SoraBaseFragment() { animatedComposable( route = ReferralFeatureRoutes.REFERRER_FILLED ) { - FooWrapper(scrollState) { + ReferralWrapper(scrollState) { val state = viewModel.referralScreenState.collectAsStateWithLifecycle().value ReferrerFilled( state = state.common, @@ -203,7 +204,7 @@ class ReferralFragment : SoraBaseFragment() { } @Composable - private fun FooWrapper( + private fun ReferralWrapper( scrollState: ScrollState, content: @Composable BoxScope.() -> Unit ) { @@ -214,6 +215,9 @@ class ReferralFragment : SoraBaseFragment() { .verticalScroll(scrollState), contentAlignment = Alignment.TopCenter, ) { + BackHandler { + viewModel.onBackPressed() + } content() } } diff --git a/feature_referral_impl/src/main/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralViewModel.kt b/feature_referral_impl/src/main/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralViewModel.kt index 6828b9461..ff4066cf3 100644 --- a/feature_referral_impl/src/main/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralViewModel.kt +++ b/feature_referral_impl/src/main/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralViewModel.kt @@ -35,7 +35,6 @@ package jp.co.soramitsu.feature_referral_impl.presentation import androidx.compose.ui.text.input.TextFieldValue import androidx.lifecycle.LiveData import androidx.lifecycle.viewModelScope -import androidx.navigation.NavOptionsBuilder import dagger.hilt.android.lifecycle.HiltViewModel import java.math.BigDecimal import javax.inject.Inject @@ -116,10 +115,6 @@ class ReferralViewModel @Inject constructor( private var referrer: String? = null - private val singleTopTrue: NavOptionsBuilder.() -> Unit = { - launchSingleTop = true - } - override fun startScreen(): String = ReferralFeatureRoutes.WELCOME_PROGRESS init { @@ -190,8 +185,7 @@ class ReferralViewModel @Inject constructor( ) } if (currentDestination == ReferralFeatureRoutes.WELCOME_PROGRESS) { - _navEvent.value = - if (_referralScreenState.value.isInitialized()) REFERRAL_PROGRAM to singleTopTrue else WELCOME_PAGE to singleTopTrue + _navToStart.value = if (_referralScreenState.value.isInitialized()) REFERRAL_PROGRAM else WELCOME_PAGE } } .launchIn(viewModelScope) @@ -310,7 +304,7 @@ class ReferralViewModel @Inject constructor( _referralScreenState.value.copy(common = _referralScreenState.value.common.copy(progress = true)) val result = interactor.observeBond(calcInvitationsAmount(bondInvitationsCount)) assetsRouter.showTxDetails(result) - _navEvent.value = REFERRAL_PROGRAM to singleTopTrue + _navToStart.value = REFERRAL_PROGRAM } } } @@ -325,7 +319,7 @@ class ReferralViewModel @Inject constructor( ) assetsRouter.showTxDetails(result) - _navEvent.value = REFERRAL_PROGRAM to singleTopTrue + _navToStart.value = REFERRAL_PROGRAM } } } @@ -341,8 +335,8 @@ class ReferralViewModel @Inject constructor( val result = interactor.observeSetReferrer(referrerOk.second) assetsRouter.showTxDetails(result) - _navEvent.value = - if (_referralScreenState.value.isInitialized()) REFERRAL_PROGRAM to singleTopTrue else WELCOME_PAGE to singleTopTrue + _navToStart.value = + if (_referralScreenState.value.isInitialized()) REFERRAL_PROGRAM else WELCOME_PAGE } } } diff --git a/feature_referral_impl/src/test/java/jp/co/soramitsu/feature_referral_impl/data/ReferralRepositoryTest.kt b/feature_referral_impl/src/test/java/jp/co/soramitsu/feature_referral_impl/data/ReferralRepositoryTest.kt index e380ec6f7..41594590a 100644 --- a/feature_referral_impl/src/test/java/jp/co/soramitsu/feature_referral_impl/data/ReferralRepositoryTest.kt +++ b/feature_referral_impl/src/test/java/jp/co/soramitsu/feature_referral_impl/data/ReferralRepositoryTest.kt @@ -33,19 +33,13 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_referral_impl.data import androidx.arch.core.executor.testing.InstantTaskExecutorRule -import androidx.room.withTransaction -import io.mockk.coEvery -import io.mockk.mockkStatic -import io.mockk.slot -import jp.co.soramitsu.common.R import jp.co.soramitsu.core_db.AppDatabase import jp.co.soramitsu.core_db.dao.ReferralsDao import jp.co.soramitsu.core_db.model.ReferralLocal -import jp.co.soramitsu.feature_referral_api.data.ReferralRepository import jp.co.soramitsu.feature_blockexplorer_api.data.BlockExplorerManager +import jp.co.soramitsu.feature_referral_api.data.ReferralRepository import jp.co.soramitsu.sora.substrate.runtime.RuntimeManager import jp.co.soramitsu.sora.substrate.substrate.ExtrinsicManager -import jp.co.soramitsu.sora.substrate.substrate.SubstrateApi import jp.co.soramitsu.sora.substrate.substrate.SubstrateCalls import jp.co.soramitsu.test_shared.MainCoroutineRule import jp.co.soramitsu.xnetworking.sorawallet.blockexplorerinfo.referral.ReferrerReward @@ -59,10 +53,11 @@ import org.junit.Rule import org.junit.Test import org.junit.rules.TestRule import org.junit.runner.RunWith -import org.mockito.BDDMockito.given import org.mockito.Mock import org.mockito.Mockito.verify import org.mockito.junit.MockitoJUnitRunner +import org.mockito.kotlin.doNothing +import org.mockito.kotlin.whenever @ExperimentalCoroutinesApi @RunWith(MockitoJUnitRunner::class) @@ -84,9 +79,6 @@ class ReferralRepositoryTest { @Mock private lateinit var blockExplorerManager: BlockExplorerManager - @Mock - private lateinit var substrateApi: SubstrateApi - @Mock private lateinit var runtimeManager: RuntimeManager @@ -114,8 +106,7 @@ class ReferralRepositoryTest { @Before fun setUp() = runTest { - given(db.referralsDao()).willReturn(referralsDao) - + whenever(db.referralsDao()).thenReturn(referralsDao) referralRepository = ReferralRepositoryImpl( db, extrinsicManager, @@ -128,13 +119,14 @@ class ReferralRepositoryTest { @Test fun `update referral rewards called`() = runTest { val address = "address" - given(blockExplorerManager.updateReferrerRewards(address)).willReturn(Unit) - - mockkStatic("androidx.room.RoomDatabaseKt") - val lambda = slot R>() - coEvery { db.withTransaction(capture(lambda)) } coAnswers { - lambda.captured.invoke() - } +// val captor = argumentCaptor R>() +// whenever(db.withTransaction(captor.capture())).thenReturn(captor.firstValue.invoke()) + +// mockkStatic("androidx.room.RoomDatabaseKt") +// val lambda = slot R>() +// coEvery { db.withTransaction(capture(lambda)) } coAnswers { +// lambda.captured.invoke() +// } referralRepository.updateReferralRewards(address) verify(blockExplorerManager).updateReferrerRewards(address) @@ -142,10 +134,8 @@ class ReferralRepositoryTest { @Test fun `get referral rewards`() = runTest { - given(referralsDao.getReferrals()).willReturn(flow { emit(REFERRER_LOCAL) }) - + whenever(referralsDao.getReferrals()).thenReturn(flow { emit(REFERRER_LOCAL) }) val result = referralRepository.getReferralRewards() - assertEquals(REFERRER_REWARDS, result.toList()[0]) } diff --git a/feature_referral_impl/src/test/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralViewModelTest.kt b/feature_referral_impl/src/test/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralViewModelTest.kt index c9292c05e..705182df2 100644 --- a/feature_referral_impl/src/test/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralViewModelTest.kt +++ b/feature_referral_impl/src/test/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralViewModelTest.kt @@ -32,16 +32,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_referral_impl.presentation -import android.net.Uri import androidx.arch.core.executor.testing.InstantTaskExecutorRule import androidx.compose.ui.text.input.TextFieldValue -import io.mockk.coEvery -import io.mockk.coVerify -import io.mockk.every -import io.mockk.impl.annotations.MockK -import io.mockk.junit4.MockKRule -import io.mockk.mockk -import io.mockk.mockkStatic import jp.co.soramitsu.common.R import jp.co.soramitsu.common.domain.Asset import jp.co.soramitsu.common.resourses.ResourceManager @@ -72,9 +64,17 @@ import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.rules.TestRule +import org.junit.runner.RunWith +import org.mockito.Mock +import org.mockito.junit.MockitoJUnitRunner +import org.mockito.kotlin.any +import org.mockito.kotlin.atLeast +import org.mockito.kotlin.verify +import org.mockito.kotlin.whenever import java.math.BigDecimal @ExperimentalCoroutinesApi +@RunWith(MockitoJUnitRunner::class) class ReferralViewModelTest { @Rule @@ -84,27 +84,22 @@ class ReferralViewModelTest { @get:Rule var mainCoroutineRule = MainCoroutineRule() - @get:Rule - val mockkRule = MockKRule(this) - - @MockK + @Mock private lateinit var interactor: ReferralInteractor - private val mockedUri = mockk() - - @MockK + @Mock private lateinit var assetsInteractor: AssetsInteractor - @MockK + @Mock private lateinit var walletInteractor: WalletInteractor - @MockK + @Mock private lateinit var assetsRouter: AssetsRouter - @MockK + @Mock private lateinit var router: MainRouter - @MockK + @Mock private lateinit var resourceManager: ResourceManager private lateinit var referralViewModel: ReferralViewModel @@ -128,27 +123,24 @@ class ReferralViewModelTest { @Before fun setUp() = runTest { - mockkStatic(Uri::parse) - every { Uri.parse(any()) } returns mockedUri - coEvery { walletInteractor.getFeeToken() } returns xorToken - coEvery { interactor.getInvitationLink() } returns "polkaswap/link" - coEvery { interactor.calcBondFee() } returns BigDecimal("0.07") - coEvery { interactor.updateReferrals() } returns Unit - every { assetsInteractor.subscribeAssetOfCurAccount(SubstrateOptionsProvider.feeAssetId) } returns assetFlow - coEvery { + whenever(walletInteractor.getFeeToken()).thenReturn(xorToken) + whenever(interactor.getInvitationLink()).thenReturn("polkaswap/link") + whenever(interactor.calcBondFee()).thenReturn(BigDecimal("0.07")) + whenever(assetsInteractor.subscribeAssetOfCurAccount(SubstrateOptionsProvider.feeAssetId)).thenReturn( + assetFlow + ) + whenever( assetsInteractor.isNotEnoughXorLeftAfterTransaction( any(), - any(), + any() ) - } returns false - - every { interactor.observeMyReferrer() } returns myReferrerFlow - every { interactor.observeReferrerBalance() } returns referrerBalanceFlow - coEvery { interactor.getSetReferrerFee() } returns BigDecimal("0.07") - every { resourceManager.getString(R.string.referral_no_available_invitations) } returns "No available invitations" - every { resourceManager.getString(R.string.referral_referral_link) } returns "Referrer’s link or address" - every { resourceManager.getString(R.string.referral_invitaion_link_title) } returns "Referrer’s link or address" - every { resourceManager.getString(R.string.referral_invitation_link) } returns "Referrer’s link or address" + ).thenReturn(false) + whenever(interactor.observeMyReferrer()).thenReturn(myReferrerFlow) + whenever(interactor.observeReferrerBalance()).thenReturn(referrerBalanceFlow) + whenever(interactor.getSetReferrerFee()).thenReturn(BigDecimal("0.07")) + whenever(resourceManager.getString(R.string.referral_no_available_invitations)).thenReturn("No available invitations") + whenever(resourceManager.getString(R.string.referral_referral_link)).thenReturn("Referrer’s link or address") + whenever(resourceManager.getString(R.string.referral_invitation_link)).thenReturn("Referrer’s link or address") assetFlowEmit(xorAsset) } @@ -174,9 +166,9 @@ class ReferralViewModelTest { @Test fun `initial screen`() = runTest { - coEvery { interactor.getReferrals() } returns flow { emit(referrals) } - every { interactor.getReferrals() } returns emptyFlow() - coEvery { interactor.observeReferrals() } returns flow { emit("") } + whenever(interactor.getReferrals()).thenReturn(flow { emit(referrals) }) + whenever(interactor.getReferrals()).thenReturn(emptyFlow()) + whenever(interactor.observeReferrals()).thenReturn(flow { emit("") }) setupViewModel() advanceUntilIdle() referrerBalanceFlowEmit(BigDecimal.ZERO) @@ -187,13 +179,13 @@ class ReferralViewModelTest { assertEquals(R.string.referral_toolbar_title, actualToolbarState.basic.title) val actualScreenState = referralViewModel.referralScreenState.value assertEquals("my referrer", actualScreenState.common.referrer) - coVerify { interactor.updateReferrals() } + verify(interactor).updateReferrals() } @Test fun `no data welcome screen`() = runTest { - every { interactor.getReferrals() } returns emptyFlow() - every { interactor.observeReferrals() } returns emptyFlow() + whenever(interactor.getReferrals()).thenReturn(emptyFlow()) + whenever(interactor.observeReferrals()).thenReturn(emptyFlow()) setupViewModel() advanceUntilIdle() val toolbar = referralViewModel.toolbarState.getOrAwaitValue() @@ -203,30 +195,31 @@ class ReferralViewModelTest { advanceUntilIdle() val state = referralViewModel.referralScreenState.value assertNull(state.common.referrer) - var navEvent = referralViewModel.navEvent.getOrAwaitValue() - assertEquals(ReferralFeatureRoutes.WELCOME_PAGE, navEvent.first) - coEvery { interactor.isLinkOrAddressOk("") } returns (false to "") + var navEvent = referralViewModel.navToStart.getOrAwaitValue() + assertEquals(ReferralFeatureRoutes.WELCOME_PAGE, navEvent) + whenever(interactor.isLinkOrAddressOk("")).thenReturn(false to "") referralViewModel.openReferrerInput() advanceUntilIdle() assertEquals(false, referralViewModel.referralScreenState.value.common.activate) assertEquals(false, referralViewModel.referralScreenState.value.common.progress) - coEvery { interactor.isLinkOrAddressOk("cnVko") } returns (true to "cnVko") + whenever(interactor.isLinkOrAddressOk("cnVko")).thenReturn(true to "cnVko") referralViewModel.onReferrerInputChange(TextFieldValue("cnVko")) advanceUntilIdle() assertEquals(true, referralViewModel.referralScreenState.value.common.activate) - assertEquals("cnVko", referralViewModel.referralScreenState.value.referrerInputState.value.text) - coEvery { interactor.observeSetReferrer("cnVko") } returns "txhash" - every { assetsRouter.showTxDetails(any(), any()) } returns Unit + assertEquals( + "cnVko", + referralViewModel.referralScreenState.value.referrerInputState.value.text + ) referralViewModel.onActivateLinkClick() advanceUntilIdle() - navEvent = referralViewModel.navEvent.getOrAwaitValue() - assertEquals(ReferralFeatureRoutes.WELCOME_PAGE, navEvent.first) + navEvent = referralViewModel.navToStart.getOrAwaitValue() + assertEquals(ReferralFeatureRoutes.WELCOME_PAGE, navEvent) } @Test fun `onDestinationChanged() called`() = runTest { - coEvery { interactor.getReferrals() } returns flow { emit(referrals) } - coEvery { interactor.observeReferrals() } returns flow { emit("") } + whenever(interactor.getReferrals()).thenReturn(flow { emit(referrals) }) + whenever(interactor.observeReferrals()).thenReturn(flow { emit("") }) setupViewModel() advanceUntilIdle() referralViewModel.onCurrentDestinationChanged(ReferralFeatureRoutes.WELCOME_PAGE) @@ -237,30 +230,17 @@ class ReferralViewModelTest { @Test fun `WHEN invitations count is changed EXPECT transaction reminder is checked`() = runTest { - every { interactor.getReferrals() } returns flow { emit(referrals) } - every { interactor.observeReferrals() } returns emptyFlow() - every { assetsInteractor.subscribeAssetOfCurAccount(SubstrateOptionsProvider.feeAssetId) } returns flow { - emit( - TestAssets.xorAsset() - ) - } + whenever(interactor.getReferrals()).thenReturn(flow { emit(referrals) }) + whenever(interactor.observeReferrals()).thenReturn(emptyFlow()) + whenever(assetsInteractor.subscribeAssetOfCurAccount(SubstrateOptionsProvider.feeAssetId)).thenReturn( + flow { emit(TestAssets.xorAsset()) }) setupViewModel() advanceUntilIdle() referralViewModel.onBondPlus() advanceUntilIdle() - coVerify(atLeast = 1) { - assetsInteractor.isNotEnoughXorLeftAfterTransaction( - any(), - any(), - ) - } + verify(assetsInteractor, atLeast(1)).isNotEnoughXorLeftAfterTransaction(any(), any()) referralViewModel.onBondMinus() advanceUntilIdle() - coVerify(atLeast = 1) { - assetsInteractor.isNotEnoughXorLeftAfterTransaction( - any(), - any(), - ) - } + verify(assetsInteractor, atLeast(1)).isNotEnoughXorLeftAfterTransaction(any(), any()) } } \ No newline at end of file diff --git a/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsScreen.kt b/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsScreen.kt index 8b66227cd..4252853a2 100644 --- a/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsScreen.kt +++ b/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsScreen.kt @@ -47,7 +47,6 @@ import androidx.compose.runtime.remember import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.focus.FocusRequester -import androidx.compose.ui.focus.FocusState import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.platform.LocalSoftwareKeyboardController import androidx.compose.ui.res.stringResource @@ -83,8 +82,6 @@ internal fun NodeDetailsScreen( onHowToRunNode = viewModel::onHowToRunNode, onNodeNameChanged = viewModel::onNameChanged, onNodeAddressChanged = viewModel::onAddressChanged, - onNodeNameFocused = viewModel::onNameFocusChanged, - onNodeAddressFocused = viewModel::onAddressFocusChanged ) if (state.loading) { @@ -101,8 +98,6 @@ private fun NodeDetailsScreenContent( onHowToRunNode: () -> Unit, onNodeNameChanged: (TextFieldValue) -> Unit, onNodeAddressChanged: (TextFieldValue) -> Unit, - onNodeNameFocused: (FocusState) -> Unit, - onNodeAddressFocused: (FocusState) -> Unit, ) { val focusRequester = remember { FocusRequester() } val keyboardController = LocalSoftwareKeyboardController.current @@ -133,7 +128,6 @@ private fun NodeDetailsScreenContent( } ), keyboardOptions = KeyboardOptions.Default.copy(imeAction = ImeAction.Done), - onFocusChanged = onNodeNameFocused, maxLines = 1, singleLine = true ) @@ -150,7 +144,6 @@ private fun NodeDetailsScreenContent( } ), keyboardOptions = KeyboardOptions.Default.copy(imeAction = ImeAction.Done), - onFocusChanged = onNodeAddressFocused, maxLines = 1, singleLine = true ) @@ -192,8 +185,6 @@ private fun PreviewNodeDetailsScreen() { onHowToRunNode = {}, onNodeNameChanged = {}, onNodeAddressChanged = {}, - onNodeAddressFocused = {}, - onNodeNameFocused = {} ) } } diff --git a/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsViewModel.kt b/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsViewModel.kt index 1a00b166c..3b23b683f 100644 --- a/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsViewModel.kt +++ b/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsViewModel.kt @@ -35,7 +35,6 @@ package jp.co.soramitsu.feature_select_node_impl.presentation.details import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue -import androidx.compose.ui.focus.FocusState import androidx.compose.ui.text.input.TextFieldValue import androidx.lifecycle.viewModelScope import dagger.assisted.Assisted @@ -213,22 +212,6 @@ internal class NodeDetailsViewModel @AssistedInject constructor( ) } - fun onNameFocusChanged(focusState: FocusState) { - state = state.copy( - nameState = state.nameState.copy( - focused = focusState.isFocused - ) - ) - } - - fun onAddressFocusChanged(focusState: FocusState) { - state = state.copy( - addressState = state.addressState.copy( - focused = focusState.isFocused - ) - ) - } - private fun subscribeAddressChanges() { address .debounce(800) diff --git a/feature_select_node_impl/src/test/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsViewModelTest.kt b/feature_select_node_impl/src/test/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsViewModelTest.kt index 4bd572d9c..d2a305174 100644 --- a/feature_select_node_impl/src/test/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsViewModelTest.kt +++ b/feature_select_node_impl/src/test/java/jp/co/soramitsu/feature_select_node_impl/presentation/details/NodeDetailsViewModelTest.kt @@ -43,7 +43,6 @@ import jp.co.soramitsu.feature_main_api.launcher.MainRouter import jp.co.soramitsu.feature_select_node_api.NodeManager import jp.co.soramitsu.feature_select_node_api.NodeManagerEvent import jp.co.soramitsu.feature_select_node_impl.TestData.CUSTOM_NODES -import jp.co.soramitsu.feature_select_node_impl.TestData.FOCUS_STATE import jp.co.soramitsu.feature_select_node_impl.TestData.NODE_DETAILS_ADDRESS import jp.co.soramitsu.feature_select_node_impl.TestData.NODE_DETAILS_NAME import jp.co.soramitsu.feature_select_node_impl.TestData.NODE_DETAIL_NODE @@ -245,24 +244,6 @@ class NodeDetailsViewModelTest { assertFalse(viewModel.state.submitButtonEnabled) } - @Test - fun `name input focused EXPECT update state`() { - addNodeViewModel() - - viewModel.onNameFocusChanged(FOCUS_STATE) - - assertEquals(FOCUS_STATE.isFocused, viewModel.state.nameState.focused) - } - - @Test - fun `address input focused EXPECT update state`() { - addNodeViewModel() - - viewModel.onAddressFocusChanged(FOCUS_STATE) - - assertEquals(FOCUS_STATE.isFocused, viewModel.state.addressState.focused) - } - @Test fun `onAddressChanged EXPECT submit button disabled`() { addNodeViewModel() diff --git a/feature_sora_card_impl/src/test/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardViewModelTest.kt b/feature_sora_card_impl/src/test/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardViewModelTest.kt index 70d242e0e..fbb64b433 100644 --- a/feature_sora_card_impl/src/test/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardViewModelTest.kt +++ b/feature_sora_card_impl/src/test/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardViewModelTest.kt @@ -103,7 +103,7 @@ class GetSoraCardViewModelTest { private lateinit var connectionManager: ConnectionManager @Before - fun setUp() = runTest { + fun setUp() { given(connectionManager.connectionState).willReturn(flowOf(true)) mockkObject(OptionsProvider) diff --git a/feature_wallet_impl/build.gradle b/feature_wallet_impl/build.gradle index 7a7b445ac..fae60d8d5 100644 --- a/feature_wallet_impl/build.gradle +++ b/feature_wallet_impl/build.gradle @@ -30,9 +30,10 @@ android { // sourceCompatibility JavaVersion.VERSION_1_8 // targetCompatibility JavaVersion.VERSION_1_8 // } -// kotlinOptions { + kotlinOptions { // jvmTarget = JavaVersion.VERSION_1_8 -// } + freeCompilerArgs += ["-Xstring-concat=inline"] + } buildFeatures { viewBinding true diff --git a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/BuyXorCard.kt b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/BuyXorCard.kt index 8f9c6fe75..d168480ad 100644 --- a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/BuyXorCard.kt +++ b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/BuyXorCard.kt @@ -32,10 +32,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_wallet_impl.presentation.cardshub +import android.content.res.Configuration import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import jp.co.soramitsu.common.R +import jp.co.soramitsu.common.presentation.compose.theme.SoraAppTheme @Composable fun BuyXorCard( @@ -52,11 +54,24 @@ fun BuyXorCard( ) } -@Preview +@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO) @Composable -private fun PreviewBuyXorCard() { - BuyXorCard( - onCloseCard = {}, - onBuyXorClicked = {}, - ) +private fun PreviewBuyXorCard01() { + SoraAppTheme { + BuyXorCard( + onCloseCard = {}, + onBuyXorClicked = {}, + ) + } +} + +@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES) +@Composable +private fun PreviewBuyXorCard02() { + SoraAppTheme { + BuyXorCard( + onCloseCard = {}, + onBuyXorClicked = {}, + ) + } } diff --git a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/SoraCard.kt b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/SoraCard.kt index 27bafdec0..7e35ea1ec 100644 --- a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/SoraCard.kt +++ b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/SoraCard.kt @@ -32,6 +32,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_wallet_impl.presentation.cardshub +import android.content.res.Configuration import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxWidth @@ -49,6 +50,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import jp.co.soramitsu.common.R import jp.co.soramitsu.common.presentation.compose.components.SoraCardImage +import jp.co.soramitsu.common.presentation.compose.theme.SoraAppTheme import jp.co.soramitsu.common.util.ext.testTagAsId import jp.co.soramitsu.common_wallet.presentation.compose.states.SoraCardState import jp.co.soramitsu.ui_core.component.button.BleachedButton @@ -79,10 +81,12 @@ fun SoraCard( CardStateButton( modifier = Modifier - .wrapContentWidth().run { + .wrapContentWidth() + .run { if (state.success.not()) padding(bottom = Dimens.x3) else padding(all = Dimens.x1) - }.run { + } + .run { if (state.success.not()) align(Alignment.BottomCenter) else align(Alignment.BottomEnd) }, @@ -156,12 +160,27 @@ private fun PreviewSoraCard1() { } @Composable -@Preview(locale = "he") +@Preview(locale = "he", uiMode = Configuration.UI_MODE_NIGHT_NO) private fun PreviewSoraCard2() { - SoraCard( - modifier = Modifier.fillMaxWidth(), - state = SoraCardState(kycStatus = "Pending", success = false, visible = true), - onCloseClicked = {}, - onCardStateClicked = {} - ) + SoraAppTheme { + SoraCard( + modifier = Modifier.fillMaxWidth(), + state = SoraCardState(kycStatus = "Pending", success = false, visible = true), + onCloseClicked = {}, + onCardStateClicked = {} + ) + } +} + +@Composable +@Preview(locale = "en", uiMode = Configuration.UI_MODE_NIGHT_NO) +private fun PreviewSoraCard3() { + SoraAppTheme { + SoraCard( + modifier = Modifier.fillMaxWidth(), + state = SoraCardState(kycStatus = null, success = false, visible = true), + onCloseClicked = {}, + onCardStateClicked = {} + ) + } } diff --git a/feature_wallet_impl/src/test/java/jp/co/soramitsu/feature_wallet_impl/data/repository/WalletRepositoryTest.kt b/feature_wallet_impl/src/test/java/jp/co/soramitsu/feature_wallet_impl/data/repository/WalletRepositoryTest.kt index 13f1b3528..2ec748382 100644 --- a/feature_wallet_impl/src/test/java/jp/co/soramitsu/feature_wallet_impl/data/repository/WalletRepositoryTest.kt +++ b/feature_wallet_impl/src/test/java/jp/co/soramitsu/feature_wallet_impl/data/repository/WalletRepositoryTest.kt @@ -36,6 +36,7 @@ import android.net.Uri import androidx.arch.core.executor.testing.InstantTaskExecutorRule import jp.co.soramitsu.common.domain.Asset import jp.co.soramitsu.common.domain.AssetBalance +import jp.co.soramitsu.common.domain.DEFAULT_ICON_URI import jp.co.soramitsu.common.domain.Token import jp.co.soramitsu.core_db.AppDatabase import jp.co.soramitsu.core_db.dao.GlobalCardsHubDao @@ -106,7 +107,7 @@ class WalletRepositoryTest { @Mock private lateinit var soraConfigManager: SoraConfigManager - private val mockedUri = mock(Uri::class.java) + private val mockedUri = DEFAULT_ICON_URI private lateinit var runtime: RuntimeSnapshot diff --git a/feature_wallet_impl/src/test/java/jp/co/soramitsu/feature_wallet_impl/presentation/wallet/CardsHubViewModelTest.kt b/feature_wallet_impl/src/test/java/jp/co/soramitsu/feature_wallet_impl/presentation/wallet/CardsHubViewModelTest.kt index bfa8e0d6b..37cf3813d 100644 --- a/feature_wallet_impl/src/test/java/jp/co/soramitsu/feature_wallet_impl/presentation/wallet/CardsHubViewModelTest.kt +++ b/feature_wallet_impl/src/test/java/jp/co/soramitsu/feature_wallet_impl/presentation/wallet/CardsHubViewModelTest.kt @@ -140,8 +140,6 @@ class CardsHubViewModelTest { @MockK private lateinit var connectionManager: ConnectionManager - private val mockedUri = mockk() - private lateinit var cardsHubViewModel: CardsHubViewModel private val account = SoraAccount("address", "name") @@ -149,16 +147,8 @@ class CardsHubViewModelTest { @OptIn(ExperimentalStdlibApi::class) @Before fun setUp() = runTest { - mockkStatic(Uri::parse) - every { Uri.parse(any()) } returns mockedUri - mockkStatic(Token::iconUri) mockkObject(BuildConfigWrapper) every { BuildConfigWrapper.getSoraCardBackEndUrl() }.returns("soracard backend") - every { TestTokens.xorToken.iconUri() } returns mockedUri - every { TestTokens.valToken.iconUri() } returns mockedUri - every { TestTokens.pswapToken.iconUri() } returns mockedUri - every { TestTokens.xstusdToken.iconUri() } returns mockedUri - every { TestTokens.xstToken.iconUri() } returns mockedUri every { connectionManager.isConnected } returns true mockkObject(OptionsProvider) every { OptionsProvider.header } returns "test android client" diff --git a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/models/BlockResponse.kt b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/models/BlockResponse.kt index e081c76d3..de3405fae 100644 --- a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/models/BlockResponse.kt +++ b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/models/BlockResponse.kt @@ -32,10 +32,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.sora.substrate.models -import androidx.annotation.Keep +import jp.co.soramitsu.common.util.ParseModel -@Keep -data class BlockResponse(val justification: Any?, val block: BlockEntry) +data class BlockResponse(val justification: Any?, val block: BlockEntry) : ParseModel() -@Keep -data class BlockEntry(val header: Any?, val extrinsics: List) +data class BlockEntry(val header: Any?, val extrinsics: List) : ParseModel() diff --git a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/BalanceResponse.kt b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/BalanceResponse.kt index 895049189..9be1fd864 100644 --- a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/BalanceResponse.kt +++ b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/BalanceResponse.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.sora.substrate.response -import androidx.annotation.Keep +import jp.co.soramitsu.common.util.ParseModel -@Keep -data class BalanceResponse(val balance: String) +data class BalanceResponse(val balance: String) : ParseModel() diff --git a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/ChainHeaderResponse.kt b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/ChainHeaderResponse.kt index 246cf52d3..bd8416722 100644 --- a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/ChainHeaderResponse.kt +++ b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/ChainHeaderResponse.kt @@ -32,7 +32,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.sora.substrate.response -import androidx.annotation.Keep +import jp.co.soramitsu.common.util.ParseModel -@Keep -class ChainHeaderResponse(val parentHash: String, val number: String, val stateRoot: String, val extrinsicsRoot: String) +class ChainHeaderResponse(val parentHash: String, val number: String, val stateRoot: String, val extrinsicsRoot: String) : ParseModel() diff --git a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/FeeResponse.kt b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/FeeResponse.kt index 5f79a6477..510a398c9 100644 --- a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/FeeResponse.kt +++ b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/FeeResponse.kt @@ -32,11 +32,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.sora.substrate.response -import androidx.annotation.Keep import java.math.BigInteger +import jp.co.soramitsu.common.util.ParseModel -@Keep data class FeeResponse( val partialFee: BigInteger, val weight: Long -) +) : ParseModel() diff --git a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/FeeResponse2.kt b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/FeeResponse2.kt index 582f0f9ea..d9b454c4e 100644 --- a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/FeeResponse2.kt +++ b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/FeeResponse2.kt @@ -32,23 +32,21 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.sora.substrate.response -import androidx.annotation.Keep import java.math.BigInteger +import jp.co.soramitsu.common.util.ParseModel import jp.co.soramitsu.shared_utils.extensions.fromHex import jp.co.soramitsu.shared_utils.extensions.fromUnsignedBytes import jp.co.soramitsu.shared_utils.extensions.requireHexPrefix -@Keep class FeeResponse2( val inclusionFee: InclusionFee -) +) : ParseModel() -@Keep class InclusionFee( private val baseFee: String?, private val lenFee: String?, private val adjustedWeightFee: String? -) { +) : ParseModel() { val sum: BigInteger get() = BrokenSubstrateHex(baseFee).decodeBigInt() + BrokenSubstrateHex(lenFee).decodeBigInt() + BrokenSubstrateHex(adjustedWeightFee).decodeBigInt() } diff --git a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/StateQueryResponse.kt b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/StateQueryResponse.kt index 3d44bbac5..fa6becd40 100644 --- a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/StateQueryResponse.kt +++ b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/response/StateQueryResponse.kt @@ -32,13 +32,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.sora.substrate.response -import androidx.annotation.Keep +import jp.co.soramitsu.common.util.ParseModel -@Keep class StateQueryResponse( val block: String, private val changes: List> -) { +) : ParseModel() { fun changesAsMap(): Map { return changes.associate { it[0]!! to it[1] } } diff --git a/sorasubstrate/src/test/java/jp/co/soramitsu/sora/substrate/SubstrateApiTest.kt b/sorasubstrate/src/test/java/jp/co/soramitsu/sora/substrate/SubstrateApiTest.kt index c977c135d..698883279 100644 --- a/sorasubstrate/src/test/java/jp/co/soramitsu/sora/substrate/SubstrateApiTest.kt +++ b/sorasubstrate/src/test/java/jp/co/soramitsu/sora/substrate/SubstrateApiTest.kt @@ -32,49 +32,48 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.sora.substrate -import androidx.arch.core.executor.testing.InstantTaskExecutorRule -import io.mockk.MockKException -import io.mockk.coEvery -import io.mockk.impl.annotations.MockK -import io.mockk.junit4.MockKRule import jp.co.soramitsu.shared_utils.extensions.fromHex +import jp.co.soramitsu.shared_utils.runtime.RuntimeSnapshot import jp.co.soramitsu.shared_utils.wsrpc.SocketService import jp.co.soramitsu.sora.substrate.runtime.RuntimeManager import jp.co.soramitsu.sora.substrate.substrate.SubstrateApiImpl import jp.co.soramitsu.test_shared.RealRuntimeProvider -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Assert.assertEquals -import org.junit.Rule +import org.junit.Before +import org.junit.Ignore import org.junit.Test -import org.junit.rules.TestRule +import org.junit.runner.RunWith +import org.mockito.junit.MockitoJUnitRunner +import org.mockito.kotlin.mock +import org.mockito.kotlin.whenever -@OptIn(ExperimentalCoroutinesApi::class) +@RunWith(MockitoJUnitRunner::class) class SubstrateApiTest { - @Rule - @JvmField - val rule: TestRule = InstantTaskExecutorRule() + private val socket: SocketService = mock() - @get:Rule - val mockkRule = MockKRule(this) - - @MockK - lateinit var socket: SocketService - - @MockK - lateinit var runtimeManager: RuntimeManager + private val runtimeManager: RuntimeManager = mock() private lateinit var api: SubstrateApiImpl + private lateinit var dev: RuntimeSnapshot + private lateinit var stage: RuntimeSnapshot private fun setUpApi() { api = SubstrateApiImpl(socket, runtimeManager) } - @Test(expected = MockKException::class) + @Before + fun before() { + dev = RealRuntimeProvider.buildRuntime(networkName = "sora2", suffix = "_dev") + stage = RealRuntimeProvider.buildRuntime(networkName = "sora2", suffix = "_soralution") + } + + @Test + @Ignore fun `dev env subscribe getPoolReserveAccount`() = runTest { - val n = RealRuntimeProvider.buildRuntime(networkName = "sora2", suffix = "_dev") - coEvery { runtimeManager.getRuntimeSnapshot() } returns n + //whenever(socket.executeAsync(request = any(), mapper = scale(PoolPropertiesResponse))).thenReturn() + whenever(runtimeManager.getRuntimeSnapshot()).thenReturn(dev) setUpApi() val baseTokenId = "0x0200000000000000000000000000000000000000000000000000000000000000" @@ -83,10 +82,10 @@ class SubstrateApiTest { assertEquals(byteArrayOf(12, 12, 14), t) } - @Test(expected = MockKException::class) + @Test + @Ignore fun `soralution env subscribe getPoolReserveAccount`() = runTest { - val n = RealRuntimeProvider.buildRuntime(networkName = "sora2", suffix = "_soralution") - coEvery { runtimeManager.getRuntimeSnapshot() } returns n + whenever(runtimeManager.getRuntimeSnapshot()).thenReturn(stage) setUpApi() val baseTokenId = "0x0200000000000000000000000000000000000000000000000000000000000000"