From ab04f0a1248247c749d6e800402e76b8ea936ba7 Mon Sep 17 00:00:00 2001 From: arvifox Date: Thu, 28 Sep 2023 20:11:31 +0300 Subject: [PATCH] mwr-651 --- app/proguard-rules.pro | 115 ++++++++++++++++ build.gradle | 10 +- .../soramitsu/common/base/SoraBaseFragment.kt | 29 +++- .../common/data/network/dto/SwapFeeDto.kt | 5 +- .../common/domain/BottomBarController.kt | 2 +- .../common/inappupdate/InAppUpdateManager.kt | 17 ++- .../compose/components/AssetAmount.kt | 121 ++++++++++++----- .../compose/components/ContentCardEndless.kt | 108 --------------- .../compose/components/DetailsItem.kt | 1 + .../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 + core_db/build.gradle | 49 +++++-- .../jp/co/soramitsu/core_db/dao/AssetDao.kt | 7 + demeter/build.gradle | 2 +- .../data/AssetsRepository.kt | 6 +- .../domain/AssetsInteractor.kt | 2 - .../selectsearchtoken/SelectSearchToken.kt | 2 +- .../data/AssetsRepositoryImpl.kt | 14 +- .../domain/AssetsInteractorImpl.kt | 5 - .../data/AssetsRepositoryTest.kt | 4 +- .../domain/AssetsInteractorTest.kt | 6 - .../screen/TxHistoryListScreen.kt | 2 +- .../domain/TransactionHistoryHandlerTest.kt | 126 ++++++++++-------- .../allcurrencies/AllCurrenciesScreen.kt | 2 +- .../presentation/allpools/AllPoolsScreen.kt | 2 +- feature_ethereum_impl/build.gradle | 2 +- .../presentation/MainActivity.kt | 14 +- feature_multiaccount_impl/build.gradle | 5 +- .../account_details/AccountDetailsScreen.kt | 63 +++++---- .../AccountDetailsScreenBasic.kt | 89 +++++++++---- .../account_list/AccountListMenu.kt | 51 ++++--- .../account_list/AccountListScreen.kt | 118 +++++++++++----- .../components/compose/SwapMarketsScreen.kt | 1 + .../components/compose/SwapSlippageScreen.kt | 43 ++++-- .../liquidityadd/LiquidityAddFragment.kt | 2 +- .../LiquidityRemoveFragment.kt | 2 +- .../presentation/screens/swap/SwapFragment.kt | 3 +- .../presentation/ReferralBondUnbondXor.kt | 73 +++++++--- .../presentation/ReferralFragment.kt | 20 +-- .../presentation/ReferralViewModel.kt | 16 +-- .../presentation/ReferralViewModelTest.kt | 8 +- .../presentation/details/NodeDetailsScreen.kt | 9 -- .../details/NodeDetailsViewModel.kt | 17 --- .../details/NodeDetailsViewModelTest.kt | 19 --- feature_wallet_impl/build.gradle | 5 +- .../presentation/cardshub/BuyXorCard.kt | 27 +++- .../presentation/cardshub/SoraCard.kt | 37 +++-- .../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 +- 63 files changed, 810 insertions(+), 534 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..889d29db4 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 : '24.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" @@ -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/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/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/components/AssetAmount.kt b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/AssetAmount.kt index 4b5e59a01..850623763 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 @@ -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..ed816ee2b 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 @@ -93,6 +93,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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9lAA;EvSKZKStz0* z-a*64NH|LyL$NCAL>3pY$ty1bBEc*@8{(@l%|F0}t_i>7wRBy+{mZ%J;!^$Q(W+TZV$PSShp z(aY0DHGT56d7@lNlp1_L;JisNoKc3CZRIZfWA6eiJ9&o;<0Ks zyu&XD+*S$wcG30+AlI+db^>v)5R0y!rmKB9Om0YZOA9oim$T6Rke#g0$qYrgi7pee zq>J=m{WusdLTzQ`*6ACs`&RqOKhf10rPgw3J75-}cF;4OQlBs{p>$5_eDG7BYTMWq z@QVhP#4AEyeKkU_Dz&lW2aQg8pr~iGt}c4WYE7A88yVe^)p7Od4y_pJRrh#a!*yhI z*^Rn_Zv+hCbrr_z@yJ0lk;4?eGxR?Y`8c82=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..3eae3095d0aebf3c634098ed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A5@Hpg=bE9Ka|L*XDv?_grSqEyK1dzZ4X*^xbtRnpyvA3I z*6q->6UgN!2_#P&5TA4K*Q+FyDp1a{2W>PuECpUhDI!jy<9SGfL~P9ZCWsJX{0r26 zp_F|f3b7RBlx_YNj6z6zfT?d0jhz@f#u z89`5&`*6xLWyxFZJ?_R{q^aERkHfbHIy-a|=dcB|ywCR7xjvxKO^#E6*HoaJIM;LS z-`6{3dGbB3$CQr8Shx4$js%|7E*Z*~)6W_074dk*(nn6Y`2Ot)l_#gXLOAj8Kpblu zt31)|=e}g;XWBl~M7UN1d0<-%D9?#NbMElDV)@O5GK_Wio@|%4ZY!*tQxBbj9YVv? zdE9>C-DzUEU=bVod-BTzjd8B!4dY@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!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QcR@tCd_gcI)3{#SYn??>Nz@Q2A;ZI__HxugsJrS=>TC$JEdQ`SYe+u(yn0w_C?D*0FxFm>8xWM=D4gCRlaMe3=-eNlD_)QI z8AdeHaAj3+wmOr{QH~wT_^f1)`*YZgWW;DP|6VsEb|H^WNwGl+i^3CXg23|T>kRu3 z=Wvx~N52&j`+p956o*Ie{KpgQ6MhT%v3x3lUGh((InPj{DBHd|Ix+0FNL1G!}gBL u^=lj^|3_}VS`@35ZrrKhhFo!8iO_VLHH<8t&OE`DD9ZA0)NL;nZep;y)b literal 0 HcmV?d00001 diff --git a/common/src/main/res/drawable-night-xxxhdpi/ic_polkaswap_full_title.png b/common/src/main/res/drawable-night-xxxhdpi/ic_polkaswap_full_title.png new file mode 100644 index 0000000000000000000000000000000000000000..e9dc8bda99a6b8eebc28b10ff26be9780ec0c8a4 GIT binary patch literal 10470 zcmYLvby$?o_cpcE(%mWD-Q6OMbT3FZxO6VPq!Q}V3W$hwcb9ZYcf%4Yi`0vLzQ61J z<9VK$GtW6Q=gd9lnwjfP(A8GM#iqhWLPEmTP*>JRLPFkrDo0?VKfR?hr&OLkSYGO; zzDP*intvbUPcm7bpM=Q1`f7?umE$yrPZcyr1uX?6r0P`Qoh<+fi9J|DS-~&>`7}4& zXQd%y@B_%0^Vjdxm)Zmfv}$dFBeX0Xn{pTH%is5)8#KDyu1mRAzG3>m1*|bx*9aCA z#;{bbb>wcv%^Ng1>&2dNfZlym__NgI4up=TK-5RR>V!neo>;^_f~VKL?sL6QeBIrN zEB|`qp#wd~vN?a1EjYJZj(Y`FP?tnS?=5XXlmS~qXS?^KG+yaA*_m$x+^&MD;>my; zt>Zma#E0v%d{wU;|M`n4SzvWyRS|n)%}XXg)4*9R!GyftlZl4sbx6^2l|iV%iT^c= za3WlhFHkJ@GYn*dqsU{cqDSJO zxgs6=@h+=3ukgPCBpe}SWJq=%>Jb|K9V*ZNiMcNjr>MZ-*#AtkWVtG^?OgTUXr-#E zaXmS1UL55a<{i#LG5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#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/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_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..7ff091519 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 @@ -56,10 +56,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 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/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..c5dd168e2 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 @@ -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_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_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..a9744c33c 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,14 +33,9 @@ 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.CoroutineManager import jp.co.soramitsu.common.domain.Token @@ -67,7 +62,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,44 +71,45 @@ 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.junit.MockitoJUnitRunner +import org.mockito.kotlin.any +import org.mockito.kotlin.anyOrNull +import org.mockito.kotlin.doReturn +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 { @@ -159,38 +154,62 @@ class TransactionHistoryHandlerTest { 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 { + + //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 +246,8 @@ class TransactionHistoryHandlerTest { @Test fun `init successful`() = runTest { - verify { transactionHistoryRepository.onSoraAccountChange() } + advanceUntilIdle() + verify(transactionHistoryRepository).onSoraAccountChange() } @Test 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_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_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_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/presentation/ReferralViewModelTest.kt b/feature_referral_impl/src/test/java/jp/co/soramitsu/feature_referral_impl/presentation/ReferralViewModelTest.kt index c9292c05e..1e85cfbe9 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 @@ -203,8 +203,8 @@ class ReferralViewModelTest { advanceUntilIdle() val state = referralViewModel.referralScreenState.value assertNull(state.common.referrer) - var navEvent = referralViewModel.navEvent.getOrAwaitValue() - assertEquals(ReferralFeatureRoutes.WELCOME_PAGE, navEvent.first) + var navEvent = referralViewModel.navToStart.getOrAwaitValue() + assertEquals(ReferralFeatureRoutes.WELCOME_PAGE, navEvent) coEvery { interactor.isLinkOrAddressOk("") } returns (false to "") referralViewModel.openReferrerInput() advanceUntilIdle() @@ -219,8 +219,8 @@ class ReferralViewModelTest { every { assetsRouter.showTxDetails(any(), any()) } returns Unit referralViewModel.onActivateLinkClick() advanceUntilIdle() - navEvent = referralViewModel.navEvent.getOrAwaitValue() - assertEquals(ReferralFeatureRoutes.WELCOME_PAGE, navEvent.first) + navEvent = referralViewModel.navToStart.getOrAwaitValue() + assertEquals(ReferralFeatureRoutes.WELCOME_PAGE, navEvent) } @Test 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_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/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] } }