parent
992a4690fa
commit
f976c7c162
@ -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<User>, 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")
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.what_the_fantasy.ui.components
|
package com.example.what_the_fantasy.data.services
|
||||||
|
|
||||||
import java.security.MessageDigest
|
import java.security.MessageDigest
|
||||||
|
|
@ -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<User>, 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")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -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)
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="39dp"
|
|
||||||
android:height="19dp"
|
|
||||||
android:viewportWidth="39"
|
|
||||||
android:viewportHeight="19">
|
|
||||||
<path
|
|
||||||
android:pathData="M25.655,1.196H11.58C9.495,1.196 7.6,2.098 6.226,3.55C4.852,5.003 4,7.006 4,9.212C4,11.416 4.852,13.42 6.226,14.872C7.6,16.325 9.495,17.226 11.58,17.226H24.79C26.263,18.341 28.065,19 30.003,19H30.015C32.486,19 34.734,17.931 36.361,16.21C37.988,14.489 39,12.114 39,9.5C39,6.887 37.99,4.51 36.359,2.792C34.73,1.07 32.483,0 30.015,0H30.003C28.43,0 26.946,0.435 25.655,1.196ZM30.482,8.22L30.512,8.226C30.568,7.977 30.705,7.779 30.925,7.637C31.143,7.493 31.371,7.451 31.609,7.51L31.616,7.479C31.379,7.42 31.192,7.274 31.057,7.043C30.922,6.81 30.882,6.57 30.938,6.32L30.908,6.312C30.852,6.563 30.715,6.761 30.496,6.904C30.277,7.047 30.048,7.089 29.811,7.029L29.804,7.06C30.042,7.12 30.228,7.266 30.364,7.497C30.5,7.728 30.538,7.968 30.482,8.22ZM33.003,9.432L33.039,9.441C33.109,9.126 33.282,8.878 33.557,8.699C33.832,8.519 34.118,8.466 34.416,8.541L34.425,8.503C34.127,8.428 33.893,8.246 33.723,7.954C33.553,7.663 33.503,7.36 33.573,7.046L33.537,7.037C33.467,7.352 33.294,7.599 33.019,7.779C32.744,7.959 32.457,8.012 32.16,7.937L32.151,7.976C32.449,8.05 32.683,8.232 32.852,8.523C33.023,8.814 33.073,9.118 33.003,9.432ZM30.351,5.022C29.279,5.577 28.507,6.703 28.417,8.053C28.283,10.068 29.719,11.816 31.625,11.958C32.529,12.025 33.377,11.718 34.032,11.161C34.357,10.885 34.693,11.128 34.551,11.476C33.777,13.386 31.923,14.66 29.852,14.505C27.235,14.311 25.263,11.91 25.446,9.143C25.622,6.491 27.724,4.458 30.212,4.481C30.67,4.486 30.767,4.807 30.351,5.022ZM30.003,1.123H30.015C34.373,1.123 37.939,4.892 37.939,9.5C37.939,14.108 34.369,17.878 30.015,17.878H30.003C25.65,17.878 22.08,14.108 22.08,9.5C22.08,4.892 25.645,1.123 30.003,1.123Z"
|
|
||||||
android:fillColor="#ffffff"/>
|
|
||||||
</vector>
|
|
@ -1,10 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="39dp"
|
|
||||||
android:height="19dp"
|
|
||||||
android:viewportWidth="39"
|
|
||||||
android:viewportHeight="19">
|
|
||||||
<path
|
|
||||||
android:pathData="M9.752,0H9.765C11.443,0 13.028,0.42 14.412,1.158H30.437C32.79,1.158 34.931,2.096 36.483,3.609C38.036,5.12 39,7.206 39,9.5C39,11.795 38.036,13.88 36.485,15.392L36.453,15.42C34.903,16.916 32.775,17.842 30.437,17.842H14.415C13.031,18.579 11.446,19 9.765,19H9.752C7.07,19 4.631,17.931 2.864,16.21C1.098,14.489 0,12.114 0,9.5C0,6.886 1.097,4.51 2.863,2.789L2.933,2.728C4.696,1.043 7.106,0 9.752,0ZM9.298,4.038C9.298,3.894 9.359,3.762 9.457,3.667C9.665,3.462 10.01,3.463 10.22,3.667L10.231,3.678C10.325,3.776 10.378,3.904 10.378,4.038V4.999C10.378,5.144 10.318,5.276 10.22,5.371C10.01,5.575 9.666,5.575 9.457,5.371C9.407,5.322 9.367,5.264 9.34,5.201C9.312,5.137 9.298,5.068 9.298,4.999V4.038ZM9.759,6.351C10.652,6.351 11.459,6.704 12.044,7.274C12.628,7.844 12.991,8.631 12.991,9.5C12.991,10.37 12.629,11.156 12.044,11.726C11.459,12.296 10.652,12.649 9.759,12.649C8.866,12.649 8.059,12.296 7.473,11.726C6.889,11.156 6.526,10.37 6.526,9.5C6.526,8.63 6.889,7.844 7.473,7.274C8.059,6.705 8.867,6.351 9.759,6.351ZM5.468,5.955C5.368,5.856 5.311,5.723 5.311,5.583C5.311,5.294 5.553,5.057 5.851,5.057C5.989,5.057 6.127,5.108 6.232,5.211L6.929,5.891C6.98,5.939 7.019,5.997 7.047,6.061C7.074,6.125 7.088,6.193 7.088,6.262C7.088,6.396 7.034,6.531 6.929,6.634C6.879,6.683 6.82,6.722 6.754,6.748C6.689,6.775 6.619,6.789 6.548,6.788C6.411,6.788 6.273,6.737 6.167,6.635L5.468,5.955ZM4.152,9.948C4.004,9.948 3.868,9.889 3.771,9.794C3.56,9.591 3.561,9.254 3.771,9.051L3.782,9.041C3.882,8.948 4.014,8.897 4.152,8.897H5.138C5.209,8.897 5.279,8.91 5.345,8.937C5.41,8.963 5.47,9.002 5.52,9.051C5.57,9.099 5.61,9.158 5.637,9.221C5.664,9.285 5.678,9.354 5.678,9.423C5.678,9.568 5.617,9.7 5.52,9.795C5.419,9.893 5.281,9.948 5.138,9.948H4.152ZM6.119,13.679C6.069,13.728 6.01,13.767 5.944,13.793C5.879,13.819 5.809,13.833 5.738,13.833C5.44,13.833 5.198,13.599 5.198,13.308C5.198,13.173 5.25,13.039 5.356,12.936L6.065,12.246C6.165,12.154 6.297,12.102 6.435,12.102C6.578,12.102 6.716,12.158 6.817,12.257C6.918,12.355 6.975,12.489 6.975,12.629C6.975,12.761 6.923,12.896 6.817,12.999L6.119,13.679ZM10.219,14.962C10.219,15.106 10.158,15.239 10.06,15.333C9.851,15.538 9.506,15.538 9.297,15.333L9.287,15.322C9.192,15.225 9.139,15.096 9.139,14.962V14.001C9.139,13.856 9.2,13.725 9.297,13.63C9.507,13.426 9.851,13.426 10.061,13.63C10.162,13.728 10.218,13.862 10.219,14.001V14.962ZM14.048,13.046C14.099,13.094 14.138,13.152 14.165,13.216C14.192,13.28 14.206,13.348 14.206,13.417C14.206,13.706 13.964,13.943 13.667,13.943C13.529,13.943 13.39,13.892 13.285,13.79L12.587,13.11C12.486,13.011 12.429,12.877 12.43,12.738C12.43,12.448 12.672,12.212 12.969,12.212C13.106,12.212 13.244,12.264 13.35,12.366L14.048,13.046ZM15.365,9.052C15.512,9.052 15.649,9.112 15.746,9.206C15.957,9.41 15.956,9.746 15.746,9.95L15.735,9.96C15.635,10.052 15.503,10.104 15.365,10.104H14.379C14.23,10.104 14.094,10.045 13.997,9.95C13.787,9.746 13.787,9.41 13.997,9.206C14.047,9.157 14.107,9.118 14.172,9.092C14.238,9.065 14.308,9.052 14.379,9.052H15.365ZM13.398,5.321C13.499,5.222 13.636,5.167 13.779,5.167C14.076,5.167 14.32,5.404 14.32,5.693C14.32,5.827 14.267,5.962 14.162,6.064L13.452,6.755C13.352,6.847 13.219,6.898 13.082,6.898C12.784,6.898 12.542,6.662 12.542,6.372C12.542,6.239 12.595,6.104 12.7,6.001L13.398,5.321ZM16.001,2.214C16.226,2.397 16.443,2.59 16.65,2.792C18.419,4.51 19.517,6.886 19.517,9.5C19.517,12.114 18.418,14.489 16.653,16.21C16.446,16.411 16.23,16.604 16.005,16.786H30.437C32.48,16.786 34.34,15.977 35.694,14.672L35.718,14.646C37.074,13.325 37.916,11.503 37.916,9.5C37.916,7.497 37.074,5.675 35.718,4.354C34.365,3.033 32.494,2.214 30.437,2.214H16.001ZM9.752,1.122H9.765C14.495,1.122 18.364,4.892 18.364,9.5C18.364,14.108 14.49,17.878 9.765,17.878H9.752C5.027,17.878 1.152,14.108 1.152,9.5C1.152,4.892 5.022,1.122 9.752,1.122Z"
|
|
||||||
android:fillColor="#000000"
|
|
||||||
android:fillType="evenOdd"/>
|
|
||||||
</vector>
|
|
Loading…
Reference in new issue