Adding string localisation

pull/3/head
Arthur VALIN 1 year ago
parent bd40bed949
commit e0fb05e8d8

@ -63,6 +63,7 @@ dependencies {
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version" androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version" debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version" debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
implementation("androidx.core:core-splashscreen:1.0.1")
implementation 'com.github.racra:smooth-corner-rect-android-compose:v1.0.0' implementation 'com.github.racra:smooth-corner-rect-android-compose:v1.0.0'

@ -14,11 +14,9 @@
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true" android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.Allin"> android:theme="@style/Theme.Allin">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>

@ -0,0 +1,72 @@
package fr.iut.alldev.allin.ui.core
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.TextUnit
import fr.iut.alldev.allin.ui.theme.AllInTheme
@Composable
fun HighlightedText(
text: String,
query: String,
highlightStyle: SpanStyle,
fontSize: TextUnit = TextUnit.Unspecified,
fontStyle: FontStyle? = null,
fontWeight: FontWeight? = null,
modifier: Modifier = Modifier,
color: Color = Color.Unspecified,
textAlign: TextAlign? = null,
style: TextStyle = LocalTextStyle.current
) {
Text(
buildAnnotatedString {
val startIndex = text.indexOf(query)
val endIndex = startIndex + query.length
if (startIndex != -1) {
append(text.substring(0, startIndex))
withStyle(highlightStyle) {
append(text.substring(startIndex, endIndex))
}
append(text.substring(endIndex))
} else {
append(text)
}
},
color = color,
fontSize = fontSize,
fontStyle = fontStyle,
modifier = modifier,
fontWeight = fontWeight,
textAlign = textAlign,
style = style
)
}
@Preview
@Composable
private fun HighlightedTextPreview() {
AllInTheme {
HighlightedText(
text = "Hello World !",
query = "World",
highlightStyle = SpanStyle(
fontWeight = FontWeight.Bold,
color = Color.Red
),
color = Color.White
)
}
}

@ -0,0 +1,158 @@
package fr.iut.alldev.allin.ui.core
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.AbsoluteRoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.ui.theme.AllInTheme
@Composable
fun StatBar(
percentage: Float
) {
val radius100percent = if(percentage==1f) 50 else 0
val radius0percent = if(percentage==0f) 50 else 0
Box(
Modifier.padding(horizontal = 9.dp)
){
Row(
Modifier.align(Alignment.Center)
){
Box(
modifier = Modifier
.height(20.dp)
.fillMaxWidth(percentage)
.clip(
AbsoluteRoundedCornerShape(
topLeftPercent = 50,
bottomLeftPercent = 50,
topRightPercent = radius100percent,
bottomRightPercent = radius100percent
)
)
.background(AllInTheme.colors.allIn_Bar1stGradient)
){
Text(
modifier = Modifier
.align(Alignment.CenterStart)
.padding(start = 15.dp),
text = "OUI",
style = AllInTheme.typography.h2,
textAlign = TextAlign.Center,
fontSize = 25.sp,
color = Color.White.copy(alpha = 0.3f),
)
}
if(percentage!=0f && percentage!=1f) {
Spacer(modifier = Modifier.width(15.dp))
}
Box(
modifier = Modifier
.height(20.dp)
.fillMaxWidth()
.clip(
AbsoluteRoundedCornerShape(
topLeftPercent = radius0percent,
bottomLeftPercent = radius0percent,
topRightPercent = 50,
bottomRightPercent = 50
)
)
.background(AllInTheme.colors.allIn_Bar2ndGradient)
)
}
Box(
Modifier
.fillMaxWidth()
.align(Alignment.Center)
) {
when (percentage) {
0f -> {
Icon(
painter = painterResource(id = R.drawable.fire_solid),
tint = AllInTheme.colors.allIn_BarPink,
contentDescription = null,
modifier = Modifier
.size(32.dp)
)
}
1f -> {
Icon(
painter = painterResource(id = R.drawable.fire_solid),
tint = AllInTheme.colors.allIn_BarPurple,
contentDescription = null,
modifier = Modifier
.align(Alignment.CenterEnd)
.size(32.dp)
)
}
else -> {
Row {
Spacer(modifier = Modifier.fillMaxWidth(percentage))
Image(
painter = painterResource(id = R.drawable.bar_flame),
contentDescription = null,
modifier = Modifier
.size(32.dp)
.offset(x = (-9).dp)
)
}
}
}
}
}
}
@Preview
@Composable
private fun StatBar0Preview() {
AllInTheme {
StatBar(percentage = 0f)
}
}
@Preview
@Composable
private fun StatBar33Preview() {
AllInTheme {
StatBar(percentage = 0.33f)
}
}
@Preview
@Composable
private fun StatBar50Preview() {
AllInTheme {
StatBar(percentage = 0.5f)
}
}
@Preview
@Composable
private fun StatBar66Preview() {
AllInTheme {
StatBar(percentage = 0.66f)
}
}
@Preview
@Composable
private fun StatBar100Preview() {
AllInTheme {
StatBar(percentage = 1f)
}
}

@ -11,12 +11,17 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Alignment.Companion.CenterEnd import androidx.compose.ui.Alignment.Companion.CenterEnd
import androidx.compose.ui.Alignment.Companion.CenterHorizontally import androidx.compose.ui.Alignment.Companion.CenterHorizontally
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import androidx.compose.ui.zIndex import androidx.compose.ui.zIndex
import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.ui.core.AllInCard import fr.iut.alldev.allin.ui.core.AllInCard
import fr.iut.alldev.allin.ui.core.HighlightedText
import fr.iut.alldev.allin.ui.core.ProfilePicture import fr.iut.alldev.allin.ui.core.ProfilePicture
import fr.iut.alldev.allin.ui.core.RainbowButton import fr.iut.alldev.allin.ui.core.RainbowButton
import fr.iut.alldev.allin.ui.theme.AllInRippleTheme import fr.iut.alldev.allin.ui.theme.AllInRippleTheme
@ -42,18 +47,14 @@ fun HomeBetCard(
Modifier Modifier
.align(Alignment.End) .align(Alignment.End)
.padding(top = 12.dp, end = 10.dp)) { .padding(top = 12.dp, end = 10.dp)) {
Text( HighlightedText(
text = stringResource(id = R.string.Proposed_by_x, creator),
query = creator,
highlightStyle = SpanStyle(fontWeight = FontWeight.Bold, color = AllInTheme.colors.allIn_Dark),
fontSize = 12.sp, fontSize = 12.sp,
text = "proposé par ",
style = AllInTheme.typography.s, style = AllInTheme.typography.s,
color = AllInTheme.colors.allIn_LightGrey300 color = AllInTheme.colors.allIn_LightGrey300
) )
Text(
fontSize = 12.sp,
text = creator,
fontWeight = FontWeight.W600,
style = AllInTheme.typography.m
)
} }
Column(Modifier.padding(horizontal = 19.dp, vertical = 11.dp)) { Column(Modifier.padding(horizontal = 19.dp, vertical = 11.dp)) {
Text( Text(
@ -72,7 +73,7 @@ fun HomeBetCard(
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Text( Text(
text = "Commence le", text = stringResource(id = R.string.Starting),
fontSize = 15.sp, fontSize = 15.sp,
style = AllInTheme.typography.m, style = AllInTheme.typography.m,
color = AllInTheme.colors.allIn_LightGrey300, color = AllInTheme.colors.allIn_LightGrey300,
@ -114,7 +115,11 @@ fun HomeBetCard(
} }
Spacer(modifier = Modifier.width(12.dp)) Spacer(modifier = Modifier.width(12.dp))
Text( Text(
text = "$nbPlayer joueurs en attente", text = pluralStringResource(
id = R.plurals.n_players_waiting,
nbPlayer,
nbPlayer
),
style = AllInTheme.typography.m, style = AllInTheme.typography.m,
color = AllInTheme.colors.allIn_LightGrey300 color = AllInTheme.colors.allIn_LightGrey300
) )
@ -124,7 +129,7 @@ fun HomeBetCard(
){ ){
RainbowButton( RainbowButton(
modifier = Modifier.padding(6.dp), modifier = Modifier.padding(6.dp),
text = "Participer", text = stringResource(id = R.string.Participate),
onClick = onClickParticipate onClick = onClickParticipate
) )
} }

@ -9,17 +9,24 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.shadow import androidx.compose.ui.draw.shadow
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.ui.core.AllInCard import fr.iut.alldev.allin.ui.core.AllInCard
import fr.iut.alldev.allin.ui.core.HighlightedText
import fr.iut.alldev.allin.ui.theme.AllInTheme import fr.iut.alldev.allin.ui.theme.AllInTheme
import kotlin.math.ceil
@Composable @Composable
fun HomePopularCards( fun HomePopularCards(
nbPlayers: Int, nbPlayers: Int,
points: String, points: Float,
pointUnit: String,
title: String, title: String,
modifier: Modifier = Modifier modifier: Modifier = Modifier
) { ) {
@ -46,7 +53,7 @@ fun HomePopularCards(
) )
Spacer(modifier = Modifier.width(3.dp)) Spacer(modifier = Modifier.width(3.dp))
Text( Text(
text = "Populaire", text = stringResource(id = R.string.Popular),
color = AllInTheme.colors.allIn_Pink, color = AllInTheme.colors.allIn_Pink,
fontSize = 17.sp, fontSize = 17.sp,
style = AllInTheme.typography.h2 style = AllInTheme.typography.h2
@ -60,27 +67,43 @@ fun HomePopularCards(
modifier = Modifier.padding(vertical = 22.dp) modifier = Modifier.padding(vertical = 22.dp)
) )
Row(modifier = Modifier.align(alignment = Alignment.CenterHorizontally)) { Row(modifier = Modifier.align(alignment = Alignment.CenterHorizontally)) {
Text( HighlightedText(
text = nbPlayers.toString(), text = pluralStringResource(
color = AllInTheme.colors.allIn_Pink, id = R.plurals.n_players,
fontSize = 15.sp, nbPlayers,
style = AllInTheme.typography.h2 nbPlayers
) ),
Text( query = nbPlayers.toString(),
text = " joueurs - ", highlightStyle = SpanStyle(
fontWeight = FontWeight.Bold,
color = AllInTheme.colors.allIn_Pink
),
color = AllInTheme.colors.white, color = AllInTheme.colors.white,
style = AllInTheme.typography.r, style = AllInTheme.typography.r,
fontSize = 15.sp fontSize = 15.sp
) )
Text( Text(
text = points, text = " - ",
color = AllInTheme.colors.allIn_Pink, color = AllInTheme.colors.white,
fontSize = 15.sp, style = AllInTheme.typography.r,
style = AllInTheme.typography.h2 fontSize = 15.sp
) )
Text( val pointsText = if (points % 1 == 0f){
text = " points en jeu", stringResource(id = R.string.int_and_unit, points.toInt(), pointUnit)
}else{
stringResource(id = R.string.float_and_unit, points, pointUnit)
}
HighlightedText(
text = pluralStringResource(
id = R.plurals.n_points_at_stake,
if(pointUnit.isEmpty()) ceil(points).toInt() else 2,
pointsText
),
query = pointsText,
highlightStyle = SpanStyle(
fontWeight = FontWeight.Bold,
color = AllInTheme.colors.allIn_Pink
),
color = AllInTheme.colors.white, color = AllInTheme.colors.white,
style = AllInTheme.typography.r, style = AllInTheme.typography.r,
fontSize = 15.sp fontSize = 15.sp
@ -96,6 +119,24 @@ fun HomePopularCards(
@Composable @Composable
private fun HomePopularCardsPreview() { private fun HomePopularCardsPreview() {
AllInTheme { AllInTheme {
HomePopularCards(nbPlayers = 12, points = "2.35k", title = "Emre va réussir son TP de CI/CD mercredi?") HomePopularCards(
nbPlayers = 12,
points = 2.35f,
pointUnit = "k",
title = "Emre va réussir son TP de CI/CD mercredi?"
)
}
}
@Preview
@Composable
private fun HomePopularCardsSingularPreview() {
AllInTheme {
HomePopularCards(
nbPlayers = 1,
points = 1.0f,
pointUnit = "",
title = "Emre va réussir son TP de CI/CD mercredi?"
)
} }
} }

@ -10,7 +10,9 @@ import androidx.compose.runtime.*
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.ui.core.AllInChip import fr.iut.alldev.allin.ui.core.AllInChip
import fr.iut.alldev.allin.ui.home.components.HomeBetCard import fr.iut.alldev.allin.ui.home.components.HomeBetCard
import fr.iut.alldev.allin.ui.home.components.HomePopularCards import fr.iut.alldev.allin.ui.home.components.HomePopularCards
@ -29,7 +31,8 @@ fun Home(){
.padding(horizontal = horizontalPadding) .padding(horizontal = horizontalPadding)
.padding(top = 23.dp), .padding(top = 23.dp),
nbPlayers = 12, nbPlayers = 12,
points = "2.35k", points = 2.35f,
pointUnit = "k",
title = "Emre va réussir son TP de CI/CD mercredi?" title = "Emre va réussir son TP de CI/CD mercredi?"
) )
} }
@ -51,7 +54,7 @@ fun Home(){
items(items) { items(items) {
var isSelected by remember { mutableStateOf(false) } var isSelected by remember { mutableStateOf(false) }
AllInChip( AllInChip(
text = it, text = stringResource(id = it),
isSelected = isSelected, isSelected = isSelected,
onClick = { isSelected = !isSelected }) onClick = { isSelected = !isSelected })
} }
@ -77,8 +80,8 @@ fun Home(){
} }
val items = listOf( val items = listOf(
"Public", R.string.Public,
"En cours", R.string.Invitation,
"Invitation", R.string.Current,
"Terminés" R.string.Finished
) )

@ -11,6 +11,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.RectangleShape import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController import androidx.navigation.compose.rememberNavController
@ -25,32 +26,32 @@ import kotlin.math.abs
sealed class TopLevelDestination( sealed class TopLevelDestination(
val route: String, val route: String,
val title: String, val title: Int,
val subtitle: String, val subtitle: Int,
val emoji: Int val emoji: Int
) { ) {
object BET : TopLevelDestination( object BET : TopLevelDestination(
route = Routes.BET, route = Routes.BET,
title = "CREER UN BET", title = R.string.create_a_bet,
subtitle = "Créez un nouveau BET et faites participer vos amis.", subtitle = R.string.create_a_bet_subtitle,
emoji = R.drawable.video_game emoji = R.drawable.video_game
) )
object BET_HISTORY : TopLevelDestination( object BET_HISTORY : TopLevelDestination(
route = Routes.BET_HISTORY, route = Routes.BET_HISTORY,
title = "HISTORIQUE DES BETS", title = R.string.bet_history,
subtitle = "Consultez vos paris en cours et terminés.", subtitle = R.string.bet_history_subtitle,
emoji = R.drawable.eyes emoji = R.drawable.eyes
) )
object FRIENDS : TopLevelDestination( object FRIENDS : TopLevelDestination(
route = Routes.FRIENDS, route = Routes.FRIENDS,
title = "AMIS", title = R.string.friends,
subtitle = "Défiez vos porches en les ajoutant en amis.", subtitle = R.string.friends_subtitle,
emoji = R.drawable.holding_hands emoji = R.drawable.holding_hands
) )
object CURRENT_BETS : TopLevelDestination( object CURRENT_BETS : TopLevelDestination(
route = Routes.CURRENT_BETS, route = Routes.CURRENT_BETS,
title = "BETS EN COURS", title = R.string.current_bets,
subtitle = "Gérez vos bets et récompensez les gagnants.", subtitle = R.string.current_bets_subtitle,
emoji = R.drawable.money_with_wings emoji = R.drawable.money_with_wings
) )
} }
@ -103,8 +104,8 @@ fun AllInDrawer(
) )
topLevelDestinations.forEach { item -> topLevelDestinations.forEach { item ->
DrawerCell( DrawerCell(
title = item.title, title = stringResource(item.title).uppercase(),
subtitle = item.subtitle, subtitle = stringResource(item.subtitle),
emoji = painterResource(id = item.emoji), emoji = painterResource(id = item.emoji),
onClick = { scope.launch { drawerState.close() } onClick = { scope.launch { drawerState.close() }
navController.navigate(item.route){ navController.navigate(item.route){

@ -5,10 +5,12 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.ui.core.ProfilePicture import fr.iut.alldev.allin.ui.core.ProfilePicture
import fr.iut.alldev.allin.ui.theme.AllInTheme import fr.iut.alldev.allin.ui.theme.AllInTheme
@ -37,12 +39,14 @@ fun DrawerHeader(
) )
Spacer(modifier = Modifier.height(28.dp)) Spacer(modifier = Modifier.height(28.dp))
Row( Row(
modifier = Modifier.fillMaxWidth().padding(horizontal = 69.dp), modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 69.dp),
horizontalArrangement = Arrangement.SpaceBetween horizontalArrangement = Arrangement.SpaceBetween
) { ) {
DrawerHeaderStat(label = "Bets", value = nbBets) DrawerHeaderStat(label = stringResource(id = R.string.bets), value = nbBets)
DrawerHeaderStat(label = "Meilleur gain", value = bestWin) DrawerHeaderStat(label = stringResource(id = R.string.best_win), value = bestWin)
DrawerHeaderStat(label = "Amis", value = nbFriends) DrawerHeaderStat(label = stringResource(id = R.string.friends), value = nbFriends)
} }
} }
} }

@ -21,7 +21,11 @@ data class AllInColors(
val allIn_Pink: Color, val allIn_Pink: Color,
val allIn_Purple: Color, val allIn_Purple: Color,
val allIn_Blue: Color, val allIn_Blue: Color,
val allIn_BarPurple: Color,
val allIn_BarPink: Color,
val allIn_MainGradient: Brush, val allIn_MainGradient: Brush,
val allIn_Bar1stGradient: Brush,
val allIn_Bar2ndGradient: Brush,
val allIn_TextGradient: Brush val allIn_TextGradient: Brush
) )
@ -39,6 +43,8 @@ internal val LocalColors = staticCompositionLocalOf {
white = Color.Unspecified, white = Color.Unspecified,
allIn_Pink = Color.Unspecified, allIn_Pink = Color.Unspecified,
allIn_Purple = Color.Unspecified, allIn_Purple = Color.Unspecified,
allIn_BarPurple = Color.Unspecified,
allIn_BarPink = Color.Unspecified,
allIn_Blue = Color.Unspecified, allIn_Blue = Color.Unspecified,
allIn_MainGradient = Brush.linearGradient( allIn_MainGradient = Brush.linearGradient(
@ -48,6 +54,14 @@ internal val LocalColors = staticCompositionLocalOf {
start = Offset(0f, Float.POSITIVE_INFINITY), start = Offset(0f, Float.POSITIVE_INFINITY),
end = Offset(Float.POSITIVE_INFINITY, 0f) end = Offset(Float.POSITIVE_INFINITY, 0f)
), ),
allIn_Bar1stGradient = Brush.horizontalGradient(
0.0f to Color(0xFF2599F8),
1.0f to Color(0xFF846AC9)
),
allIn_Bar2ndGradient = Brush.horizontalGradient(
0.0f to Color(0xFFFE2B8A),
1.0f to Color(0xFFC249A8)
),
allIn_TextGradient = Brush.horizontalGradient( allIn_TextGradient = Brush.horizontalGradient(
0.0f to Color(0xFFF876C1), 0.0f to Color(0xFFF876C1),
1.0f to Color(0xFF2399F8) 1.0f to Color(0xFF2399F8)

@ -30,6 +30,8 @@ fun AllInTheme(
white = Color(0xFFFFFFFF), white = Color(0xFFFFFFFF),
allIn_Pink = Color(0xFFFF2A89), allIn_Pink = Color(0xFFFF2A89),
allIn_Purple = Color(0xFF7D79FF), allIn_Purple = Color(0xFF7D79FF),
allIn_BarPurple = Color(0xFF846AC9),
allIn_BarPink = Color(0xFFFE2B8A),
allIn_Blue = Color(0xFF6a89fa), allIn_Blue = Color(0xFF6a89fa),
allIn_MainGradient = Brush.linearGradient( allIn_MainGradient = Brush.linearGradient(
@ -39,6 +41,14 @@ fun AllInTheme(
start = Offset(0f, Float.POSITIVE_INFINITY), start = Offset(0f, Float.POSITIVE_INFINITY),
end = Offset(Float.POSITIVE_INFINITY, 0f) end = Offset(Float.POSITIVE_INFINITY, 0f)
), ),
allIn_Bar1stGradient = Brush.horizontalGradient(
0.0f to Color(0xFF2599F8),
1.0f to Color(0xFF846AC9)
),
allIn_Bar2ndGradient = Brush.horizontalGradient(
0.0f to Color(0xFFFE2B8A),
1.0f to Color(0xFFC249A8)
),
allIn_TextGradient = Brush.horizontalGradient( allIn_TextGradient = Brush.horizontalGradient(
0.0f to Color(0xFFF876C1), 0.0f to Color(0xFFF876C1),
1.0f to Color(0xFF2399F8) 1.0f to Color(0xFF2399F8)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="448dp"
android:height="512dp"
android:viewportWidth="448"
android:viewportHeight="512">
<path
android:fillColor="#FF000000"
android:pathData="M159.3,5.4c7.8,-7.3 19.9,-7.2 27.7,0.1c27.6,25.9 53.5,53.8 77.7,84c11,-14.4 23.5,-30.1 37,-42.9c7.9,-7.4 20.1,-7.4 28,0.1c34.6,33 63.9,76.6 84.5,118c20.3,40.8 33.8,82.5 33.8,111.9C448,404.2 348.2,512 224,512C98.4,512 0,404.1 0,276.5c0,-38.4 17.8,-85.3 45.4,-131.7C73.3,97.7 112.7,48.6 159.3,5.4zM225.7,416c25.3,0 47.7,-7 68.8,-21c42.1,-29.4 53.4,-88.2 28.1,-134.4c-4.5,-9 -16,-9.6 -22.5,-2l-25.2,29.3c-6.6,7.6 -18.5,7.4 -24.7,-0.5c-16.5,-21 -46,-58.5 -62.8,-79.8c-6.3,-8 -18.3,-8.1 -24.7,-0.1c-33.8,42.5 -50.8,69.3 -50.8,99.4C112,375.4 162.6,416 225.7,416z"/>
</vector>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:type="linear"
android:angle="45"
android:startColor="#fff951a8"
android:centerColor="#ffaa7ef3"
android:endColor="#ff199fee" />
</shape>

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--Drawer-->
<string name="bets">Bets</string>
<string name="best_win">Meilleur gain</string>
<string name="friends">Amis</string>
<string name="create_a_bet">Créer un bet</string>
<string name="create_a_bet_subtitle">Créez un nouveau bet et faites participer vos amis.</string>
<string name="bet_history">Historique des bets</string>
<string name="bet_history_subtitle">Consultez vos paris en cours et terminés.</string>
<string name="friends_subtitle">Défiez vos porches en les ajoutant en amis.</string>
<string name="current_bets">Bets en cours</string>
<string name="current_bets_subtitle">Gérez vos bets et récompensez les gagnants.</string>
<!--Main Page-->
<string name="Popular">Populaire</string>
<string name="Public">Public</string>
<string name="Invitation">Invitation</string>
<string name="Current">En cours</string>
<string name="Finished">Terminés</string>
<string name="Starting">Commence le</string>
<string name="Participate">Participer</string>
<string name="Proposed_by_x">Proposé par %1$s</string>
<plurals name="n_players_waiting">
<item quantity="one">%d joueur en attente</item>
<item quantity="other">%d joueurs en attente</item>
<item quantity="many">%d joueurs en attente</item>
</plurals>
<plurals name="n_players">
<item quantity="one">%d joueur</item>
<item quantity="other">%d joueurs</item>
<item quantity="many">%d joueurs</item>
</plurals>
<plurals name="n_points_at_stake">
<item quantity="one">%s point en jeu</item>
<item quantity="other">%s points en jeu</item>
<item quantity="many">%s points en jeu</item>
</plurals>
</resources>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Allin" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:windowSplashScreenBackground">@drawable/main_gradient</item>
</style>
</resources>

@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources xmlns:android="http://schemas.android.com/apk/res/android">
</resources> </resources>

@ -1,3 +1,38 @@
<resources> <resources>
<string name="app_name">allin</string> <!--Core-->
<string name="app_name" translatable="false">Allin</string>
<string name="float_and_unit" translatable="false">%.2g%s</string>
<string name="int_and_unit" translatable="false">%d%s</string>
<!--Drawer-->
<string name="bets">Bets</string>
<string name="best_win">Best win</string>
<string name="friends">Friends</string>
<string name="create_a_bet">Create a bet</string>
<string name="create_a_bet_subtitle">Create a net bet and get your friends participating.</string>
<string name="bet_history">Bet history</string>
<string name="bet_history_subtitle">View your current and finished bets.</string>
<string name="friends_subtitle">Challenge your folks by adding them as friends.</string>
<string name="current_bets">Current bets</string>
<string name="current_bets_subtitle">Manage your bets and reward the winners.</string>
<!--Main Page-->
<string name="Popular">Popular</string>
<string name="Public">Public</string>
<string name="Invitation">Invitation</string>
<string name="Current">Current</string>
<string name="Finished">Finished</string>
<string name="Starting">Starting</string>
<string name="Participate">Participate</string>
<string name="Proposed_by_x">Proposed by %1$s</string>
<plurals name="n_players_waiting">
<item quantity="one">%d player waiting</item>
<item quantity="other">%d players waiting</item>
</plurals>
<plurals name="n_players">
<item quantity="one">%d player</item>
<item quantity="other">%d players</item>
</plurals>
<plurals name="n_points_at_stake">
<item quantity="one">%s point at stake</item>
<item quantity="other">%s points at stake</item>
</plurals>
</resources> </resources>

@ -32,7 +32,7 @@ android {
dependencies { dependencies {
implementation 'androidx.core:core-ktx:1.7.0' implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0' implementation 'com.google.android.material:material:1.9.0'
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'

Loading…
Cancel
Save