diff --git a/codeSnippets/snippets/tutorial-client-kmm/.gitignore b/codeSnippets/snippets/tutorial-client-kmm/.gitignore deleted file mode 100644 index e510fa99d..000000000 --- a/codeSnippets/snippets/tutorial-client-kmm/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -*.iml -.gradle -.idea -.DS_Store -build -captures -.externalNativeBuild -.cxx -local.properties -xcuserdata \ No newline at end of file diff --git a/codeSnippets/snippets/tutorial-client-kmm/README.md b/codeSnippets/snippets/tutorial-client-kmm/README.md deleted file mode 100644 index 9f2da234e..000000000 --- a/codeSnippets/snippets/tutorial-client-kmm/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Ktor client in a Kotlin Multiplatform Mobile application - -The project created in -the [Creating a cross-platform mobile application](https://ktor.io/docs/getting-started-ktor-client-multiplatform-mobile.html) -tutorial. - -## Running - -To run this sample: - -1. Clone the [ktor-documentation](https://github.com/ktorio/ktor-documentation) repository. -2. Open the [tutorial-client-kmm](../tutorial-client-kmm) folder in Android Studio. -3. Run the application as described - in [Run your application](https://ktor.io/docs/getting-started-ktor-client-multiplatform-mobile.html#run). diff --git a/codeSnippets/snippets/tutorial-client-kmm/androidApp/build.gradle.kts b/codeSnippets/snippets/tutorial-client-kmm/androidApp/build.gradle.kts deleted file mode 100644 index db7277c73..000000000 --- a/codeSnippets/snippets/tutorial-client-kmm/androidApp/build.gradle.kts +++ /dev/null @@ -1,47 +0,0 @@ -plugins { - alias(libs.plugins.androidApplication) - alias(libs.plugins.kotlinAndroid) - alias(libs.plugins.kotlinCompose) -} - -android { - namespace = "com.example.kmmktor.android" - compileSdk = 34 - defaultConfig { - applicationId = "com.example.kmmktor.android" - minSdk = 25 - targetSdk = 34 - versionCode = 1 - versionName = "1.0" - } - buildFeatures { - compose = true - } - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - buildTypes { - getByName("release") { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } -} - -dependencies { - implementation(projects.shared) - implementation(libs.compose.ui) - implementation(libs.compose.ui.tooling.preview) - implementation(libs.compose.material3) - implementation(libs.androidx.activity.compose) - implementation(libs.kotlinx.coroutines.android) - debugImplementation(libs.compose.ui.tooling) -} \ No newline at end of file diff --git a/codeSnippets/snippets/tutorial-client-kmm/androidApp/src/main/java/com/example/kmmktor/android/MainActivity.kt b/codeSnippets/snippets/tutorial-client-kmm/androidApp/src/main/java/com/example/kmmktor/android/MainActivity.kt deleted file mode 100644 index 72deef769..000000000 --- a/codeSnippets/snippets/tutorial-client-kmm/androidApp/src/main/java/com/example/kmmktor/android/MainActivity.kt +++ /dev/null @@ -1,58 +0,0 @@ -package com.example.kmmktor.android - -import android.os.Bundle -import androidx.activity.ComponentActivity -import androidx.activity.compose.setContent -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.material3.* -import androidx.compose.runtime.Composable -import androidx.compose.runtime.LaunchedEffect -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.rememberCoroutineScope -import androidx.compose.runtime.setValue -import androidx.compose.ui.Modifier -import androidx.compose.ui.tooling.preview.Preview -import com.example.kmmktor.Greeting -import kotlinx.coroutines.launch - -class MainActivity : ComponentActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContent { - MyApplicationTheme { - Surface( - modifier = Modifier.fillMaxSize(), - color = MaterialTheme.colorScheme.background - ) { - val scope = rememberCoroutineScope() - var text by remember { mutableStateOf("Loading") } - LaunchedEffect(true) { - scope.launch { - text = try { - Greeting().greeting() - } catch (e: Exception) { - e.localizedMessage ?: "error" - } - } - } - GreetingView(text) - } - } - } - } -} - -@Composable -fun GreetingView(text: String) { - Text(text = text) -} - -@Preview -@Composable -fun DefaultPreview() { - MyApplicationTheme { - GreetingView("Hello, Android!") - } -} diff --git a/codeSnippets/snippets/tutorial-client-kmm/androidApp/src/main/java/com/example/kmmktor/android/MyApplicationTheme.kt b/codeSnippets/snippets/tutorial-client-kmm/androidApp/src/main/java/com/example/kmmktor/android/MyApplicationTheme.kt deleted file mode 100644 index 089e6233b..000000000 --- a/codeSnippets/snippets/tutorial-client-kmm/androidApp/src/main/java/com/example/kmmktor/android/MyApplicationTheme.kt +++ /dev/null @@ -1,55 +0,0 @@ -package com.example.kmmktor.android - -import androidx.compose.foundation.isSystemInDarkTheme -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Shapes -import androidx.compose.material3.Typography -import androidx.compose.material3.darkColorScheme -import androidx.compose.material3.lightColorScheme -import androidx.compose.runtime.Composable -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.TextStyle -import androidx.compose.ui.text.font.FontFamily -import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp - -@Composable -fun MyApplicationTheme( - darkTheme: Boolean = isSystemInDarkTheme(), - content: @Composable () -> Unit -) { - val colors = if (darkTheme) { - darkColorScheme( - primary = Color(0xFFBB86FC), - secondary = Color(0xFF03DAC5), - tertiary = Color(0xFF3700B3) - ) - } else { - lightColorScheme( - primary = Color(0xFF6200EE), - secondary = Color(0xFF03DAC5), - tertiary = Color(0xFF3700B3) - ) - } - val typography = Typography( - bodyMedium = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Normal, - fontSize = 16.sp - ) - ) - val shapes = Shapes( - small = RoundedCornerShape(4.dp), - medium = RoundedCornerShape(4.dp), - large = RoundedCornerShape(0.dp) - ) - - MaterialTheme( - colorScheme = colors, - typography = typography, - shapes = shapes, - content = content - ) -} diff --git a/codeSnippets/snippets/tutorial-client-kmm/androidApp/src/main/res/values/styles.xml b/codeSnippets/snippets/tutorial-client-kmm/androidApp/src/main/res/values/styles.xml deleted file mode 100644 index 6b4fa3d08..000000000 --- a/codeSnippets/snippets/tutorial-client-kmm/androidApp/src/main/res/values/styles.xml +++ /dev/null @@ -1,3 +0,0 @@ - -