Skip to content

Commit a858d91

Browse files
PankraSergDenis LyazginDeneathahmedelkashev
authored
release 2.0.6 (#587)
* add staging buildtype * fix application id suffix * add staging google-services * legacy icons update adaptive prod icon * 1726 fix Process CEX (Binance, Kraken, etc) QR codes for account deposit * add bad internet connection alert * 1799 fix Turn off the Internet. The application crashes after entering the PIN code * 1792 fix Incorrect word order in the source type list * 1796 fix After installing the application, in Manage assets the background of the screen is incorrect * update soramitsu 6 years logo * 1383 Add logic of hiding crowdloan slot in case of early termination of fundraising * 1564 Pull to refresh does not work on the Crowdloans page * 1791 When updating the screen there is an eternal loading * 1812 Incorrect title while exporting a wallet * 1813 Button "View in Subscan" doesn’t work * 1816 Add account. Create a new account. We should delete "Substrate keypair krypto type" field and "Substrate secret derivation path" field * 1808 "Locked" screen doesn’t match the design * 1807 Wrong picker title when exporting account * 1792 fix Incorrect word order in the source type list * fix balance list details initial position scroll issues * 1803 Import an account. The warning icon ⚠️ does not disappear if you press the "I don’t need an account" button. * 1833 Extra chain account occurs in the list of assets after having added another one * 1816 Add account. Create a new account. We should delete "Substrate keypair krypto type" field and "Substrate secret derivation path" field * 1796 fix After installing the application, in Manage assets the background of the screen is incorrect * 1799 fix Turn off the Internet. The application crashes after entering the PIN code * 1836 Create a wallet. Back arrow button doesn’t work * 1838 Manage assets. After the search, the "add account" buttons appear * 1848 Manage assets. There aren’t positions without accounts * fix crash on cold start immediate staking open * 1855 The application crashes on the test node * version up -> 2.0.6 (67) * alert message fix * 1862 The place of currency changed if choose AED currency * 1859 There is no name of token in the title * 1858 With a quick tap on the Skip button, many wallets are created * 1867 Crash occurs on subsequent auth after adding a custom invalid URL in the process of adding a new node * 1863 Validation doesn't work on Ethereum secret derivation path field when adding a wallet 1860 Slashes appear automatically in the Substrate and Ethereum secret der path input line on the backup mnemonic after returning from the confirm mnemonic screen * 1861 Create a wallet. Wrong hint “Wallet“ in the field for typing wallet name * 1860 Slashes appear automatically in the Substrate and Ethereum secret der path input line on the backup mnemonic after returning from the confirm mnemonic screen * 1857 The currency next to the wallet name does not change * use latest tag for android build box Signed-off-by: Ahmed Elkashef <[email protected]> * change app name for staging Co-authored-by: Denis Lyazgin <[email protected]> Co-authored-by: Deneath <[email protected]> Co-authored-by: Ahmed Elkashef <[email protected]>
1 parent f66fbaa commit a858d91

File tree

87 files changed

+798
-287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+798
-287
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def pipeline = new org.android.AppPipeline(
55
sonar: false,
66
pushReleaseNotes: false,
77
testCmd: 'runTest',
8-
dockerImage: 'build-tools/android-build-box-jdk11',
8+
dockerImage: 'build-tools/android-build-box-jdk11:latest',
99
publishCmd: 'publishReleaseApk'
1010
)
1111
pipeline.runPipeline('fearless')

app/build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ android {
3737
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
3838
signingConfig signingConfigs.ci
3939
}
40+
staging {
41+
initWith debug
42+
matchingFallbacks = ['debug']
43+
versionNameSuffix '-staging'
44+
applicationIdSuffix '.staging'
45+
//Init firebase
46+
def localReleaseNotes = releaseNotes()
47+
def localFirebaseGroup = firebaseGroup()
48+
firebaseAppDistribution {
49+
releaseNotes = localReleaseNotes
50+
groups = localFirebaseGroup
51+
}
52+
}
4053
develop {
4154
signingConfig signingConfigs.ci
4255
matchingFallbacks = ['debug']

app/src/main/java/jp/co/soramitsu/app/root/domain/RootInteractor.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,7 @@ class RootInteractor(
2727
}
2828
}
2929

30-
suspend fun getRemoteConfig() = walletRepository.getRemoteConfig().toDomain()
30+
suspend fun getRemoteConfig() = walletRepository.getRemoteConfig().map { it.toDomain() }
31+
32+
fun chainRegistrySyncUp() = walletRepository.chainRegistrySyncUp()
3133
}

app/src/main/java/jp/co/soramitsu/app/root/navigation/Navigator.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,12 +518,16 @@ class Navigator :
518518
navController?.navigate(R.id.action_nodesFragment_to_addNodeFragment, AddNodeFragment.getBundle(chainId))
519519
}
520520

521-
override fun openExportMnemonic(metaId: Long, chainId: ChainId): DelayedNavigation {
522-
val extras = ExportMnemonicFragment.getBundle(metaId, chainId)
521+
override fun openExportMnemonic(metaId: Long, chainId: ChainId, isExportWallet: Boolean): DelayedNavigation {
522+
val extras = ExportMnemonicFragment.getBundle(metaId, chainId, isExportWallet)
523523

524524
return NavComponentDelayedNavigation(R.id.action_export_mnemonic, extras)
525525
}
526526

527+
override fun openExportMnemonic(metaId: Long, chainId: ChainId): DelayedNavigation {
528+
return openExportMnemonic(metaId, chainId, isExportWallet = false)
529+
}
530+
527531
override fun openExportSeed(metaId: Long, chainId: ChainId, isExportWallet: Boolean): DelayedNavigation {
528532
val extras = ExportSeedFragment.getBundle(metaId, chainId, isExportWallet)
529533

app/src/main/java/jp/co/soramitsu/app/root/presentation/RootActivity.kt

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import androidx.lifecycle.OnLifecycleEvent
1616
import androidx.lifecycle.ProcessLifecycleOwner
1717
import androidx.navigation.NavController
1818
import androidx.navigation.fragment.NavHostFragment
19-
import javax.inject.Inject
2019
import jp.co.soramitsu.app.R
2120
import jp.co.soramitsu.app.root.di.RootApi
2221
import jp.co.soramitsu.app.root.di.RootComponent
@@ -29,11 +28,10 @@ import jp.co.soramitsu.common.utils.EventObserver
2928
import jp.co.soramitsu.common.utils.showToast
3029
import jp.co.soramitsu.common.utils.updatePadding
3130
import jp.co.soramitsu.common.view.bottomSheet.AlertBottomSheet
32-
import jp.co.soramitsu.splash.presentation.SplashBackgroundHolder
33-
import kotlinx.android.synthetic.main.activity_root.mainView
3431
import kotlinx.android.synthetic.main.activity_root.rootNetworkBar
32+
import javax.inject.Inject
3533

36-
class RootActivity : BaseActivity<RootViewModel>(), SplashBackgroundHolder, LifecycleObserver {
34+
class RootActivity : BaseActivity<RootViewModel>(), LifecycleObserver {
3735

3836
companion object {
3937
private const val ANIM_DURATION = 150L
@@ -53,8 +51,6 @@ class RootActivity : BaseActivity<RootViewModel>(), SplashBackgroundHolder, Life
5351
override fun onRestoreInstanceState(savedInstanceState: Bundle) {
5452
super.onRestoreInstanceState(savedInstanceState)
5553

56-
removeSplashBackground()
57-
5854
viewModel.restoredAfterConfigChange()
5955
}
6056

@@ -142,6 +138,12 @@ class RootActivity : BaseActivity<RootViewModel>(), SplashBackgroundHolder, Life
142138
finish()
143139
}
144140
)
141+
viewModel.showNoInternetConnectionAlert.observe(
142+
this,
143+
EventObserver {
144+
showNoInternetConnectionAlert()
145+
}
146+
)
145147
}
146148

147149
private fun showUnsupportedAppVersionAlert() {
@@ -155,6 +157,17 @@ class RootActivity : BaseActivity<RootViewModel>(), SplashBackgroundHolder, Life
155157
.show()
156158
}
157159

160+
private fun showNoInternetConnectionAlert() {
161+
AlertBottomSheet.Builder(this)
162+
.setTitle(jp.co.soramitsu.feature_wallet_impl.R.string.common_connection_problems)
163+
.setMessage(jp.co.soramitsu.feature_wallet_impl.R.string.connection_problems_alert_message)
164+
.setButtonText(jp.co.soramitsu.feature_wallet_impl.R.string.common_retry)
165+
.setCancelable(false)
166+
.callback { viewModel.retryLoadConfigClicked() }
167+
.build()
168+
.show()
169+
}
170+
158171
private fun openPlayMarket() {
159172
try {
160173
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(PLAY_MARKET_APP_URI)))
@@ -202,10 +215,6 @@ class RootActivity : BaseActivity<RootViewModel>(), SplashBackgroundHolder, Life
202215
rootNetworkBar.startAnimation(animation)
203216
}
204217

205-
override fun removeSplashBackground() {
206-
mainView.setBackgroundResource(R.color.black)
207-
}
208-
209218
override fun changeLanguage() {
210219
viewModel.noticeLanguageLanguage()
211220

app/src/main/java/jp/co/soramitsu/app/root/presentation/RootViewModel.kt

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ package jp.co.soramitsu.app.root.presentation
33
import androidx.lifecycle.LiveData
44
import androidx.lifecycle.MutableLiveData
55
import androidx.lifecycle.viewModelScope
6-
import java.util.Date
7-
import java.util.Timer
8-
import java.util.TimerTask
96
import jp.co.soramitsu.app.R
107
import jp.co.soramitsu.app.root.domain.RootInteractor
118
import jp.co.soramitsu.common.base.BaseViewModel
@@ -15,14 +12,17 @@ import jp.co.soramitsu.common.resources.ResourceManager
1512
import jp.co.soramitsu.common.utils.Event
1613
import jp.co.soramitsu.core.updater.Updater
1714
import jp.co.soramitsu.runtime.multiNetwork.connection.ChainConnection.ExternalRequirement
18-
import kotlin.concurrent.timerTask
19-
import kotlin.time.DurationUnit
20-
import kotlin.time.toDuration
2115
import kotlinx.coroutines.Dispatchers
2216
import kotlinx.coroutines.flow.MutableStateFlow
2317
import kotlinx.coroutines.flow.launchIn
2418
import kotlinx.coroutines.flow.onEach
2519
import kotlinx.coroutines.launch
20+
import java.util.Date
21+
import java.util.Timer
22+
import java.util.TimerTask
23+
import kotlin.concurrent.timerTask
24+
import kotlin.time.DurationUnit
25+
import kotlin.time.toDuration
2626

2727
class RootViewModel(
2828
private val interactor: RootInteractor,
@@ -41,6 +41,9 @@ class RootViewModel(
4141
private val _showUnsupportedAppVersionAlert = MutableLiveData<Event<Unit>>()
4242
val showUnsupportedAppVersionAlert: LiveData<Event<Unit>> = _showUnsupportedAppVersionAlert
4343

44+
private val _showNoInternetConnectionAlert = MutableLiveData<Event<Unit>>()
45+
val showNoInternetConnectionAlert: LiveData<Event<Unit>> = _showNoInternetConnectionAlert
46+
4447
private val _openPlayMarket = MutableLiveData<Event<Unit>>()
4548
val openPlayMarket: LiveData<Event<Unit>> = _openPlayMarket
4649

@@ -50,22 +53,42 @@ class RootViewModel(
5053
private var timer = Timer()
5154
private var timerTask: TimerTask? = null
5255

56+
private var shouldHandleResumeInternetConnection = false
57+
5358
init {
5459
checkAppVersion()
60+
}
61+
62+
private fun checkAppVersion() {
63+
viewModelScope.launch {
64+
val appConfigResult = interactor.getRemoteConfig()
65+
when {
66+
appConfigResult.isFailure -> {
67+
shouldHandleResumeInternetConnection = true
68+
_showNoInternetConnectionAlert.value = Event(Unit)
69+
}
70+
appConfigResult.getOrNull()?.isCurrentVersionSupported == false -> {
71+
_showUnsupportedAppVersionAlert.value = Event(Unit)
72+
}
73+
else -> {
74+
runBalancesUpdate()
75+
}
76+
}
77+
}
78+
}
79+
80+
private fun runBalancesUpdate() {
81+
if (shouldHandleResumeInternetConnection) {
82+
shouldHandleResumeInternetConnection = false
83+
interactor.chainRegistrySyncUp()
84+
}
5585
interactor.runBalancesUpdate()
5686
.onEach { handleUpdatesSideEffect(it) }
5787
.launchIn(this)
5888

5989
updatePhishingAddresses()
6090
}
6191

62-
private fun checkAppVersion() = viewModelScope.launch {
63-
val appConfig = interactor.getRemoteConfig()
64-
if (appConfig.isCurrentVersionSupported.not()) {
65-
_showUnsupportedAppVersionAlert.value = Event(Unit)
66-
}
67-
}
68-
6992
private fun handleUpdatesSideEffect(sideEffect: Updater.SideEffect) {
7093
// pass
7194
hashCode()
@@ -77,8 +100,6 @@ class RootViewModel(
77100
}
78101
}
79102

80-
fun jsonFileOpened(content: String?) {}
81-
82103
override fun onCleared() {
83104
super.onCleared()
84105

@@ -144,4 +165,8 @@ class RootViewModel(
144165
rootRouter.openNavGraph()
145166
}
146167
}
168+
169+
fun retryLoadConfigClicked() {
170+
checkAppVersion()
171+
}
147172
}

app/src/main/res/layout/activity_root.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
android:id="@+id/mainView"
43
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
android:id="@+id/mainView"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
7-
android:background="@drawable/drawable_background_image">
7+
android:background="@color/black">
88

99
<androidx.fragment.app.FragmentContainerView
1010
android:id="@+id/navHost"
1111
android:name="androidx.navigation.fragment.NavHostFragment"
1212
android:layout_width="match_parent"
1313
android:layout_height="match_parent"
14-
app:navGraph="@navigation/root_nav_graph"
15-
app:defaultNavHost="true" />
14+
app:defaultNavHost="true"
15+
app:navGraph="@navigation/root_nav_graph" />
1616

1717
<TextView
1818
android:id="@+id/rootNetworkBar"
@@ -31,7 +31,6 @@
3131
<View
3232
android:id="@+id/root_touch_interceptor"
3333
android:layout_width="match_parent"
34-
android:layout_height="match_parent"
35-
/>
34+
android:layout_height="match_parent" />
3635

3736
</FrameLayout>
Loading
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="108dp"
3+
android:height="108dp"
4+
android:viewportWidth="108"
5+
android:viewportHeight="108">
6+
<group
7+
android:scaleX="1.001"
8+
android:scaleY="1.001"
9+
android:translateX="23.97"
10+
android:translateY="40.4865">
11+
<path
12+
android:fillAlpha="0.9"
13+
android:fillColor="#ffffff"
14+
android:pathData="M59.309,4.0444L36.1118,7.2311C35.9794,7.2492 35.8561,7.3124 35.7618,7.411L33.8522,9.3953C33.6147,9.6427 33.2308,9.6427 32.9925,9.3953L32.6583,9.0476C32.4183,8.7984 32.4183,8.3927 32.6583,8.1436L34.9377,5.7753C35.1777,5.5262 35.1777,5.1205 34.9377,4.8713L30.4293,0.1857C30.1919,-0.0617 29.808,-0.0617 29.5697,0.1857L25.0613,4.8713C24.8213,5.1205 24.8213,5.5262 25.0613,5.7753L27.3407,8.1436C27.5807,8.3927 27.5807,8.7984 27.3407,9.0476L27.0064,9.3953C26.769,9.6427 26.3851,9.6427 26.1468,9.3953L24.2372,7.411C24.1421,7.3124 24.0196,7.2492 23.8872,7.2311L0.6908,4.0444C0.1124,3.9648 -0.2318,4.6983 0.1819,5.1283L5.2405,10.3857C5.6261,10.7862 5.3547,11.4747 4.8111,11.4747C4.2675,11.4747 3.9962,12.1633 4.3817,12.5638L9.1234,17.4916C9.2012,17.5721 9.2989,17.63 9.4047,17.6577L25.5453,21.8876C25.676,21.9222 25.7927,22.0009 25.8762,22.1116L28.3733,25.428C28.8184,26.0707 29.5705,26.8146 29.5705,26.8146C29.808,27.062 30.1919,27.062 30.4301,26.8146C30.4301,26.8146 31.0523,26.1572 31.6274,25.428L34.1244,22.1116C34.208,22.0009 34.3238,21.9222 34.4554,21.8876L50.5959,17.6577C50.7026,17.63 50.7994,17.5721 50.8772,17.4916L55.6189,12.5638C56.0045,12.1633 55.7331,11.4747 55.1895,11.4747C54.6459,11.4747 54.3745,10.7862 54.7601,10.3857L59.8187,5.1283C60.2316,4.6983 59.8874,3.9657 59.309,4.0444Z"
15+
android:strokeAlpha="0.9" />
16+
</group>
17+
</vector>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@drawable/ic_launcher_background"/>
4+
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
5+
</adaptive-icon>
338 Bytes
Loading
-55 Bytes
Loading
1.01 KB
Loading
Loading
Loading

0 commit comments

Comments
 (0)