diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/Logs/LogsUsers.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/Logs/LogsUsers.kt deleted file mode 100644 index e32f089..0000000 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/Logs/LogsUsers.kt +++ /dev/null @@ -1,28 +0,0 @@ -package com.example.what_the_fantasy.Logs - -import android.util.Log -import com.example.what_the_fantasy.data.model.User - -class LogsUsers{ - fun logDebugAllUsers(users : List, titleLog : String){ - for(user in users){ - Log.e(titleLog, "User created: ${user.username} => ${user.email} => ${user.imgUrl} => ${user.langage}") - } - } - - fun logDebugUserEmail(user : User?, titleLog : String){ - Log.e(titleLog, "User created: ${user?.username} => ${user?.email}") - } - - fun logDebugUserLangage(user : User?, titleLog : String){ - Log.e(titleLog, "User Change: ${user?.username} => ${user?.langage}") - } - - fun logInformationUserConnect(user : User?, titleLog : String){ - Log.e(titleLog, "${user?.username} logged in") - } - - fun unlogInformationUserConnect(titleLog : String){ - Log.e(titleLog, "Logged out") - } -} diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/data/services/ServicesStub.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/data/services/ServicesStub.kt index 054b3d2..382cd2e 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/data/services/ServicesStub.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/data/services/ServicesStub.kt @@ -3,7 +3,7 @@ package com.example.what_the_fantasy.data.services import android.annotation.SuppressLint import com.example.what_the_fantasy.data.local.UserStub.users import com.example.what_the_fantasy.data.model.User -import com.example.what_the_fantasy.Logs.LogsUsers +import com.example.what_the_fantasy.logs.LogsUsers import com.example.what_the_fantasy.data.local.FavoriteStub.favorites import com.example.what_the_fantasy.data.local.QuoteStub.quotes import com.example.what_the_fantasy.data.model.Favorite @@ -11,7 +11,6 @@ import com.example.what_the_fantasy.data.local.CommentStub.comments import com.example.what_the_fantasy.data.model.Comment import com.example.what_the_fantasy.data.model.Quote import com.example.what_the_fantasy.data.model.SrcLanguage -import com.example.what_the_fantasy.ui.components.hashPassword import java.time.LocalDate class ServicesStub : IServices { diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/hashPassword.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/data/services/hashPassword.kt similarity index 88% rename from What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/hashPassword.kt rename to What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/data/services/hashPassword.kt index 2f46a9d..2334aca 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/hashPassword.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/data/services/hashPassword.kt @@ -1,4 +1,4 @@ -package com.example.what_the_fantasy.ui.components +package com.example.what_the_fantasy.data.services import java.security.MessageDigest diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/logs/LogsUsers.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/logs/LogsUsers.kt new file mode 100644 index 0000000..03d938a --- /dev/null +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/logs/LogsUsers.kt @@ -0,0 +1,42 @@ +import android.content.Context +import android.util.Log +import com.example.what_the_fantasy.data.model.User + +class LogsUsers(private val context: Context) { + + private fun isDebug(): Boolean { + return (context.applicationInfo.flags and android.content.pm.ApplicationInfo.FLAG_DEBUGGABLE) != 0 + } + + fun logDebugAllUsers(users: List, titleLog: String) { + if (isDebug()) { + for (user in users) { + Log.d(titleLog, "User created: ${user.username} => ${user.email} => ${user.imgUrl} => ${user.langage}") + } + } + } + + fun logDebugUserEmail(user: User?, titleLog: String) { + if (isDebug()) { + Log.d(titleLog, "User email: ${user?.username} => ${user?.email}") + } + } + + fun logDebugUserLangage(user: User?, titleLog: String) { + if (isDebug()) { + Log.d(titleLog, "User language change: ${user?.username} => ${user?.langage}") + } + } + + fun logInformationUserConnect(user: User?, titleLog: String) { + if (isDebug()) { + Log.i(titleLog, "${user?.username} logged in") + } + } + + fun unlogInformationUserConnect(titleLog: String) { + if (isDebug()) { + Log.i(titleLog, "Logged out") + } + } +} diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/BackBar.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/BackBar.kt deleted file mode 100644 index c2deeda..0000000 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/BackBar.kt +++ /dev/null @@ -1,64 +0,0 @@ -package com.example.what_the_fantasy.ui.components - -import androidx.compose.foundation.Image -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxHeight -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.size -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.rounded.AccountCircle -import androidx.compose.material.icons.rounded.ArrowBack -import androidx.compose.material3.Button -import androidx.compose.material3.ButtonDefaults -import androidx.compose.material3.Icon -import androidx.compose.material3.IconButton -import androidx.compose.material3.IconButtonColors -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.unit.dp -import com.example.what_the_fantasy.R -import com.example.what_the_fantasy.ui.theme.colorButtonNav -import com.example.what_the_fantasy.ui.theme.colorNavBar - -@Composable -fun BackBar(navBack : () ->Unit , - content : @Composable ()-> Unit ){ - Column( - modifier = Modifier - .fillMaxSize() - ) { - Row( - modifier = Modifier - .fillMaxWidth() - .height(70.dp) - .background(colorNavBar), - Arrangement.SpaceBetween, - verticalAlignment = Alignment.Bottom - ) { - IconButton(onClick = {navBack()}, - modifier = Modifier - .size(60.dp) - ) { - Icon(Icons.Rounded.ArrowBack, - contentDescription = "Back", - modifier = Modifier - .size(60.dp) - ) - } - - } - - Box(modifier = Modifier.background(Color.Black).fillMaxHeight()) { - content() - } - } -} \ No newline at end of file diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/LittleQuoteComponent.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/LittleQuoteComponent.kt deleted file mode 100644 index 3f9481c..0000000 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/LittleQuoteComponent.kt +++ /dev/null @@ -1,68 +0,0 @@ -package com.example.what_the_fantasy.ui.components - -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.stringResource -import androidx.compose.ui.text.style.TextOverflow -import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp -import coil.compose.AsyncImage -import com.example.what_the_fantasy.R -import com.example.what_the_fantasy.data.model.Quote -import com.example.what_the_fantasy.ui.theme.gradienBox - -@Composable -fun LittleQuoteComponent(quote : Quote){ - Row( - modifier = Modifier - .fillMaxWidth(0.9f) - .clip(RoundedCornerShape(16.dp)) - .background(gradienBox) - ) { - val sizeTextInfoQuote = 13 - val lineHeightText = 12 - val sizeTextQuote = 16 - - AsyncImage( - model = quote.imgUrl, - contentDescription = "Quote picture", - modifier = Modifier - .size(130.dp) - .clip(RoundedCornerShape(16.dp)) - ) - Column(modifier = Modifier.padding(10.dp)) { - - TextInfoQuote( - quote.content, - sizeTextQuote, - lineHeightText - ) - - SpaceHeightComponent(40) - - TextInfoQuote("${stringResource(R.string.dateQuote)} : ${quote.date}", sizeTextInfoQuote, lineHeightText) - TextInfoQuote("${quote.type} : ${quote.source}", sizeTextInfoQuote, lineHeightText) - TextInfoQuote("${stringResource(R.string.CharacterQuote)}: ${quote.character}", sizeTextInfoQuote, lineHeightText) - } - } -} - -@Composable -fun TextInfoQuote(text : String, fontSizeText : Int, lineHeightText : Int){ - Text(text, - color = Color.White, - fontSize = fontSizeText.sp, - maxLines = 1, - overflow = TextOverflow.Ellipsis, - lineHeight = lineHeightText.sp) -} \ No newline at end of file diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/NavBar.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/NavBar.kt index 55b229e..e8e1cb1 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/NavBar.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/NavBar.kt @@ -4,8 +4,6 @@ import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize @@ -20,8 +18,6 @@ import androidx.compose.material3.IconButtonColors import androidx.compose.material3.MaterialTheme import androidx.compose.material3.NavigationBar import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/LoginPage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/LoginPage.kt index a98a4f8..511ed28 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/LoginPage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/LoginPage.kt @@ -30,16 +30,14 @@ import androidx.compose.ui.text.input.PasswordVisualTransformation import androidx.compose.ui.text.input.VisualTransformation import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import com.example.what_the_fantasy.Logs.LogsUsers +import com.example.what_the_fantasy.logs.LogsUsers import com.example.what_the_fantasy.R import com.example.what_the_fantasy.data.model.User import com.example.what_the_fantasy.data.services.IServices import com.example.what_the_fantasy.ui.components.ErrorMessageProfileComponent import com.example.what_the_fantasy.ui.components.SpaceHeightComponent import com.example.what_the_fantasy.ui.components.TitlePageComponent -import com.example.what_the_fantasy.ui.components.hashPassword -import com.example.what_the_fantasy.ui.theme.colorBackground -import com.example.what_the_fantasy.ui.theme.gradienBox +import com.example.what_the_fantasy.data.services.hashPassword @Composable fun LoginPage(navControllerSignUp: () -> Unit, navControllerProfil: (Int) -> Unit, services : IServices) { diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/ProfilPage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/ProfilPage.kt index 131ffeb..346cb6e 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/ProfilPage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/ProfilPage.kt @@ -45,7 +45,7 @@ import androidx.compose.ui.text.input.VisualTransformation import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import coil.compose.AsyncImage -import com.example.what_the_fantasy.Logs.LogsUsers +import com.example.what_the_fantasy.logs.LogsUsers import com.example.what_the_fantasy.R import com.example.what_the_fantasy.data.model.User import com.example.what_the_fantasy.data.services.IServices @@ -53,7 +53,6 @@ import com.example.what_the_fantasy.ui.components.ErrorMessageProfileComponent import com.example.what_the_fantasy.ui.components.NavBar import com.example.what_the_fantasy.ui.components.SpaceHeightComponent import com.example.what_the_fantasy.ui.components.TitlePageComponent -import com.example.what_the_fantasy.ui.theme.gradienBox @Composable fun ProfilPage(index: Int, diff --git a/What_The_Fantasy/app/src/main/res/drawable/dark_mode_toggle_icon.xml b/What_The_Fantasy/app/src/main/res/drawable/dark_mode_toggle_icon.xml deleted file mode 100644 index 752f388..0000000 --- a/What_The_Fantasy/app/src/main/res/drawable/dark_mode_toggle_icon.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/What_The_Fantasy/app/src/main/res/drawable/light_mode_toggle_icon.xml b/What_The_Fantasy/app/src/main/res/drawable/light_mode_toggle_icon.xml deleted file mode 100644 index 8e171be..0000000 --- a/What_The_Fantasy/app/src/main/res/drawable/light_mode_toggle_icon.xml +++ /dev/null @@ -1,10 +0,0 @@ - - -