Update the formatting of non-resource files (#153)

This commit is contained in:
Brian Yencho 2023-10-24 09:11:07 -05:00 committed by Álison Fernandes
parent 6476ee2927
commit dae7091fde
10 changed files with 17 additions and 9 deletions

View file

@ -15,8 +15,8 @@
tools:targetApi="31"> tools:targetApi="31">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:launchMode="singleTask"
android:exported="true" android:exported="true"
android:launchMode="singleTask"
android:theme="@style/LaunchTheme"> android:theme="@style/LaunchTheme">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@ -25,11 +25,13 @@
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data <data
android:scheme="bitwarden" android:host="captcha-callback"
android:host="captcha-callback" /> android:scheme="bitwarden" />
</intent-filter> </intent-filter>
</activity> </activity>
</application> </application>

View file

@ -2,8 +2,8 @@ package com.x8bit.bitwarden
import android.content.Intent import android.content.Intent
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import com.x8bit.bitwarden.data.auth.repository.util.getCaptchaCallbackTokenResult
import com.x8bit.bitwarden.data.auth.repository.AuthRepository import com.x8bit.bitwarden.data.auth.repository.AuthRepository
import com.x8bit.bitwarden.data.auth.repository.util.getCaptchaCallbackTokenResult
import dagger.hilt.android.lifecycle.HiltViewModel import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject import javax.inject.Inject

View file

@ -4,6 +4,7 @@ import okhttp3.Interceptor
import okhttp3.Response import okhttp3.Response
import java.io.IOException import java.io.IOException
import javax.inject.Singleton import javax.inject.Singleton
/** /**
* Interceptor responsible for adding the auth token(Bearer) to API requests. * Interceptor responsible for adding the auth token(Bearer) to API requests.
*/ */

View file

@ -52,6 +52,7 @@ fun LoginScreen(
is LoginEvent.NavigateToCaptcha -> { is LoginEvent.NavigateToCaptcha -> {
intentHandler.startCustomTabsActivity(uri = event.uri) intentHandler.startCustomTabsActivity(uri = event.uri)
} }
is LoginEvent.ShowToast -> { is LoginEvent.ShowToast -> {
Toast.makeText(context, event.message, Toast.LENGTH_SHORT).show() Toast.makeText(context, event.message, Toast.LENGTH_SHORT).show()
} }

View file

@ -7,10 +7,10 @@ import android.os.Parcelable
import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.data.auth.repository.AuthRepository
import com.x8bit.bitwarden.data.auth.repository.model.LoginResult import com.x8bit.bitwarden.data.auth.repository.model.LoginResult
import com.x8bit.bitwarden.data.auth.repository.util.CaptchaCallbackTokenResult import com.x8bit.bitwarden.data.auth.repository.util.CaptchaCallbackTokenResult
import com.x8bit.bitwarden.data.auth.repository.util.generateUriForCaptcha import com.x8bit.bitwarden.data.auth.repository.util.generateUriForCaptcha
import com.x8bit.bitwarden.data.auth.repository.AuthRepository
import com.x8bit.bitwarden.ui.platform.base.BaseViewModel import com.x8bit.bitwarden.ui.platform.base.BaseViewModel
import com.x8bit.bitwarden.ui.platform.base.util.asText import com.x8bit.bitwarden.ui.platform.base.util.asText
import com.x8bit.bitwarden.ui.platform.components.BasicDialogState import com.x8bit.bitwarden.ui.platform.components.BasicDialogState
@ -73,6 +73,7 @@ class LoginViewModel @Inject constructor(
is LoginAction.Internal.ReceiveCaptchaToken -> { is LoginAction.Internal.ReceiveCaptchaToken -> {
handleCaptchaTokenReceived(action.tokenResult) handleCaptchaTokenReceived(action.tokenResult)
} }
is LoginAction.Internal.ReceiveLoginResult -> { is LoginAction.Internal.ReceiveLoginResult -> {
handleReceiveLoginResult(action = action) handleReceiveLoginResult(action = action)
} }
@ -89,6 +90,7 @@ class LoginViewModel @Inject constructor(
), ),
) )
} }
is LoginResult.Error -> { is LoginResult.Error -> {
mutableStateFlow.update { mutableStateFlow.update {
it.copy( it.copy(
@ -101,6 +103,7 @@ class LoginViewModel @Inject constructor(
) )
} }
} }
is LoginResult.Success -> { is LoginResult.Success -> {
mutableStateFlow.update { it.copy(loadingDialogState = LoadingDialogState.Hidden) } mutableStateFlow.update { it.copy(loadingDialogState = LoadingDialogState.Hidden) }
} }

View file

@ -3,8 +3,8 @@ package com.x8bit.bitwarden.ui.platform.feature.rootnav
import android.os.Parcelable import android.os.Parcelable
import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.x8bit.bitwarden.data.auth.repository.model.AuthState
import com.x8bit.bitwarden.data.auth.repository.AuthRepository import com.x8bit.bitwarden.data.auth.repository.AuthRepository
import com.x8bit.bitwarden.data.auth.repository.model.AuthState
import com.x8bit.bitwarden.ui.platform.base.BaseViewModel import com.x8bit.bitwarden.ui.platform.base.BaseViewModel
import dagger.hilt.android.lifecycle.HiltViewModel import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.launchIn

View file

@ -1,8 +1,8 @@
package com.x8bit.bitwarden package com.x8bit.bitwarden
import android.content.Intent import android.content.Intent
import com.x8bit.bitwarden.data.auth.repository.util.CaptchaCallbackTokenResult
import com.x8bit.bitwarden.data.auth.repository.AuthRepository import com.x8bit.bitwarden.data.auth.repository.AuthRepository
import com.x8bit.bitwarden.data.auth.repository.util.CaptchaCallbackTokenResult
import io.mockk.every import io.mockk.every
import io.mockk.mockk import io.mockk.mockk
import io.mockk.mockkStatic import io.mockk.mockkStatic

View file

@ -38,6 +38,7 @@ class LocalDateTimeSerializerTest {
), ),
) )
} }
@Test @Test
fun `properly deserializes raw JSON with nano seconds to LocalDate`() { fun `properly deserializes raw JSON with nano seconds to LocalDate`() {
assertEquals( assertEquals(

View file

@ -4,10 +4,10 @@ import android.net.Uri
import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.SavedStateHandle
import app.cash.turbine.test import app.cash.turbine.test
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.data.auth.repository.AuthRepository
import com.x8bit.bitwarden.data.auth.repository.model.LoginResult import com.x8bit.bitwarden.data.auth.repository.model.LoginResult
import com.x8bit.bitwarden.data.auth.repository.util.CaptchaCallbackTokenResult import com.x8bit.bitwarden.data.auth.repository.util.CaptchaCallbackTokenResult
import com.x8bit.bitwarden.data.auth.repository.util.generateUriForCaptcha import com.x8bit.bitwarden.data.auth.repository.util.generateUriForCaptcha
import com.x8bit.bitwarden.data.auth.repository.AuthRepository
import com.x8bit.bitwarden.ui.platform.base.BaseViewModelTest import com.x8bit.bitwarden.ui.platform.base.BaseViewModelTest
import com.x8bit.bitwarden.ui.platform.base.util.asText import com.x8bit.bitwarden.ui.platform.base.util.asText
import com.x8bit.bitwarden.ui.platform.components.BasicDialogState import com.x8bit.bitwarden.ui.platform.components.BasicDialogState

View file

@ -1,10 +1,10 @@
package com.x8bit.bitwarden.ui.platform.feature.rootnav package com.x8bit.bitwarden.ui.platform.feature.rootnav
import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.SavedStateHandle
import com.x8bit.bitwarden.data.auth.repository.AuthRepository
import com.x8bit.bitwarden.data.auth.repository.model.AuthState import com.x8bit.bitwarden.data.auth.repository.model.AuthState
import com.x8bit.bitwarden.data.auth.repository.model.AuthState.Authenticated import com.x8bit.bitwarden.data.auth.repository.model.AuthState.Authenticated
import com.x8bit.bitwarden.data.auth.repository.model.AuthState.Unauthenticated import com.x8bit.bitwarden.data.auth.repository.model.AuthState.Unauthenticated
import com.x8bit.bitwarden.data.auth.repository.AuthRepository
import com.x8bit.bitwarden.ui.platform.base.BaseViewModelTest import com.x8bit.bitwarden.ui.platform.base.BaseViewModelTest
import io.mockk.every import io.mockk.every
import io.mockk.mockk import io.mockk.mockk