Skip to content

Commit

Permalink
dependency updates, refactoring, bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikailo01 committed Sep 22, 2024
1 parent cd70aac commit e99177c
Show file tree
Hide file tree
Showing 39 changed files with 327 additions and 173 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ plugins {

android {
namespace = "com.bytecause.lenslex"
compileSdk = 34
compileSdk = 35
android.buildFeatures.buildConfig = true

defaultConfig {
applicationId = "com.bytecause.lenslex"
minSdk = 24
targetSdk = 34
targetSdk = 35
versionCode = 1
versionName = "1.0"
versionName = "1.0.0-rc1"

testInstrumentationRunner = "com.bytecause.lenslex.InstrumentationTestRunner"
vectorDrawables {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class WordsRepositoryImpl(

private fun user(): FirebaseUser? = auth.getAuth().currentUser

@Suppress("UNCHECKED_CAST")
override fun getWords(
originLangCode: String,
targetLangCode: String
Expand Down Expand Up @@ -63,6 +64,7 @@ class WordsRepositoryImpl(
awaitClose { listener?.remove() }
}

@Suppress("UNCHECKED_CAST")
private fun documentToWords(document: DocumentSnapshot): Words {
return document.data?.let { field ->
Words(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
Expand All @@ -27,8 +28,13 @@ fun EmailField(
emailValue: String,
isEmailError: Boolean,
modifier: Modifier = Modifier,
shouldHideSoftKeyboard: Boolean = false,
onEmailValueChanged: (String) -> Unit
) {
val keyboardController = LocalSoftwareKeyboardController.current

if (shouldHideSoftKeyboard) keyboardController?.hide()

OutlinedTextField(
modifier = modifier.fillMaxWidth(),
value = emailValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.bytecause.lenslex.R

Expand Down Expand Up @@ -55,4 +56,10 @@ fun NetworkUnavailableDialog(
.height(15.dp))
}
}
}

@Composable
@Preview
private fun NetworkUnavailableDialogPreview() {
NetworkUnavailableDialog(text = "", onTryAgainClick = {}, onDismiss = {})
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import androidx.compose.ui.unit.dp
import com.bytecause.lenslex.R
import com.bytecause.lenslex.navigation.Screen
import com.bytecause.lenslex.ui.events.LoginUiEvent
import com.bytecause.lenslex.ui.screens.uistate.LoginState
import com.bytecause.lenslex.ui.screens.model.LoginState
import com.bytecause.lenslex.util.CredentialValidationResult
import com.bytecause.lenslex.util.PasswordValidationResult
import com.bytecause.lenslex.util.TestTags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.bytecause.lenslex.R
import com.bytecause.lenslex.ui.events.LoginUiEvent
import com.bytecause.lenslex.ui.screens.uistate.LoginState
import com.bytecause.lenslex.ui.screens.model.LoginState
import com.bytecause.lenslex.util.CredentialValidationResult
import com.bytecause.lenslex.util.PasswordValidationResult

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ import com.google.firebase.auth.AuthCredential
sealed interface AccountSettingsUiEvent {
data object OnNavigateBack : AccountSettingsUiEvent
data object OnDeleteAccountButtonClick : AccountSettingsUiEvent
data object OnConfirmConfirmationDialog : AccountSettingsUiEvent
data object OnConfirmDeleteConfirmationDialog : AccountSettingsUiEvent
data object OnDismissConfirmationDialog : AccountSettingsUiEvent
data object OnLaunchReauthenticationGoogleIntent : AccountSettingsUiEvent
data object OnCredentialsDialogDismiss : AccountSettingsUiEvent
data class OnShowSnackBar(val message: String) : AccountSettingsUiEvent
data class OnLinkGoogleProvider(val value: AuthCredential) : AccountSettingsUiEvent
data class OnReauthenticateWithGoogle(val value: AuthCredential) : AccountSettingsUiEvent
data class OnShowCredentialDialog(val value: CredentialType) : AccountSettingsUiEvent
data class OnShowReauthorizationDialog(val boolean: Boolean) : AccountSettingsUiEvent
data class OnReauthorizationDialogDoneClick(val credentials: Credentials) : AccountSettingsUiEvent
data class OnLinkButtonClick(val value: Provider) : AccountSettingsUiEvent
data class OnEnteredCredential(val value: Credentials) : AccountSettingsUiEvent
data class OnEnteredCredential(val credentials: Credentials) : AccountSettingsUiEvent
data class OnDialogCredentialChanged(val value: Credentials.Sensitive) : AccountSettingsUiEvent
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.bytecause.lenslex.ui.interfaces

sealed interface CredentialType {
data object Reauthorization : CredentialType
data object AccountLink : CredentialType
data object Username : CredentialType
data object Email : CredentialType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import com.bytecause.lenslex.ui.components.RowItem
import com.bytecause.lenslex.ui.components.TopAppBar
import com.bytecause.lenslex.ui.events.AccountUiEffect
import com.bytecause.lenslex.ui.events.AccountUiEvent
import com.bytecause.lenslex.ui.screens.uistate.AccountState
import com.bytecause.lenslex.ui.screens.model.AccountState
import com.bytecause.lenslex.ui.screens.viewmodel.AccountViewModel
import com.bytecause.lenslex.util.BlurTransformation
import com.bytecause.lenslex.util.compressImage
Expand Down
Loading

0 comments on commit e99177c

Please sign in to comment.