diff --git a/.gitignore b/.gitignore index 8cf0ec8..ad20951 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,5 @@ local.properties _sandbox # Android Studio captures folder -captures/ \ No newline at end of file +captures/ +/.kotlin/* diff --git a/.idea/icon.png b/.idea/icon.png new file mode 100644 index 0000000..f053582 Binary files /dev/null and b/.idea/icon.png differ diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 4a1f0a1..2ee452d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -76,6 +76,7 @@ dependencies { implementation(libs.androidx.window) implementation(libs.materialWindow) implementation(libs.navigation) + implementation(project(":library:resources")) ksp(libs.kotlin.inject.ksp) implementation(libs.kotlin.inject.runtime) diff --git a/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameClickTests.kt b/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameClickTests.kt index 60ac904..84a51bc 100644 --- a/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameClickTests.kt +++ b/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameClickTests.kt @@ -1,5 +1,6 @@ package me.nasrabadiam.tictactoe.game +import androidx.compose.ui.test.junit4.ComposeContentTestRule import androidx.compose.ui.test.junit4.createComposeRule import androidx.lifecycle.SavedStateHandle import me.nasrabadiam.tictactoe.assertPlayersCountEquals @@ -7,7 +8,7 @@ import me.nasrabadiam.tictactoe.clickOnCell import me.nasrabadiam.tictactoe.game.model.Player import me.nasrabadiam.tictactoe.game.ui.GameScreen import me.nasrabadiam.tictactoe.game.ui.GameViewModel -import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.COMPACT +import me.nasrabadiam.tictactoe.ui.getWindowSizeClass import org.junit.Rule import org.junit.Test @@ -18,11 +19,19 @@ class GameClickTests { private val gameUseCase = GameUseCase() private val gameViewModel = GameViewModel(gameUseCase, SavedStateHandle()) - private val windowClass = COMPACT + + private fun ComposeContentTestRule.setContent( + viewModel: GameViewModel = gameViewModel + ) { + setContent { + val windowSizeClass = getWindowSizeClass() + GameScreen(viewModel, windowSizeClass) + } + } @Test fun whenClickOnCellsShouldDrawItem(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() clickOnCell(0, 0) @@ -31,7 +40,7 @@ class GameClickTests { @Test fun whenClickOnSecondCellShouldChangeTurn(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() clickOnCell(0, 0) clickOnCell(1, 1) @@ -42,7 +51,7 @@ class GameClickTests { @Test fun whenClickOnCellThatClickedBeforeShouldDoNothing(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() clickOnCell(0, 0) diff --git a/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameLogicTests.kt b/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameLogicTests.kt index 83c1d7c..655239a 100644 --- a/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameLogicTests.kt +++ b/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameLogicTests.kt @@ -4,6 +4,7 @@ import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.hasContentDescription import androidx.compose.ui.test.hasText import androidx.compose.ui.test.isDisplayed +import androidx.compose.ui.test.junit4.ComposeContentTestRule import androidx.compose.ui.test.junit4.createComposeRule import androidx.lifecycle.SavedStateHandle import me.nasrabadiam.tictactoe.DRAW_RESULT_STRING @@ -14,7 +15,7 @@ import me.nasrabadiam.tictactoe.clickOnCell import me.nasrabadiam.tictactoe.game.model.Player import me.nasrabadiam.tictactoe.game.ui.GameScreen import me.nasrabadiam.tictactoe.game.ui.GameViewModel -import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.COMPACT +import me.nasrabadiam.tictactoe.ui.getWindowSizeClass import org.junit.Rule import org.junit.Test @@ -25,7 +26,15 @@ class GameLogicTests { private val gameUseCase = GameUseCase() private val gameViewModel = GameViewModel(gameUseCase, SavedStateHandle()) - private val windowClass = COMPACT + + private fun ComposeContentTestRule.setContent( + viewModel: GameViewModel = gameViewModel + ) { + setContent { + val windowSizeClass = getWindowSizeClass() + GameScreen(viewModel, windowSizeClass) + } + } /** * X - M - M @@ -34,7 +43,7 @@ class GameLogicTests { */ @Test fun whenXWinsVerticallyShouldShowWinnerAndEndsTheGame(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() val colIndex = 0 clickOnCell(col = colIndex, row = 0) // X @@ -57,7 +66,7 @@ class GameLogicTests { */ @Test fun whenXWinsHorizontallyShouldShowWinnerAndEndsTheGame(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() val rowIndex = 0 clickOnCell(col = 0, row = rowIndex) // X @@ -80,7 +89,7 @@ class GameLogicTests { */ @Test fun whenXWinsInCrossShouldShowWinnerAndEndsTheGame(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() clickOnCell(col = 0, row = 0) // X clickOnCell(col = 0, row = 1) // O @@ -102,7 +111,7 @@ class GameLogicTests { */ @Test fun whenOWinsVerticallyShouldShowWinnerAndEndsTheGame(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() val colIndex = 2 clickOnCell(col = 0, row = 0) // X @@ -126,7 +135,7 @@ class GameLogicTests { */ @Test fun whenOWinsHorizontallyShouldShowWinnerAndEndsTheGame(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() val rowIndex = 1 clickOnCell(col = 0, row = 0) // X @@ -150,7 +159,7 @@ class GameLogicTests { */ @Test fun whenOWinsInCrossShouldShowWinnerAndEndsTheGame(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() clickOnCell(col = 0, row = 0) // X clickOnCell(col = 2, row = 0) // O @@ -173,7 +182,7 @@ class GameLogicTests { */ @Test fun whenOAndXDrawShouldShowDrawAndEndsTheGame(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() clickOnCell(col = 0, row = 0) // X clickOnCell(col = 2, row = 0) // O diff --git a/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameScoreTests.kt b/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameScoreTests.kt index 0ed8d23..4879c46 100644 --- a/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameScoreTests.kt +++ b/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameScoreTests.kt @@ -2,6 +2,7 @@ package me.nasrabadiam.tictactoe.game import androidx.compose.ui.test.assertAny import androidx.compose.ui.test.hasText +import androidx.compose.ui.test.junit4.ComposeContentTestRule import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onChildren import androidx.compose.ui.test.onNodeWithContentDescription @@ -12,7 +13,7 @@ import me.nasrabadiam.tictactoe.REPLAY_GAME_BUTTON_TEXT import me.nasrabadiam.tictactoe.clickOnCell import me.nasrabadiam.tictactoe.game.ui.GameScreen import me.nasrabadiam.tictactoe.game.ui.GameViewModel -import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.COMPACT +import me.nasrabadiam.tictactoe.ui.getWindowSizeClass import org.junit.Rule import org.junit.Test @@ -23,11 +24,19 @@ class GameScoreTests { private val gameUseCase = GameUseCase() private val gameViewModel = GameViewModel(gameUseCase, SavedStateHandle()) - private val windowClass = COMPACT + + private fun ComposeContentTestRule.setContent( + viewModel: GameViewModel = gameViewModel + ) { + setContent { + val windowSizeClass = getWindowSizeClass() + GameScreen(viewModel, windowSizeClass) + } + } @Test fun whenXWinsOneTimeShouldShowScore1AndO0(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() val rowIndex = 0 clickOnCell(col = 0, row = rowIndex) // X @@ -46,7 +55,7 @@ class GameScoreTests { @Test fun whenXWinsOneTimeAndOWinsAnotherShouldShowScore1ForXAnd1ForO(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() val rowIndex = 0 clickOnCell(col = 0, row = rowIndex) // X diff --git a/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameTests.kt b/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameTests.kt index 314c04b..4c2136c 100644 --- a/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameTests.kt +++ b/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameTests.kt @@ -6,6 +6,7 @@ import androidx.compose.ui.test.assertIsNotDisplayed import androidx.compose.ui.test.hasTestTag import androidx.compose.ui.test.hasText import androidx.compose.ui.test.isDisplayed +import androidx.compose.ui.test.junit4.ComposeContentTestRule import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick @@ -21,7 +22,7 @@ import me.nasrabadiam.tictactoe.game.model.Player import me.nasrabadiam.tictactoe.game.ui.GameScreen import me.nasrabadiam.tictactoe.game.ui.GameViewModel import me.nasrabadiam.tictactoe.getCellTestTag -import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.COMPACT +import me.nasrabadiam.tictactoe.ui.getWindowSizeClass import org.junit.Rule import org.junit.Test @@ -32,11 +33,19 @@ class GameTests { private val gameUseCase = GameUseCase() private val gameViewModel = GameViewModel(gameUseCase, SavedStateHandle()) - private val windowClass = COMPACT + + private fun ComposeContentTestRule.setContent( + viewModel: GameViewModel = gameViewModel + ) { + setContent { + val windowSizeClass = getWindowSizeClass() + GameScreen(viewModel, windowSizeClass) + } + } @Test fun displayGameCells(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() for (index in 0..DEFAULT_BOARD_CELL_COUNT) { onNode(hasTestTag(getCellTestTag(index))).isDisplayed() } @@ -44,14 +53,14 @@ class GameTests { @Test fun displayRestartButton(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() onNodeWithText(RESTART_GAME_BUTTON_TEXT).assertIsDisplayed() } @Test fun displayReplayButtonWhenOneGameFinished(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() onNodeWithText(REPLAY_GAME_BUTTON_TEXT).assertIsNotDisplayed() @@ -74,7 +83,7 @@ class GameTests { @Test fun restartGameBoardWhenClickOnReplayButton(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() clickOnCell(col = 0, row = 0) // X clickOnCell(col = 2, row = 0) // O @@ -101,7 +110,7 @@ class GameTests { @Test fun whenClickOnRestartGameButtonShouldRestartGame(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() clickOnCell(col = 0, row = 0) // X clickOnCell(col = 2, row = 0) // O diff --git a/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameTurnTests.kt b/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameTurnTests.kt index ada6b32..c7d86ef 100644 --- a/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameTurnTests.kt +++ b/app/src/androidTest/java/me/nasrabadiam/tictactoe/game/GameTurnTests.kt @@ -1,5 +1,6 @@ package me.nasrabadiam.tictactoe.game +import androidx.compose.ui.test.junit4.ComposeContentTestRule import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick @@ -10,7 +11,7 @@ import me.nasrabadiam.tictactoe.clickOnCell import me.nasrabadiam.tictactoe.game.model.Player import me.nasrabadiam.tictactoe.game.ui.GameScreen import me.nasrabadiam.tictactoe.game.ui.GameViewModel -import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.COMPACT +import me.nasrabadiam.tictactoe.ui.getWindowSizeClass import org.junit.Rule import org.junit.Test @@ -21,11 +22,19 @@ class GameTurnTests { private val gameUseCase = GameUseCase() private val gameViewModel = GameViewModel(gameUseCase, SavedStateHandle()) - private val windowClass = COMPACT + + private fun ComposeContentTestRule.setContent( + viewModel: GameViewModel = gameViewModel + ) { + setContent { + val windowSizeClass = getWindowSizeClass() + GameScreen(viewModel, windowSizeClass) + } + } @Test fun whenGameStartsXShouldStartTheGame(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() clickOnCell(0, 0) @@ -35,7 +44,7 @@ class GameTurnTests { @Test fun whenGameDrawsWhoDoesNotPlayThisGameFirstShouldPlayFirst(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() clickOnCell(col = 0, row = 0) // X clickOnCell(col = 2, row = 0) // O @@ -61,7 +70,7 @@ class GameTurnTests { @Test fun whenXWinsTheGameShouldStartTheNextGame(): Unit = with(composeRule) { - setContent { GameScreen(gameViewModel, windowClass) } + setContent() val colIndex = 0 diff --git a/app/src/androidTest/java/me/nasrabadiam/tictactoe/home/HomeScreenTests.kt b/app/src/androidTest/java/me/nasrabadiam/tictactoe/home/HomeScreenTests.kt index 4d8e11e..43506b1 100644 --- a/app/src/androidTest/java/me/nasrabadiam/tictactoe/home/HomeScreenTests.kt +++ b/app/src/androidTest/java/me/nasrabadiam/tictactoe/home/HomeScreenTests.kt @@ -2,10 +2,11 @@ package me.nasrabadiam.tictactoe.home import androidx.compose.ui.test.assertIsNotEnabled import androidx.compose.ui.test.hasContentDescription +import androidx.compose.ui.test.junit4.ComposeContentTestRule import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.performClick import me.nasrabadiam.tictactoe.home.HomeEvent.PlayWithAFriend -import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.NORMAL +import me.nasrabadiam.tictactoe.ui.getWindowSizeClass import org.junit.Rule import org.junit.Test @@ -14,25 +15,31 @@ class HomeScreenTests { @get:Rule val composeRule = createComposeRule() - private val windowClass = NORMAL - private val homeEvent: (HomeEvent) -> Unit = { } + private fun ComposeContentTestRule.setContent( + homeEvent: (HomeEvent) -> Unit = {} + ) { + setContent { + val windowSizeClass = getWindowSizeClass() + HomeScreen(homeEvent, windowSizeClass) + } + } @Test fun whenOpenHomeScreenShouldShowAppIcon(): Unit = with(composeRule) { - setContent { HomeScreen(homeEvent, windowClass) } + setContent() onNode(hasContentDescription("App Logo")).assertExists() } @Test fun whenOpenHomeScreenShouldShowPlayWithAFriendButton(): Unit = with(composeRule) { - setContent { HomeScreen(homeEvent, windowClass) } + setContent() onNode(hasContentDescription(PLAY_WITH_A_FRIEND_BUTTON_TEXT)).assertExists() } @Test fun whenOpenHomeScreenShouldShowPlaySoloButtonDisabled(): Unit = with(composeRule) { - setContent { HomeScreen(homeEvent, windowClass) } + setContent() val soloButton = onNode(hasContentDescription(PLAY_SOLO_BUTTON_TEXT)) soloButton.assertExists() soloButton.assertIsNotEnabled() @@ -40,7 +47,7 @@ class HomeScreenTests { @Test fun whenClickedOnPlaySoloShouldDoNothing(): Unit = with(composeRule) { - setContent { HomeScreen(homeEvent, windowClass) } + setContent() val playSoloButton = onNode(hasContentDescription(PLAY_SOLO_BUTTON_TEXT)) playSoloButton.performClick() playSoloButton.assertExists() @@ -52,7 +59,7 @@ class HomeScreenTests { val homeEvent: (HomeEvent) -> Unit = { if (it == PlayWithAFriend) clicked = true } - setContent { HomeScreen(homeEvent, windowClass) } + setContent(homeEvent) onNode(hasContentDescription(PLAY_WITH_A_FRIEND_BUTTON_TEXT)).performClick() assert(clicked) { "when clicked on play with a friend button," + diff --git a/app/src/main/java/me/nasrabadiam/tictactoe/game/ui/GameScreen.kt b/app/src/main/java/me/nasrabadiam/tictactoe/game/ui/GameScreen.kt index 1a35e62..46875bc 100644 --- a/app/src/main/java/me/nasrabadiam/tictactoe/game/ui/GameScreen.kt +++ b/app/src/main/java/me/nasrabadiam/tictactoe/game/ui/GameScreen.kt @@ -32,6 +32,8 @@ import androidx.compose.ui.unit.dp import me.nasrabadiam.tictactoe.game.ui.GameEvent.CellClicked import me.nasrabadiam.tictactoe.game.ui.GameEvent.RestartClicked import me.nasrabadiam.tictactoe.game.ui.GameEvent.RulesClicked +import me.nasrabadiam.tictactoe.strings.appStrings +import me.nasrabadiam.tictactoe.strings.getAppStrings import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.COMPACT import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.EXPANDED @@ -205,7 +207,7 @@ private fun CompactGameScreen( Button( modifier = Modifier - .semantics { contentDescription = RESTART_BUTTON_TEXT } + .semantics { contentDescription = getAppStrings().restart } .padding(horizontal = 24.dp) .weight(1f) .widthIn(min = 124.dp, max = 210.dp), @@ -216,20 +218,20 @@ private fun CompactGameScreen( contentDescription = null ) Spacer(modifier = Modifier.width(16.dp)) - Text(text = RESTART_BUTTON_TEXT) + Text(text = appStrings.restart) } Button( modifier = Modifier - .semantics { contentDescription = COMING_SOON_BUTTON_TEXT } + .semantics { contentDescription = getAppStrings().comingSoon } .padding(horizontal = 24.dp) .weight(1f) .widthIn(min = 124.dp, max = 210.dp), enabled = false, onClick = { sendEvent(RulesClicked) } ) { - Text(text = GAME_RULE_BUTTON_TEXT) + Text(text = appStrings.gameRules) Text( - text = COMING_SOON_BUTTON_TEXT, + text = appStrings.comingSoon, style = MaterialTheme.typography.labelSmall ) } @@ -274,7 +276,7 @@ private fun ActionButtons( Icon(imageVector = Icons.Rounded.Refresh, contentDescription = null) Spacer(modifier = Modifier.width(16.dp)) Text( - text = RESTART_BUTTON_TEXT, + text = appStrings.restart, overflow = TextOverflow.Ellipsis, maxLines = 1 ) @@ -287,18 +289,14 @@ private fun ActionButtons( enabled = false, onClick = onRulesClicked ) { - Text(text = GAME_RULE_BUTTON_TEXT) + Text(text = appStrings.gameRules) Text( - text = COMING_SOON_BUTTON_TEXT, + text = appStrings.comingSoon, style = MaterialTheme.typography.labelSmall ) } } -private const val RESTART_BUTTON_TEXT = "Restart" -private const val GAME_RULE_BUTTON_TEXT = "Game Rules" -private const val COMING_SOON_BUTTON_TEXT = "(Coming Soon)" - @Preview(showBackground = true) @Preview(showSystemUi = true, device = Devices.TABLET) @Composable diff --git a/app/src/main/java/me/nasrabadiam/tictactoe/home/HomeScreen.kt b/app/src/main/java/me/nasrabadiam/tictactoe/home/HomeScreen.kt index fdbc198..54b93f0 100644 --- a/app/src/main/java/me/nasrabadiam/tictactoe/home/HomeScreen.kt +++ b/app/src/main/java/me/nasrabadiam/tictactoe/home/HomeScreen.kt @@ -3,13 +3,14 @@ package me.nasrabadiam.tictactoe.home 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.BoxWithConstraints import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.material.icons.Icons @@ -33,8 +34,11 @@ import androidx.compose.ui.tooling.preview.Devices import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.min import me.nasrabadiam.tictactoe.R import me.nasrabadiam.tictactoe.home.HomeEvent.PlayWithAFriend +import me.nasrabadiam.tictactoe.strings.appStrings +import me.nasrabadiam.tictactoe.strings.getAppStrings import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.COMPACT import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.EXPANDED @@ -120,7 +124,7 @@ private fun HorizontalHomeScreen( @Composable private fun AppLogo(modifier: Modifier = Modifier) { - Box( + BoxWithConstraints( modifier = modifier .semantics { contentDescription = "App Logo" } .padding(60.dp) @@ -128,10 +132,14 @@ private fun AppLogo(modifier: Modifier = Modifier) { .scale(1.5f) .background(MaterialTheme.colorScheme.primary) ) { + val minSize = min(maxHeight, maxWidth) * 4 / 5 + Image( - modifier = Modifier.semantics(mergeDescendants = true) {}, + modifier = Modifier + .size(minSize) + .semantics(mergeDescendants = true) {}, painter = painterResource(id = R.drawable.ic_launcher_foreground), - contentScale = ContentScale.FillWidth, + contentScale = ContentScale.Fit, colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onPrimary), contentDescription = null ) @@ -146,7 +154,7 @@ private fun GameButtons( ) { Button( modifier = modifier - .semantics { contentDescription = PLAY_WITH_A_FRIEND_TEXT } + .semantics { contentDescription = getAppStrings().playWithAFriend } .widthIn(220.dp), colors = ButtonDefaults.buttonColors().copy( contentColor = MaterialTheme.colorScheme.onPrimary, @@ -164,13 +172,16 @@ private fun GameButtons( ) Text( modifier = Modifier.padding(start = 8.dp), - text = PLAY_WITH_A_FRIEND_TEXT + text = appStrings.playWithAFriend ) } buttonsSpace() Button( modifier = modifier - .semantics { contentDescription = PLAY_SOLO_TEXT + COMING_SOON_TEXT } + .semantics { + val playSoloContentDesc = getAppStrings().playSolo + getAppStrings().comingSoon + contentDescription = playSoloContentDesc + } .widthIn(min = 220.dp), onClick = { TODO("Not Implemented yet!") }, enabled = false @@ -182,20 +193,16 @@ private fun GameButtons( ) Text( modifier = Modifier.padding(start = 8.dp), - text = PLAY_SOLO_TEXT + text = appStrings.playSolo ) Text( modifier = Modifier.padding(start = 2.dp), - text = COMING_SOON_TEXT, + text = appStrings.comingSoon, style = MaterialTheme.typography.labelSmall ) } } -private const val PLAY_SOLO_TEXT = "Play solo" -private const val COMING_SOON_TEXT = "(coming soon)" -private const val PLAY_WITH_A_FRIEND_TEXT = "Play with a friend" - @Preview(showBackground = true) @Preview(showSystemUi = true, device = Devices.TABLET) @Composable diff --git a/app/src/main/java/me/nasrabadiam/tictactoe/strings/AppStrings.kt b/app/src/main/java/me/nasrabadiam/tictactoe/strings/AppStrings.kt new file mode 100644 index 0000000..6c2cadf --- /dev/null +++ b/app/src/main/java/me/nasrabadiam/tictactoe/strings/AppStrings.kt @@ -0,0 +1,54 @@ +package me.nasrabadiam.tictactoe.strings + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.ProvidableCompositionLocal +import androidx.compose.runtime.staticCompositionLocalOf +import androidx.compose.ui.text.intl.Locale +import me.nasrabadiam.resources.LanguageTag +import me.nasrabadiam.resources.LayoutDirection +import me.nasrabadiam.resources.Locales +import me.nasrabadiam.resources.Lyricist +import me.nasrabadiam.resources.ProvideStrings +import me.nasrabadiam.resources.getName +import me.nasrabadiam.resources.rememberStrings + +internal val AppStrings: Map = mapOf( + Locales.EN.getName() to EnStrings, + Locales.FA.getName() to FaStrings, +) + +internal val AppStringsLayoutDirections: Map = mapOf( + Locales.EN.getName() to LayoutDirection.LTR, + Locales.FA.getName() to LayoutDirection.RTL, +) + +internal val LocalStrings: ProvidableCompositionLocal = + staticCompositionLocalOf { EnStrings } + +internal val appStrings: Strings + @Composable + get() = LocalStrings.current + +internal fun getAppStrings(locale: Locale = Locale.current): Strings { + return (AppStrings[locale.toLanguageTag()] ?: EnStrings) +} + +@Composable +internal fun rememberAppStrings( + defaultLanguageTag: LanguageTag = Locales.EN.getName(), + currentLanguageTag: LanguageTag = Locale.current.toLanguageTag(), +): Lyricist = + rememberStrings( + AppStrings, + AppStringsLayoutDirections, + defaultLanguageTag, + currentLanguageTag + ) + +@Composable +internal fun ProvideAppStrings( + lyricist: Lyricist = rememberAppStrings(), + content: @Composable () -> Unit +) { + ProvideStrings(lyricist, LocalStrings, content) +} \ No newline at end of file diff --git a/app/src/main/java/me/nasrabadiam/tictactoe/strings/EnStrings.kt b/app/src/main/java/me/nasrabadiam/tictactoe/strings/EnStrings.kt new file mode 100644 index 0000000..5b3a1ca --- /dev/null +++ b/app/src/main/java/me/nasrabadiam/tictactoe/strings/EnStrings.kt @@ -0,0 +1,9 @@ +package me.nasrabadiam.tictactoe.strings + +internal val EnStrings = Strings( + playSolo = "Play solo", + comingSoon = "(coming soon)", + playWithAFriend = "Play with a friend", + restart = "Restart", + gameRules = "Game Rules" +) \ No newline at end of file diff --git a/app/src/main/java/me/nasrabadiam/tictactoe/strings/FaStrings.kt b/app/src/main/java/me/nasrabadiam/tictactoe/strings/FaStrings.kt new file mode 100644 index 0000000..65d174d --- /dev/null +++ b/app/src/main/java/me/nasrabadiam/tictactoe/strings/FaStrings.kt @@ -0,0 +1,9 @@ +package me.nasrabadiam.tictactoe.strings + +internal val FaStrings = Strings( + playSolo = "بازی یک نفره", + comingSoon = "(به زودی)", + playWithAFriend = "بازی دو نفره", + restart = "شروع دوباره", + gameRules = "قوانین بازی " +) \ No newline at end of file diff --git a/app/src/main/java/me/nasrabadiam/tictactoe/strings/Strings.kt b/app/src/main/java/me/nasrabadiam/tictactoe/strings/Strings.kt new file mode 100644 index 0000000..9676fcd --- /dev/null +++ b/app/src/main/java/me/nasrabadiam/tictactoe/strings/Strings.kt @@ -0,0 +1,9 @@ +package me.nasrabadiam.tictactoe.strings + +internal data class Strings( + val playSolo: String, + val comingSoon: String, + val playWithAFriend: String, + val restart: String, + val gameRules: String, +) \ No newline at end of file diff --git a/app/src/main/java/me/nasrabadiam/tictactoe/ui/icon/IranFlag.kt b/app/src/main/java/me/nasrabadiam/tictactoe/ui/icon/IranFlag.kt new file mode 100644 index 0000000..bfb3a6d --- /dev/null +++ b/app/src/main/java/me/nasrabadiam/tictactoe/ui/icon/IranFlag.kt @@ -0,0 +1,1659 @@ +package me.nasrabadiam.tictactoe.ui.icon + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.width +import androidx.compose.material.icons.Icons +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.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import me.nasrabadiam.tictactoe.ui.theme.TicTacToeTheme + +val Icons.IranFlag: ImageVector + get() { + val current = _iranFlag + if (current != null) return current + + return ImageVector.Builder( + name = "com.nasrabadiam.tictactoe.IranFlag", + defaultWidth = 630.0.dp, + defaultHeight = 360.0.dp, + viewportWidth = 630.0f, + viewportHeight = 360.0f, + ).apply { + // M0 0 H630 V360 H0z + path( + fill = SolidColor(Color(0xFFDA0000)), + ) { + // M 0 0 + moveTo(x = 0.0f, y = 0.0f) + // H 630 + horizontalLineTo(x = 630.0f) + // V 360 + verticalLineTo(y = 360.0f) + // H 0z + horizontalLineTo(x = 0.0f) + close() + } + // M0 0 H630 V240 H0z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 0 0 + moveTo(x = 0.0f, y = 0.0f) + // H 630 + horizontalLineTo(x = 630.0f) + // V 240 + verticalLineTo(y = 240.0f) + // H 0z + horizontalLineTo(x = 0.0f) + close() + } + // M0 0 H630 V120 H0z + path( + fill = SolidColor(Color(0xFF239F40)), + ) { + // M 0 0 + moveTo(x = 0.0f, y = 0.0f) + // H 630 + horizontalLineTo(x = 630.0f) + // V 120 + verticalLineTo(y = 120.0f) + // H 0z + horizontalLineTo(x = 0.0f) + close() + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 8.4 101.8 + moveTo(x = 8.4f, y = 101.8f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 9.799999 114.4 + moveTo(x = 9.799999f, y = 114.4f) + // L 9.799999 107.4 + lineTo(x = 9.799999f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 32.199997 107.4 + lineTo(x = 32.199997f, y = 107.4f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 14 113 + moveTo(x = 14.0f, y = 113.0f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 37.8 107.4 + lineTo(x = 37.8f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 60.199997 100.4 + lineTo(x = 60.199997f, y = 100.4f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 8.4 120 + moveTo(x = 8.4f, y = 120.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 8.4 240 + moveTo(x = 8.4f, y = 240.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 8.4 247 + moveTo(x = 8.4f, y = 247.0f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 9.799999 259.6 + moveTo(x = 9.799999f, y = 259.6f) + // L 9.799999 252.6 + lineTo(x = 9.799999f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 32.199997 252.6 + lineTo(x = 32.199997f, y = 252.6f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 14 258.2 + moveTo(x = 14.0f, y = 258.2f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 37.8 252.6 + lineTo(x = 37.8f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 60.199997 245.6 + lineTo(x = 60.199997f, y = 245.6f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 64.4 101.8 + moveTo(x = 64.4f, y = 101.8f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 65.8 114.4 + moveTo(x = 65.8f, y = 114.4f) + // L 65.8 107.4 + lineTo(x = 65.8f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 88.2 107.4 + lineTo(x = 88.2f, y = 107.4f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 70 113 + moveTo(x = 70.0f, y = 113.0f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 93.8 107.4 + lineTo(x = 93.8f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 116.2 100.4 + lineTo(x = 116.2f, y = 100.4f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 64.4 120 + moveTo(x = 64.4f, y = 120.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 64.4 240 + moveTo(x = 64.4f, y = 240.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 64.4 247 + moveTo(x = 64.4f, y = 247.0f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 65.8 259.6 + moveTo(x = 65.8f, y = 259.6f) + // L 65.8 252.6 + lineTo(x = 65.8f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 88.2 252.6 + lineTo(x = 88.2f, y = 252.6f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 70 258.2 + moveTo(x = 70.0f, y = 258.2f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 93.8 252.6 + lineTo(x = 93.8f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 116.2 245.6 + lineTo(x = 116.2f, y = 245.6f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 120.4 101.8 + moveTo(x = 120.4f, y = 101.8f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 121.8 114.4 + moveTo(x = 121.8f, y = 114.4f) + // L 121.8 107.4 + lineTo(x = 121.8f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 144.2 107.4 + lineTo(x = 144.2f, y = 107.4f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 126 113 + moveTo(x = 126.0f, y = 113.0f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 149.8 107.4 + lineTo(x = 149.8f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 172.2 100.4 + lineTo(x = 172.2f, y = 100.4f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 120.4 120 + moveTo(x = 120.4f, y = 120.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 120.4 240 + moveTo(x = 120.4f, y = 240.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 120.4 247 + moveTo(x = 120.4f, y = 247.0f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 121.8 259.6 + moveTo(x = 121.8f, y = 259.6f) + // L 121.8 252.6 + lineTo(x = 121.8f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 144.2 252.6 + lineTo(x = 144.2f, y = 252.6f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 126 258.2 + moveTo(x = 126.0f, y = 258.2f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 149.8 252.6 + lineTo(x = 149.8f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 172.2 245.6 + lineTo(x = 172.2f, y = 245.6f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 176.4 101.8 + moveTo(x = 176.4f, y = 101.8f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 177.79999 114.4 + moveTo(x = 177.79999f, y = 114.4f) + // L 177.79999 107.4 + lineTo(x = 177.79999f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 200.2 107.4 + lineTo(x = 200.2f, y = 107.4f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 182 113 + moveTo(x = 182.0f, y = 113.0f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 205.79999 107.4 + lineTo(x = 205.79999f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 228.2 100.4 + lineTo(x = 228.2f, y = 100.4f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 176.4 120 + moveTo(x = 176.4f, y = 120.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 176.4 240 + moveTo(x = 176.4f, y = 240.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 176.4 247 + moveTo(x = 176.4f, y = 247.0f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 177.79999 259.6 + moveTo(x = 177.79999f, y = 259.6f) + // L 177.79999 252.6 + lineTo(x = 177.79999f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 200.2 252.6 + lineTo(x = 200.2f, y = 252.6f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 182 258.2 + moveTo(x = 182.0f, y = 258.2f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 205.79999 252.6 + lineTo(x = 205.79999f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 228.2 245.6 + lineTo(x = 228.2f, y = 245.6f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 232.4 101.8 + moveTo(x = 232.4f, y = 101.8f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 233.79999 114.4 + moveTo(x = 233.79999f, y = 114.4f) + // L 233.79999 107.4 + lineTo(x = 233.79999f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 256.19998 107.4 + lineTo(x = 256.19998f, y = 107.4f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 238 113 + moveTo(x = 238.0f, y = 113.0f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 261.8 107.4 + lineTo(x = 261.8f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 284.19998 100.4 + lineTo(x = 284.19998f, y = 100.4f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 232.4 120 + moveTo(x = 232.4f, y = 120.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 232.4 240 + moveTo(x = 232.4f, y = 240.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 232.4 247 + moveTo(x = 232.4f, y = 247.0f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 233.79999 259.6 + moveTo(x = 233.79999f, y = 259.6f) + // L 233.79999 252.6 + lineTo(x = 233.79999f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 256.19998 252.6 + lineTo(x = 256.19998f, y = 252.6f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 238 258.2 + moveTo(x = 238.0f, y = 258.2f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 261.8 252.6 + lineTo(x = 261.8f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 284.19998 245.6 + lineTo(x = 284.19998f, y = 245.6f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 288.4 101.8 + moveTo(x = 288.4f, y = 101.8f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 289.8 114.4 + moveTo(x = 289.8f, y = 114.4f) + // L 289.8 107.4 + lineTo(x = 289.8f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 312.19998 107.4 + lineTo(x = 312.19998f, y = 107.4f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 294 113 + moveTo(x = 294.0f, y = 113.0f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 317.8 107.4 + lineTo(x = 317.8f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 340.19998 100.4 + lineTo(x = 340.19998f, y = 100.4f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 288.4 120 + moveTo(x = 288.4f, y = 120.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 288.4 240 + moveTo(x = 288.4f, y = 240.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 288.4 247 + moveTo(x = 288.4f, y = 247.0f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 289.8 259.6 + moveTo(x = 289.8f, y = 259.6f) + // L 289.8 252.6 + lineTo(x = 289.8f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 312.19998 252.6 + lineTo(x = 312.19998f, y = 252.6f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 294 258.2 + moveTo(x = 294.0f, y = 258.2f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 317.8 252.6 + lineTo(x = 317.8f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 340.19998 245.6 + lineTo(x = 340.19998f, y = 245.6f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 344.4 101.8 + moveTo(x = 344.4f, y = 101.8f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 345.8 114.4 + moveTo(x = 345.8f, y = 114.4f) + // L 345.8 107.4 + lineTo(x = 345.8f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 368.19998 107.4 + lineTo(x = 368.19998f, y = 107.4f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 350 113 + moveTo(x = 350.0f, y = 113.0f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 373.8 107.4 + lineTo(x = 373.8f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 396.19998 100.4 + lineTo(x = 396.19998f, y = 100.4f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 344.4 120 + moveTo(x = 344.4f, y = 120.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 344.4 240 + moveTo(x = 344.4f, y = 240.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 344.4 247 + moveTo(x = 344.4f, y = 247.0f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 345.8 259.6 + moveTo(x = 345.8f, y = 259.6f) + // L 345.8 252.6 + lineTo(x = 345.8f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 368.19998 252.6 + lineTo(x = 368.19998f, y = 252.6f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 350 258.2 + moveTo(x = 350.0f, y = 258.2f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 373.8 252.6 + lineTo(x = 373.8f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 396.19998 245.6 + lineTo(x = 396.19998f, y = 245.6f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 400.4 101.8 + moveTo(x = 400.4f, y = 101.8f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 401.8 114.4 + moveTo(x = 401.8f, y = 114.4f) + // L 401.8 107.4 + lineTo(x = 401.8f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 424.19998 107.4 + lineTo(x = 424.19998f, y = 107.4f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 406 113 + moveTo(x = 406.0f, y = 113.0f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 429.8 107.4 + lineTo(x = 429.8f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 452.19998 100.4 + lineTo(x = 452.19998f, y = 100.4f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 400.4 120 + moveTo(x = 400.4f, y = 120.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 400.4 240 + moveTo(x = 400.4f, y = 240.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 400.4 247 + moveTo(x = 400.4f, y = 247.0f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 401.8 259.6 + moveTo(x = 401.8f, y = 259.6f) + // L 401.8 252.6 + lineTo(x = 401.8f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 424.19998 252.6 + lineTo(x = 424.19998f, y = 252.6f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 406 258.2 + moveTo(x = 406.0f, y = 258.2f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 429.8 252.6 + lineTo(x = 429.8f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 452.19998 245.6 + lineTo(x = 452.19998f, y = 245.6f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 456.4 101.8 + moveTo(x = 456.4f, y = 101.8f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 457.8 114.4 + moveTo(x = 457.8f, y = 114.4f) + // L 457.8 107.4 + lineTo(x = 457.8f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 480.19998 107.4 + lineTo(x = 480.19998f, y = 107.4f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 462 113 + moveTo(x = 462.0f, y = 113.0f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 485.8 107.4 + lineTo(x = 485.8f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 508.19998 100.4 + lineTo(x = 508.19998f, y = 100.4f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 456.4 120 + moveTo(x = 456.4f, y = 120.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 456.4 240 + moveTo(x = 456.4f, y = 240.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 456.4 247 + moveTo(x = 456.4f, y = 247.0f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 457.8 259.6 + moveTo(x = 457.8f, y = 259.6f) + // L 457.8 252.6 + lineTo(x = 457.8f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 480.19998 252.6 + lineTo(x = 480.19998f, y = 252.6f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 462 258.2 + moveTo(x = 462.0f, y = 258.2f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 485.8 252.6 + lineTo(x = 485.8f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 508.19998 245.6 + lineTo(x = 508.19998f, y = 245.6f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 512.4 101.8 + moveTo(x = 512.4f, y = 101.8f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 513.80005 114.4 + moveTo(x = 513.80005f, y = 114.4f) + // L 513.80005 107.4 + lineTo(x = 513.80005f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 536.2 107.4 + lineTo(x = 536.2f, y = 107.4f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 518 113 + moveTo(x = 518.0f, y = 113.0f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 541.80005 107.4 + lineTo(x = 541.80005f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 564.2 100.4 + lineTo(x = 564.2f, y = 100.4f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 512.4 120 + moveTo(x = 512.4f, y = 120.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 512.4 240 + moveTo(x = 512.4f, y = 240.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 512.4 247 + moveTo(x = 512.4f, y = 247.0f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 513.80005 259.6 + moveTo(x = 513.80005f, y = 259.6f) + // L 513.80005 252.6 + lineTo(x = 513.80005f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 536.2 252.6 + lineTo(x = 536.2f, y = 252.6f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 518 258.2 + moveTo(x = 518.0f, y = 258.2f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 541.80005 252.6 + lineTo(x = 541.80005f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 564.2 245.6 + lineTo(x = 564.2f, y = 245.6f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 568.4 101.8 + moveTo(x = 568.4f, y = 101.8f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 569.80005 114.4 + moveTo(x = 569.80005f, y = 114.4f) + // L 569.80005 107.4 + lineTo(x = 569.80005f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 592.2 107.4 + lineTo(x = 592.2f, y = 107.4f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 574 113 + moveTo(x = 574.0f, y = 113.0f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 597.80005 107.4 + lineTo(x = 597.80005f, y = 107.4f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 620.2 100.4 + lineTo(x = 620.2f, y = 100.4f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 568.4 120 + moveTo(x = 568.4f, y = 120.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 7 h9 m1 0 h9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 568.4 240 + moveTo(x = 568.4f, y = 240.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + // m 2.8 0 + moveToRelative(dx = 2.8f, dy = 0.0f) + // l 25.199999 0 + lineToRelative(dx = 25.199999f, dy = 0.0f) + } + // M0 1 h26 M1 10 V5 h8 v4 h8 V5 h-5 M4 9 h2 m20 0 h-5 V5 h8 m0 -5 v9 h8 V0 m-4 0 v9 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 2.0f, + ) { + // M 568.4 247 + moveTo(x = 568.4f, y = 247.0f) + // l 36.399998 0 + lineToRelative(dx = 36.399998f, dy = 0.0f) + // M 569.80005 259.6 + moveTo(x = 569.80005f, y = 259.6f) + // L 569.80005 252.6 + lineTo(x = 569.80005f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // l 0 5.6 + lineToRelative(dx = 0.0f, dy = 5.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 592.2 252.6 + lineTo(x = 592.2f, y = 252.6f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // M 574 258.2 + moveTo(x = 574.0f, y = 258.2f) + // l 2.8 0 + lineToRelative(dx = 2.8f, dy = 0.0f) + // m 28 0 + moveToRelative(dx = 28.0f, dy = 0.0f) + // l -7 0 + lineToRelative(dx = -7.0f, dy = 0.0f) + // L 597.80005 252.6 + lineTo(x = 597.80005f, y = 252.6f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // m 0 -7 + moveToRelative(dx = 0.0f, dy = -7.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + // l 11.2 0 + lineToRelative(dx = 11.2f, dy = 0.0f) + // L 620.2 245.6 + lineTo(x = 620.2f, y = 245.6f) + // m -5.6 0 + moveToRelative(dx = -5.6f, dy = 0.0f) + // l 0 12.599999 + lineToRelative(dx = 0.0f, dy = 12.599999f) + } + // M-.55 .84 a.91 .91 0 0 0 .88 -1.56 1 1 0 0 1 -.88 1.56 + path( + fill = SolidColor(Color(0xFFDA0000)), + ) { + // M 290.25 217.8 + moveTo(x = 290.25f, y = 217.8f) + // a 40.95 40.95 0 0 0 39.6 -70.2 + arcToRelative( + a = 40.95f, + b = 40.95f, + theta = 0.0f, + isMoreThanHalf = false, + isPositiveArc = false, + dx1 = 39.6f, + dy1 = -70.2f, + ) + // a 45 45 0 0 1 -39.6 70.2 + arcToRelative( + a = 45.0f, + b = 45.0f, + theta = 0.0f, + isMoreThanHalf = false, + isPositiveArc = true, + dx1 = -39.6f, + dy1 = 70.2f, + ) + } + // M.62 .66 a.76 .76 0 0 0 -.2 -1.4 1 1 0 0 1 .2 1.4 M0 1 l-.05 -1 L0 -.79 a.3 .3 0 0 0 .12 .1 v.59 l-.04 1z m-.02 -1.85 L0 -.83 a.14 .14 0 0 0 .25 -.14 A.14 .14 0 0 1 0 -.92 + path( + fill = SolidColor(Color(0xFFDA0000)), + ) { + // M 342.9 209.7 + moveTo(x = 342.9f, y = 209.7f) + // a 34.2 34.2 0 0 0 -9 -63 + arcToRelative( + a = 34.2f, + b = 34.2f, + theta = 0.0f, + isMoreThanHalf = false, + isPositiveArc = false, + dx1 = -9.0f, + dy1 = -63.0f, + ) + // a 45 45 0 0 1 9 63 + arcToRelative( + a = 45.0f, + b = 45.0f, + theta = 0.0f, + isMoreThanHalf = false, + isPositiveArc = true, + dx1 = 9.0f, + dy1 = 63.0f, + ) + // M 315 225 + moveTo(x = 315.0f, y = 225.0f) + // l -2.25 -45 + lineToRelative(dx = -2.25f, dy = -45.0f) + // L 315 144.45 + lineTo(x = 315.0f, y = 144.45f) + // a 13.500001 13.500001 0 0 0 5.4 4.5 + arcToRelative( + a = 13.500001f, + b = 13.500001f, + theta = 0.0f, + isMoreThanHalf = false, + isPositiveArc = false, + dx1 = 5.4f, + dy1 = 4.5f, + ) + // l 0 26.55 + lineToRelative(dx = 0.0f, dy = 26.55f) + // l -1.8 45z + lineToRelative(dx = -1.8f, dy = 45.0f) + close() + // m -0.9 -83.25 + moveToRelative(dx = -0.9f, dy = -83.25f) + // L 315 142.65 + lineTo(x = 315.0f, y = 142.65f) + // a 6.4469476 6.4469476 0 0 0 11.25 -6.3 + arcToRelative( + a = 6.4469476f, + b = 6.4469476f, + theta = 0.0f, + isMoreThanHalf = false, + isPositiveArc = false, + dx1 = 11.25f, + dy1 = -6.3f, + ) + // A 6.3 6.3 0 0 1 315 138.6 + arcTo( + horizontalEllipseRadius = 6.3f, + verticalEllipseRadius = 6.3f, + theta = 0.0f, + isMoreThanHalf = false, + isPositiveArc = true, + x1 = 315.0f, + y1 = 138.6f, + ) + } + // M-.55 .84 a.91 .91 0 0 0 .88 -1.56 1 1 0 0 1 -.88 1.56 + path( + fill = SolidColor(Color(0xFFDA0000)), + ) { + // M 339.75 217.8 + moveTo(x = 339.75f, y = 217.8f) + // a 40.95 40.95 0 0 1 -39.6 -70.2 + arcToRelative( + a = 40.95f, + b = 40.95f, + theta = 0.0f, + isMoreThanHalf = false, + isPositiveArc = true, + dx1 = -39.6f, + dy1 = -70.2f, + ) + // a 45 45 0 0 0 39.6 70.2 + arcToRelative( + a = 45.0f, + b = 45.0f, + theta = 0.0f, + isMoreThanHalf = false, + isPositiveArc = false, + dx1 = 39.6f, + dy1 = 70.2f, + ) + } + // M.62 .66 a.76 .76 0 0 0 -.2 -1.4 1 1 0 0 1 .2 1.4 M0 1 l-.05 -1 L0 -.79 a.3 .3 0 0 0 .12 .1 v.59 l-.04 1z m-.02 -1.85 L0 -.83 a.14 .14 0 0 0 .25 -.14 A.14 .14 0 0 1 0 -.92 + path( + fill = SolidColor(Color(0xFFDA0000)), + ) { + // M 287.1 209.7 + moveTo(x = 287.1f, y = 209.7f) + // a 34.2 34.2 0 0 1 9 -63 + arcToRelative( + a = 34.2f, + b = 34.2f, + theta = 0.0f, + isMoreThanHalf = false, + isPositiveArc = true, + dx1 = 9.0f, + dy1 = -63.0f, + ) + // a 45 45 0 0 0 -9 63 + arcToRelative( + a = 45.0f, + b = 45.0f, + theta = 0.0f, + isMoreThanHalf = false, + isPositiveArc = false, + dx1 = -9.0f, + dy1 = 63.0f, + ) + // M 315 225 + moveTo(x = 315.0f, y = 225.0f) + // l 2.25 -45 + lineToRelative(dx = 2.25f, dy = -45.0f) + // L 315 144.45 + lineTo(x = 315.0f, y = 144.45f) + // a 13.500001 13.500001 0 0 1 -5.4 4.5 + arcToRelative( + a = 13.500001f, + b = 13.500001f, + theta = 0.0f, + isMoreThanHalf = false, + isPositiveArc = true, + dx1 = -5.4f, + dy1 = 4.5f, + ) + // l 0 26.55 + lineToRelative(dx = 0.0f, dy = 26.55f) + // l 1.8 45z + lineToRelative(dx = 1.8f, dy = 45.0f) + close() + // m 0.9 -83.25 + moveToRelative(dx = 0.9f, dy = -83.25f) + // L 315 142.65 + lineTo(x = 315.0f, y = 142.65f) + // a 6.4469476 6.4469476 0 0 1 -11.25 -6.3 + arcToRelative( + a = 6.4469476f, + b = 6.4469476f, + theta = 0.0f, + isMoreThanHalf = false, + isPositiveArc = true, + dx1 = -11.25f, + dy1 = -6.3f, + ) + // A 6.3 6.3 0 0 0 315 138.6 + arcTo( + horizontalEllipseRadius = 6.3f, + verticalEllipseRadius = 6.3f, + theta = 0.0f, + isMoreThanHalf = false, + isPositiveArc = false, + x1 = 315.0f, + y1 = 138.6f, + ) + } + }.build().also { _iranFlag = it } + } + +@Preview +@Composable +private fun IconPreview() { + TicTacToeTheme { + Column( + verticalArrangement = Arrangement.spacedBy(8.dp), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Image( + imageVector = Icons.IranFlag, + contentDescription = null, + modifier = Modifier + .width((630.0).dp) + .height((360.0).dp), + ) + } + } +} + +@Suppress("ObjectPropertyName") +private var _iranFlag: ImageVector? = null diff --git a/app/src/main/java/me/nasrabadiam/tictactoe/ui/icon/USFlag.kt b/app/src/main/java/me/nasrabadiam/tictactoe/ui/icon/USFlag.kt new file mode 100644 index 0000000..0c8138f --- /dev/null +++ b/app/src/main/java/me/nasrabadiam/tictactoe/ui/icon/USFlag.kt @@ -0,0 +1,913 @@ +package me.nasrabadiam.tictactoe.ui.icon + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.width +import androidx.compose.material.icons.Icons +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.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import me.nasrabadiam.tictactoe.ui.theme.TicTacToeTheme + +val Icons.USFlag: ImageVector + get() { + val current = _usFlag + if (current != null) return current + + return ImageVector.Builder( + name = "com.nasrabadiam.tictactoe.USFlag", + defaultWidth = 1235.0.dp, + defaultHeight = 650.0.dp, + viewportWidth = 7410.0f, + viewportHeight = 3900.0f, + ).apply { + // + path( + fill = SolidColor(Color(0xFFB22234)), + ) { + // M 0 0 + moveTo(x = 0.0f, y = 0.0f) + // h 7410 + horizontalLineToRelative(dx = 7410.0f) + // v 3900 + verticalLineToRelative(dy = 3900.0f) + // h -7410z + horizontalLineToRelative(dx = -7410.0f) + close() + } + // M0 450 H7410 m0 600 H0 m0 600 H7410 m0 600 H0 m0 600 H7410 m0 600 H0 + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 300.0f, + ) { + // M 0 450 + moveTo(x = 0.0f, y = 450.0f) + // H 7410 + horizontalLineTo(x = 7410.0f) + // m 0 600 + moveToRelative(dx = 0.0f, dy = 600.0f) + // H 0 + horizontalLineTo(x = 0.0f) + // m 0 600 + moveToRelative(dx = 0.0f, dy = 600.0f) + // H 7410 + horizontalLineTo(x = 7410.0f) + // m 0 600 + moveToRelative(dx = 0.0f, dy = 600.0f) + // H 0 + horizontalLineTo(x = 0.0f) + // m 0 600 + moveToRelative(dx = 0.0f, dy = 600.0f) + // H 7410 + horizontalLineTo(x = 7410.0f) + // m 0 600 + moveToRelative(dx = 0.0f, dy = 600.0f) + // H 0 + horizontalLineTo(x = 0.0f) + } + // + path( + fill = SolidColor(Color(0xFF3C3B6E)), + ) { + // M 0 0 + moveTo(x = 0.0f, y = 0.0f) + // h 2964 + horizontalLineToRelative(dx = 2964.0f) + // v 2100 + verticalLineToRelative(dy = 2100.0f) + // h -2964z + horizontalLineToRelative(dx = -2964.0f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 247 90 + moveTo(x = 247.0f, y = 90.0f) + // L 317.53424 307.08203 + lineTo(x = 317.53424f, y = 307.08203f) + // L 132.87321 172.91795 + lineTo(x = 132.87321f, y = 172.91795f) + // H 361.12677 + horizontalLineTo(x = 361.12677f) + // L 176.46577 307.08203z + lineTo(x = 176.46577f, y = 307.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 247 510 + moveTo(x = 247.0f, y = 510.0f) + // L 317.53424 727.08203 + lineTo(x = 317.53424f, y = 727.08203f) + // L 132.87321 592.91797 + lineTo(x = 132.87321f, y = 592.91797f) + // L 361.12677 592.91797 + lineTo(x = 361.12677f, y = 592.91797f) + // L 176.46577 727.08203z + lineTo(x = 176.46577f, y = 727.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 247 930 + moveTo(x = 247.0f, y = 930.0f) + // L 317.53424 1147.082 + lineTo(x = 317.53424f, y = 1147.082f) + // L 132.87321 1012.91797 + lineTo(x = 132.87321f, y = 1012.91797f) + // L 361.12677 1012.91797 + lineTo(x = 361.12677f, y = 1012.91797f) + // L 176.46577 1147.082z + lineTo(x = 176.46577f, y = 1147.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 247 1350 + moveTo(x = 247.0f, y = 1350.0f) + // L 317.53424 1567.082 + lineTo(x = 317.53424f, y = 1567.082f) + // L 132.87321 1432.918 + lineTo(x = 132.87321f, y = 1432.918f) + // L 361.12677 1432.918 + lineTo(x = 361.12677f, y = 1432.918f) + // L 176.46577 1567.082z + lineTo(x = 176.46577f, y = 1567.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 247 1770 + moveTo(x = 247.0f, y = 1770.0f) + // L 317.53424 1987.082 + lineTo(x = 317.53424f, y = 1987.082f) + // L 132.87321 1852.918 + lineTo(x = 132.87321f, y = 1852.918f) + // L 361.12677 1852.918 + lineTo(x = 361.12677f, y = 1852.918f) + // L 176.46577 1987.082z + lineTo(x = 176.46577f, y = 1987.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 494 300 + moveTo(x = 494.0f, y = 300.0f) + // L 564.53424 517.08203 + lineTo(x = 564.53424f, y = 517.08203f) + // L 379.87323 382.91797 + lineTo(x = 379.87323f, y = 382.91797f) + // L 608.1268 382.91797 + lineTo(x = 608.1268f, y = 382.91797f) + // L 423.46576 517.08203z + lineTo(x = 423.46576f, y = 517.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 494 720 + moveTo(x = 494.0f, y = 720.0f) + // L 564.53424 937.08203 + lineTo(x = 564.53424f, y = 937.08203f) + // L 379.87323 802.91797 + lineTo(x = 379.87323f, y = 802.91797f) + // L 608.1268 802.91797 + lineTo(x = 608.1268f, y = 802.91797f) + // L 423.46576 937.08203z + lineTo(x = 423.46576f, y = 937.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 494 1140 + moveTo(x = 494.0f, y = 1140.0f) + // L 564.53424 1357.082 + lineTo(x = 564.53424f, y = 1357.082f) + // L 379.87323 1222.918 + lineTo(x = 379.87323f, y = 1222.918f) + // L 608.1268 1222.918 + lineTo(x = 608.1268f, y = 1222.918f) + // L 423.46576 1357.082z + lineTo(x = 423.46576f, y = 1357.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 494 1560 + moveTo(x = 494.0f, y = 1560.0f) + // L 564.53424 1777.082 + lineTo(x = 564.53424f, y = 1777.082f) + // L 379.87323 1642.918 + lineTo(x = 379.87323f, y = 1642.918f) + // L 608.1268 1642.918 + lineTo(x = 608.1268f, y = 1642.918f) + // L 423.46576 1777.082z + lineTo(x = 423.46576f, y = 1777.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 741 90 + moveTo(x = 741.0f, y = 90.0f) + // L 811.53424 307.08203 + lineTo(x = 811.53424f, y = 307.08203f) + // L 626.8732 172.91795 + lineTo(x = 626.8732f, y = 172.91795f) + // L 855.1268 172.91795 + lineTo(x = 855.1268f, y = 172.91795f) + // L 670.46576 307.08203z + lineTo(x = 670.46576f, y = 307.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 741 510 + moveTo(x = 741.0f, y = 510.0f) + // L 811.53424 727.08203 + lineTo(x = 811.53424f, y = 727.08203f) + // L 626.8732 592.91797 + lineTo(x = 626.8732f, y = 592.91797f) + // L 855.1268 592.91797 + lineTo(x = 855.1268f, y = 592.91797f) + // L 670.46576 727.08203z + lineTo(x = 670.46576f, y = 727.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 741 930 + moveTo(x = 741.0f, y = 930.0f) + // L 811.53424 1147.082 + lineTo(x = 811.53424f, y = 1147.082f) + // L 626.8732 1012.91797 + lineTo(x = 626.8732f, y = 1012.91797f) + // L 855.1268 1012.91797 + lineTo(x = 855.1268f, y = 1012.91797f) + // L 670.46576 1147.082z + lineTo(x = 670.46576f, y = 1147.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 741 1350 + moveTo(x = 741.0f, y = 1350.0f) + // L 811.53424 1567.082 + lineTo(x = 811.53424f, y = 1567.082f) + // L 626.8732 1432.918 + lineTo(x = 626.8732f, y = 1432.918f) + // L 855.1268 1432.918 + lineTo(x = 855.1268f, y = 1432.918f) + // L 670.46576 1567.082z + lineTo(x = 670.46576f, y = 1567.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 741 1770 + moveTo(x = 741.0f, y = 1770.0f) + // L 811.53424 1987.082 + lineTo(x = 811.53424f, y = 1987.082f) + // L 626.8732 1852.918 + lineTo(x = 626.8732f, y = 1852.918f) + // L 855.1268 1852.918 + lineTo(x = 855.1268f, y = 1852.918f) + // L 670.46576 1987.082z + lineTo(x = 670.46576f, y = 1987.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 988 300 + moveTo(x = 988.0f, y = 300.0f) + // L 1058.5342 517.08203 + lineTo(x = 1058.5342f, y = 517.08203f) + // L 873.8732 382.91797 + lineTo(x = 873.8732f, y = 382.91797f) + // L 1102.1267 382.91797 + lineTo(x = 1102.1267f, y = 382.91797f) + // L 917.46576 517.08203z + lineTo(x = 917.46576f, y = 517.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 988 720 + moveTo(x = 988.0f, y = 720.0f) + // L 1058.5342 937.08203 + lineTo(x = 1058.5342f, y = 937.08203f) + // L 873.8732 802.91797 + lineTo(x = 873.8732f, y = 802.91797f) + // L 1102.1267 802.91797 + lineTo(x = 1102.1267f, y = 802.91797f) + // L 917.46576 937.08203z + lineTo(x = 917.46576f, y = 937.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 988 1140 + moveTo(x = 988.0f, y = 1140.0f) + // L 1058.5342 1357.082 + lineTo(x = 1058.5342f, y = 1357.082f) + // L 873.8732 1222.918 + lineTo(x = 873.8732f, y = 1222.918f) + // L 1102.1267 1222.918 + lineTo(x = 1102.1267f, y = 1222.918f) + // L 917.46576 1357.082z + lineTo(x = 917.46576f, y = 1357.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 988 1560 + moveTo(x = 988.0f, y = 1560.0f) + // L 1058.5342 1777.082 + lineTo(x = 1058.5342f, y = 1777.082f) + // L 873.8732 1642.918 + lineTo(x = 873.8732f, y = 1642.918f) + // L 1102.1267 1642.918 + lineTo(x = 1102.1267f, y = 1642.918f) + // L 917.46576 1777.082z + lineTo(x = 917.46576f, y = 1777.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1235 90 + moveTo(x = 1235.0f, y = 90.0f) + // L 1305.5342 307.08203 + lineTo(x = 1305.5342f, y = 307.08203f) + // L 1120.8732 172.91795 + lineTo(x = 1120.8732f, y = 172.91795f) + // L 1349.1267 172.91795 + lineTo(x = 1349.1267f, y = 172.91795f) + // L 1164.4658 307.08203z + lineTo(x = 1164.4658f, y = 307.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1235 510 + moveTo(x = 1235.0f, y = 510.0f) + // L 1305.5342 727.08203 + lineTo(x = 1305.5342f, y = 727.08203f) + // L 1120.8732 592.91797 + lineTo(x = 1120.8732f, y = 592.91797f) + // L 1349.1267 592.91797 + lineTo(x = 1349.1267f, y = 592.91797f) + // L 1164.4658 727.08203z + lineTo(x = 1164.4658f, y = 727.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1235 930 + moveTo(x = 1235.0f, y = 930.0f) + // L 1305.5342 1147.082 + lineTo(x = 1305.5342f, y = 1147.082f) + // L 1120.8732 1012.91797 + lineTo(x = 1120.8732f, y = 1012.91797f) + // L 1349.1267 1012.91797 + lineTo(x = 1349.1267f, y = 1012.91797f) + // L 1164.4658 1147.082z + lineTo(x = 1164.4658f, y = 1147.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1235 1350 + moveTo(x = 1235.0f, y = 1350.0f) + // L 1305.5342 1567.082 + lineTo(x = 1305.5342f, y = 1567.082f) + // L 1120.8732 1432.918 + lineTo(x = 1120.8732f, y = 1432.918f) + // L 1349.1267 1432.918 + lineTo(x = 1349.1267f, y = 1432.918f) + // L 1164.4658 1567.082z + lineTo(x = 1164.4658f, y = 1567.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1235 1770 + moveTo(x = 1235.0f, y = 1770.0f) + // L 1305.5342 1987.082 + lineTo(x = 1305.5342f, y = 1987.082f) + // L 1120.8732 1852.918 + lineTo(x = 1120.8732f, y = 1852.918f) + // L 1349.1267 1852.918 + lineTo(x = 1349.1267f, y = 1852.918f) + // L 1164.4658 1987.082z + lineTo(x = 1164.4658f, y = 1987.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1482 300 + moveTo(x = 1482.0f, y = 300.0f) + // L 1552.5342 517.08203 + lineTo(x = 1552.5342f, y = 517.08203f) + // L 1367.8732 382.91797 + lineTo(x = 1367.8732f, y = 382.91797f) + // L 1596.1267 382.91797 + lineTo(x = 1596.1267f, y = 382.91797f) + // L 1411.4658 517.08203z + lineTo(x = 1411.4658f, y = 517.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1482 720 + moveTo(x = 1482.0f, y = 720.0f) + // L 1552.5342 937.08203 + lineTo(x = 1552.5342f, y = 937.08203f) + // L 1367.8732 802.91797 + lineTo(x = 1367.8732f, y = 802.91797f) + // L 1596.1267 802.91797 + lineTo(x = 1596.1267f, y = 802.91797f) + // L 1411.4658 937.08203z + lineTo(x = 1411.4658f, y = 937.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1482 1140 + moveTo(x = 1482.0f, y = 1140.0f) + // L 1552.5342 1357.082 + lineTo(x = 1552.5342f, y = 1357.082f) + // L 1367.8732 1222.918 + lineTo(x = 1367.8732f, y = 1222.918f) + // L 1596.1267 1222.918 + lineTo(x = 1596.1267f, y = 1222.918f) + // L 1411.4658 1357.082z + lineTo(x = 1411.4658f, y = 1357.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1482 1560 + moveTo(x = 1482.0f, y = 1560.0f) + // L 1552.5342 1777.082 + lineTo(x = 1552.5342f, y = 1777.082f) + // L 1367.8732 1642.918 + lineTo(x = 1367.8732f, y = 1642.918f) + // L 1596.1267 1642.918 + lineTo(x = 1596.1267f, y = 1642.918f) + // L 1411.4658 1777.082z + lineTo(x = 1411.4658f, y = 1777.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1729 90 + moveTo(x = 1729.0f, y = 90.0f) + // L 1799.5342 307.08203 + lineTo(x = 1799.5342f, y = 307.08203f) + // L 1614.8732 172.91795 + lineTo(x = 1614.8732f, y = 172.91795f) + // L 1843.1267 172.91795 + lineTo(x = 1843.1267f, y = 172.91795f) + // L 1658.4658 307.08203z + lineTo(x = 1658.4658f, y = 307.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1729 510 + moveTo(x = 1729.0f, y = 510.0f) + // L 1799.5342 727.08203 + lineTo(x = 1799.5342f, y = 727.08203f) + // L 1614.8732 592.91797 + lineTo(x = 1614.8732f, y = 592.91797f) + // L 1843.1267 592.91797 + lineTo(x = 1843.1267f, y = 592.91797f) + // L 1658.4658 727.08203z + lineTo(x = 1658.4658f, y = 727.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1729 930 + moveTo(x = 1729.0f, y = 930.0f) + // L 1799.5342 1147.082 + lineTo(x = 1799.5342f, y = 1147.082f) + // L 1614.8732 1012.91797 + lineTo(x = 1614.8732f, y = 1012.91797f) + // L 1843.1267 1012.91797 + lineTo(x = 1843.1267f, y = 1012.91797f) + // L 1658.4658 1147.082z + lineTo(x = 1658.4658f, y = 1147.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1729 1350 + moveTo(x = 1729.0f, y = 1350.0f) + // L 1799.5342 1567.082 + lineTo(x = 1799.5342f, y = 1567.082f) + // L 1614.8732 1432.918 + lineTo(x = 1614.8732f, y = 1432.918f) + // L 1843.1267 1432.918 + lineTo(x = 1843.1267f, y = 1432.918f) + // L 1658.4658 1567.082z + lineTo(x = 1658.4658f, y = 1567.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1729 1770 + moveTo(x = 1729.0f, y = 1770.0f) + // L 1799.5342 1987.082 + lineTo(x = 1799.5342f, y = 1987.082f) + // L 1614.8732 1852.918 + lineTo(x = 1614.8732f, y = 1852.918f) + // L 1843.1267 1852.918 + lineTo(x = 1843.1267f, y = 1852.918f) + // L 1658.4658 1987.082z + lineTo(x = 1658.4658f, y = 1987.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1976 300 + moveTo(x = 1976.0f, y = 300.0f) + // L 2046.5342 517.08203 + lineTo(x = 2046.5342f, y = 517.08203f) + // L 1861.8732 382.91797 + lineTo(x = 1861.8732f, y = 382.91797f) + // L 2090.1267 382.91797 + lineTo(x = 2090.1267f, y = 382.91797f) + // L 1905.4658 517.08203z + lineTo(x = 1905.4658f, y = 517.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1976 720 + moveTo(x = 1976.0f, y = 720.0f) + // L 2046.5342 937.08203 + lineTo(x = 2046.5342f, y = 937.08203f) + // L 1861.8732 802.91797 + lineTo(x = 1861.8732f, y = 802.91797f) + // L 2090.1267 802.91797 + lineTo(x = 2090.1267f, y = 802.91797f) + // L 1905.4658 937.08203z + lineTo(x = 1905.4658f, y = 937.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1976 1140 + moveTo(x = 1976.0f, y = 1140.0f) + // L 2046.5342 1357.082 + lineTo(x = 2046.5342f, y = 1357.082f) + // L 1861.8732 1222.918 + lineTo(x = 1861.8732f, y = 1222.918f) + // L 2090.1267 1222.918 + lineTo(x = 2090.1267f, y = 1222.918f) + // L 1905.4658 1357.082z + lineTo(x = 1905.4658f, y = 1357.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 1976 1560 + moveTo(x = 1976.0f, y = 1560.0f) + // L 2046.5342 1777.082 + lineTo(x = 2046.5342f, y = 1777.082f) + // L 1861.8732 1642.918 + lineTo(x = 1861.8732f, y = 1642.918f) + // L 2090.1267 1642.918 + lineTo(x = 2090.1267f, y = 1642.918f) + // L 1905.4658 1777.082z + lineTo(x = 1905.4658f, y = 1777.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 2223 90 + moveTo(x = 2223.0f, y = 90.0f) + // L 2293.5342 307.08203 + lineTo(x = 2293.5342f, y = 307.08203f) + // L 2108.8733 172.91795 + lineTo(x = 2108.8733f, y = 172.91795f) + // L 2337.1267 172.91795 + lineTo(x = 2337.1267f, y = 172.91795f) + // L 2152.4658 307.08203z + lineTo(x = 2152.4658f, y = 307.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 2223 510 + moveTo(x = 2223.0f, y = 510.0f) + // L 2293.5342 727.08203 + lineTo(x = 2293.5342f, y = 727.08203f) + // L 2108.8733 592.91797 + lineTo(x = 2108.8733f, y = 592.91797f) + // L 2337.1267 592.91797 + lineTo(x = 2337.1267f, y = 592.91797f) + // L 2152.4658 727.08203z + lineTo(x = 2152.4658f, y = 727.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 2223 930 + moveTo(x = 2223.0f, y = 930.0f) + // L 2293.5342 1147.082 + lineTo(x = 2293.5342f, y = 1147.082f) + // L 2108.8733 1012.91797 + lineTo(x = 2108.8733f, y = 1012.91797f) + // L 2337.1267 1012.91797 + lineTo(x = 2337.1267f, y = 1012.91797f) + // L 2152.4658 1147.082z + lineTo(x = 2152.4658f, y = 1147.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 2223 1350 + moveTo(x = 2223.0f, y = 1350.0f) + // L 2293.5342 1567.082 + lineTo(x = 2293.5342f, y = 1567.082f) + // L 2108.8733 1432.918 + lineTo(x = 2108.8733f, y = 1432.918f) + // L 2337.1267 1432.918 + lineTo(x = 2337.1267f, y = 1432.918f) + // L 2152.4658 1567.082z + lineTo(x = 2152.4658f, y = 1567.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 2223 1770 + moveTo(x = 2223.0f, y = 1770.0f) + // L 2293.5342 1987.082 + lineTo(x = 2293.5342f, y = 1987.082f) + // L 2108.8733 1852.918 + lineTo(x = 2108.8733f, y = 1852.918f) + // L 2337.1267 1852.918 + lineTo(x = 2337.1267f, y = 1852.918f) + // L 2152.4658 1987.082z + lineTo(x = 2152.4658f, y = 1987.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 2470 300 + moveTo(x = 2470.0f, y = 300.0f) + // L 2540.5342 517.08203 + lineTo(x = 2540.5342f, y = 517.08203f) + // L 2355.8733 382.91797 + lineTo(x = 2355.8733f, y = 382.91797f) + // L 2584.1267 382.91797 + lineTo(x = 2584.1267f, y = 382.91797f) + // L 2399.4658 517.08203z + lineTo(x = 2399.4658f, y = 517.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 2470 720 + moveTo(x = 2470.0f, y = 720.0f) + // L 2540.5342 937.08203 + lineTo(x = 2540.5342f, y = 937.08203f) + // L 2355.8733 802.91797 + lineTo(x = 2355.8733f, y = 802.91797f) + // L 2584.1267 802.91797 + lineTo(x = 2584.1267f, y = 802.91797f) + // L 2399.4658 937.08203z + lineTo(x = 2399.4658f, y = 937.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 2470 1140 + moveTo(x = 2470.0f, y = 1140.0f) + // L 2540.5342 1357.082 + lineTo(x = 2540.5342f, y = 1357.082f) + // L 2355.8733 1222.918 + lineTo(x = 2355.8733f, y = 1222.918f) + // L 2584.1267 1222.918 + lineTo(x = 2584.1267f, y = 1222.918f) + // L 2399.4658 1357.082z + lineTo(x = 2399.4658f, y = 1357.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 2470 1560 + moveTo(x = 2470.0f, y = 1560.0f) + // L 2540.5342 1777.082 + lineTo(x = 2540.5342f, y = 1777.082f) + // L 2355.8733 1642.918 + lineTo(x = 2355.8733f, y = 1642.918f) + // L 2584.1267 1642.918 + lineTo(x = 2584.1267f, y = 1642.918f) + // L 2399.4658 1777.082z + lineTo(x = 2399.4658f, y = 1777.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 2717 90 + moveTo(x = 2717.0f, y = 90.0f) + // L 2787.5342 307.08203 + lineTo(x = 2787.5342f, y = 307.08203f) + // L 2602.8733 172.91795 + lineTo(x = 2602.8733f, y = 172.91795f) + // L 2831.1267 172.91795 + lineTo(x = 2831.1267f, y = 172.91795f) + // L 2646.4658 307.08203z + lineTo(x = 2646.4658f, y = 307.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 2717 510 + moveTo(x = 2717.0f, y = 510.0f) + // L 2787.5342 727.08203 + lineTo(x = 2787.5342f, y = 727.08203f) + // L 2602.8733 592.91797 + lineTo(x = 2602.8733f, y = 592.91797f) + // L 2831.1267 592.91797 + lineTo(x = 2831.1267f, y = 592.91797f) + // L 2646.4658 727.08203z + lineTo(x = 2646.4658f, y = 727.08203f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 2717 930 + moveTo(x = 2717.0f, y = 930.0f) + // L 2787.5342 1147.082 + lineTo(x = 2787.5342f, y = 1147.082f) + // L 2602.8733 1012.91797 + lineTo(x = 2602.8733f, y = 1012.91797f) + // L 2831.1267 1012.91797 + lineTo(x = 2831.1267f, y = 1012.91797f) + // L 2646.4658 1147.082z + lineTo(x = 2646.4658f, y = 1147.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 2717 1350 + moveTo(x = 2717.0f, y = 1350.0f) + // L 2787.5342 1567.082 + lineTo(x = 2787.5342f, y = 1567.082f) + // L 2602.8733 1432.918 + lineTo(x = 2602.8733f, y = 1432.918f) + // L 2831.1267 1432.918 + lineTo(x = 2831.1267f, y = 1432.918f) + // L 2646.4658 1567.082z + lineTo(x = 2646.4658f, y = 1567.082f) + close() + } + // M247 90 317.534230 307.082039 132.873218 172.917961 H361.126782 L176.465770 307.082039z + path( + fill = SolidColor(Color(0xFFFFFFFF)), + ) { + // M 2717 1770 + moveTo(x = 2717.0f, y = 1770.0f) + // L 2787.5342 1987.082 + lineTo(x = 2787.5342f, y = 1987.082f) + // L 2602.8733 1852.918 + lineTo(x = 2602.8733f, y = 1852.918f) + // L 2831.1267 1852.918 + lineTo(x = 2831.1267f, y = 1852.918f) + // L 2646.4658 1987.082z + lineTo(x = 2646.4658f, y = 1987.082f) + close() + } + }.build().also { _usFlag = it } + } + +@Preview +@Composable +private fun IconPreview() { + TicTacToeTheme { + Column( + verticalArrangement = Arrangement.spacedBy(8.dp), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Image( + imageVector = Icons.USFlag, + contentDescription = null, + modifier = Modifier + .width((7410.0).dp) + .height((250.0).dp), + ) + } + } +} + +@Suppress("ObjectPropertyName") +private var _usFlag: ImageVector? = null diff --git a/app/src/main/java/me/nasrabadiam/tictactoe/ui/theme/Theme.kt b/app/src/main/java/me/nasrabadiam/tictactoe/ui/theme/Theme.kt index 38185a7..5e5c554 100644 --- a/app/src/main/java/me/nasrabadiam/tictactoe/ui/theme/Theme.kt +++ b/app/src/main/java/me/nasrabadiam/tictactoe/ui/theme/Theme.kt @@ -14,6 +14,10 @@ import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalView import androidx.core.view.WindowCompat +import me.nasrabadiam.resources.Locale +import me.nasrabadiam.resources.LocaleManager +import me.nasrabadiam.tictactoe.strings.ProvideAppStrings +import me.nasrabadiam.tictactoe.strings.rememberAppStrings private val DarkColorScheme = darkColorScheme( primary = Purple80, @@ -39,6 +43,7 @@ private val LightColorScheme = lightColorScheme( @Composable fun TicTacToeTheme( + currentLocale: Locale = LocaleManager.currentLocale, darkTheme: Boolean = isSystemInDarkTheme(), // Dynamic color is available on Android 12+ dynamicColor: Boolean = true, @@ -63,9 +68,14 @@ fun TicTacToeTheme( } } - MaterialTheme( - colorScheme = colorScheme, - typography = Typography, - content = content - ) + val currentLanguage = rememberAppStrings().apply { + languageTag = currentLocale + } + ProvideAppStrings(currentLanguage) { + MaterialTheme( + colorScheme = colorScheme, + typography = Typography, + content = content + ) + } } \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 27adc46..7621235 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,6 +8,7 @@ plugins { alias(libs.plugins.parcelize) apply false alias(libs.plugins.sentry) apply false alias(libs.plugins.compose.compiler) apply false + alias(libs.plugins.kotlinJvm) apply false } tasks.register("detektAll") { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 943e71d..c2d921f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -53,6 +53,7 @@ materialWindow = { group = "androidx.compose.material3", name = "material3-windo [plugins] androidApplication = { id = "com.android.application", version.ref = "agp" } +javaLibrary = { id = "java-library" } kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlinJvm" } diff --git a/library/resources/.gitignore b/library/resources/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/library/resources/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/library/resources/build.gradle.kts b/library/resources/build.gradle.kts new file mode 100644 index 0000000..ad9276f --- /dev/null +++ b/library/resources/build.gradle.kts @@ -0,0 +1,16 @@ +plugins { + id(libs.plugins.javaLibrary.get().pluginId) + alias(libs.plugins.kotlinJvm) + alias(libs.plugins.compose.compiler) +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} + +dependencies { + implementation(libs.coroutines) + implementation(platform(libs.compose.bom)) + implementation(libs.ui) +} \ No newline at end of file diff --git a/library/resources/src/main/java/me/nasrabadiam/resources/LocaleManager.kt b/library/resources/src/main/java/me/nasrabadiam/resources/LocaleManager.kt new file mode 100644 index 0000000..2adb8d0 --- /dev/null +++ b/library/resources/src/main/java/me/nasrabadiam/resources/LocaleManager.kt @@ -0,0 +1,30 @@ +package me.nasrabadiam.resources + +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue +import me.nasrabadiam.resources.Locales.EN + +typealias Locale = String + +public object LocaleManager { + + var currentLocale: Locale by mutableStateOf(EN.getName()) + private set + + fun updateLocale(locale: Locales) { + currentLocale = locale.name.lowercase() + } +} + +public fun getLocale(): Locale { + return LocaleManager.currentLocale +} + +public enum class Locales { + EN, FA +} + +public fun Locales.getName(): String { + return this.name.lowercase() +} \ No newline at end of file diff --git a/library/resources/src/main/java/me/nasrabadiam/resources/Lyricist.kt b/library/resources/src/main/java/me/nasrabadiam/resources/Lyricist.kt new file mode 100644 index 0000000..cf562e3 --- /dev/null +++ b/library/resources/src/main/java/me/nasrabadiam/resources/Lyricist.kt @@ -0,0 +1,75 @@ +package me.nasrabadiam.resources + +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asStateFlow + +public typealias LanguageTag = String + +public class Lyricist( + private val defaultLanguageTag: LanguageTag, + private val layoutDirections: Map, + private val translations: Map +) { + + private val mutableState: MutableStateFlow> = + MutableStateFlow( + LyricistState( + defaultLanguageTag, + getLayoutDirection(defaultLanguageTag), + getStrings(defaultLanguageTag) + ) + ) + + public val state: StateFlow> = + mutableState.asStateFlow() + + public var languageTag: LanguageTag + get() = mutableState.value.languageTag + set(languageTag) { + mutableState.value = LyricistState( + languageTag, + getLayoutDirection(languageTag), + getStrings(languageTag) + ) + } + + public val layoutDirection: LayoutDirection + get() = mutableState.value.layoutDirection + + public val strings: T + get() = mutableState.value.strings + + private val LanguageTag.fallback: LanguageTag + get() = split(FALLBACK_REGEX).first() + + private fun getStrings(languageTag: LanguageTag) = + translations[languageTag] + ?: translations[languageTag.fallback] + ?: translations[defaultLanguageTag] + ?: throw LyricistException("Strings for language tag $languageTag not found") + + private fun getLayoutDirection(languageTag: LanguageTag): LayoutDirection = + layoutDirections[languageTag] + ?: layoutDirections[languageTag.fallback] + ?: layoutDirections[defaultLanguageTag] + ?: throw LyricistException("LayoutDirection for language tag $languageTag not found") + + private companion object { + private val FALLBACK_REGEX = Regex("[-_]") + } +} + +public data class LyricistState internal constructor( + val languageTag: LanguageTag, + val layoutDirection: LayoutDirection, + val strings: T, +) + +public class LyricistException internal constructor( + override val message: String +) : RuntimeException() + +public enum class LayoutDirection { + LTR, RTL +} diff --git a/library/resources/src/main/java/me/nasrabadiam/resources/LyricistCompose.kt b/library/resources/src/main/java/me/nasrabadiam/resources/LyricistCompose.kt new file mode 100644 index 0000000..0b748fa --- /dev/null +++ b/library/resources/src/main/java/me/nasrabadiam/resources/LyricistCompose.kt @@ -0,0 +1,46 @@ +package me.nasrabadiam.resources + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.ProvidableCompositionLocal +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember +import androidx.compose.ui.platform.LocalLayoutDirection +import androidx.compose.ui.text.intl.Locale +import androidx.compose.ui.unit.LayoutDirection as ComposeLayoutDirection + +@Composable +public fun rememberStrings( + translations: Map, + layoutDirections: Map, + defaultLanguageTag: LanguageTag = "en", + currentLanguageTag: LanguageTag = Locale.current.toLanguageTag() +): Lyricist = + remember(defaultLanguageTag) { + Lyricist(defaultLanguageTag, layoutDirections, translations) + }.apply { + languageTag = currentLanguageTag + } + +@Composable +public fun ProvideStrings( + lyricist: Lyricist, + provider: ProvidableCompositionLocal, + content: @Composable () -> Unit +) { + val state by lyricist.state.collectAsState() + + CompositionLocalProvider( + provider provides state.strings, + LocalLayoutDirection provides state.layoutDirection.toComposeLayoutDirection(), + content = content + ) +} + +private fun LayoutDirection.toComposeLayoutDirection(): ComposeLayoutDirection { + return when (this) { + LayoutDirection.LTR -> ComposeLayoutDirection.Ltr + LayoutDirection.RTL -> ComposeLayoutDirection.Rtl + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index a8e838b..cfcdbe4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -15,3 +15,4 @@ dependencyResolutionManagement { rootProject.name = "TicTacToe" include(":app") +include(":library:resources")