Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/review and updates #8

Merged
merged 4 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions .idea/other.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ dependencies {
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.androidx.lifecycle.runtime.compose.android)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
Expand All @@ -72,4 +73,8 @@ dependencies {
implementation(libs.converter.gson)
implementation(libs.retrofit)
implementation(libs.androidx.core.splashscreen)
implementation(libs.coil.compose)
implementation(libs.coil.gif)


}
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.nuvemconnect.app.nuvemconnect.model.error

import android.util.Patterns
import androidx.compose.runtime.Immutable

@Immutable
sealed class EmailErrorType(val message: String) {
object None : EmailErrorType("")
object Empty : EmailErrorType("O campo de e-mail não pode estar vazio.")
object InvalidFormat : EmailErrorType("Formato de e-mail inválido.")
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.nuvemconnect.app.nuvemconnect.model.error

import androidx.compose.runtime.Immutable

@Immutable
sealed class NameErrorType(name: String) {
object None : NameErrorType("")
object Empty : NameErrorType("O campo de nome não pode estar vazio.")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.nuvemconnect.app.nuvemconnect.model.error

import androidx.compose.runtime.Immutable


@Immutable
sealed class PasswordErrorType(val message: String) {
object None: PasswordErrorType("")
object Empty: PasswordErrorType("Campo obrigatório")
object rulePassword: PasswordErrorType("A senha precisa conter no mínimo 8 caracteres contendo ao menos 1 maiúsculo, 1 minúsculo, 1 número e um caractere especial. Mas, não pode conter espaços ou o símbolo @")
object IncorrectPassword: PasswordErrorType("Senha incorreta")
object minimumPassword: PasswordErrorType("A senha deve contar no mínimo 8 digitos")

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ import androidx.compose.ui.Modifier
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.nuvemconnect.app.nuvemconnect.model.error.PasswordErrorType
import com.nuvemconnect.app.nuvemconnect.navigation.graph.splashScreen
import com.nuvemconnect.app.nuvemconnect.ui.screens.forgotpassword.ForgotPassword
import com.nuvemconnect.app.nuvemconnect.ui.screens.forgotpassword.PasswordCode
import com.nuvemconnect.app.nuvemconnect.ui.screens.forgotpassword.ResetPassword
import com.nuvemconnect.app.nuvemconnect.ui.screens.home.HomeScreen
import com.nuvemconnect.app.nuvemconnect.ui.screens.login.LoginScreen
import com.nuvemconnect.app.nuvemconnect.ui.screens.login.LoginViewModel
import com.nuvemconnect.app.nuvemconnect.ui.screens.login.WelcomeScreen
import com.nuvemconnect.app.nuvemconnect.ui.screens.register.RegisterScreen
import com.nuvemconnect.app.nuvemconnect.ui.screens.register.VerificationLinkScreen

@Composable
fun Navigation(modifier: Modifier = Modifier) {
Expand All @@ -21,9 +25,9 @@ fun Navigation(modifier: Modifier = Modifier) {
navController = navController,
startDestination = Screens.Splash.route
) {
splashScreen{
navController.navigate(Screens.Welcome.route){
popUpTo(Screens.Splash.route){
splashScreen {
navController.navigate(Screens.Welcome.route) {
popUpTo(Screens.Splash.route) {
inclusive = true
}
}
Expand All @@ -32,15 +36,15 @@ fun Navigation(modifier: Modifier = Modifier) {
WelcomeScreen(navController = navController)
}

composable(route = Screens.Register.route){
RegisterScreen()
composable(route = Screens.Register.route) {
RegisterScreen(navController = navController)
}

composable(route = Screens.Login.route) {
LoginScreen(modifier, navController)
LoginScreen(modifier, navController, LoginViewModel())
}

composable(route = Screens.Password.route){
composable(route = Screens.Password.route) {
ForgotPassword(modifier, navController)
}
composable(route = Screens.ForgotPassword.route) {
Expand All @@ -52,7 +56,11 @@ fun Navigation(modifier: Modifier = Modifier) {
composable(route = Screens.ResetPassword.route) {
ResetPassword(navController = navController)
}


composable(route = Screens.VerificationLink.route) {
VerificationLinkScreen(navController = navController)
}
composable(route = Screens.Home.route){
HomeScreen(navController = navController)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ sealed class Screens(val route: String) {
data object Home : Screens("home")
data object Splash : Screens("splash")
data object Welcome : Screens("welcome")
data object VerificationLink: Screens("verification_link")

}

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.nuvemconnect.app.nuvemconnect.navigation.Screens
import com.nuvemconnect.app.nuvemconnect.ui.screens.login.LoginScreen
import com.nuvemconnect.app.nuvemconnect.ui.screens.login.LoginViewModel

fun NavGraphBuilder.loginScreen(navigate: Unit) {
composable(route = Screens.Login.route) {
LoginScreen(navController = rememberNavController())
LoginScreen(navController = rememberNavController(), viewModel = LoginViewModel())
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.nuvemconnect.app.nuvemconnect.navigation.graph

import androidx.core.util.LogWriter
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.nuvemconnect.app.nuvemconnect.navigation.Screens
import com.nuvemconnect.app.nuvemconnect.ui.screens.login.LoginScreen
import com.nuvemconnect.app.nuvemconnect.ui.screens.login.LoginViewModel
import com.nuvemconnect.app.nuvemconnect.ui.screens.login.WelcomeScreen

fun NavGraphBuilder.welcomeScreen(){
Expand All @@ -13,7 +15,7 @@ fun NavGraphBuilder.welcomeScreen(){
}

composable(route = Screens.Login.route){
LoginScreen(navController = rememberNavController())
LoginScreen(navController = rememberNavController(), viewModel = LoginViewModel())
}

}
Loading