diff --git a/iosApp/iosApp.xcodeproj/project.pbxproj b/iosApp/iosApp.xcodeproj/project.pbxproj index 8f93214..f4f5f14 100644 --- a/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/iosApp/iosApp.xcodeproj/project.pbxproj @@ -11,7 +11,7 @@ /* End PBXFileReference section */ /* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ - 95ABF2C8EE96D87C60CB4B62 /* Exceptions for "iosApp" folder in "iosApp" target */ = { + 95ABF2C8EE96D87C60CB4B62 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { isa = PBXFileSystemSynchronizedBuildFileExceptionSet; membershipExceptions = ( Info.plist, @@ -24,7 +24,7 @@ 89B7F8019E767C8CDD8E9E81 /* iosApp */ = { isa = PBXFileSystemSynchronizedRootGroup; exceptions = ( - 95ABF2C8EE96D87C60CB4B62 /* Exceptions for "iosApp" folder in "iosApp" target */, + 95ABF2C8EE96D87C60CB4B62 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); path = iosApp; sourceTree = ""; @@ -47,6 +47,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 47B0C8770C82BEADFE13EF77 /* Products */ = { + isa = PBXGroup; + children = ( + 9DA43AABF87DF46F5E794E72 /* Gwenedeg.app */, + ); + name = Products; + sourceTree = ""; + }; A562F15E4A0F12F420BB5B12 = { isa = PBXGroup; children = ( @@ -56,14 +64,6 @@ ); sourceTree = ""; }; - 47B0C8770C82BEADFE13EF77 /* Products */ = { - isa = PBXGroup; - children = ( - 9DA43AABF87DF46F5E794E72 /* Gwenedeg.app */, - ); - name = Products; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -167,6 +167,34 @@ /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ + 0F61D172BA94A3B6F831A0D3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = arm64; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; + DEVELOPMENT_TEAM = 492RZGQ5SU; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = iosApp/Info.plist; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; 21881C6A07515FFC1DADCA05 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReferenceAnchor = D8035B75140A5CBF147B4F8A /* Configuration */; @@ -232,6 +260,34 @@ }; name = Debug; }; + 61BCF02D053AC97BF036B6EA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = arm64; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; + DEVELOPMENT_TEAM = "${TEAM_ID}"; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = iosApp/Info.plist; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; E201D027F4E1648F1454A88C /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReferenceAnchor = D8035B75140A5CBF147B4F8A /* Configuration */; @@ -290,74 +346,9 @@ }; name = Release; }; - 0F61D172BA94A3B6F831A0D3 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; - DEVELOPMENT_TEAM = "${TEAM_ID}"; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = iosApp/Info.plist; - INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 61BCF02D053AC97BF036B6EA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; - DEVELOPMENT_TEAM = "${TEAM_ID}"; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = iosApp/Info.plist; - INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 7D7378CC21ADE468E3035338 /* Build configuration list for PBXProject "iosApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 21881C6A07515FFC1DADCA05 /* Debug */, - E201D027F4E1648F1454A88C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 582786CD1EA9153C0E140AAC /* Build configuration list for PBXNativeTarget "iosApp" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -367,7 +358,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 7D7378CC21ADE468E3035338 /* Build configuration list for PBXProject "iosApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 21881C6A07515FFC1DADCA05 /* Debug */, + E201D027F4E1648F1454A88C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 50584B9465876AB65BD227D3 /* Project object */; -} \ No newline at end of file +} diff --git a/shared/src/androidHostTest/kotlin/fr/ajaury/gwenedeg/SharedLogicAndroidHostTest.kt b/shared/src/androidHostTest/kotlin/fr/ajaury/gwenedeg/SharedLogicAndroidHostTest.kt deleted file mode 100644 index 99d48ec..0000000 --- a/shared/src/androidHostTest/kotlin/fr/ajaury/gwenedeg/SharedLogicAndroidHostTest.kt +++ /dev/null @@ -1,12 +0,0 @@ -package fr.ajaury.gwenedeg - -import kotlin.test.Test -import kotlin.test.assertEquals - -class SharedLogicAndroidHostTest { - - @Test - fun example() { - assertEquals(3, 1 + 2) - } -} \ No newline at end of file diff --git a/shared/src/androidMain/kotlin/fr/ajaury/gwenedeg/Platform.android.kt b/shared/src/androidMain/kotlin/fr/ajaury/gwenedeg/Platform.android.kt deleted file mode 100644 index ff77ec3..0000000 --- a/shared/src/androidMain/kotlin/fr/ajaury/gwenedeg/Platform.android.kt +++ /dev/null @@ -1,9 +0,0 @@ -package fr.ajaury.gwenedeg - -import android.os.Build - -class AndroidPlatform : Platform { - override val name: String = "Android ${Build.VERSION.SDK_INT}" -} - -actual fun getPlatform(): Platform = AndroidPlatform() \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/App.kt b/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/App.kt index 3287b68..9ca82ef 100644 --- a/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/App.kt +++ b/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/App.kt @@ -1,49 +1,14 @@ package fr.ajaury.gwenedeg -import androidx.compose.animation.AnimatedVisibility -import androidx.compose.foundation.Image -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.safeContentPadding -import androidx.compose.material3.Button import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text -import androidx.compose.runtime.* -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier +import androidx.compose.runtime.Composable import androidx.compose.ui.tooling.preview.Preview -import org.jetbrains.compose.resources.painterResource - -import gwenedeg.shared.generated.resources.Res -import gwenedeg.shared.generated.resources.compose_multiplatform +import fr.ajaury.gwenedeg.records.ui.RecordsScreen @Composable @Preview fun App() { MaterialTheme { - var showContent by remember { mutableStateOf(false) } - Column( - modifier = Modifier - .background(MaterialTheme.colorScheme.primaryContainer) - .safeContentPadding() - .fillMaxSize(), - horizontalAlignment = Alignment.CenterHorizontally, - ) { - Button(onClick = { showContent = !showContent }) { - Text("Click me!") - } - AnimatedVisibility(showContent) { - val greeting = remember { Greeting().greet() } - Column( - modifier = Modifier.fillMaxWidth(), - horizontalAlignment = Alignment.CenterHorizontally, - ) { - Image(painterResource(Res.drawable.compose_multiplatform), null) - Text("Compose: $greeting") - } - } - } + RecordsScreen() } -} \ No newline at end of file +} diff --git a/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/Greeting.kt b/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/Greeting.kt deleted file mode 100644 index 3533ff5..0000000 --- a/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/Greeting.kt +++ /dev/null @@ -1,9 +0,0 @@ -package fr.ajaury.gwenedeg - -class Greeting { - private val platform = getPlatform() - - fun greet(): String { - return sayHello(platform.name) - } -} \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/GreetingUtil.kt b/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/GreetingUtil.kt deleted file mode 100644 index d4ead29..0000000 --- a/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/GreetingUtil.kt +++ /dev/null @@ -1,4 +0,0 @@ -package fr.ajaury.gwenedeg - -fun sayHello(to: String): String = - "Hello, $to!" \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/Platform.kt b/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/Platform.kt deleted file mode 100644 index 4df4965..0000000 --- a/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/Platform.kt +++ /dev/null @@ -1,7 +0,0 @@ -package fr.ajaury.gwenedeg - -interface Platform { - val name: String -} - -expect fun getPlatform(): Platform \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/records/ui/RecordView.kt b/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/records/ui/RecordView.kt new file mode 100644 index 0000000..c6658e2 --- /dev/null +++ b/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/records/ui/RecordView.kt @@ -0,0 +1,15 @@ +package fr.ajaury.gwenedeg.records.ui + +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp + +@Composable +fun RecordView(record: String) { + Text( + text = record, + modifier = Modifier.padding(16.dp), + ) +} diff --git a/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/records/ui/RecordsScreen.kt b/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/records/ui/RecordsScreen.kt new file mode 100644 index 0000000..b16d57c --- /dev/null +++ b/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/records/ui/RecordsScreen.kt @@ -0,0 +1,68 @@ +package fr.ajaury.gwenedeg.records.ui + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.safeContentPadding +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.material3.HorizontalDivider +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Scaffold +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp + +private val records = + listOf( + "An onestiz", + "En em brezntiñ", + "An amzer a ra", + "E komz get unan arall", + "Me hag ar brezhoneg", + "Ar yec'hed", + "Deskriviñ", + "Me 'gar / Ne garan ket", + "C'hoantoù", + "Penaos 'peus kavet...?", + "Oberiantizoù", + "Debriñ hag evet", + "Bale, pourmen ha beajiñ", + "Ma c'horf", + "Dle eo / ret eo / dav eo / mall eo...", + "Deizioù ar sizhun", + "Mizioù ha kourzoù ar blez", + "Bez'zo / N'eus ket...", + "Banne.../Tamm...", + "Stad a vuhez", + "Lec'hiiñ", + ) + +@Composable +fun RecordsScreen() { + Scaffold { innerPadding -> + LazyColumn( + modifier = + Modifier + .padding(innerPadding) + .background(MaterialTheme.colorScheme.primaryContainer) + .fillMaxSize(), + ) { + items(records) { item -> + RecordView( + record = item, + ) + + if (!item.isLastItem()) { + HorizontalDivider( + modifier = Modifier.padding(horizontal = 16.dp), + thickness = 1.dp, + color = MaterialTheme.colorScheme.outlineVariant, + ) + } + } + } + } +} + +private fun String.isLastItem(): Boolean = this == records.last() diff --git a/shared/src/commonTest/kotlin/fr/ajaury/gwenedeg/SharedCommonTest.kt b/shared/src/commonTest/kotlin/fr/ajaury/gwenedeg/SharedCommonTest.kt deleted file mode 100644 index d4c186b..0000000 --- a/shared/src/commonTest/kotlin/fr/ajaury/gwenedeg/SharedCommonTest.kt +++ /dev/null @@ -1,12 +0,0 @@ -package fr.ajaury.gwenedeg - -import kotlin.test.Test -import kotlin.test.assertEquals - -class SharedCommonTest { - - @Test - fun example() { - assertEquals(3, 1 + 2) - } -} \ No newline at end of file diff --git a/shared/src/iosMain/kotlin/fr/ajaury/gwenedeg/Platform.ios.kt b/shared/src/iosMain/kotlin/fr/ajaury/gwenedeg/Platform.ios.kt deleted file mode 100644 index f405e8c..0000000 --- a/shared/src/iosMain/kotlin/fr/ajaury/gwenedeg/Platform.ios.kt +++ /dev/null @@ -1,9 +0,0 @@ -package fr.ajaury.gwenedeg - -import platform.UIKit.UIDevice - -class IOSPlatform: Platform { - override val name: String = UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion -} - -actual fun getPlatform(): Platform = IOSPlatform() \ No newline at end of file diff --git a/shared/src/iosTest/kotlin/fr/ajaury/gwenedeg/SharedLogicIOSTest.kt b/shared/src/iosTest/kotlin/fr/ajaury/gwenedeg/SharedLogicIOSTest.kt deleted file mode 100644 index 014b81a..0000000 --- a/shared/src/iosTest/kotlin/fr/ajaury/gwenedeg/SharedLogicIOSTest.kt +++ /dev/null @@ -1,12 +0,0 @@ -package fr.ajaury.gwenedeg - -import kotlin.test.Test -import kotlin.test.assertEquals - -class SharedLogicIOSTest { - - @Test - fun example() { - assertEquals(3, 1 + 2) - } -} \ No newline at end of file diff --git a/shared/src/jsMain/kotlin/fr/ajaury/gwenedeg/Platform.js.kt b/shared/src/jsMain/kotlin/fr/ajaury/gwenedeg/Platform.js.kt deleted file mode 100644 index f8e70b8..0000000 --- a/shared/src/jsMain/kotlin/fr/ajaury/gwenedeg/Platform.js.kt +++ /dev/null @@ -1,14 +0,0 @@ -package fr.ajaury.gwenedeg - -import web.navigator.navigator - -class JsPlatform: Platform { - private val userAgent = navigator.userAgent - private val browserList = listOf("Chrome", "Firefox", "Safari", "Edge") - - override val name: String = userAgent.findAnyOf(browserList, ignoreCase = true) - ?.let { (startIndex) -> userAgent.substring(startIndex).substringBefore(" ") } - ?: "Unknown" -} - -actual fun getPlatform(): Platform = JsPlatform() \ No newline at end of file diff --git a/shared/src/jvmMain/kotlin/fr/ajaury/gwenedeg/Platform.jvm.kt b/shared/src/jvmMain/kotlin/fr/ajaury/gwenedeg/Platform.jvm.kt deleted file mode 100644 index 878b156..0000000 --- a/shared/src/jvmMain/kotlin/fr/ajaury/gwenedeg/Platform.jvm.kt +++ /dev/null @@ -1,7 +0,0 @@ -package fr.ajaury.gwenedeg - -class JVMPlatform: Platform { - override val name: String = "Java ${System.getProperty("java.version")}" -} - -actual fun getPlatform(): Platform = JVMPlatform() \ No newline at end of file diff --git a/shared/src/jvmTest/kotlin/fr/ajaury/gwenedeg/SharedLogicDesktopTest.kt b/shared/src/jvmTest/kotlin/fr/ajaury/gwenedeg/SharedLogicDesktopTest.kt deleted file mode 100644 index 77549df..0000000 --- a/shared/src/jvmTest/kotlin/fr/ajaury/gwenedeg/SharedLogicDesktopTest.kt +++ /dev/null @@ -1,12 +0,0 @@ -package fr.ajaury.gwenedeg - -import kotlin.test.Test -import kotlin.test.assertEquals - -class SharedLogicDesktopTest { - - @Test - fun example() { - assertEquals(3, 1 + 2) - } -} \ No newline at end of file diff --git a/shared/src/wasmJsMain/kotlin/fr/ajaury/gwenedeg/Platform.wasmJs.kt b/shared/src/wasmJsMain/kotlin/fr/ajaury/gwenedeg/Platform.wasmJs.kt deleted file mode 100644 index 3a26e51..0000000 --- a/shared/src/wasmJsMain/kotlin/fr/ajaury/gwenedeg/Platform.wasmJs.kt +++ /dev/null @@ -1,7 +0,0 @@ -package fr.ajaury.gwenedeg - -class WasmPlatform: Platform { - override val name: String = "Web with Kotlin/Wasm" -} - -actual fun getPlatform(): Platform = WasmPlatform() \ No newline at end of file