Skip to content

Commit

Permalink
Merge pull request #418 from sora-xor/version_up
Browse files Browse the repository at this point in the history
version up
  • Loading branch information
arvifox authored Jun 18, 2024
2 parents c46ea37 + 4325e72 commit ffca336
Show file tree
Hide file tree
Showing 143 changed files with 208 additions and 866 deletions.
2 changes: 1 addition & 1 deletion android-foundation
Submodule android-foundation updated 29 files
+28 −8 build.gradle.kts
+1 −0 src/main/AndroidManifest.xml
+9 −0 src/main/java/jp/co/soramitsu/androidfoundation/compose/AnyTitle.kt
+18 −0 src/main/java/jp/co/soramitsu/androidfoundation/compose/KeyboardState.kt
+20 −0 src/main/java/jp/co/soramitsu/androidfoundation/compose/SharedViewModel.kt
+11 −0 src/main/java/jp/co/soramitsu/androidfoundation/compose/TestTag.kt
+26 −0 src/main/java/jp/co/soramitsu/androidfoundation/coroutine/SuspendableProperty.kt
+153 −0 src/main/java/jp/co/soramitsu/androidfoundation/format/BigDecimalExt.kt
+5 −0 src/main/java/jp/co/soramitsu/androidfoundation/format/BigIntegerExt.kt
+41 −0 src/main/java/jp/co/soramitsu/androidfoundation/format/BigIntegerSerializer.kt
+21 −0 src/main/java/jp/co/soramitsu/androidfoundation/format/CollectionExt.kt
+2 −2 src/main/java/jp/co/soramitsu/androidfoundation/format/CompoundNumberFormatter.kt
+8 −0 src/main/java/jp/co/soramitsu/androidfoundation/format/CoroutineExt.kt
+8 −0 src/main/java/jp/co/soramitsu/androidfoundation/format/FiatFormatter.kt
+33 −0 src/main/java/jp/co/soramitsu/androidfoundation/format/ImageValue.kt
+7 −0 src/main/java/jp/co/soramitsu/androidfoundation/format/InputStreamExt.kt
+2 −2 src/main/java/jp/co/soramitsu/androidfoundation/format/NumberFormatters.kt
+9 −2 src/main/java/jp/co/soramitsu/androidfoundation/format/TextString.kt
+40 −5 src/main/java/jp/co/soramitsu/androidfoundation/format/TextValue.kt
+13 −0 src/main/java/jp/co/soramitsu/androidfoundation/fragment/CustomViewModelFactory.kt
+34 −9 src/main/java/jp/co/soramitsu/androidfoundation/fragment/FragmentUtils.kt
+59 −0 src/main/java/jp/co/soramitsu/androidfoundation/fragment/SingleLiveEvent.kt
+36 −6 src/main/java/jp/co/soramitsu/androidfoundation/intent/IntentUtils.kt
+6 −23 src/main/java/jp/co/soramitsu/androidfoundation/intent/ShareUtil.kt
+0 −24 src/main/java/jp/co/soramitsu/androidfoundation/phone/ClipboardManager.kt
+13 −2 src/main/java/jp/co/soramitsu/androidfoundation/phone/DeviceVibrator.kt
+70 −0 src/main/java/jp/co/soramitsu/androidfoundation/resource/ResourceManager.kt
+22 −0 src/main/java/jp/co/soramitsu/androidfoundation/testing/AssertException.kt
+20 −0 src/main/java/jp/co/soramitsu/androidfoundation/testing/ReadRes.kt
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ dependencies {
kover(project(":common"))
kover(project(":common_wallet"))
kover(project(":core_db"))
kover(project(":core_di"))
kover(project(":demeter"))
kover(project(":feature_account_api"))
kover(project(":feature_account_impl"))
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/jp/co/soramitsu/sora/SoraApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ import coil.decode.SvgDecoder
import com.google.firebase.FirebaseApp
import dagger.hilt.android.HiltAndroidApp
import javax.inject.Inject
import jp.co.soramitsu.androidfoundation.resource.ResourceManager
import jp.co.soramitsu.common.domain.DarkThemeManager
import jp.co.soramitsu.common.domain.OptionsProvider
import jp.co.soramitsu.common.io.FileManager
import jp.co.soramitsu.common.resourses.ResourceManager
import jp.co.soramitsu.common.util.BuildType
import jp.co.soramitsu.common.util.BuildUtils
import jp.co.soramitsu.common.util.Flavor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ class SplashActivity : AppCompatActivity() {
splashViewModel.showOnBoardingScreen.observe(this) {
multiaccStarter.startOnboardingFlow(this)
}
splashViewModel.showOnBoardingScreenViaInviteLink.observe(this) {
multiaccStarter.startOnboardingFlowWithInviteLink(this)
finish()
}
splashViewModel.showMainScreenFromInviteLink.observe(this) {
mainStarter.startWithInvite(this)
finish()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject
import jp.co.soramitsu.androidfoundation.fragment.SingleLiveEvent
import jp.co.soramitsu.androidfoundation.fragment.trigger
import jp.co.soramitsu.common.logger.FirebaseWrapper
import jp.co.soramitsu.common.presentation.SingleLiveEvent
import jp.co.soramitsu.common.presentation.trigger
import jp.co.soramitsu.common.presentation.viewmodel.BaseViewModel
import jp.co.soramitsu.feature_account_api.domain.model.OnboardingState
import jp.co.soramitsu.sora.splash.domain.SplashInteractor
Expand All @@ -58,7 +58,6 @@ class SplashViewModel @Inject constructor(

val showMainScreen = SingleLiveEvent<Unit>()
val showOnBoardingScreen = SingleLiveEvent<OnboardingState>()
val showOnBoardingScreenViaInviteLink = SingleLiveEvent<Unit>()
val showMainScreenFromInviteLink = SingleLiveEvent<Unit>()

init {
Expand Down Expand Up @@ -93,17 +92,4 @@ class SplashViewModel @Inject constructor(
}
}
}

fun handleDeepLink(invitationCode: String) {
viewModelScope.launch {
val state = interactor.getRegistrationState()
interactor.saveInviteCode(invitationCode)

if (OnboardingState.INITIAL == state) {
showOnBoardingScreenViaInviteLink.trigger()
} else {
showMainScreenFromInviteLink.trigger()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import org.junit.rules.TestRule
import org.junit.runner.RunWith
import org.mockito.BDDMockito.given
import org.mockito.Mock
import org.mockito.Mockito.verify
import org.mockito.junit.MockitoJUnitRunner

@ExperimentalCoroutinesApi
Expand Down Expand Up @@ -100,32 +99,4 @@ class SplashViewModelTest {
val r = splashViewModel.showOnBoardingScreen.getOrAwaitValue()
assertEquals(OnboardingState.INITIAL, r)
}

@Test
fun `handleDeepLink before registration called`() = runTest {
val state = OnboardingState.INITIAL
val invitationCode = "INVITATION_CODE"

given(interactor.getRegistrationState()).willReturn(state)

splashViewModel.handleDeepLink(invitationCode)
advanceUntilIdle()
verify(interactor).saveInviteCode(invitationCode)
val r = splashViewModel.showOnBoardingScreenViaInviteLink.getOrAwaitValue()
assertEquals(Unit, r)
}

@Test
fun `handleDeepLink after registration called`() = runTest {
val state = OnboardingState.REGISTRATION_FINISHED
val invitationCode = "INVITATION_CODE"

given(interactor.getRegistrationState()).willReturn(state)

splashViewModel.handleDeepLink(invitationCode)
advanceUntilIdle()
verify(interactor).saveInviteCode(invitationCode)
val r = splashViewModel.showMainScreenFromInviteLink.getOrAwaitValue()
assertEquals(Unit, r)
}
}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
alias(libs.plugins.firebaseCrashlyticsPlugin) apply false
alias(libs.plugins.firebaseAppDistributionPlugin) apply false
alias(libs.plugins.triplet) apply false
id("com.google.devtools.ksp") version "1.9.22-1.0.17" apply false
id("com.google.devtools.ksp") version "1.9.24-1.0.20" apply false
id("org.jetbrains.kotlinx.kover") version "0.7.5"
}

Expand Down
4 changes: 2 additions & 2 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
compileSdk = 34

defaultConfig {
minSdk = 24
minSdk = 26
multiDexEnabled = true
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -50,7 +50,7 @@ android {

buildTypes {
release {
isMinifyEnabled = true
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import android.graphics.drawable.PictureDrawable
import com.caverock.androidsvg.SVG
import javax.inject.Singleton
import jdenticon.Jdenticon
import jp.co.soramitsu.common.resourses.ResourceManager
import jp.co.soramitsu.androidfoundation.resource.ResourceManager
import jp.co.soramitsu.xcrypto.util.toHexString
import jp.co.soramitsu.xsubstrate.ss58.SS58Encoder.toAccountId

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
import java.util.concurrent.TimeUnit
import jp.co.soramitsu.androidfoundation.resource.ResourceManager
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.resourses.LanguagesHolder
import jp.co.soramitsu.common.resourses.ResourceManager

class DateTimeFormatter(
private val languagesHolder: LanguagesHolder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import java.util.Locale
import java.util.TimeZone
import javax.inject.Singleton
import jp.co.soramitsu.androidfoundation.phone.BasicClipboardManager
import jp.co.soramitsu.androidfoundation.resource.ResourceManager
import jp.co.soramitsu.common.BuildConfig
import jp.co.soramitsu.common.account.AccountAvatarGenerator
import jp.co.soramitsu.common.data.AppStateProviderImpl
Expand All @@ -71,7 +72,6 @@ import jp.co.soramitsu.common.interfaces.WithProgress
import jp.co.soramitsu.common.io.FileManager
import jp.co.soramitsu.common.io.FileManagerImpl
import jp.co.soramitsu.common.resourses.LanguagesHolder
import jp.co.soramitsu.common.resourses.ResourceManager
import jp.co.soramitsu.common.util.CryptoAssistant
import jp.co.soramitsu.common.util.DeviceParamsProvider
import jp.co.soramitsu.common.util.EncryptionUtil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.androidfoundation.resource.ResourceManager
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.resourses.ResourceManager

class SoraException(
val kind: Kind,
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.navigation.NavOptionsBuilder
import jp.co.soramitsu.androidfoundation.fragment.SingleLiveEvent
import jp.co.soramitsu.androidfoundation.fragment.trigger
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.base.theOnlyRoute
import jp.co.soramitsu.common.domain.SoraException
import jp.co.soramitsu.common.logger.FirebaseWrapper
import jp.co.soramitsu.common.presentation.SingleLiveEvent
import jp.co.soramitsu.common.presentation.compose.SnackBarState
import jp.co.soramitsu.common.presentation.trigger
import jp.co.soramitsu.ui_core.component.toolbar.Action
import jp.co.soramitsu.ui_core.component.toolbar.SoramitsuToolbarState

Expand Down
Loading

0 comments on commit ffca336

Please sign in to comment.