From a7a92b91459ee4106940f7bf0c1ed3a1573dc007 Mon Sep 17 00:00:00 2001 From: arvifox Date: Wed, 4 Oct 2023 19:11:49 +0300 Subject: [PATCH 1/2] sca-8 --- .../co/soramitsu/sora/navigation/Navigator.kt | 2 +- .../main/res/navigation/main_nav_graph.xml | 2 +- .../compose/components}/BasicBannerCard.kt | 2 +- .../soramitsu/common/util/NumbersFormatter.kt | 1 + .../domain/SoraCardInteractor.kt | 2 + .../domain/SoraCardInteractorImpl.kt | 6 + .../{get/card => }/BalanceIndicator.kt | 2 +- .../{get/card => }/GetSoraCardFragment.kt | 2 +- .../{get/card => }/GetSoraCardScreen.kt | 2 +- .../{get/card => }/GetSoraCardState.kt | 2 +- .../{get/card => }/GetSoraCardViewModel.kt | 2 +- .../{get/card => }/details/IconButtonMenu.kt | 2 +- .../{get/card => }/details/ListTile.kt | 2 +- .../details/SoraCardDetailsFragment.kt | 3 +- .../details/SoraCardDetailsScreen.kt | 94 +++++----- .../details/SoraCardDetailsViewModel.kt | 6 +- .../card => }/details/SoraCardIBANCard.kt | 2 +- .../details/SoraCardMainSoraContentCard.kt | 18 +- .../details/SoraCardRecentActivitiesCard.kt | 2 +- .../card => }/details/SoraCardSettingsCard.kt | 2 +- .../details/SoraCardReferralBannerCard.kt | 160 ------------------ .../res/navigation/sora_card_nav_graph.xml | 2 +- .../get/card/GetSoraCardViewModelTest.kt | 1 + .../presentation/cardshub/BuyXorCard.kt | 1 + .../presentation/cardshub/ReferralCard.kt | 1 + 25 files changed, 88 insertions(+), 233 deletions(-) rename {feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub => common/src/main/java/jp/co/soramitsu/common/presentation/compose/components}/BasicBannerCard.kt (99%) rename feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/{get/card => }/BalanceIndicator.kt (98%) rename feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/{get/card => }/GetSoraCardFragment.kt (98%) rename feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/{get/card => }/GetSoraCardScreen.kt (99%) rename feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/{get/card => }/GetSoraCardState.kt (96%) rename feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/{get/card => }/GetSoraCardViewModel.kt (98%) rename feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/{get/card => }/details/IconButtonMenu.kt (97%) rename feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/{get/card => }/details/ListTile.kt (98%) rename feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/{get/card => }/details/SoraCardDetailsFragment.kt (98%) rename feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/{get/card => }/details/SoraCardDetailsScreen.kt (71%) rename feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/{get/card => }/details/SoraCardDetailsViewModel.kt (97%) rename feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/{get/card => }/details/SoraCardIBANCard.kt (98%) rename feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/{get/card => }/details/SoraCardMainSoraContentCard.kt (93%) rename feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/{get/card => }/details/SoraCardRecentActivitiesCard.kt (98%) rename feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/{get/card => }/details/SoraCardSettingsCard.kt (98%) delete mode 100644 feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardReferralBannerCard.kt diff --git a/app/src/main/java/jp/co/soramitsu/sora/navigation/Navigator.kt b/app/src/main/java/jp/co/soramitsu/sora/navigation/Navigator.kt index a400426f0..c80aec33a 100644 --- a/app/src/main/java/jp/co/soramitsu/sora/navigation/Navigator.kt +++ b/app/src/main/java/jp/co/soramitsu/sora/navigation/Navigator.kt @@ -69,7 +69,7 @@ import jp.co.soramitsu.feature_select_node_api.SelectNodeRouter import jp.co.soramitsu.feature_select_node_impl.presentation.nodeAddress import jp.co.soramitsu.feature_select_node_impl.presentation.nodeName import jp.co.soramitsu.feature_select_node_impl.presentation.pinCodeChecked -import jp.co.soramitsu.feature_sora_card_impl.presentation.get.card.GetSoraCardFragment +import jp.co.soramitsu.feature_sora_card_impl.presentation.GetSoraCardFragment import jp.co.soramitsu.feature_wallet_api.launcher.WalletRouter import jp.co.soramitsu.sora.R diff --git a/app/src/main/res/navigation/main_nav_graph.xml b/app/src/main/res/navigation/main_nav_graph.xml index cf17067e0..74ae770a8 100644 --- a/app/src/main/res/navigation/main_nav_graph.xml +++ b/app/src/main/res/navigation/main_nav_graph.xml @@ -75,7 +75,7 @@ + android:name="jp.co.soramitsu.feature_sora_card_impl.presentation.details.SoraCardDetailsFragment" /> diff --git a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/BasicBannerCard.kt b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/BasicBannerCard.kt similarity index 99% rename from feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/BasicBannerCard.kt rename to common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/BasicBannerCard.kt index 6074afb86..ce0c49ced 100644 --- a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/BasicBannerCard.kt +++ b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/BasicBannerCard.kt @@ -30,7 +30,7 @@ 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_wallet_impl.presentation.cardshub +package jp.co.soramitsu.common.presentation.compose.components import androidx.annotation.DrawableRes import androidx.compose.foundation.Image diff --git a/common/src/main/java/jp/co/soramitsu/common/util/NumbersFormatter.kt b/common/src/main/java/jp/co/soramitsu/common/util/NumbersFormatter.kt index 7c7eeb29b..4b84aec19 100644 --- a/common/src/main/java/jp/co/soramitsu/common/util/NumbersFormatter.kt +++ b/common/src/main/java/jp/co/soramitsu/common/util/NumbersFormatter.kt @@ -46,6 +46,7 @@ import kotlin.math.pow private const val DECIMAL_PATTERN_BASE = "###,###." private const val TWO_DIGITS_PATTERN = "00" const val nbspace = ' ' +const val euro = '€' private const val DEFAULT_PRECISION = 2 diff --git a/feature_sora_card_api/src/main/java/jp/co/soramitsu/feature_sora_card_api/domain/SoraCardInteractor.kt b/feature_sora_card_api/src/main/java/jp/co/soramitsu/feature_sora_card_api/domain/SoraCardInteractor.kt index 0b9f90f14..38583a19d 100644 --- a/feature_sora_card_api/src/main/java/jp/co/soramitsu/feature_sora_card_api/domain/SoraCardInteractor.kt +++ b/feature_sora_card_api/src/main/java/jp/co/soramitsu/feature_sora_card_api/domain/SoraCardInteractor.kt @@ -49,5 +49,7 @@ interface SoraCardInteractor { suspend fun fetchUserIbanAccount(): Result + suspend fun fetchIbanBalance(): Result + suspend fun logOutFromSoraCard() } diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt index cdf3339e7..16bd56353 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt @@ -171,6 +171,12 @@ internal class SoraCardInteractorImpl @Inject constructor( sorted.first().iban } + override suspend fun fetchIbanBalance(): Result = + soraCardClientProxy.getIBAN().mapCatching { wrapper -> + val sorted = wrapper.ibans.sortedByDescending { it.createdDate } + sorted.first().availableBalance + } + override suspend fun logOutFromSoraCard() { soraCardClientProxy.logout() setLogout() diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/BalanceIndicator.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/BalanceIndicator.kt similarity index 98% rename from feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/BalanceIndicator.kt rename to feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/BalanceIndicator.kt index 4001a20e6..a8c534ca3 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/BalanceIndicator.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/BalanceIndicator.kt @@ -30,7 +30,7 @@ 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_sora_card_impl.presentation.get.card +package jp.co.soramitsu.feature_sora_card_impl.presentation import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardFragment.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/GetSoraCardFragment.kt similarity index 98% rename from feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardFragment.kt rename to feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/GetSoraCardFragment.kt index 1aee9379f..a14365399 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardFragment.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/GetSoraCardFragment.kt @@ -30,7 +30,7 @@ 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_sora_card_impl.presentation.get.card +package jp.co.soramitsu.feature_sora_card_impl.presentation import android.os.Bundle import android.view.View diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardScreen.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/GetSoraCardScreen.kt similarity index 99% rename from feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardScreen.kt rename to feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/GetSoraCardScreen.kt index 492dd1a4d..ab4d741af 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardScreen.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/GetSoraCardScreen.kt @@ -30,7 +30,7 @@ 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_sora_card_impl.presentation.get.card +package jp.co.soramitsu.feature_sora_card_impl.presentation import androidx.compose.foundation.ScrollState import androidx.compose.foundation.clickable diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardState.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/GetSoraCardState.kt similarity index 96% rename from feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardState.kt rename to feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/GetSoraCardState.kt index 8b25d2aec..787da789c 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardState.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/GetSoraCardState.kt @@ -30,7 +30,7 @@ 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_sora_card_impl.presentation.get.card +package jp.co.soramitsu.feature_sora_card_impl.presentation data class GetSoraCardState( val xorRatioAvailable: Boolean = false, diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardViewModel.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/GetSoraCardViewModel.kt similarity index 98% rename from feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardViewModel.kt rename to feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/GetSoraCardViewModel.kt index 4ddc1fc5e..872a720b3 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardViewModel.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/GetSoraCardViewModel.kt @@ -30,7 +30,7 @@ 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_sora_card_impl.presentation.get.card +package jp.co.soramitsu.feature_sora_card_impl.presentation import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.LiveData diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/IconButtonMenu.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/IconButtonMenu.kt similarity index 97% rename from feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/IconButtonMenu.kt rename to feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/IconButtonMenu.kt index ca5844c96..e2cef4cea 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/IconButtonMenu.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/IconButtonMenu.kt @@ -30,7 +30,7 @@ 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_sora_card_impl.presentation.get.card.details +package jp.co.soramitsu.feature_sora_card_impl.presentation.details import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Row diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/ListTile.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/ListTile.kt similarity index 98% rename from feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/ListTile.kt rename to feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/ListTile.kt index b9b410f63..8786c2f40 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/ListTile.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/ListTile.kt @@ -30,7 +30,7 @@ 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_sora_card_impl.presentation.get.card.details +package jp.co.soramitsu.feature_sora_card_impl.presentation.details import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardDetailsFragment.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsFragment.kt similarity index 98% rename from feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardDetailsFragment.kt rename to feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsFragment.kt index c39160f6f..f85f1fd45 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardDetailsFragment.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsFragment.kt @@ -30,7 +30,7 @@ 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_sora_card_impl.presentation.get.card.details +package jp.co.soramitsu.feature_sora_card_impl.presentation.details import android.os.Bundle import android.view.View @@ -86,6 +86,7 @@ class SoraCardDetailsFragment : SoraBaseFragment() { composable(theOnlyRoute) { val state = viewModel.soraCardDetailsScreenState.collectAsStateWithLifecycle() SoraCardDetailsScreen( + scrollState = scrollState, soraCardDetailsScreenState = state.value, onShowSoraCardDetailsClick = viewModel::onShowSoraCardDetailsClick, onSoraCardMenuActionClick = viewModel::onSoraCardMenuActionClick, diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardDetailsScreen.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsScreen.kt similarity index 71% rename from feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardDetailsScreen.kt rename to feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsScreen.kt index c18ed4092..e09513e63 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardDetailsScreen.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsScreen.kt @@ -30,28 +30,34 @@ 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_sora_card_impl.presentation.get.card.details +package jp.co.soramitsu.feature_sora_card_impl.presentation.details +import androidx.compose.foundation.ScrollState import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +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.BasicBannerCard import jp.co.soramitsu.ui_core.resources.Dimens import jp.co.soramitsu.ui_core.theme.customColors data class SoraCardDetailsScreenState( val soraCardMainSoraContentCardState: SoraCardMainSoraContentCardState, - val soraCardReferralBannerCardState: SoraCardReferralBannerCardState? = null, + val soraCardReferralBannerCardState: Boolean = false, val soraCardRecentActivitiesCardState: SoraCardRecentActivitiesCardState? = null, val soraCardIBANCardState: SoraCardIBANCardState? = null, val soraCardSettingsCard: SoraCardSettingsCardState? = null, @@ -60,6 +66,7 @@ data class SoraCardDetailsScreenState( @Composable fun SoraCardDetailsScreen( + scrollState: ScrollState, soraCardDetailsScreenState: SoraCardDetailsScreenState, onShowSoraCardDetailsClick: () -> Unit, onSoraCardMenuActionClick: (position: Int) -> Unit, @@ -71,66 +78,58 @@ fun SoraCardDetailsScreen( onIbanCardClick: () -> Unit, onSettingsOptionClick: (position: Int) -> Unit ) { - LazyColumn( + Column( modifier = Modifier + .verticalScroll(scrollState) .fillMaxSize() .padding(horizontal = Dimens.x2), verticalArrangement = Arrangement .spacedBy(Dimens.x2), horizontalAlignment = Alignment - .CenterHorizontally + .CenterHorizontally, ) { - item { - SoraCardMainSoraContentCard( - soraCardMainSoraContentCardState = soraCardDetailsScreenState.soraCardMainSoraContentCardState, - onShowMoreClick = onShowSoraCardDetailsClick, - onIconButtonClick = onSoraCardMenuActionClick + SoraCardMainSoraContentCard( + soraCardMainSoraContentCardState = soraCardDetailsScreenState.soraCardMainSoraContentCardState, + onShowMoreClick = onShowSoraCardDetailsClick, + onIconButtonClick = onSoraCardMenuActionClick + ) + if (soraCardDetailsScreenState.soraCardReferralBannerCardState) { + BasicBannerCard( + imageContent = R.drawable.sora_card_referral_banner, + title = stringResource(id = R.string.sora_card_referral_headline), + description = "", + button = stringResource(id = R.string.sora_card_refer_and_earn_action), + onButtonClicked = onReferralBannerClick, + onCloseCard = onCloseReferralBannerClick, ) } - soraCardDetailsScreenState.soraCardReferralBannerCardState?.let { state -> - item { - SoraCardReferralBannerCard( - soraCardReferralBannerCardState = state, - onReferAndEarnClick = onReferralBannerClick, - onCloseClick = onCloseReferralBannerClick - ) - } - } soraCardDetailsScreenState.soraCardRecentActivitiesCardState?.let { state -> if (state.data.isNotEmpty()) - item { - SoraCardRecentActivitiesCard( - soraCardRecentActivitiesCardState = state, - onListTileClick = onRecentActivityClick, - onShowMoreClick = onShowMoreRecentActivitiesClick - ) - } + SoraCardRecentActivitiesCard( + soraCardRecentActivitiesCardState = state, + onListTileClick = onRecentActivityClick, + onShowMoreClick = onShowMoreRecentActivitiesClick + ) } soraCardDetailsScreenState.soraCardIBANCardState?.let { state -> - item { - SoraCardIBANCard( - soraCardIBANCardState = state, - onShareClick = onIbanCardShareClick, - onCardClick = onIbanCardClick, - ) - } + SoraCardIBANCard( + soraCardIBANCardState = state, + onShareClick = onIbanCardShareClick, + onCardClick = onIbanCardClick, + ) } soraCardDetailsScreenState.soraCardSettingsCard?.let { state -> if (state.settings.isNotEmpty()) - item { - SoraCardSettingsCard( - state = state, - onItemClick = onSettingsOptionClick - ) - } - } - item { - Spacer( - modifier = Modifier - .fillMaxWidth() - .height(Dimens.x5) - ) + SoraCardSettingsCard( + state = state, + onItemClick = onSettingsOptionClick + ) } + Spacer( + modifier = Modifier + .fillMaxWidth() + .height(Dimens.x5) + ) } } @@ -145,13 +144,14 @@ private fun PreviewSoraCardDetailsScreen() { .fillMaxSize() ) { SoraCardDetailsScreen( + scrollState = rememberScrollState(), soraCardDetailsScreenState = SoraCardDetailsScreenState( soraCardMainSoraContentCardState = SoraCardMainSoraContentCardState( balance = 3665.50f, isCardEnabled = false, soraCardMenuActions = SoraCardMenuAction.values().toList() ), - soraCardReferralBannerCardState = SoraCardReferralBannerCardState(), + soraCardReferralBannerCardState = true, soraCardRecentActivitiesCardState = SoraCardRecentActivitiesCardState( data = listOf() ), diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardDetailsViewModel.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsViewModel.kt similarity index 97% rename from feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardDetailsViewModel.kt rename to feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsViewModel.kt index 27dfc1cf8..1af2c6fc1 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardDetailsViewModel.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsViewModel.kt @@ -30,7 +30,7 @@ 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_sora_card_impl.presentation.get.card.details +package jp.co.soramitsu.feature_sora_card_impl.presentation.details import androidx.lifecycle.LiveData import androidx.lifecycle.viewModelScope @@ -65,10 +65,10 @@ class SoraCardDetailsViewModel @Inject constructor( soraCardMainSoraContentCardState = SoraCardMainSoraContentCardState( balance = 0f, isCardEnabled = false, - soraCardMenuActions = SoraCardMenuAction.values().toList() + soraCardMenuActions = SoraCardMenuAction.entries ), soraCardSettingsCard = SoraCardSettingsCardState( - soraCardSettingsOptions = SoraCardSettingsOption.values().toList() + soraCardSettingsOptions = SoraCardSettingsOption.entries ), logoutDialog = false, ) diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardIBANCard.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardIBANCard.kt similarity index 98% rename from feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardIBANCard.kt rename to feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardIBANCard.kt index 7a4fa512e..64d131892 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardIBANCard.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardIBANCard.kt @@ -30,7 +30,7 @@ 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_sora_card_impl.presentation.get.card.details +package jp.co.soramitsu.feature_sora_card_impl.presentation.details import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardMainSoraContentCard.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardMainSoraContentCard.kt similarity index 93% rename from feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardMainSoraContentCard.kt rename to feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardMainSoraContentCard.kt index 6280db054..b48dc7713 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardMainSoraContentCard.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardMainSoraContentCard.kt @@ -30,7 +30,7 @@ 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_sora_card_impl.presentation.get.card.details +package jp.co.soramitsu.feature_sora_card_impl.presentation.details import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -53,6 +53,7 @@ import jp.co.soramitsu.common.R import jp.co.soramitsu.common.presentation.compose.components.SoraCardImage import jp.co.soramitsu.common.presentation.compose.uikit.tokens.Image import jp.co.soramitsu.common.presentation.compose.uikit.tokens.Text +import jp.co.soramitsu.common.util.euro import jp.co.soramitsu.ui_core.component.button.BleachedButton import jp.co.soramitsu.ui_core.component.button.properties.Order import jp.co.soramitsu.ui_core.component.button.properties.Size @@ -68,6 +69,7 @@ enum class SoraCardMenuAction { data class SoraCardMainSoraContentCardState( val balance: Float, val isCardEnabled: Boolean, + val actionsEnabled: Boolean = false, val soraCardMenuActions: List, ) { @@ -79,28 +81,28 @@ data class SoraCardMainSoraContentCardState( testTagId = it.toString(), image = Image.ResImage(id = R.drawable.ic_new_arrow_down_24), text = Text.StringRes(id = R.string.sora_card_action_top_up), - isEnabled = isCardEnabled + isEnabled = actionsEnabled, ) SoraCardMenuAction.TRANSFER -> IconButtonMenuState( testTagId = it.toString(), image = Image.ResImage(id = R.drawable.ic_new_arrow_up_24), text = Text.StringRes(id = R.string.sora_card_action_transfer), - isEnabled = isCardEnabled + isEnabled = actionsEnabled, ) SoraCardMenuAction.EXCHANGE -> IconButtonMenuState( testTagId = it.toString(), image = Image.ResImage(id = R.drawable.ic_refresh_24), text = Text.StringRes(id = R.string.sora_card_action_exchange), - isEnabled = isCardEnabled + isEnabled = actionsEnabled, ) SoraCardMenuAction.FREEZE -> IconButtonMenuState( testTagId = it.toString(), image = Image.ResImage(id = R.drawable.ic_snow_flake), text = Text.StringRes(id = R.string.sora_card_action_freeze), - isEnabled = isCardEnabled + isEnabled = actionsEnabled, ) } } @@ -154,7 +156,7 @@ fun SoraCardMainSoraContentCard( color = MaterialTheme.customColors.fgPrimary ) Text( - text = "%.5f".format(soraCardMainSoraContentCardState.balance), + text = "%s%.2f".format(euro, soraCardMainSoraContentCardState.balance), style = MaterialTheme.customTypography.headline2, color = MaterialTheme.customColors.fgPrimary ) @@ -182,7 +184,7 @@ private fun PreviewMainSoraContentCard() { soraCardMainSoraContentCardState = SoraCardMainSoraContentCardState( balance = 3644.50f, isCardEnabled = true, - soraCardMenuActions = SoraCardMenuAction.values().toList() + soraCardMenuActions = SoraCardMenuAction.entries ), onShowMoreClick = {}, onIconButtonClick = { _ -> } @@ -196,7 +198,7 @@ private fun PreviewMainSoraContentCard2() { soraCardMainSoraContentCardState = SoraCardMainSoraContentCardState( balance = 3644.50f, isCardEnabled = true, - soraCardMenuActions = SoraCardMenuAction.values().toList() + soraCardMenuActions = SoraCardMenuAction.entries ), onShowMoreClick = {}, onIconButtonClick = { _ -> } diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardRecentActivitiesCard.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardRecentActivitiesCard.kt similarity index 98% rename from feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardRecentActivitiesCard.kt rename to feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardRecentActivitiesCard.kt index e3c4fccba..dc0118823 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardRecentActivitiesCard.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardRecentActivitiesCard.kt @@ -30,7 +30,7 @@ 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_sora_card_impl.presentation.get.card.details +package jp.co.soramitsu.feature_sora_card_impl.presentation.details import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardSettingsCard.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardSettingsCard.kt similarity index 98% rename from feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardSettingsCard.kt rename to feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardSettingsCard.kt index 13c7c4495..60006f47d 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardSettingsCard.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardSettingsCard.kt @@ -30,7 +30,7 @@ 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_sora_card_impl.presentation.get.card.details +package jp.co.soramitsu.feature_sora_card_impl.presentation.details import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardReferralBannerCard.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardReferralBannerCard.kt deleted file mode 100644 index d1bbeb9bc..000000000 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/details/SoraCardReferralBannerCard.kt +++ /dev/null @@ -1,160 +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.feature_sora_card_impl.presentation.get.card.details - -import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.IntrinsicSize -import androidx.compose.foundation.layout.fillMaxHeight -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.wrapContentWidth -import androidx.compose.foundation.shape.CircleShape -import androidx.compose.material.MaterialTheme -import androidx.compose.material.Text -import androidx.compose.runtime.Composable -import androidx.compose.runtime.Stable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.layout.ContentScale -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.tooling.preview.Preview -import jp.co.soramitsu.common.R -import jp.co.soramitsu.common.presentation.compose.uikit.tokens.Image -import jp.co.soramitsu.common.presentation.compose.uikit.tokens.Text -import jp.co.soramitsu.common.presentation.compose.uikit.tokens.retrievePainter -import jp.co.soramitsu.common.presentation.compose.uikit.tokens.retrieveString -import jp.co.soramitsu.ui_core.component.button.BleachedButton -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.ContentCard -import jp.co.soramitsu.ui_core.resources.Dimens -import jp.co.soramitsu.ui_core.theme.customColors -import jp.co.soramitsu.ui_core.theme.customTypography - -@Stable -class SoraCardReferralBannerCardState { - - val headlineText: Text = Text.StringRes( - id = R.string.sora_card_referral_headline - ) - - val referAndEarnText: Text = Text.StringRes( - id = R.string.sora_card_refer_and_earn_action - ) - - val backgroundImage: Image = Image.ResImage( - id = R.drawable.sora_card_referral_banner - ) -} - -@Composable -fun SoraCardReferralBannerCard( - soraCardReferralBannerCardState: SoraCardReferralBannerCardState, - onReferAndEarnClick: () -> Unit, - onCloseClick: () -> Unit -) { - ContentCard( - modifier = Modifier - .height(IntrinsicSize.Min) - .fillMaxWidth(), - onClick = onReferAndEarnClick - ) { - Box { - Column( - modifier = Modifier - .fillMaxHeight() - .align(Alignment.TopStart) - .padding( - top = Dimens.x2, - bottom = Dimens.x3, - start = Dimens.x3, - end = Dimens.x3, - ) - ) { - Text( - text = soraCardReferralBannerCardState.headlineText.retrieveString(), - style = MaterialTheme.customTypography.headline2, - color = MaterialTheme.customColors.fgPrimary - ) - - FilledButton( - modifier = Modifier - .wrapContentWidth() - .padding(top = Dimens.x1), - text = soraCardReferralBannerCardState.referAndEarnText.retrieveString(), - size = Size.ExtraSmall, - order = Order.PRIMARY, - onClick = onReferAndEarnClick, - ) - } - - Image( - modifier = Modifier - .fillMaxSize() - .align(Alignment.BottomEnd) - .padding(top = Dimens.x2), - painter = soraCardReferralBannerCardState.backgroundImage.retrievePainter(), - contentDescription = null, - contentScale = ContentScale.Fit, - alignment = Alignment.BottomEnd - ) - - BleachedButton( - modifier = Modifier - .wrapContentWidth() - .align(Alignment.TopEnd) - .padding(Dimens.x1), - size = Size.ExtraSmall, - order = Order.TERTIARY, - shape = CircleShape, - onClick = onCloseClick, - leftIcon = painterResource(R.drawable.ic_cross), - ) - } - } -} - -@Preview -@Composable -fun PreviewSoraCardReferralBannerCard() { - SoraCardReferralBannerCard( - soraCardReferralBannerCardState = SoraCardReferralBannerCardState(), - onReferAndEarnClick = {}, - onCloseClick = {} - ) -} diff --git a/feature_sora_card_impl/src/main/res/navigation/sora_card_nav_graph.xml b/feature_sora_card_impl/src/main/res/navigation/sora_card_nav_graph.xml index 6f6e28bd6..470cfb1b5 100644 --- a/feature_sora_card_impl/src/main/res/navigation/sora_card_nav_graph.xml +++ b/feature_sora_card_impl/src/main/res/navigation/sora_card_nav_graph.xml @@ -6,6 +6,6 @@ + android:name="jp.co.soramitsu.feature_sora_card_impl.presentation.GetSoraCardFragment" /> \ No newline at end of file diff --git a/feature_sora_card_impl/src/test/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardViewModelTest.kt b/feature_sora_card_impl/src/test/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardViewModelTest.kt index fbb64b433..5bed70dbc 100644 --- a/feature_sora_card_impl/src/test/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardViewModelTest.kt +++ b/feature_sora_card_impl/src/test/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/GetSoraCardViewModelTest.kt @@ -43,6 +43,7 @@ import jp.co.soramitsu.feature_main_api.launcher.MainRouter import jp.co.soramitsu.feature_polkaswap_api.launcher.PolkaswapRouter import jp.co.soramitsu.feature_sora_card_api.domain.SoraCardInteractor import jp.co.soramitsu.feature_sora_card_api.domain.models.SoraCardAvailabilityInfo +import jp.co.soramitsu.feature_sora_card_impl.presentation.GetSoraCardViewModel import jp.co.soramitsu.feature_wallet_api.launcher.WalletRouter import jp.co.soramitsu.sora.substrate.runtime.SubstrateOptionsProvider import jp.co.soramitsu.sora.substrate.substrate.ConnectionManager 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 d168480ad..66926b5ce 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 @@ -37,6 +37,7 @@ 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.components.BasicBannerCard import jp.co.soramitsu.common.presentation.compose.theme.SoraAppTheme @Composable diff --git a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/ReferralCard.kt b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/ReferralCard.kt index 9841b8d1d..1a8acad62 100644 --- a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/ReferralCard.kt +++ b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/ReferralCard.kt @@ -36,6 +36,7 @@ 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.components.BasicBannerCard @Composable fun ReferralCard( From 9c9339ba30000846b15659fa60c85cbb942c8f3b Mon Sep 17 00:00:00 2001 From: arvifox Date: Fri, 6 Oct 2023 13:13:23 +0300 Subject: [PATCH 2/2] sca-8 sca-130 sca-133, balance, iban --- android-foundation | 2 +- build.gradle | 2 +- .../common/domain/OptionsProvider.kt | 2 + .../soramitsu/common/util/NumbersFormatter.kt | 3 +- common/src/main/res/values-ar/strings.xml | 8 +- common/src/main/res/values-az/strings.xml | 6 ++ common/src/main/res/values-de/strings.xml | 8 +- common/src/main/res/values-es/strings.xml | 8 +- common/src/main/res/values-fa/strings.xml | 8 +- common/src/main/res/values-fi/strings.xml | 8 +- common/src/main/res/values-fr/strings.xml | 8 +- common/src/main/res/values-hi-rIN/strings.xml | 8 +- common/src/main/res/values-in/strings.xml | 8 +- common/src/main/res/values-iw/strings.xml | 92 ++++++++++--------- common/src/main/res/values-ja/strings.xml | 8 +- common/src/main/res/values-ms-rMY/strings.xml | 8 +- common/src/main/res/values-nb/strings.xml | 8 +- common/src/main/res/values-nl/strings.xml | 8 +- common/src/main/res/values-pt/strings.xml | 8 +- common/src/main/res/values-ru/strings.xml | 10 +- common/src/main/res/values-sr/strings.xml | 8 +- common/src/main/res/values-tr/strings.xml | 8 +- common/src/main/res/values-vi/strings.xml | 6 ++ common/src/main/res/values-zh-rCN/strings.xml | 6 ++ common/src/main/res/values-zh-rTW/strings.xml | 8 +- common/src/main/res/values/strings.xml | 9 +- .../jp/co/soramitsu/common/domain/FiatTest.kt | 2 +- .../common/util/NumbersFormatterTest.kt | 1 + .../presentation/compose/states/CardState.kt | 2 +- .../domain/SoraCardInteractor.kt | 2 +- .../domain/SoraCardInteractorImpl.kt | 6 +- .../details/SoraCardDetailsFragment.kt | 6 +- .../details/SoraCardDetailsScreen.kt | 7 +- .../details/SoraCardDetailsViewModel.kt | 27 +++++- .../details/SoraCardMainSoraContentCard.kt | 50 +++++----- .../details/SoraCardSettingsCard.kt | 24 +++-- .../cardshub/CardsHubViewModel.kt | 20 ++-- .../presentation/cardshub/SoraCard.kt | 37 ++++---- 38 files changed, 303 insertions(+), 147 deletions(-) diff --git a/android-foundation b/android-foundation index ead7e75bf..71b8d1433 160000 --- a/android-foundation +++ b/android-foundation @@ -1 +1 @@ -Subproject commit ead7e75bfdba7b00cac5f3e69f5c34295d64d78b +Subproject commit 71b8d143362a155e943af891860f1174392f4ff9 diff --git a/build.gradle b/build.gradle index 9f9fbb84c..5d7f1f189 100644 --- a/build.gradle +++ b/build.gradle @@ -44,7 +44,7 @@ buildscript { composeCompiler : '1.5.3', composeConstraintLayout: '1.1.0-alpha05', uiCore : '0.2.7', - soraCard : '0.1.49', + soraCard : '0.1.51', lazySodium : '5.0.2', jna : '5.8.0', accompanist : '0.30.1', diff --git a/common/src/main/java/jp/co/soramitsu/common/domain/OptionsProvider.kt b/common/src/main/java/jp/co/soramitsu/common/domain/OptionsProvider.kt index dc1d85ba4..0b62e694a 100644 --- a/common/src/main/java/jp/co/soramitsu/common/domain/OptionsProvider.kt +++ b/common/src/main/java/jp/co/soramitsu/common/domain/OptionsProvider.kt @@ -50,6 +50,8 @@ object OptionsProvider { const val defaultScale = 18 const val nameByteLimit = 32 const val fiatSymbol = "$" + const val nbspace = ' ' + const val euroSign = '€' const val website = "https://sora.org" const val sourceLink = "https://github.com/sora-xor/Sora-Android" diff --git a/common/src/main/java/jp/co/soramitsu/common/util/NumbersFormatter.kt b/common/src/main/java/jp/co/soramitsu/common/util/NumbersFormatter.kt index 4b84aec19..e36417758 100644 --- a/common/src/main/java/jp/co/soramitsu/common/util/NumbersFormatter.kt +++ b/common/src/main/java/jp/co/soramitsu/common/util/NumbersFormatter.kt @@ -40,13 +40,12 @@ import java.text.NumberFormat import java.util.Currency import java.util.Locale import jp.co.soramitsu.common.domain.OptionsProvider +import jp.co.soramitsu.common.domain.OptionsProvider.nbspace import kotlin.math.absoluteValue import kotlin.math.pow private const val DECIMAL_PATTERN_BASE = "###,###." private const val TWO_DIGITS_PATTERN = "00" -const val nbspace = ' ' -const val euro = '€' private const val DEFAULT_PRECISION = 2 diff --git a/common/src/main/res/values-ar/strings.xml b/common/src/main/res/values-ar/strings.xml index 3645ace78..0c96dd521 100644 --- a/common/src/main/res/values-ar/strings.xml +++ b/common/src/main/res/values-ar/strings.xml @@ -39,6 +39,8 @@ سعر الرمز المميز تجمعات %s الخاصة بك الأصول المراد إرسالها + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. @@ -48,6 +50,7 @@ شراء توكن XOR شراء أو بيع توكن XOR باليورو شراء XOR مع فيات + Can\'t load balance تغيير اللغة تغيير PIN اختر عملة @@ -172,6 +175,7 @@ تحديث إزالة Request + Rewrite الروسية مسح ضوئي مسح QR @@ -235,6 +239,7 @@ Incorrect password Enter password ارصدة غير كافية لرسوم المعاملة + Create pool Provide liquidity and earn rewards Swap tokens on SORA network إذا فقدت الوصول إلى هذا الجهاز ، فستفقد أموالك ، ما لم تقم بعمل نسخة احتياطية! @@ -515,7 +520,7 @@ IBAN account details Log in or Sign up لا مزيد من المحاولات المجانية - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -536,6 +541,7 @@ ناجح الحالة You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node مظهر النظام diff --git a/common/src/main/res/values-az/strings.xml b/common/src/main/res/values-az/strings.xml index 9356db09b..4d065ebc3 100644 --- a/common/src/main/res/values-az/strings.xml +++ b/common/src/main/res/values-az/strings.xml @@ -39,6 +39,8 @@ Token price Your %s pools Asset to send + Yedək artıq mövcuddur. Yenidən yazmağa davam edin. + Yedəkləmə alınmadı. Google Diskinizdə kifayət qədər yer yoxdur. Bir az yer boşaltın və yenidən cəhd edin. Parol üçün məcburi tələb yerinə yetirildi Minimum altı simvol. İsteğe bağlı olaraq, daha yaxşı təhlükəsizlik üçün böyük hərflər, rəqəmlər və qeyri-əlifba simvolları daxil edin. Parolun təyin edilməsi Google ehtiyat nüsxənizi şifrələyəcək. Pul kisəsini bərpa edərkən bunu daxil etməlisiniz.\n Minimum parol uzunluğu 6 simvoldur. @@ -48,6 +50,7 @@ Buy XOR token Buy or sell XOR token with euro Buy XOR with fiat + Balansı yükləmək mümkün deyil Change language Change PIN Token seçin @@ -168,6 +171,7 @@ Refresh Sil Request + Yenidən yazmaq Rus dili Tara Scan QR @@ -231,6 +235,7 @@ Incorrect password Enter password Əməliyyat haqqı üçün kifayət qədər vəsait yoxdur + Hovuz yaradın Likvidliyi təmin edin və mükafatlar qazanın SORA şəbəkəsində tokenləri dəyişdirin If you loose access to this device, your funds will be lost, unless you back up! @@ -512,6 +517,7 @@ Successful Status You have succesfully imported an account + Dəstək söhbəti Bu əməliyyatdan sonra %s qaldığınıza əmin olun. Əks halda, başqa sövdələşmə edə bilməyəcəksiniz. Switch node System appearance diff --git a/common/src/main/res/values-de/strings.xml b/common/src/main/res/values-de/strings.xml index e0ad4261f..02fe233d0 100644 --- a/common/src/main/res/values-de/strings.xml +++ b/common/src/main/res/values-de/strings.xml @@ -39,6 +39,8 @@ Token price Your %s pools Asset to send + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. @@ -48,6 +50,7 @@ Buy XOR token Buy or sell XOR token with euro Buy XOR with fiat + Can\'t load balance Change language Change PIN Token\nauswählen @@ -168,6 +171,7 @@ Refresh Entfernen Request + Rewrite Russisch Scan Scan QR @@ -231,6 +235,7 @@ Incorrect password Enter password Nicht genügend Guthaben für die Transaktionsgebühr + Create pool Provide liquidity and earn rewards Swap tokens on SORA network Wenn du den Zugang zu diesem Gerät verlierst, gehen deine Assets verloren, es sei denn, du machst ein Backup! @@ -491,7 +496,7 @@ IBAN account details Log in or Sign up No more free attempts - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -512,6 +517,7 @@ Successful Status You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node System appearance diff --git a/common/src/main/res/values-es/strings.xml b/common/src/main/res/values-es/strings.xml index 0c0b2b908..ba8254ca8 100644 --- a/common/src/main/res/values-es/strings.xml +++ b/common/src/main/res/values-es/strings.xml @@ -39,6 +39,8 @@ Precio del token Tus %spares de liquidez Activo a enviar + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. @@ -48,6 +50,7 @@ Comprar XOR token Comprar o Vender XOR con euro Comprar XOR con fiat + Can\'t load balance Change language Change PIN Select token @@ -168,6 +171,7 @@ Refrescar Remove Request + Rewrite Ruso Escanear Escanear QR @@ -231,6 +235,7 @@ Incorrect password Enter password No hay fondos suficientes para la comisión de la transacción + Create pool Provide liquidity and earn rewards Swap tokens on SORA network If you loose access to this device, your funds will be lost, unless you back up! @@ -491,7 +496,7 @@ IBAN account details Log in or Sign up No quedan más intentos gratuitos - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -512,6 +517,7 @@ Successful Estado You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node System appearance diff --git a/common/src/main/res/values-fa/strings.xml b/common/src/main/res/values-fa/strings.xml index 1f64856a6..42b8c7acd 100644 --- a/common/src/main/res/values-fa/strings.xml +++ b/common/src/main/res/values-fa/strings.xml @@ -39,6 +39,8 @@ Token price Your %s pools Asset to send + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. @@ -48,6 +50,7 @@ Buy XOR token Buy or sell XOR token with euro Buy XOR with fiat + Can\'t load balance Change language Change PIN توکن را انتخاب کنید @@ -168,6 +171,7 @@ Refresh برداشت Request + Rewrite روسی اسکن Scan QR @@ -231,6 +235,7 @@ Incorrect password Enter password بودجه کافی برای هزینه تراکنش وجود ندارد + Create pool Provide liquidity and earn rewards Swap tokens on SORA network If you loose access to this device, your funds will be lost, unless you back up! @@ -491,7 +496,7 @@ IBAN account details Log in or Sign up No more free attempts - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -512,6 +517,7 @@ Successful وضعیت You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node System appearance diff --git a/common/src/main/res/values-fi/strings.xml b/common/src/main/res/values-fi/strings.xml index 3ad5d1120..f90468ebb 100644 --- a/common/src/main/res/values-fi/strings.xml +++ b/common/src/main/res/values-fi/strings.xml @@ -39,6 +39,8 @@ Token price Your %s pools Asset to send + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. @@ -48,6 +50,7 @@ Buy XOR token Buy or sell XOR token with euro Buy XOR with fiat + Can\'t load balance Change language Change PIN Valitse tokeni @@ -168,6 +171,7 @@ Refresh Poista Request + Rewrite Venäjän kieli Skannata Scan QR @@ -231,6 +235,7 @@ Incorrect password Enter password Ei riittävästi varoja siirtomaksuun + Create pool Provide liquidity and earn rewards Swap tokens on SORA network If you loose access to this device, your funds will be lost, unless you back up! @@ -491,7 +496,7 @@ IBAN account details Log in or Sign up No more free attempts - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -512,6 +517,7 @@ Successful Tila You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node System appearance diff --git a/common/src/main/res/values-fr/strings.xml b/common/src/main/res/values-fr/strings.xml index 701f5b309..1ba47a01c 100644 --- a/common/src/main/res/values-fr/strings.xml +++ b/common/src/main/res/values-fr/strings.xml @@ -39,6 +39,8 @@ Prix du jeton Vos %s pool(s) Actif à envoyer + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Critères de sécurité obligatoires remplis Minimum six caractères. Pour une meilleure sécurité, inclure des lettres majuscules, des nombres et des caractères spéciaux. Définir un mot de passe va encrypter votre sauvegarde. Vous devred entrer le mot de passe pour restaurer votre portefeuille.\nLe mot de passe doit être d\'au moins six caractères. @@ -48,6 +50,7 @@ Acheter des jetons XOR Acheter ou vendre des jetons XOR avec des euros Acheter du XOR avec des euros + Can\'t load balance Changer la langue Changer le code PIN Choisissez le jeton @@ -168,6 +171,7 @@ Rafraîchir Supprimer Demander + Rewrite Russe Analyse Scanner code QR @@ -231,6 +235,7 @@ Mot de passe incorrect Entrer le mot de passe Pas assez de fonds pour les frais de transaction + Create pool Fournir des liquidités et gagner des récompenses Échanger des tokens sur le réseau SORA Si vous perdez l\'accès à cet appareil, vos fonds seront perdus, sauf si vous sauvegardez! @@ -491,7 +496,7 @@ IBAN account details Se connecter ou s\'inscrire Nombre d\'essais gratuits épuisé - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Parrainer et gagner Refer SORA Card.\nGet €20 bonus. @@ -512,6 +517,7 @@ Confirmée Statut Vous avez importé votre compte avec succès + Support chat Assurez-vous qu’il vous reste %s après cette transaction. Sinon, vous ne pourrez pas effectuer une autre transaction. Changer de nœud Apparence du système diff --git a/common/src/main/res/values-hi-rIN/strings.xml b/common/src/main/res/values-hi-rIN/strings.xml index 694bc10f4..2c293bbb5 100644 --- a/common/src/main/res/values-hi-rIN/strings.xml +++ b/common/src/main/res/values-hi-rIN/strings.xml @@ -39,6 +39,8 @@ टोकन मूल्य आपके %s पूल भेजने के लिए संपत्ति + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. @@ -48,6 +50,7 @@ XOR टोकन खरीदें यूरो के साथ XOR टोकन खरीदें या बेचें फिएट के साथ XOR खरीदें + Can\'t load balance भाषा बदलें पिन बदलिए टोकन चुनें @@ -168,6 +171,7 @@ ताज़ा करना हटाये Request + Rewrite रूसी स्कैन QR स्कैन करें @@ -231,6 +235,7 @@ Incorrect password Enter password नेटवर्क शुल्क के लिए पर्याप्त धनराशि नहीं है + Create pool Provide liquidity and earn rewards Swap tokens on SORA network अगर आप इस डिवाइस का एक्सेस खो देते हैं, तो आपके फंड का नुकसान हो जाएगा, जब तक कि आप बैकअप नहीं लेते! @@ -491,7 +496,7 @@ IBAN account details Log in or Sign up कोई और मुफ़्त प्रयास नहीं - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -512,6 +517,7 @@ सफल स्थिति You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node सिस्टम स्थिति diff --git a/common/src/main/res/values-in/strings.xml b/common/src/main/res/values-in/strings.xml index 23490c60d..d1eaa408d 100644 --- a/common/src/main/res/values-in/strings.xml +++ b/common/src/main/res/values-in/strings.xml @@ -39,6 +39,8 @@ Token price Your %s pools Asset to send + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. @@ -48,6 +50,7 @@ Buy XOR token Buy or sell XOR token with euro Buy XOR with fiat + Can\'t load balance Change language Change PIN Select token @@ -167,6 +170,7 @@ Refresh Remove Request + Rewrite Rusia Pindai Scan QR @@ -230,6 +234,7 @@ Incorrect password Enter password Tidak cukup dana untuk biaya transaksi + Create pool Provide liquidity and earn rewards Swap tokens on SORA network If you loose access to this device, your funds will be lost, unless you back up! @@ -486,7 +491,7 @@ IBAN account details Log in or Sign up No more free attempts - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -507,6 +512,7 @@ Successful Status You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node System appearance diff --git a/common/src/main/res/values-iw/strings.xml b/common/src/main/res/values-iw/strings.xml index 508f31438..82d95945d 100644 --- a/common/src/main/res/values-iw/strings.xml +++ b/common/src/main/res/values-iw/strings.xml @@ -18,8 +18,8 @@ אשר סיסמה מנומונית אשר את מילות המפתח אפשרויות חשבון - גיבוי ל- Google - מחק את הגיבוי של Google + גיבוי לגוגל + מחק את הגיבוי של גוגל חלק מהנתונים אינם מעודכנים אתה תראה את הפעילות שלך כאן ברגע שתתחיל לבצע טרנזקציות לא היתה אפשרות לטעון את הפעילות שלך. נסה לרענן את הרשימה @@ -39,15 +39,18 @@ מחיר טוקן %s המאגרים שלך נכס לשליחה - Mandatory requirement for the password fulfilled - Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. - הגדרת סיסמה תצפין את גיבוי ה-Google שלך. יהיה עליך להזין אותה בעת שחזור הארנק שלך. - Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet. + גיבוי כבר קיים. המשך לשכתב אותו. + הגיבוי נכשל. אין מספיק מקום בגוגל דרייב שלך. פנה קצת מקום ונסה שוב. + דרישת חובה למילוי הסיסמה + מינימום שישה תווים. לחלופין, לאבטחה טובה יותר, כלול אותיות רישיות, מספרים ותווים שאינם אלפביתיים. + הגדרת סיסמה תצפין את גיבוי הגוגל שלך. יהיה עליך להזין אותה בעת שחזור הארנק שלך. + הגדרת סיסמה תצפין את גיבוי הגוגל שלך. יהיה עליך להזין זאת בעת שחזור הארנק. לאמת האש בלוק קנה טוקן XOR קנה או מכור טוקן XOR באירו קנה XOR עם פיאט + Can\'t load balance שנה שפה שנה PIN בחר טוקן @@ -86,14 +89,14 @@ הועתק ללוח צור בקשת QR קרואטית - Currencies + מטבעות מחק - Disabled + מושבת גלה בוצע הולנדית ערוך - Enabled + מופעל אנגלית הזן סכום תוצאה דו-משמעית @@ -132,14 +135,14 @@ לא ניתן להמשיך בפעולה כי סטטוס המשתמש אינו חוקי אסטונית הרחב - לחקור + סקירה נכשל פיליפינית פינית צרפתית גרמנית - Google authorization failed - Backup decryption failed. Please check password and try again + הרשאת גוגל נכשלה + פענוח הגיבוי נכשל. אנא בדוק את הסיסמה ונסה שוב עברית הינדי @@ -170,6 +173,7 @@ רענן הסר בקשה + כתוב מחדש רוסית סרוק סרוק QR @@ -218,14 +222,14 @@ סיסמה חלשה צור חשבון חדש מצב כהה - אם תמחק את הגיבוי של Google, תוכל לשחזר את הארנק שלך רק באמצעות גיבוי ידני של מילות המפתח. + אם תמחק את גיבוי הגוגל שלך, תוכל לשחזר את הארנק שלך רק באמצעות גיבוי ידני של מילות המפתח. האם אתה בטוח? קפוא נמשך מהמאגר נשלח למאגר מפתחי סורה עובדים כעת על תכונה שתציג רשימה מלאה של מאגרים שהם פעילים בפולקסוואפ.\n\nלעת עתה, אם ברצונך ליצור/להוסיף למאגר אנא השתמש בכפתור למטה. מאגרי פולקסוואפ - Edit view + ערוך תצוגה אין נמענים אחרונים.\n כתובות שנשלחו יוצגו כאן. הנמענים יופיעו כאן הזן סיסמת גיבוי @@ -233,8 +237,9 @@ סיסמה שגויה הזן סיסמה אין מספיק כספים עבור עמלת רשת - Provide liquidity and earn rewards - Swap tokens on SORA network + צור מאגר + ספק נזילות והרווח תגמולים + החלף טוקנים ברשת סורה אם תאבד את הגישה למכשיר הזה, הכספים שלך יאבדו, אלא אם תעשה גיבוי! אפשרויות גיבוי הצג את מילות המפתח @@ -296,7 +301,7 @@ הצומת הזה כבר נוסף: %s \n נוצר חיבור עם הצומת %s לא הצליח לאמת כתובת האתר (פרוטוקול URL שגוי) צומת במצב לא מקוון - המשך עם Google + המשך עם גוגל הזן שם עבור החשבון החדש שלך וכיצד הוא יופיע תחת הכתובת שלך. עם זהות ברשת, ניתן להפוך אותה לזמינה לאחרים. גלוי רק עבורך ומאוחסן באופן מקומי קבע שם לחשבון שלך @@ -322,11 +327,11 @@ נשאר לך עוד ניסיון אחד לפני ההתקררות הגדר קוד PIN גע בסורק טביעת האצבע - Powered by Demeter Farming - Some portion of your pool share is staked. To have access to it you have to unstake it first. - Your pool share staked - Staked for %s - To remove liquidity you need to unstake it first + מופעל על ידי Demeter Farming + חלק מהנתח שלך במאגר מושקע. כדי לקבל גישה אליו, עליך להסיר אותו תחילה מהמאגר. + נתח המאגר שלך נעול + נעול עבור %s + כדי להסיר נזילות ראשית עליך להסיר את הנעילה פולקסוואפ מתוחזק על ידי קהילת סורה. לפני שתמשיך להשתמש בפולקסוואפ, אנא עיין %%בשאלות הנפוצות של פולקסוואפ%% ובתיעוד, הכולל הסבר מפורט על אופן הפעולה של פולקסוואפ, כמו גם את %%תזכיר המדיניות ותנאי השירותים של פולקסוואפ%%, ו- %%מדיניות הפרטיות%%.\n\nמסמכים אלה חיוניים לחוויית משתמש מאובטחת וחיובית. על ידי שימוש בפולקסוואפ, אתה מכיר בכך שקראת והבנת את המסמכים האלה. אתה גם מאשר את הדברים הבאים: האחריות הבלעדית שלך לעמידה בכל החוקים שעשויים לחול על השימוש הספציפי שלך בפולקסוואפ בתחום השיפוט הסמכותי שלך; @@ -340,8 +345,8 @@ אין מספיק נזילות עמלת מאגר נזילות חלק מכל עסקה הולך לספקי נזילות כתמריץ פרוטוקול. - Swap fee - Your swap involves both a Synthetic fee and an LP fee.\nThe Synthetic fee is accounted when the swap goes through the XST liquidity source for synthetic assets, and the LP fee when the swap goes through liquidity pools. + עמלת החלפה + ההחלפה שלך כוללת גם עמלה סינתטית וגם עמלת אספקת נזילות.\nהעמלה הסינתטית נלקחת בחשבון כאשר ההחלפה עוברת דרך מקור הנזילות XST עבור נכסים סינתטיים, ועמלת אספקת הנזילות כאשר ההחלפה עוברת דרך מאגרי נזילות. שוק ניתוב נזילות SMART מבטיח את המחיר הטוב ביותר לכל טרנזקציה על ידי שילוב אפשרויות המחיר הטובות ביותר בלבד מכל השווקים הזמינים. כאשר זמין, עקומת צירוף הטוקנים (TBC) תשמש לנזילות כל עוד מחיר הנכס משתלם יותר מאשר ממקורות אחרים, שעליהם מנוצל מאגר XYK. TBC - קנייה רק מעקומת צירוף הטוקנים (השוק העיקרי). קיימת אפשרות שהמחיר יכול להפוך לבלתי משתלם בהשוואה למאגר XYK (שוק משני), אך הערך המתקבל מהתגמולים המוענקים לאורך זמן עשוי להתברר כמשתלם הרבה יותר לטווח ארוך. @@ -354,7 +359,7 @@ עמלת הרשת משמשת כדי להבטיח את הצמיחה והביצועים היציבים של מערכת סורה. התפוקה מוערכת. תקבל לפחות %s או שהטרנזקציה תחזור. הבריכה לא נוצרה - Rewards payout in + תשלום תגמולים ב תגמול פארמינג על אספקת נזילות הטרנזקציה שלך עשויה להיות מקודמת הטרנזקציות שלך יחזרו אם המחיר ישתנה באופן בלתי משתלם יותר מאחוז זה @@ -411,7 +416,7 @@ צרף למאגר XOR הזן את הקישור של המפנה קבל הזמנות נוספות - %s מצורף למאגר לכל הזמנה כדי לכסות את דמי הרשת עבור החברים שלך להצטרף. \n \n אתה יכול להסיר מהמאגר את ה- XOR שלך בכל עת עבור הזמנות שאינן בשימוש. + %s מצורף למאגר לכל הזמנה כדי לכסות את דמי הרשת עבור צירוף החברים שלך. \nאתה יכול להסיר מהמאגר את ה- XOR שלך שאינו בשימוש בכל עת. הזן את כמות ההזמנות הרצויה הזמנות זמינות קישור להזמנה @@ -448,7 +453,7 @@ מסלול הצג את קוד ה-QR שלי חפש נכסים - אין תוצאות חיפוש + אין תוצאות חפש כתובת חשבון חפש או הוסף כתובת חדשה בחר חשבון לייבוא @@ -483,32 +488,32 @@ הצג עוד הצג יתרות אפסיות החלקה - Something went wrong - Exchange - Freeze - Top up - Transfer + משהו השתבש + החלף + הקפא + טען + העבר כבר יש לי כרטיס €0 דמי שירות שנתיים - Card info + פרטי כרטיס לא נכלל באפליקציה תושבים ממדינות מסוימות אינם יכולים להגיש בקשה לכרטיס סורה ברגע זה קנה XOR עם EUR - Card management is coming soon - Card details + ניהול כרטיסים יגיע בקרוב + פרטי כרטיס הנפקת כרטיס חינם או 20 € דמי רישום אם אתה מחזיק, נועל או מספק נזילות בשווי של לפחות 100 אירו של XOR בחשבון סורה שלך השג עוד XOR - IBAN account details + פרטי חשבון IBAN התחבר או הירשם אין עוד ניסיונות בחינם - Log out SORA Card - You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. - Refer & Earn - Refer SORA Card.\nGet €20 bonus. - ראה את הפרטים - Card settings + התנתק מכרטיס סורה + אתה עומד להתנתק מכרטיס סורה. עדיין תהיה לך גישה לאפליקציה העצמאית של כרטיס סורה, אך היתרה לא תהיה זמינה לך יותר בארנק סורה. + הפנה והרווח + הפנה כרטיס סורה.\n קבל בונוס של 20 אירו. + הצג פרטים + הגדרות כרטיס הגש בקשה לכרטיס או התחבר אם יש ברשותך כבר אחד החלף קריפטו עבור XOR הטען את כרטיס סורה עם פיאט או קריפטו ושלם באינטרנט, בחנות או משוך מכספומט @@ -524,6 +529,7 @@ מוצלח סטטוס ייבאת חשבון בהצלחה + Support chat ודא שנותרו לך %s לאחר עסקה זו. אחרת, לא תוכל לבצע עסקה אחרת. החלף צומת מראה חיצוני של המערכת @@ -538,7 +544,7 @@ על ידי יצירת חשבון אתה מסכים עם %%התנאים וההגבלות%% ו- %%מדיניות הפרטיות%% תנאים והגבלות כשאתה ממשיך אתה מסכים עם ה- - An unexpected error has occured.\n\nYou may troubleshoot this issue in SORA community at the @SORAhappiness Telegram chat. + אירעה שגיאה בלתי צפויה. \n\n אתה יכול לפתור בעיה זו בצ\'אט הטלגרם של קהילת סורה @SORAhappiness. עדכון עבור אפליקצית סורה הורד והוא מוכן להתקנה.\n\nחשוב להשתמש בגירסה העדכנית ביותר של האפליקציה.\n\nכדי לעדכן את האפליקציה, נדרשת הפעלה מחדש. האם ברצונך להתקין את העדכון כעת? נעול diff --git a/common/src/main/res/values-ja/strings.xml b/common/src/main/res/values-ja/strings.xml index 7499e4d5d..ba2a23722 100644 --- a/common/src/main/res/values-ja/strings.xml +++ b/common/src/main/res/values-ja/strings.xml @@ -39,6 +39,8 @@ トークン価格 %s プール 送信するアセット + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. @@ -48,6 +50,7 @@ XORトークンの購入 ユーロでXORトークンを売買 法定通貨で XOR を購入 + Can\'t load balance 言語の変更 PINの変更 トークンの選択 @@ -167,6 +170,7 @@ 更新 削除 Request + Rewrite ロシア語 スキャン QRをスキャン @@ -230,6 +234,7 @@ Incorrect password Enter password ネットワーク手数料のための資金が不足しています + Create pool Provide liquidity and earn rewards Swap tokens on SORA network このデバイスへのアクセスを失った場合、バックアップしない限り、資金は失われます! @@ -485,7 +490,7 @@ IBAN account details Log in or Sign up これ以上の無料試行はありません - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -506,6 +511,7 @@ 成功 ステータス You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node システム外観 diff --git a/common/src/main/res/values-ms-rMY/strings.xml b/common/src/main/res/values-ms-rMY/strings.xml index a3e76e6e6..33cb9bf97 100644 --- a/common/src/main/res/values-ms-rMY/strings.xml +++ b/common/src/main/res/values-ms-rMY/strings.xml @@ -39,6 +39,8 @@ Harga token Kolam %s anda Aset untuk dihantar + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Menetapkan kata laluan akan menyulitkan sandaran Google anda. Anda perlu memasukkannya semasa memulihkan dompet anda. @@ -48,6 +50,7 @@ Beli token XOR Beli atau jual token XOR dengan euro Beli XOR dengan fiat + Can\'t load balance Tukar bahasa Tukar PIN Pilih token @@ -167,6 +170,7 @@ Segarkan semula Mengalih keluar Permintaan + Rewrite Bahasa Rusia Imbas Imbas QR @@ -230,6 +234,7 @@ Kata laluan tidak betul Masukkan kata laluan Tidak cukup dana untuk bayaran transaksi + Create pool Provide liquidity and earn rewards Swap tokens on SORA network Jika anda kehilangan akses kepada peranti ini, dana anda akan hilang, melainkan anda membuat sandaran! @@ -485,7 +490,7 @@ IBAN account details Log masuk atau Daftar Tiada lagi percubaan percuma - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -506,6 +511,7 @@ Berjaya Status Anda telah berjaya mengimport akaun + Support chat Pastikan anda mempunyai %s yang tersisa selepas transaksi ini. Jika tidak, anda tidak akan dapat melakukan transaksi lain. Tukar nod Penampilan sistem diff --git a/common/src/main/res/values-nb/strings.xml b/common/src/main/res/values-nb/strings.xml index 14d078f7a..064ef9eb4 100644 --- a/common/src/main/res/values-nb/strings.xml +++ b/common/src/main/res/values-nb/strings.xml @@ -39,6 +39,8 @@ Token price Your %s pools Asset to send + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. @@ -48,6 +50,7 @@ Buy XOR token Buy or sell XOR token with euro Buy XOR with fiat + Can\'t load balance Change language Change PIN Select token @@ -168,6 +171,7 @@ Refresh Remove Request + Rewrite Russisk Skann Scan QR @@ -231,6 +235,7 @@ Incorrect password Enter password Ikke nok midler til transaksjonsgebyr + Create pool Provide liquidity and earn rewards Swap tokens on SORA network If you loose access to this device, your funds will be lost, unless you back up! @@ -491,7 +496,7 @@ IBAN account details Log in or Sign up No more free attempts - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -512,6 +517,7 @@ Successful Status You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node System appearance diff --git a/common/src/main/res/values-nl/strings.xml b/common/src/main/res/values-nl/strings.xml index 1b55e7ba3..7862bc668 100644 --- a/common/src/main/res/values-nl/strings.xml +++ b/common/src/main/res/values-nl/strings.xml @@ -39,6 +39,8 @@ Token prijs Your %s pools Asset to send + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. @@ -48,6 +50,7 @@ Buy XOR token Buy or sell XOR token with euro Buy XOR with fiat + Can\'t load balance Taal veranderen PIN wijzigen Kies token @@ -168,6 +171,7 @@ Refresh Verwijder Request + Rewrite Russisch Scannen Scan QR @@ -231,6 +235,7 @@ Incorrect password Enter password Niet genoeg fondsen voor transactiekosten + Create pool Provide liquidity and earn rewards Swap tokens on SORA network Als u de toegang tot dit apparaat verliest, gaat uw geld verloren, tenzij u een back-up maakt! @@ -491,7 +496,7 @@ IBAN account details Log in or Sign up Geen gratis pogingen meer - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -512,6 +517,7 @@ Succesvol Status You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node Systeem verschijning diff --git a/common/src/main/res/values-pt/strings.xml b/common/src/main/res/values-pt/strings.xml index f8799c0d3..75e38d06f 100644 --- a/common/src/main/res/values-pt/strings.xml +++ b/common/src/main/res/values-pt/strings.xml @@ -39,6 +39,8 @@ Token price Your %s pools Asset to send + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. @@ -48,6 +50,7 @@ Buy XOR token Buy or sell XOR token with euro Buy XOR with fiat + Can\'t load balance Change language Change PIN Selecione token @@ -168,6 +171,7 @@ Refresh Remover Request + Rewrite Russo Scan Scan QR @@ -231,6 +235,7 @@ Incorrect password Enter password Fundos insuficientes para a taxa de transação + Create pool Provide liquidity and earn rewards Swap tokens on SORA network If you loose access to this device, your funds will be lost, unless you back up! @@ -491,7 +496,7 @@ IBAN account details Log in or Sign up No more free attempts - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -512,6 +517,7 @@ Successful Status You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node System appearance diff --git a/common/src/main/res/values-ru/strings.xml b/common/src/main/res/values-ru/strings.xml index 0c00d3223..f60614d2a 100644 --- a/common/src/main/res/values-ru/strings.xml +++ b/common/src/main/res/values-ru/strings.xml @@ -39,6 +39,8 @@ Token price Your %s pools Отправляемый ассет + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Обязательное требование к паролю выполнено Минимум шесть символов. По желанию, для повышения безопасности, можно включить заглавные буквы, цифры и неалфавитные символы. Установка пароля зашифрует резервную копию Google. Его нужно будет ввести при восстановлении кошелька.\nМинимальная длина пароля - 6 символов. @@ -48,6 +50,7 @@ Купить токен XOR Купить или продать токен XOR за евро Купить XOR за фиат + Не удается загрузить баланс Изменить язык Изменить пин-код Выберите токен @@ -171,6 +174,7 @@ Refresh Удалить Запрос + Rewrite Русский Сканировать Сканировать QR-код @@ -234,13 +238,14 @@ Неверный пароль Введите пароль Недостаточно средств для оплаты комиссии + Create pool Предоставляйте ликвидность и получайте вознаграждения Меняйте токены в сети SORA При потере доступа к этому устройству, ваши средства будут потеряны, если вы не сделаете резервную копию! Параметры резервного копирования Показать парольную фразу Показать Raw Seed - Параметры открытия счета + Открыть настройки аккаунта Пароль требуется для шифрования вашей учетной записи и сохранения в виде Restore JSON. Пожалуйста, создайте пароль для продолжения работы. Скачать JSON Подтвердить пароль @@ -509,7 +514,7 @@ IBAN account details Войдите или зарегистрируйтесь No more free attempts - Log out SORA Card + Выйти из SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -530,6 +535,7 @@ Successful Статус Вы успешно импортировали учетную запись + Чат поддержки Убедитесь, что у вас останется %s после этой транзакции. Иначе вы не сможете оплатить комиссию сети за другую транзакцию. Переключить ноду Внешний вид системы diff --git a/common/src/main/res/values-sr/strings.xml b/common/src/main/res/values-sr/strings.xml index 1e69ecb58..6bd4cb62b 100644 --- a/common/src/main/res/values-sr/strings.xml +++ b/common/src/main/res/values-sr/strings.xml @@ -39,6 +39,8 @@ Token price Your %s pools Asset to send + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. @@ -48,6 +50,7 @@ Buy XOR token Buy or sell XOR token with euro Buy XOR with fiat + Can\'t load balance Change language Change PIN Изаберите токeн @@ -169,6 +172,7 @@ Refresh Povuci Request + Rewrite Руски Скенирај Scan QR @@ -232,6 +236,7 @@ Incorrect password Enter password Нема довољно средстава за накнаду за трансакцију + Create pool Provide liquidity and earn rewards Swap tokens on SORA network Ako izgubite pristup ovom uređaju, vaša sredstva će biti izgubljena osim ako ne napravite rezervnu kopiju! @@ -496,7 +501,7 @@ IBAN account details Log in or Sign up No more free attempts - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -517,6 +522,7 @@ Successful Статус You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node System appearance diff --git a/common/src/main/res/values-tr/strings.xml b/common/src/main/res/values-tr/strings.xml index f08b52ae1..aa8ee92cb 100644 --- a/common/src/main/res/values-tr/strings.xml +++ b/common/src/main/res/values-tr/strings.xml @@ -39,6 +39,8 @@ Token price Your %s pools Asset to send + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. @@ -48,6 +50,7 @@ Buy XOR token Buy or sell XOR token with euro Buy XOR with fiat + Can\'t load balance Change language Change PIN Token seçin @@ -168,6 +171,7 @@ Refresh Kaldırmak Request + Rewrite Rusça Tarama Scan QR @@ -231,6 +235,7 @@ Incorrect password Enter password İşlem ücreti için yeterli miktar yok + Create pool Provide liquidity and earn rewards Swap tokens on SORA network If you loose access to this device, your funds will be lost, unless you back up! @@ -491,7 +496,7 @@ IBAN account details Log in or Sign up No more free attempts - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -512,6 +517,7 @@ Successful Durum You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node System appearance diff --git a/common/src/main/res/values-vi/strings.xml b/common/src/main/res/values-vi/strings.xml index 43dc2682e..ed96206f9 100644 --- a/common/src/main/res/values-vi/strings.xml +++ b/common/src/main/res/values-vi/strings.xml @@ -39,6 +39,8 @@ Giá token %s pool của bạn Tài sản cần gửi + Sao lưu đã tồn tại. Tiến hành viết lại nó. + Sao lưu không thành công. Không đủ dung lượng trên Google Drive của bạn. Hãy giải phóng một số dung lượng và thử lại. Yêu cầu bắt buộc đối với mật khẩu được đáp ứng Tối thiểu sáu ký tự. Tùy chọn, để bảo mật tốt hơn, hãy bao gồm các chữ cái viết hoa, số và các ký tự không phải bảng chữ cái. Đặt mật khẩu sẽ mã hóa bản sao lưu Google của bạn. Bạn sẽ cần nhập thông tin này khi khôi phục ví của mình.\nĐộ dài mật khẩu tối thiểu là 6 ký tự. @@ -48,6 +50,7 @@ Mua token XOR Mua hoặc bán XOR bằng euro Mua XOR bằng tiền pháp định + Can\'t load balance Thay đổi ngôn ngữ Thay đổi mã PIN Chọn token @@ -167,6 +170,7 @@ Làm mới Gỡ bỏ Yêu cầu + Ghi lại Tiếng Nga Quét Quét mã QR @@ -230,6 +234,7 @@ Mật khẩu không chính xác Nhập mật khẩu Không đủ tiền cho phí giao dịch + Tạo pool Cung cấp thanh khoản và kiếm phần thưởng Hoán đổi token trên mạng SORA Nếu bạn mất quyền truy cập vào thiết bị này, tiền của bạn sẽ bị mất, trừ khi bạn sao lưu! @@ -506,6 +511,7 @@ Thành công Trạng thái Bạn đã nhập thành công một tài khoản + Support chat Đảm bảo rằng bạn còn %s sau giao dịch này. Nếu không, bạn sẽ không thể thực hiện một giao dịch khác. Chuyển node Hệ thống hiển thị diff --git a/common/src/main/res/values-zh-rCN/strings.xml b/common/src/main/res/values-zh-rCN/strings.xml index d01891b59..ae146573f 100644 --- a/common/src/main/res/values-zh-rCN/strings.xml +++ b/common/src/main/res/values-zh-rCN/strings.xml @@ -39,6 +39,8 @@ 代币价格 你的%s池子 待发送的资产 + 备份已存在。继续覆盖它。 + 备份失败。您的Google Drive空间不足,请释放一些空间并重试。 密码的强制要求已满足 至少六个字符。为了更好的安全性,可以包含大写字母、数字和非字母字符。 设置密码将加密您的Google备份。在恢复钱包时,您需要输入此密码。\n最小密码长度为6个字符。 @@ -48,6 +50,7 @@ 购买XOR代币 用欧元购买或出售XOR代币 用法币购买XOR + Can\'t load balance 更改语言 更改PIN码 选择代币 @@ -167,6 +170,7 @@ 刷新 移除 请求 + 重写 俄语 扫描 扫描二维码 @@ -230,6 +234,7 @@ 密码错误 输入密码 网络费用不足 + 创建池子 提供流动性并获得奖励 在SORA网络上进行代币兑换 如果您无法访问此设备,您的资金将会丢失,除非您备份! @@ -506,6 +511,7 @@ 成功的 状态 您已成功导入一个账户 + Support chat 确保在此事务之后还剩下 %s。否则,您将无法进行其他交易。 切换节点 系统外观 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index a07c9e99b..847b70231 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -39,6 +39,8 @@ 代幣價格 Your %s pools Asset to send + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. @@ -48,6 +50,7 @@ Buy XOR token Buy or sell XOR token with euro Buy XOR with fiat + Can\'t load balance Change language Change PIN 選擇\n令牌 @@ -167,6 +170,7 @@ Refresh 消除 Request + Rewrite 俄語 掃描 Scan QR @@ -230,6 +234,7 @@ Incorrect password Enter password 手續費用資金不足 + Create pool Provide liquidity and earn rewards Swap tokens on SORA network 如果您無法訪問此設備,您的資金將會丟失,除非您備份! @@ -486,7 +491,7 @@ IBAN account details Log in or Sign up No more free attempts - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -507,6 +512,7 @@ Successful 狀態 You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node System appearance diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 56e1530cd..52fe01341 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -39,16 +39,18 @@ Token price Your %s pools Asset to send + Backup already exists. Proceed to rewrite it. + Backup failed. Not enough space on your Google Drive. Free some space and try again. Mandatory requirement for the password fulfilled Minimum six characters. Optionally, for better security, include uppercase letters, numbers and non-alphabetic characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet.\nMinimum password length is 6 characters. Setting a password will encrypt your Google backup. You’ll need to enter this when restoring your wallet. - Backup failed. Not enough space on your Google Drive. Free some space and try again. Authenticate Block hash Buy XOR token Buy or sell XOR token with euro Buy XOR with fiat + Can\'t load balance Change language Change PIN Select token @@ -169,6 +171,7 @@ Refresh Remove Request + Rewrite Russian Scan Scan QR @@ -232,6 +235,7 @@ Incorrect password Enter password Not enough funds for network fee + Create pool Provide liquidity and earn rewards Swap tokens on SORA network If you loose access to this device, your funds will be lost, unless you back up! @@ -492,7 +496,7 @@ IBAN account details Log in or Sign up No more free attempts - Log out SORA Card + Log out of SORA Card You are about to log out of SORA Card. You will still have access to the SORA Card standalone app, but the balance will no longer be available to you in the SORA Wallet. Refer & Earn Refer SORA Card.\nGet €20 bonus. @@ -513,6 +517,7 @@ Successful Status You have succesfully imported an account + Support chat Ensure that you have %s left after this transaction. Otherwise, you won’t be able to do another transaction. Switch node System appearance diff --git a/common/src/test/java/jp/co/soramitsu/common/domain/FiatTest.kt b/common/src/test/java/jp/co/soramitsu/common/domain/FiatTest.kt index cd2bf23bd..d94fea9c9 100644 --- a/common/src/test/java/jp/co/soramitsu/common/domain/FiatTest.kt +++ b/common/src/test/java/jp/co/soramitsu/common/domain/FiatTest.kt @@ -32,8 +32,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common.domain +import jp.co.soramitsu.common.domain.OptionsProvider.nbspace import jp.co.soramitsu.common.util.NumbersFormatter -import jp.co.soramitsu.common.util.nbspace import org.junit.After import org.junit.Assert.assertEquals import org.junit.Before diff --git a/common/src/test/java/jp/co/soramitsu/common/util/NumbersFormatterTest.kt b/common/src/test/java/jp/co/soramitsu/common/util/NumbersFormatterTest.kt index c5f5e3804..a3b3cf53d 100644 --- a/common/src/test/java/jp/co/soramitsu/common/util/NumbersFormatterTest.kt +++ b/common/src/test/java/jp/co/soramitsu/common/util/NumbersFormatterTest.kt @@ -32,6 +32,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.common.util +import jp.co.soramitsu.common.domain.OptionsProvider.nbspace import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Test diff --git a/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/states/CardState.kt b/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/states/CardState.kt index 1084ddb4b..563667706 100644 --- a/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/states/CardState.kt +++ b/common_wallet/src/main/java/jp/co/soramitsu/common_wallet/presentation/compose/states/CardState.kt @@ -118,7 +118,7 @@ fun mapAssetsToCardState( } data class SoraCardState( - val success: Boolean, + val balance: String?, val kycStatus: String?, val visible: Boolean = false, ) : CardState diff --git a/feature_sora_card_api/src/main/java/jp/co/soramitsu/feature_sora_card_api/domain/SoraCardInteractor.kt b/feature_sora_card_api/src/main/java/jp/co/soramitsu/feature_sora_card_api/domain/SoraCardInteractor.kt index 38583a19d..b11d24b43 100644 --- a/feature_sora_card_api/src/main/java/jp/co/soramitsu/feature_sora_card_api/domain/SoraCardInteractor.kt +++ b/feature_sora_card_api/src/main/java/jp/co/soramitsu/feature_sora_card_api/domain/SoraCardInteractor.kt @@ -49,7 +49,7 @@ interface SoraCardInteractor { suspend fun fetchUserIbanAccount(): Result - suspend fun fetchIbanBalance(): Result + suspend fun fetchIbanBalance(): Result suspend fun logOutFromSoraCard() } diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt index 16bd56353..a91bd25e9 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt @@ -35,6 +35,7 @@ package jp.co.soramitsu.feature_sora_card_impl.domain import java.math.BigDecimal import javax.inject.Inject import jp.co.soramitsu.common.domain.CoroutineManager +import jp.co.soramitsu.common.domain.OptionsProvider.euroSign import jp.co.soramitsu.common.domain.compareByTotal import jp.co.soramitsu.common.util.NumbersFormatter import jp.co.soramitsu.common.util.ext.Big100 @@ -171,10 +172,11 @@ internal class SoraCardInteractorImpl @Inject constructor( sorted.first().iban } - override suspend fun fetchIbanBalance(): Result = + override suspend fun fetchIbanBalance(): Result = soraCardClientProxy.getIBAN().mapCatching { wrapper -> val sorted = wrapper.ibans.sortedByDescending { it.createdDate } - sorted.first().availableBalance + val euroValue = (sorted.first().availableBalance / 100.0) + "%s%.2f".format(euroSign, euroValue) } override suspend fun logOutFromSoraCard() { diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsFragment.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsFragment.kt index f85f1fd45..66b65d60f 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsFragment.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsFragment.kt @@ -34,7 +34,6 @@ package jp.co.soramitsu.feature_sora_card_impl.presentation.details import android.os.Bundle import android.view.View -import androidx.compose.animation.ExperimentalAnimationApi import androidx.compose.foundation.ScrollState import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Row @@ -53,6 +52,7 @@ import androidx.navigation.NavHostController import androidx.navigation.compose.composable import dagger.hilt.android.AndroidEntryPoint import jp.co.soramitsu.androidfoundation.intent.ShareUtil.shareText +import jp.co.soramitsu.androidfoundation.intent.openSoraTelegramSupportChat import jp.co.soramitsu.common.R import jp.co.soramitsu.common.base.SoraBaseFragment import jp.co.soramitsu.common.base.theOnlyRoute @@ -76,9 +76,11 @@ class SoraCardDetailsFragment : SoraBaseFragment() { shareText(c, getString(R.string.common_share), share) } } + viewModel.telegramChat.observe { + openSoraTelegramSupportChat(context) + } } - @OptIn(ExperimentalAnimationApi::class) override fun NavGraphBuilder.content( scrollState: ScrollState, navController: NavHostController diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsScreen.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsScreen.kt index e09513e63..d68351f5f 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsScreen.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsScreen.kt @@ -147,9 +147,8 @@ private fun PreviewSoraCardDetailsScreen() { scrollState = rememberScrollState(), soraCardDetailsScreenState = SoraCardDetailsScreenState( soraCardMainSoraContentCardState = SoraCardMainSoraContentCardState( - balance = 3665.50f, - isCardEnabled = false, - soraCardMenuActions = SoraCardMenuAction.values().toList() + balance = "3665.50", + soraCardMenuActions = SoraCardMenuAction.entries ), soraCardReferralBannerCardState = true, soraCardRecentActivitiesCardState = SoraCardRecentActivitiesCardState( @@ -159,7 +158,7 @@ private fun PreviewSoraCardDetailsScreen() { iban = "LT61 3250 0467 7252 5583", ), soraCardSettingsCard = SoraCardSettingsCardState( - soraCardSettingsOptions = SoraCardSettingsOption.values().toList() + soraCardSettingsOptions = SoraCardSettingsOption.entries ), logoutDialog = false, ), diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsViewModel.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsViewModel.kt index 1af2c6fc1..616d71205 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsViewModel.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsViewModel.kt @@ -58,17 +58,18 @@ class SoraCardDetailsViewModel @Inject constructor( private val _shareLinkEvent = SingleLiveEvent() val shareLinkEvent: LiveData = _shareLinkEvent + val telegramChat = SingleLiveEvent() + private var ibanCache: String? = null private val _soraCardDetailsScreenState = MutableStateFlow( SoraCardDetailsScreenState( soraCardMainSoraContentCardState = SoraCardMainSoraContentCardState( - balance = 0f, - isCardEnabled = false, - soraCardMenuActions = SoraCardMenuAction.entries + balance = null, + soraCardMenuActions = SoraCardMenuAction.entries, ), soraCardSettingsCard = SoraCardSettingsCardState( - soraCardSettingsOptions = SoraCardSettingsOption.entries + soraCardSettingsOptions = SoraCardSettingsOption.entries, ), logoutDialog = false, ) @@ -86,16 +87,29 @@ class SoraCardDetailsViewModel @Inject constructor( viewModelScope.launch { tryCatch { + var local = _soraCardDetailsScreenState.value soraCardInteractor.fetchUserIbanAccount() .onSuccess { iban -> ibanCache = iban - _soraCardDetailsScreenState.value = soraCardDetailsScreenState.value.copy( + local = local.copy( soraCardIBANCardState = SoraCardIBANCardState(iban) ) } .onFailure { onError(it) } + soraCardInteractor.fetchIbanBalance() + .onFailure { + onError(it) + } + .onSuccess { + local = local.copy( + soraCardMainSoraContentCardState = local.soraCardMainSoraContentCardState.copy( + balance = it + ) + ) + } + _soraCardDetailsScreenState.value = local } } } @@ -145,6 +159,9 @@ class SoraCardDetailsViewModel @Inject constructor( SoraCardSettingsOption.LOG_OUT -> _soraCardDetailsScreenState.value = _soraCardDetailsScreenState.value.copy(logoutDialog = true) + + SoraCardSettingsOption.SUPPORT_CHAT -> + telegramChat.trigger() } } diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardMainSoraContentCard.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardMainSoraContentCard.kt index b48dc7713..af8f51bc0 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardMainSoraContentCard.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardMainSoraContentCard.kt @@ -40,7 +40,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.layout.wrapContentSize -import androidx.compose.foundation.shape.CircleShape import androidx.compose.material.MaterialTheme import androidx.compose.material.Text import androidx.compose.runtime.Composable @@ -53,10 +52,6 @@ import jp.co.soramitsu.common.R import jp.co.soramitsu.common.presentation.compose.components.SoraCardImage import jp.co.soramitsu.common.presentation.compose.uikit.tokens.Image import jp.co.soramitsu.common.presentation.compose.uikit.tokens.Text -import jp.co.soramitsu.common.util.euro -import jp.co.soramitsu.ui_core.component.button.BleachedButton -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.ContentCard import jp.co.soramitsu.ui_core.resources.Dimens import jp.co.soramitsu.ui_core.theme.customColors @@ -67,8 +62,7 @@ enum class SoraCardMenuAction { } data class SoraCardMainSoraContentCardState( - val balance: Float, - val isCardEnabled: Boolean, + val balance: String?, val actionsEnabled: Boolean = false, val soraCardMenuActions: List, ) { @@ -83,6 +77,7 @@ data class SoraCardMainSoraContentCardState( text = Text.StringRes(id = R.string.sora_card_action_top_up), isEnabled = actionsEnabled, ) + SoraCardMenuAction.TRANSFER -> IconButtonMenuState( testTagId = it.toString(), @@ -90,6 +85,7 @@ data class SoraCardMainSoraContentCardState( text = Text.StringRes(id = R.string.sora_card_action_transfer), isEnabled = actionsEnabled, ) + SoraCardMenuAction.EXCHANGE -> IconButtonMenuState( testTagId = it.toString(), @@ -97,6 +93,7 @@ data class SoraCardMainSoraContentCardState( text = Text.StringRes(id = R.string.sora_card_action_exchange), isEnabled = actionsEnabled, ) + SoraCardMenuAction.FREEZE -> IconButtonMenuState( testTagId = it.toString(), @@ -127,21 +124,24 @@ fun SoraCardMainSoraContentCard( Box( modifier = Modifier.wrapContentSize() ) { - SoraCardImage(modifier = Modifier.fillMaxWidth().wrapContentHeight()) - if (soraCardMainSoraContentCardState.isCardEnabled) - BleachedButton( - modifier = Modifier - .wrapContentSize() - .align(Alignment.BottomEnd) - .padding(Dimens.x1_5), - shape = CircleShape, - size = Size.Small, - order = Order.SECONDARY, - text = stringResource(id = R.string.show_more), - onClick = onShowMoreClick - ) + SoraCardImage( + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight() + ) +// BleachedButton( +// modifier = Modifier +// .wrapContentSize() +// .align(Alignment.BottomEnd) +// .padding(Dimens.x1_5), +// shape = CircleShape, +// size = Size.Small, +// order = Order.SECONDARY, +// text = stringResource(id = R.string.show_more), +// onClick = onShowMoreClick, +// ) } - if (soraCardMainSoraContentCardState.isCardEnabled) + if (soraCardMainSoraContentCardState.balance != null) Row( modifier = Modifier .fillMaxWidth() @@ -156,7 +156,7 @@ fun SoraCardMainSoraContentCard( color = MaterialTheme.customColors.fgPrimary ) Text( - text = "%s%.2f".format(euro, soraCardMainSoraContentCardState.balance), + text = soraCardMainSoraContentCardState.balance, style = MaterialTheme.customTypography.headline2, color = MaterialTheme.customColors.fgPrimary ) @@ -182,8 +182,7 @@ fun SoraCardMainSoraContentCard( private fun PreviewMainSoraContentCard() { SoraCardMainSoraContentCard( soraCardMainSoraContentCardState = SoraCardMainSoraContentCardState( - balance = 3644.50f, - isCardEnabled = true, + balance = "3644.50", soraCardMenuActions = SoraCardMenuAction.entries ), onShowMoreClick = {}, @@ -196,8 +195,7 @@ private fun PreviewMainSoraContentCard() { private fun PreviewMainSoraContentCard2() { SoraCardMainSoraContentCard( soraCardMainSoraContentCardState = SoraCardMainSoraContentCardState( - balance = 3644.50f, - isCardEnabled = true, + balance = "3644.50", soraCardMenuActions = SoraCardMenuAction.entries ), onShowMoreClick = {}, diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardSettingsCard.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardSettingsCard.kt index 60006f47d..df189bcdd 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardSettingsCard.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardSettingsCard.kt @@ -39,30 +39,25 @@ import androidx.compose.foundation.layout.wrapContentSize 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.res.stringResource import androidx.compose.ui.tooling.preview.Preview import jp.co.soramitsu.common.R import jp.co.soramitsu.common.presentation.compose.uikit.tokens.Image import jp.co.soramitsu.common.presentation.compose.uikit.tokens.Text -import jp.co.soramitsu.common.presentation.compose.uikit.tokens.retrieveString import jp.co.soramitsu.ui_core.component.card.ContentCard import jp.co.soramitsu.ui_core.resources.Dimens import jp.co.soramitsu.ui_core.theme.customColors import jp.co.soramitsu.ui_core.theme.customTypography enum class SoraCardSettingsOption { - LOG_OUT + SUPPORT_CHAT, LOG_OUT } data class SoraCardSettingsCardState( val soraCardSettingsOptions: List ) { - val headlineText: Text = Text.StringRes( - id = R.string.sora_card_settings_headline - ) - val settings: List = soraCardSettingsOptions.map { when (it) { SoraCardSettingsOption.LOG_OUT -> @@ -73,6 +68,15 @@ data class SoraCardSettingsCardState( title = Text.StringRes(id = R.string.sora_card_option_logout), icon = Image.ResImage(id = R.drawable.ic_arrow_right) ) + + SoraCardSettingsOption.SUPPORT_CHAT -> + ListTileState( + testTagId = it.toString(), + variant = ListTileVariant.TITLE_NAVIGATION_HINT, + flag = ListTileFlag.NORMAL, + title = Text.StringRes(id = R.string.support_chat), + icon = Image.ResImage(id = R.drawable.ic_arrow_right) + ) } } } @@ -95,14 +99,14 @@ fun SoraCardSettingsCard( .wrapContentSize() .padding(horizontal = Dimens.x1) .padding(top = Dimens.x1, bottom = Dimens.x2), - text = state.headlineText.retrieveString(), + text = stringResource(id = R.string.sora_card_settings_headline), style = MaterialTheme.customTypography.headline2, color = MaterialTheme.customColors.fgPrimary, ) repeat(state.settings.size) { ListTileView( listTileState = state.settings[it], - onItemClick = remember { { onItemClick.invoke(it) } } + onItemClick = { onItemClick.invoke(it) }, ) } } @@ -114,7 +118,7 @@ fun SoraCardSettingsCard( private fun PreviewSoraCardSettingsCard() { SoraCardSettingsCard( state = SoraCardSettingsCardState( - soraCardSettingsOptions = SoraCardSettingsOption.values().toList() + soraCardSettingsOptions = SoraCardSettingsOption.entries ), onItemClick = { _ -> } ) diff --git a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubViewModel.kt b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubViewModel.kt index 0b9ab996a..68f1cd93f 100644 --- a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubViewModel.kt +++ b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubViewModel.kt @@ -159,8 +159,8 @@ class CardsHubViewModel @Inject constructor( cardHub to listOf( SoraCardState( visible = cardHub.visibility, - kycStatus = mapped.first, - success = mapped.second, + kycStatus = mapped, + balance = if (status == SoraCardCommonVerification.Successful) soraCardInteractor.fetchIbanBalance().getOrDefault("") else null, ) ) } @@ -205,26 +205,26 @@ class CardsHubViewModel @Inject constructor( }.launchIn(viewModelScope) } - private fun mapKycStatus(kycStatus: SoraCardCommonVerification): Pair { + private fun mapKycStatus(kycStatus: SoraCardCommonVerification): String? { return when (kycStatus) { SoraCardCommonVerification.Failed -> { - resourceManager.getString(R.string.sora_card_verification_failed) to false + resourceManager.getString(R.string.sora_card_verification_failed) } SoraCardCommonVerification.Rejected -> { - resourceManager.getString(R.string.sora_card_verification_rejected) to false + resourceManager.getString(R.string.sora_card_verification_rejected) } SoraCardCommonVerification.Pending -> { - resourceManager.getString(R.string.sora_card_verification_in_progress) to false + resourceManager.getString(R.string.sora_card_verification_in_progress) } SoraCardCommonVerification.Successful -> { - resourceManager.getString(R.string.sora_card_verification_successful) to true + resourceManager.getString(R.string.sora_card_verification_successful) } - SoraCardCommonVerification.NotFound -> { - null to false + else -> { + null } } } @@ -338,7 +338,7 @@ class CardsHubViewModel @Inject constructor( if (card.kycStatus == null) { if (!connectionManager.isConnected) return mainRouter.showGetSoraCard() - } else if (card.success) { + } else if (card.balance != null) { mainRouter.showSoraCardDetails() } else { currentSoraCardContractData?.let { contractData -> 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 7e35ea1ec..620855efd 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 @@ -49,6 +49,7 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import jp.co.soramitsu.common.R +import jp.co.soramitsu.common.domain.OptionsProvider.euroSign 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 @@ -83,19 +84,19 @@ fun SoraCard( modifier = Modifier .wrapContentWidth() .run { - if (state.success.not()) + if (state.balance == null) padding(bottom = Dimens.x3) else padding(all = Dimens.x1) } .run { - if (state.success.not()) + if (state.balance == null) align(Alignment.BottomCenter) else align(Alignment.BottomEnd) }, kycStatus = state.kycStatus, - success = state.success, + balance = state.balance, onCardStateClicked = onCardStateClicked, ) - if (state.success.not()) + if (state.balance == null) BleachedButton( modifier = Modifier .wrapContentWidth() @@ -114,7 +115,7 @@ fun SoraCard( private fun CardStateButton( modifier: Modifier = Modifier, kycStatus: String?, - success: Boolean, + balance: String?, onCardStateClicked: () -> Unit ) { if (kycStatus == null) { @@ -127,7 +128,16 @@ private fun CardStateButton( text = stringResource(R.string.sora_card_see_details), ) } else { - if (success.not()) + if (balance != null) + BleachedButton( + modifier = modifier + .testTagAsId("CardInfo"), + size = Size.ExtraSmall, + order = Order.SECONDARY, + onClick = onCardStateClicked, + text = balance, + ) + else TonalButton( modifier = modifier .testTagAsId("SoraCardButton"), @@ -136,15 +146,6 @@ private fun CardStateButton( onClick = onCardStateClicked, text = kycStatus, ) - else - BleachedButton( - modifier = modifier - .testTagAsId("CardInfo"), - size = Size.ExtraSmall, - order = Order.SECONDARY, - onClick = onCardStateClicked, - text = stringResource(id = R.string.sora_card_banner_title_card_info) - ) } } @@ -153,7 +154,7 @@ private fun CardStateButton( private fun PreviewSoraCard1() { SoraCard( modifier = Modifier.fillMaxWidth(), - state = SoraCardState(kycStatus = "", success = true, visible = true), + state = SoraCardState(kycStatus = "", balance = "${euroSign}345.3", visible = true), onCloseClicked = {}, onCardStateClicked = {} ) @@ -165,7 +166,7 @@ private fun PreviewSoraCard2() { SoraAppTheme { SoraCard( modifier = Modifier.fillMaxWidth(), - state = SoraCardState(kycStatus = "Pending", success = false, visible = true), + state = SoraCardState(kycStatus = "Pending", balance = null, visible = true), onCloseClicked = {}, onCardStateClicked = {} ) @@ -178,7 +179,7 @@ private fun PreviewSoraCard3() { SoraAppTheme { SoraCard( modifier = Modifier.fillMaxWidth(), - state = SoraCardState(kycStatus = null, success = false, visible = true), + state = SoraCardState(kycStatus = null, balance = null, visible = true), onCloseClicked = {}, onCardStateClicked = {} )