├── composeApp ├── src │ ├── iosMain │ │ └── kotlin │ │ │ ├── network │ │ │ └── chaintech │ │ │ │ └── screencapture │ │ │ │ ├── App.ios.kt │ │ │ │ └── theme │ │ │ │ └── Theme.ios.kt │ │ │ └── main.kt │ ├── commonMain │ │ ├── composeResources │ │ │ ├── drawable │ │ │ │ ├── qr_code.png │ │ │ │ ├── ekka_poster.jpg │ │ │ │ ├── ic_dark_mode.xml │ │ │ │ ├── ic_rotate_right.xml │ │ │ │ ├── ic_cyclone.xml │ │ │ │ └── ic_light_mode.xml │ │ │ ├── font │ │ │ │ └── IndieFlower-Regular.ttf │ │ │ └── values │ │ │ │ └── strings.xml │ │ └── kotlin │ │ │ └── network │ │ │ └── chaintech │ │ │ └── screencapture │ │ │ ├── theme │ │ │ ├── Color.kt │ │ │ └── Theme.kt │ │ │ └── App.kt │ ├── androidMain │ │ ├── res │ │ │ └── xml │ │ │ │ └── file_paths.xml │ │ ├── kotlin │ │ │ └── network │ │ │ │ └── chaintech │ │ │ │ └── screencapture │ │ │ │ ├── theme │ │ │ │ └── Theme.android.kt │ │ │ │ └── App.android.kt │ │ └── AndroidManifest.xml │ └── commonTest │ │ └── kotlin │ │ └── network │ │ └── chaintech │ │ └── screencapture │ │ └── ComposeTest.kt └── build.gradle.kts ├── iosApp ├── iosApp │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Preview Content │ │ └── Preview Assets.xcassets │ │ │ └── Contents.json │ └── iosApp.swift └── iosApp.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ └── project.pbxproj ├── gradle ├── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties └── libs.versions.toml ├── .gitignore ├── settings.gradle.kts ├── gradle.properties ├── gradlew.bat ├── README.md └── gradlew /composeApp/src/iosMain/kotlin/network/chaintech/screencapture/App.ios.kt: -------------------------------------------------------------------------------- 1 | package network.chaintech.screencapture 2 | 3 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chaintech-Network/ComposeMultiplatformScreenCapture/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/drawable/qr_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chaintech-Network/ComposeMultiplatformScreenCapture/HEAD/composeApp/src/commonMain/composeResources/drawable/qr_code.png -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/drawable/ekka_poster.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chaintech-Network/ComposeMultiplatformScreenCapture/HEAD/composeApp/src/commonMain/composeResources/drawable/ekka_poster.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.iml 3 | .gradle 4 | .idea 5 | .kotlin 6 | .DS_Store 7 | build 8 | */build 9 | captures 10 | .externalNativeBuild 11 | .cxx 12 | local.properties 13 | xcuserdata/ 14 | Pods/ 15 | *.jks 16 | *yarn.lock 17 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/IndieFlower-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chaintech-Network/ComposeMultiplatformScreenCapture/HEAD/composeApp/src/commonMain/composeResources/font/IndieFlower-Regular.ttf -------------------------------------------------------------------------------- /iosApp/iosApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /composeApp/src/iosMain/kotlin/main.kt: -------------------------------------------------------------------------------- 1 | import androidx.compose.ui.window.ComposeUIViewController 2 | import network.chaintech.screencapture.App 3 | import platform.UIKit.UIViewController 4 | 5 | fun MainViewController(): UIViewController = ComposeUIViewController { App() } 6 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/xml/file_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Cyclone 3 | Open github 4 | Run 5 | Stop 6 | Theme 7 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "ComposeMultiplatformScreenCapture" 2 | include(":composeApp") 3 | 4 | pluginManagement { 5 | repositories { 6 | google() 7 | gradlePluginPortal() 8 | mavenCentral() 9 | } 10 | } 11 | 12 | dependencyResolutionManagement { 13 | repositories { 14 | google() 15 | mavenCentral() 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/drawable/ic_dark_mode.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | #Gradle 2 | org.gradle.jvmargs=-Xmx4G -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx4G" 3 | org.gradle.caching=true 4 | org.gradle.configuration-cache=true 5 | org.gradle.daemon=true 6 | org.gradle.parallel=true 7 | 8 | #Kotlin 9 | kotlin.code.style=official 10 | kotlin.js.compiler=ir 11 | 12 | #Android 13 | android.useAndroidX=true 14 | android.nonTransitiveRClass=true 15 | 16 | #Compose 17 | org.jetbrains.compose.experimental.uikit.enabled=true 18 | org.jetbrains.compose.experimental.jscanvas.enabled=true 19 | org.jetbrains.compose.experimental.wasm.enabled=true 20 | -------------------------------------------------------------------------------- /iosApp/iosApp/iosApp.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import ComposeApp 3 | 4 | @main 5 | class AppDelegate: UIResponder, UIApplicationDelegate { 6 | var window: UIWindow? 7 | 8 | func application( 9 | _ application: UIApplication, 10 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 11 | ) -> Bool { 12 | window = UIWindow(frame: UIScreen.main.bounds) 13 | if let window = window { 14 | window.rootViewController = MainKt.MainViewController() 15 | window.makeKeyAndVisible() 16 | } 17 | return true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /composeApp/src/iosMain/kotlin/network/chaintech/screencapture/theme/Theme.ios.kt: -------------------------------------------------------------------------------- 1 | package network.chaintech.screencapture.theme 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.runtime.LaunchedEffect 5 | import platform.UIKit.UIApplication 6 | import platform.UIKit.UIStatusBarStyleDarkContent 7 | import platform.UIKit.UIStatusBarStyleLightContent 8 | import platform.UIKit.setStatusBarStyle 9 | 10 | @Composable 11 | internal actual fun SystemAppearance(isDark: Boolean) { 12 | LaunchedEffect(isDark) { 13 | UIApplication.sharedApplication.setStatusBarStyle( 14 | if (isDark) UIStatusBarStyleDarkContent else UIStatusBarStyleLightContent 15 | ) 16 | } 17 | } -------------------------------------------------------------------------------- /composeApp/src/androidMain/kotlin/network/chaintech/screencapture/theme/Theme.android.kt: -------------------------------------------------------------------------------- 1 | package network.chaintech.screencapture.theme 2 | 3 | import android.app.Activity 4 | import androidx.compose.runtime.Composable 5 | import androidx.compose.runtime.LaunchedEffect 6 | import androidx.compose.ui.platform.LocalView 7 | import androidx.core.view.WindowInsetsControllerCompat 8 | 9 | @Composable 10 | internal actual fun SystemAppearance(isDark: Boolean) { 11 | val view = LocalView.current 12 | LaunchedEffect(isDark) { 13 | val window = (view.context as Activity).window 14 | WindowInsetsControllerCompat(window, window.decorView).apply { 15 | isAppearanceLightStatusBars = isDark 16 | isAppearanceLightNavigationBars = isDark 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/drawable/ic_rotate_right.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/kotlin/network/chaintech/screencapture/App.android.kt: -------------------------------------------------------------------------------- 1 | package network.chaintech.screencapture 2 | 3 | import android.app.Application 4 | import android.os.Bundle 5 | import androidx.activity.ComponentActivity 6 | import androidx.activity.compose.setContent 7 | import androidx.activity.enableEdgeToEdge 8 | import network.chaintech.composeMultiplatformScreenCapture.AppContext 9 | 10 | class AndroidApp : Application() { 11 | companion object { 12 | lateinit var INSTANCE: AndroidApp 13 | } 14 | 15 | override fun onCreate() { 16 | super.onCreate() 17 | INSTANCE = this 18 | } 19 | } 20 | 21 | class AppActivity : ComponentActivity() { 22 | override fun onCreate(savedInstanceState: Bundle?) { 23 | super.onCreate(savedInstanceState) 24 | AppContext.apply { set(this@AppActivity) } 25 | enableEdgeToEdge() 26 | setContent { App() } 27 | } 28 | } -------------------------------------------------------------------------------- /gradle/libs.versions.toml: -------------------------------------------------------------------------------- 1 | [versions] 2 | 3 | composeMultiplatformScreenCapture = "1.0.1" 4 | kotlin = "1.9.23" 5 | compose = "1.6.1" 6 | agp = "8.2.2" 7 | androidx-activityCompose = "1.9.0" 8 | androidx-uiTest = "1.6.6" 9 | 10 | [libraries] 11 | 12 | androidx-activityCompose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" } 13 | androidx-testManifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "androidx-uiTest" } 14 | androidx-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "androidx-uiTest" } 15 | compose-multiplatform-screen-capture = { module = "network.chaintech:compose-multiplatform-screen-capture", version.ref = "composeMultiplatformScreenCapture" } 16 | 17 | [plugins] 18 | 19 | multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } 20 | compose = { id = "org.jetbrains.compose", version.ref = "compose" } 21 | android-application = { id = "com.android.application", version.ref = "agp" } 22 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/drawable/ic_cyclone.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/drawable/ic_light_mode.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 26 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /composeApp/src/commonTest/kotlin/network/chaintech/screencapture/ComposeTest.kt: -------------------------------------------------------------------------------- 1 | package network.chaintech.screencapture 2 | 3 | import androidx.compose.foundation.layout.Column 4 | import androidx.compose.material3.Button 5 | import androidx.compose.material3.Text 6 | import androidx.compose.runtime.getValue 7 | import androidx.compose.runtime.mutableStateOf 8 | import androidx.compose.runtime.remember 9 | import androidx.compose.runtime.setValue 10 | import androidx.compose.ui.Modifier 11 | import androidx.compose.ui.platform.testTag 12 | import androidx.compose.ui.test.ExperimentalTestApi 13 | import androidx.compose.ui.test.assertTextEquals 14 | import androidx.compose.ui.test.onNodeWithTag 15 | import androidx.compose.ui.test.performClick 16 | import androidx.compose.ui.test.runComposeUiTest 17 | import kotlin.test.Test 18 | 19 | @OptIn(ExperimentalTestApi::class) 20 | class ComposeTest { 21 | 22 | @Test 23 | fun simpleCheck() = runComposeUiTest { 24 | setContent { 25 | var txt by remember { mutableStateOf("Go") } 26 | Column { 27 | Text( 28 | text = txt, 29 | modifier = Modifier.testTag("t_text") 30 | ) 31 | Button( 32 | onClick = { txt += "." }, 33 | modifier = Modifier.testTag("t_button") 34 | ) { 35 | Text("click me") 36 | } 37 | } 38 | } 39 | 40 | onNodeWithTag("t_button").apply { 41 | repeat(3) { performClick() } 42 | } 43 | onNodeWithTag("t_text").assertTextEquals("Go...") 44 | } 45 | } -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 1>&2 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 48 | echo. 1>&2 49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 50 | echo location of your Java installation. 1>&2 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 1>&2 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 62 | echo. 1>&2 63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 64 | echo location of your Java installation. 1>&2 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /composeApp/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import org.jetbrains.compose.ExperimentalComposeLibrary 2 | import com.android.build.api.dsl.ManagedVirtualDevice 3 | import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi 4 | import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree 5 | 6 | plugins { 7 | alias(libs.plugins.multiplatform) 8 | alias(libs.plugins.compose) 9 | alias(libs.plugins.android.application) 10 | } 11 | 12 | kotlin { 13 | androidTarget { 14 | compilations.all { 15 | kotlinOptions { 16 | jvmTarget = "${JavaVersion.VERSION_1_8}" 17 | freeCompilerArgs += "-Xjdk-release=${JavaVersion.VERSION_1_8}" 18 | } 19 | } 20 | //https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-test.html 21 | @OptIn(ExperimentalKotlinGradlePluginApi::class) 22 | instrumentedTestVariant { 23 | sourceSetTree.set(KotlinSourceSetTree.test) 24 | dependencies { 25 | debugImplementation(libs.androidx.testManifest) 26 | implementation(libs.androidx.junit4) 27 | } 28 | } 29 | } 30 | 31 | listOf( 32 | iosX64(), 33 | iosArm64(), 34 | iosSimulatorArm64() 35 | ).forEach { 36 | it.binaries.framework { 37 | baseName = "ComposeApp" 38 | isStatic = true 39 | } 40 | } 41 | 42 | sourceSets { 43 | all { 44 | languageSettings { 45 | optIn("org.jetbrains.compose.resources.ExperimentalResourceApi") 46 | } 47 | } 48 | commonMain.dependencies { 49 | implementation(compose.runtime) 50 | implementation(compose.foundation) 51 | implementation(compose.material3) 52 | implementation(compose.components.resources) 53 | implementation(compose.components.uiToolingPreview) 54 | implementation(libs.compose.multiplatform.screen.capture) 55 | } 56 | 57 | commonTest.dependencies { 58 | implementation(kotlin("test")) 59 | @OptIn(ExperimentalComposeLibrary::class) 60 | implementation(compose.uiTest) 61 | } 62 | 63 | androidMain.dependencies { 64 | implementation(compose.uiTooling) 65 | implementation(libs.androidx.activityCompose) 66 | } 67 | 68 | iosMain.dependencies { 69 | } 70 | 71 | } 72 | } 73 | 74 | android { 75 | namespace = "network.chaintech.screencapture" 76 | compileSdk = 34 77 | 78 | defaultConfig { 79 | minSdk = 24 80 | targetSdk = 34 81 | 82 | applicationId = "network.chaintech.screencapture.androidApp" 83 | versionCode = 1 84 | versionName = "1.0.0" 85 | 86 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 87 | } 88 | sourceSets["main"].apply { 89 | manifest.srcFile("src/androidMain/AndroidManifest.xml") 90 | res.srcDirs("src/androidMain/res") 91 | } 92 | //https://developer.android.com/studio/test/gradle-managed-devices 93 | @Suppress("UnstableApiUsage") 94 | testOptions { 95 | managedDevices.devices { 96 | maybeCreate("pixel5").apply { 97 | device = "Pixel 5" 98 | apiLevel = 34 99 | systemImageSource = "aosp" 100 | } 101 | } 102 | } 103 | compileOptions { 104 | sourceCompatibility = JavaVersion.VERSION_1_8 105 | targetCompatibility = JavaVersion.VERSION_1_8 106 | } 107 | buildFeatures { 108 | compose = true 109 | } 110 | composeOptions { 111 | kotlinCompilerExtensionVersion = "1.5.11" 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ScreenCapture 2 | 3 | ScreenCapture is a Compose Multiplatform library for capturing screens in your Android or iOS App. 4 | 5 | ![Hero-image - Screen Capture (2)](https://github.com/ChainTechNetwork/ComposeMultiplatformScreenCapture/assets/143475887/e3332273-983c-4c87-8258-716ae8f93fb6) 6 | 7 | 8 | ## Installation 9 | 10 | Add the dependency to your `build.gradle.kts` file: 11 | 12 | ``` 13 | commonMain.dependencies { 14 | implementation("network.chaintech:compose-multiplatform-screen-capture:1.0.1") 15 | } 16 | ``` 17 | 18 | ## Usage 19 | 20 | ![screen_capture_demo](https://github.com/ChainTechNetwork/ComposeMultiplatformScreenCapture/assets/143475887/69d08028-49b1-4586-a264-8203257e7f93) 21 | 22 | 23 | ### Android 24 | - Include this in your AndroidManifest.xml: 25 | 26 | ``` 27 | 32 | 35 | 36 | ``` 37 | 38 | - Create file_paths.xml in androidMain->res->xml and add the following code: 39 | 40 | ``` 41 | 42 | 45 | 48 | 49 | ``` 50 | 51 | - Add the following line in onCreate of your Activity class: 52 | 53 | ``` 54 | class AppActivity : ComponentActivity() { 55 | override fun onCreate(savedInstanceState: Bundle?) { 56 | ... 57 | AppContext.apply { set(this@AppActivity) } 58 | ... 59 | } 60 | } 61 | ``` 62 | 63 | ### Composable Usage 64 | 65 | ```kotlin 66 | val captureController = rememberScreenCaptureController() 67 | 68 | ScreenCaptureComposable( 69 | modifier = Modifier, 70 | screenCaptureController = captureController, 71 | shareImage = true, 72 | onCaptured = { img, throwable -> 73 | 74 | } 75 | ) { 76 | AppTheme { 77 | content() // place your composable content here 78 | } 79 | } 80 | ``` 81 | 82 | 83 | ### Capture Image Example 84 | 85 | ```kotlin 86 | ElevatedButton( 87 | modifier = Modifier 88 | .padding(top = 40.dp) 89 | .widthIn(min = 200.dp).align(Alignment.CenterHorizontally), 90 | onClick = { 91 | captureController.capture() 92 | }, 93 | content = { 94 | Text( 95 | "Preview ScreenShot", 96 | style = TextStyle(fontSize = 16.sp), 97 | fontWeight = FontWeight.Bold 98 | ) 99 | }, 100 | colors = ButtonDefaults.elevatedButtonColors(containerColor = Color.Cyan), 101 | ) 102 | ``` 103 | 104 | ### Explanation 105 | 106 | * `modifier`: Modifier for modifying the layout of the screen capture component. 107 | * `screenCaptureController`: Controller for managing the screen capture functionality. 108 | * `shareImage`: Boolean indicating whether the user intends to share the captured image. 109 | * `onCaptured`: Callback invoked when an image is successfully captured or when there's a failure during the capture process. It provides an ImageBitmap representing the captured image and a Throwable in case of any errors. 110 | * `content`: A composable function that defines the content to be displayed within the screen capture component. This could include buttons, text, or any other UI elements related to screen capture functionality. 111 | 112 | - For More [Follow This Class](https://github.com/ChainTechNetwork/ComposeMultiplatformScreenCapture/blob/main/composeApp/src/commonMain/kotlin/network/chaintech/screencapture/App.kt) 113 | - Follow [Medium Link](https://medium.com/mobile-innovation-network/screencapture-compose-multiplatform-kmp-5aef62dd0dcf) for example 114 | - Follow [LinkedIn For More Updates](https://www.linkedin.com/showcase/mobile-innovation-network) 115 | 116 | 117 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/network/chaintech/screencapture/theme/Color.kt: -------------------------------------------------------------------------------- 1 | package network.chaintech.screencapture.theme 2 | 3 | import androidx.compose.ui.graphics.Color 4 | 5 | //generated by https://m3.material.io/theme-builder#/custom 6 | //Color palette was taken here: https://colorhunt.co/palettes/popular 7 | 8 | internal val md_theme_light_primary = Color(0xFF00687A) 9 | internal val md_theme_light_onPrimary = Color(0xFFFFFFFF) 10 | internal val md_theme_light_primaryContainer = Color(0xFFABEDFF) 11 | internal val md_theme_light_onPrimaryContainer = Color(0xFF001F26) 12 | internal val md_theme_light_secondary = Color(0xFF00696E) 13 | internal val md_theme_light_onSecondary = Color(0xFFFFFFFF) 14 | internal val md_theme_light_secondaryContainer = Color(0xFF6FF6FE) 15 | internal val md_theme_light_onSecondaryContainer = Color(0xFF002022) 16 | internal val md_theme_light_tertiary = Color(0xFF904D00) 17 | internal val md_theme_light_onTertiary = Color(0xFFFFFFFF) 18 | internal val md_theme_light_tertiaryContainer = Color(0xFFFFDCC2) 19 | internal val md_theme_light_onTertiaryContainer = Color(0xFF2E1500) 20 | internal val md_theme_light_error = Color(0xFFBA1A1A) 21 | internal val md_theme_light_errorContainer = Color(0xFFFFDAD6) 22 | internal val md_theme_light_onError = Color(0xFFFFFFFF) 23 | internal val md_theme_light_onErrorContainer = Color(0xFF410002) 24 | internal val md_theme_light_background = Color(0xFFFFFBFF) 25 | internal val md_theme_light_onBackground = Color(0xFF221B00) 26 | internal val md_theme_light_surface = Color(0xFFFFFBFF) 27 | internal val md_theme_light_onSurface = Color(0xFF221B00) 28 | internal val md_theme_light_surfaceVariant = Color(0xFFDBE4E7) 29 | internal val md_theme_light_onSurfaceVariant = Color(0xFF3F484B) 30 | internal val md_theme_light_outline = Color(0xFF70797B) 31 | internal val md_theme_light_inverseOnSurface = Color(0xFFFFF0C0) 32 | internal val md_theme_light_inverseSurface = Color(0xFF3A3000) 33 | internal val md_theme_light_inversePrimary = Color(0xFF55D6F4) 34 | internal val md_theme_light_shadow = Color(0xFF000000) 35 | internal val md_theme_light_surfaceTint = Color(0xFF00687A) 36 | internal val md_theme_light_outlineVariant = Color(0xFFBFC8CB) 37 | internal val md_theme_light_scrim = Color(0xFF000000) 38 | 39 | internal val md_theme_dark_primary = Color(0xFF55D6F4) 40 | internal val md_theme_dark_onPrimary = Color(0xFF003640) 41 | internal val md_theme_dark_primaryContainer = Color(0xFF004E5C) 42 | internal val md_theme_dark_onPrimaryContainer = Color(0xFFABEDFF) 43 | internal val md_theme_dark_secondary = Color(0xFF4CD9E2) 44 | internal val md_theme_dark_onSecondary = Color(0xFF00373A) 45 | internal val md_theme_dark_secondaryContainer = Color(0xFF004F53) 46 | internal val md_theme_dark_onSecondaryContainer = Color(0xFF6FF6FE) 47 | internal val md_theme_dark_tertiary = Color(0xFFFFB77C) 48 | internal val md_theme_dark_onTertiary = Color(0xFF4D2700) 49 | internal val md_theme_dark_tertiaryContainer = Color(0xFF6D3900) 50 | internal val md_theme_dark_onTertiaryContainer = Color(0xFFFFDCC2) 51 | internal val md_theme_dark_error = Color(0xFFFFB4AB) 52 | internal val md_theme_dark_errorContainer = Color(0xFF93000A) 53 | internal val md_theme_dark_onError = Color(0xFF690005) 54 | internal val md_theme_dark_onErrorContainer = Color(0xFFFFDAD6) 55 | internal val md_theme_dark_background = Color(0xFF221B00) 56 | internal val md_theme_dark_onBackground = Color(0xFFFFE264) 57 | internal val md_theme_dark_surface = Color(0xFF221B00) 58 | internal val md_theme_dark_onSurface = Color(0xFFFFE264) 59 | internal val md_theme_dark_surfaceVariant = Color(0xFF3F484B) 60 | internal val md_theme_dark_onSurfaceVariant = Color(0xFFBFC8CB) 61 | internal val md_theme_dark_outline = Color(0xFF899295) 62 | internal val md_theme_dark_inverseOnSurface = Color(0xFF221B00) 63 | internal val md_theme_dark_inverseSurface = Color(0xFFFFE264) 64 | internal val md_theme_dark_inversePrimary = Color(0xFF00687A) 65 | internal val md_theme_dark_shadow = Color(0xFF000000) 66 | internal val md_theme_dark_surfaceTint = Color(0xFF55D6F4) 67 | internal val md_theme_dark_outlineVariant = Color(0xFF3F484B) 68 | internal val md_theme_dark_scrim = Color(0xFF000000) 69 | 70 | 71 | internal val seed = Color(0xFF2C3639) 72 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/network/chaintech/screencapture/theme/Theme.kt: -------------------------------------------------------------------------------- 1 | package network.chaintech.screencapture.theme 2 | 3 | import androidx.compose.foundation.isSystemInDarkTheme 4 | import androidx.compose.material3.MaterialTheme 5 | import androidx.compose.material3.Surface 6 | import androidx.compose.material3.darkColorScheme 7 | import androidx.compose.material3.lightColorScheme 8 | import androidx.compose.runtime.* 9 | 10 | private val LightColorScheme = lightColorScheme( 11 | primary = md_theme_light_primary, 12 | onPrimary = md_theme_light_onPrimary, 13 | primaryContainer = md_theme_light_primaryContainer, 14 | onPrimaryContainer = md_theme_light_onPrimaryContainer, 15 | secondary = md_theme_light_secondary, 16 | onSecondary = md_theme_light_onSecondary, 17 | secondaryContainer = md_theme_light_secondaryContainer, 18 | onSecondaryContainer = md_theme_light_onSecondaryContainer, 19 | tertiary = md_theme_light_tertiary, 20 | onTertiary = md_theme_light_onTertiary, 21 | tertiaryContainer = md_theme_light_tertiaryContainer, 22 | onTertiaryContainer = md_theme_light_onTertiaryContainer, 23 | error = md_theme_light_error, 24 | errorContainer = md_theme_light_errorContainer, 25 | onError = md_theme_light_onError, 26 | onErrorContainer = md_theme_light_onErrorContainer, 27 | background = md_theme_light_background, 28 | onBackground = md_theme_light_onBackground, 29 | surface = md_theme_light_surface, 30 | onSurface = md_theme_light_onSurface, 31 | surfaceVariant = md_theme_light_surfaceVariant, 32 | onSurfaceVariant = md_theme_light_onSurfaceVariant, 33 | outline = md_theme_light_outline, 34 | inverseOnSurface = md_theme_light_inverseOnSurface, 35 | inverseSurface = md_theme_light_inverseSurface, 36 | inversePrimary = md_theme_light_inversePrimary, 37 | surfaceTint = md_theme_light_surfaceTint, 38 | outlineVariant = md_theme_light_outlineVariant, 39 | scrim = md_theme_light_scrim, 40 | ) 41 | 42 | private val DarkColorScheme = darkColorScheme( 43 | primary = md_theme_dark_primary, 44 | onPrimary = md_theme_dark_onPrimary, 45 | primaryContainer = md_theme_dark_primaryContainer, 46 | onPrimaryContainer = md_theme_dark_onPrimaryContainer, 47 | secondary = md_theme_dark_secondary, 48 | onSecondary = md_theme_dark_onSecondary, 49 | secondaryContainer = md_theme_dark_secondaryContainer, 50 | onSecondaryContainer = md_theme_dark_onSecondaryContainer, 51 | tertiary = md_theme_dark_tertiary, 52 | onTertiary = md_theme_dark_onTertiary, 53 | tertiaryContainer = md_theme_dark_tertiaryContainer, 54 | onTertiaryContainer = md_theme_dark_onTertiaryContainer, 55 | error = md_theme_dark_error, 56 | errorContainer = md_theme_dark_errorContainer, 57 | onError = md_theme_dark_onError, 58 | onErrorContainer = md_theme_dark_onErrorContainer, 59 | background = md_theme_dark_background, 60 | onBackground = md_theme_dark_onBackground, 61 | surface = md_theme_dark_surface, 62 | onSurface = md_theme_dark_onSurface, 63 | surfaceVariant = md_theme_dark_surfaceVariant, 64 | onSurfaceVariant = md_theme_dark_onSurfaceVariant, 65 | outline = md_theme_dark_outline, 66 | inverseOnSurface = md_theme_dark_inverseOnSurface, 67 | inverseSurface = md_theme_dark_inverseSurface, 68 | inversePrimary = md_theme_dark_inversePrimary, 69 | surfaceTint = md_theme_dark_surfaceTint, 70 | outlineVariant = md_theme_dark_outlineVariant, 71 | scrim = md_theme_dark_scrim, 72 | ) 73 | 74 | internal val LocalThemeIsDark = compositionLocalOf { mutableStateOf(true) } 75 | 76 | @Composable 77 | internal fun AppTheme( 78 | content: @Composable() () -> Unit 79 | ) { 80 | val systemIsDark = isSystemInDarkTheme() 81 | val isDarkState = remember { mutableStateOf(systemIsDark) } 82 | CompositionLocalProvider( 83 | LocalThemeIsDark provides isDarkState 84 | ) { 85 | val isDark by isDarkState 86 | SystemAppearance(!isDark) 87 | MaterialTheme( 88 | colorScheme = if (isDark) DarkColorScheme else LightColorScheme, 89 | content = { Surface(content = content) } 90 | ) 91 | } 92 | } 93 | 94 | @Composable 95 | internal expect fun SystemAppearance(isDark: Boolean) 96 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" 250 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/network/chaintech/screencapture/App.kt: -------------------------------------------------------------------------------- 1 | package network.chaintech.screencapture 2 | 3 | import androidx.compose.foundation.Canvas 4 | import androidx.compose.foundation.Image 5 | import androidx.compose.foundation.background 6 | import androidx.compose.foundation.border 7 | import androidx.compose.foundation.clickable 8 | import androidx.compose.foundation.layout.Box 9 | import androidx.compose.foundation.layout.Column 10 | import androidx.compose.foundation.layout.ColumnScope 11 | import androidx.compose.foundation.layout.Row 12 | import androidx.compose.foundation.layout.Spacer 13 | import androidx.compose.foundation.layout.fillMaxSize 14 | import androidx.compose.foundation.layout.fillMaxWidth 15 | import androidx.compose.foundation.layout.height 16 | import androidx.compose.foundation.layout.padding 17 | import androidx.compose.foundation.layout.size 18 | import androidx.compose.foundation.layout.statusBarsPadding 19 | import androidx.compose.foundation.layout.width 20 | import androidx.compose.foundation.shape.CircleShape 21 | import androidx.compose.foundation.shape.RoundedCornerShape 22 | import androidx.compose.material.icons.Icons 23 | import androidx.compose.material.icons.filled.Done 24 | import androidx.compose.material.icons.filled.Share 25 | import androidx.compose.material3.Card 26 | import androidx.compose.material3.CardDefaults 27 | import androidx.compose.material3.Icon 28 | import androidx.compose.material3.Text 29 | import androidx.compose.runtime.Composable 30 | import androidx.compose.ui.Alignment 31 | import androidx.compose.ui.Modifier 32 | import androidx.compose.ui.draw.clip 33 | import androidx.compose.ui.geometry.Offset 34 | import androidx.compose.ui.graphics.Color 35 | import androidx.compose.ui.graphics.PathEffect 36 | import androidx.compose.ui.layout.ContentScale 37 | import androidx.compose.ui.text.TextStyle 38 | import androidx.compose.ui.text.font.FontWeight 39 | import androidx.compose.ui.unit.dp 40 | import androidx.compose.ui.unit.sp 41 | import composemultiplatformscreencapture.composeapp.generated.resources.Res 42 | import composemultiplatformscreencapture.composeapp.generated.resources.qr_code 43 | import network.chaintech.composeMultiplatformScreenCapture.ScreenCaptureComposable 44 | import network.chaintech.composeMultiplatformScreenCapture.rememberScreenCaptureController 45 | import network.chaintech.screencapture.theme.AppTheme 46 | import org.jetbrains.compose.resources.painterResource 47 | 48 | @Composable 49 | internal fun App() = AppTheme { 50 | PaymentReceived() 51 | } 52 | 53 | @Composable 54 | fun PaymentReceived() { 55 | val captureController = rememberScreenCaptureController() 56 | Column( 57 | modifier = Modifier 58 | .fillMaxSize() 59 | .background(Color(0xFF004DEF)) 60 | ) { 61 | Row( 62 | modifier = Modifier.padding(top = 20.dp).statusBarsPadding(), 63 | verticalAlignment = Alignment.CenterVertically 64 | ) { 65 | Spacer(modifier = Modifier.weight(1f)) 66 | Icon( 67 | Icons.Filled.Share, 68 | "Share", 69 | modifier = Modifier.padding(end = 12.dp).size(28.dp) 70 | .clickable { captureController.capture() }, 71 | tint = Color.White 72 | ) 73 | } 74 | 75 | ScreenCaptureComposable( 76 | modifier = Modifier, 77 | screenCaptureController = captureController, 78 | shareImage = true, 79 | onCaptured = { img, throwable -> 80 | 81 | } 82 | ) { 83 | AppTheme { 84 | Column(modifier = Modifier.background(Color.White)) { 85 | PaymentReceivedView() 86 | } 87 | } 88 | } 89 | } 90 | } 91 | 92 | @Composable 93 | fun ColumnScope.PaymentReceivedView() { 94 | Box(modifier = Modifier.fillMaxWidth()) { 95 | Box(modifier = Modifier.height(200.dp).fillMaxWidth().background(Color(0xFF004DEF))) { 96 | Text( 97 | text = "Invoice", 98 | style = TextStyle(fontSize = 20.sp, color = Color.White), 99 | fontWeight = FontWeight.Medium, 100 | modifier = Modifier.padding(top = 18.dp).align(Alignment.TopCenter) 101 | ) 102 | } 103 | Card( 104 | modifier = Modifier 105 | .padding(top = 96.dp, start = 16.dp, end = 16.dp, bottom = 30.dp) 106 | .fillMaxWidth(), 107 | colors = CardDefaults.cardColors(Color.White), 108 | shape = RoundedCornerShape(6.dp), 109 | elevation = CardDefaults.cardElevation(2.dp) 110 | ) { 111 | Column( 112 | modifier = Modifier 113 | .fillMaxWidth() 114 | ) { 115 | Text( 116 | text = "Money Transfer", 117 | style = TextStyle(fontSize = 20.sp, color = Color.Black), 118 | fontWeight = FontWeight.Medium, 119 | modifier = Modifier.padding(top = 50.dp).align(Alignment.CenterHorizontally) 120 | ) 121 | Text( 122 | text = "Powered by MobiKwik", 123 | style = TextStyle(fontSize = 20.sp, color = Color.Black), 124 | fontWeight = FontWeight.Medium, 125 | modifier = Modifier.padding(top = 4.dp).align(Alignment.CenterHorizontally) 126 | ) 127 | 128 | Column( 129 | modifier = Modifier 130 | .fillMaxWidth(0.8f) 131 | .padding(top = 16.dp) 132 | .background(Color(0xFFF7F7F7), RoundedCornerShape(8.dp)) 133 | .padding(bottom = 10.dp).align(Alignment.CenterHorizontally), 134 | ) { 135 | Text( 136 | text = "Order ID: OMK25e9ef4ed5005544", 137 | style = TextStyle(fontSize = 14.sp, color = Color.Gray), 138 | modifier = Modifier.padding(top = 10.dp, start = 16.dp, end = 16.dp) 139 | ) 140 | 141 | DashedLine(modifier = Modifier.padding(top = 10.dp).height(2.dp).fillMaxWidth()) 142 | 143 | Text( 144 | text = "UPI Transaction ID: 4320692331397", 145 | style = TextStyle(fontSize = 14.sp, color = Color.Gray), 146 | modifier = Modifier.padding(top = 10.dp, start = 16.dp, end = 16.dp) 147 | ) 148 | } 149 | Text( 150 | text = "Fri, 04 Feb 2024, 8:12 pm", 151 | style = TextStyle(fontSize = 14.sp, color = Color.Gray), 152 | modifier = Modifier.padding(top = 16.dp, bottom = 16.dp) 153 | .align(Alignment.CenterHorizontally) 154 | ) 155 | } 156 | } 157 | Column(modifier = Modifier.fillMaxWidth()) { 158 | Card( 159 | modifier = Modifier 160 | .padding(top = 66.dp) 161 | .size(60.dp) 162 | .align(Alignment.CenterHorizontally), 163 | colors = CardDefaults.cardColors(Color.White), 164 | shape = CircleShape, 165 | elevation = CardDefaults.cardElevation(0.dp) 166 | ) { 167 | Box( 168 | modifier = Modifier 169 | .padding(3.dp) 170 | .fillMaxSize() 171 | .border(2.dp, Color(0xFF004DEF), CircleShape) 172 | .clip(CircleShape) 173 | .align(Alignment.CenterHorizontally) 174 | ) { 175 | Icon( 176 | Icons.Filled.Done, 177 | "Share", 178 | modifier = Modifier.size(36.dp).align(Alignment.Center), 179 | tint = Color.Green 180 | ) 181 | } 182 | } 183 | } 184 | } 185 | Column( 186 | modifier = Modifier.background(Color(0xFFE6EBE5)) 187 | .padding(horizontal = 14.dp, vertical = 18.dp) 188 | ) { 189 | Row(modifier = Modifier.fillMaxWidth()) { 190 | Text( 191 | text = "Total Amount Paid", 192 | style = TextStyle(fontSize = 20.sp, color = Color.Black), 193 | fontWeight = FontWeight.Medium, 194 | modifier = Modifier 195 | ) 196 | Spacer(modifier = Modifier.width(1.dp).weight(1f)) 197 | Text( 198 | text = "₹395", 199 | style = TextStyle(fontSize = 20.sp, color = Color.Black), 200 | fontWeight = FontWeight.Medium, 201 | modifier = Modifier 202 | ) 203 | } 204 | Text( 205 | text = "Paid from UPI: ₹395", 206 | style = TextStyle(fontSize = 14.sp, color = Color.Gray), 207 | modifier = Modifier.padding(top = 8.dp) 208 | ) 209 | } 210 | 211 | Text( 212 | text = "Billed To", 213 | style = TextStyle(fontSize = 16.sp, color = Color.Black), 214 | modifier = Modifier.padding(top = 20.dp, start = 14.dp, end = 14.dp) 215 | ) 216 | 217 | Row(modifier = Modifier.padding(top = 8.dp, start = 14.dp, end = 14.dp).fillMaxWidth()) { 218 | Text( 219 | text = "Name", 220 | style = TextStyle(fontSize = 16.sp, color = Color.Gray), 221 | modifier = Modifier 222 | ) 223 | Spacer(modifier = Modifier.width(1.dp).weight(1f)) 224 | Text( 225 | text = "Robert Jhon Castillo", 226 | style = TextStyle(fontSize = 16.sp, color = Color.Black), 227 | modifier = Modifier 228 | ) 229 | } 230 | Row(modifier = Modifier.padding(top = 8.dp, start = 14.dp, end = 14.dp).fillMaxWidth()) { 231 | Text( 232 | text = "Mobile No.", 233 | style = TextStyle(fontSize = 16.sp, color = Color.Gray), 234 | modifier = Modifier 235 | ) 236 | Spacer(modifier = Modifier.width(1.dp).weight(1f)) 237 | Text( 238 | text = "7896554456", 239 | style = TextStyle(fontSize = 16.sp, color = Color.Black), 240 | modifier = Modifier 241 | ) 242 | } 243 | Row(modifier = Modifier.padding(top = 8.dp, start = 14.dp, end = 14.dp).fillMaxWidth()) { 244 | Text( 245 | text = "VPA", 246 | style = TextStyle(fontSize = 16.sp, color = Color.Gray), 247 | modifier = Modifier 248 | ) 249 | Spacer(modifier = Modifier.width(1.dp).weight(1f)) 250 | Text( 251 | text = "7896554456@ikwik", 252 | style = TextStyle(fontSize = 16.sp, color = Color.Black), 253 | modifier = Modifier 254 | ) 255 | } 256 | 257 | Text( 258 | text = "Received By", 259 | style = TextStyle(fontSize = 16.sp, color = Color.Black), 260 | modifier = Modifier.padding(top = 20.dp, start = 14.dp, end = 14.dp) 261 | ) 262 | 263 | Row(modifier = Modifier.padding(top = 8.dp, start = 14.dp, end = 14.dp).fillMaxWidth()) { 264 | Text( 265 | text = "Name", 266 | style = TextStyle(fontSize = 16.sp, color = Color.Gray), 267 | modifier = Modifier 268 | ) 269 | Spacer(modifier = Modifier.width(1.dp).weight(1f)) 270 | Text( 271 | text = "Robert Jhon Castillo", 272 | style = TextStyle(fontSize = 16.sp, color = Color.Black), 273 | modifier = Modifier 274 | ) 275 | } 276 | Row(modifier = Modifier.padding(top = 8.dp, start = 14.dp, end = 14.dp).fillMaxWidth()) { 277 | Text( 278 | text = "Mobile No.", 279 | style = TextStyle(fontSize = 16.sp, color = Color.Gray), 280 | modifier = Modifier 281 | ) 282 | Spacer(modifier = Modifier.width(1.dp).weight(1f)) 283 | Text( 284 | text = "NA", 285 | style = TextStyle(fontSize = 16.sp, color = Color.Black), 286 | modifier = Modifier 287 | ) 288 | } 289 | Row(modifier = Modifier.padding(top = 8.dp, start = 14.dp, end = 14.dp).fillMaxWidth()) { 290 | Text( 291 | text = "VPA", 292 | style = TextStyle(fontSize = 16.sp, color = Color.Gray), 293 | modifier = Modifier 294 | ) 295 | Spacer(modifier = Modifier.width(1.dp).weight(1f)) 296 | Text( 297 | text = "paytm-jiomobility@paytm", 298 | style = TextStyle(fontSize = 16.sp, color = Color.Black), 299 | modifier = Modifier 300 | ) 301 | } 302 | Image( 303 | modifier = Modifier 304 | .padding(top = 26.dp, bottom = 40.dp) 305 | .size(90.dp) 306 | .align(Alignment.CenterHorizontally), 307 | painter = painterResource(Res.drawable.qr_code), 308 | contentDescription = null, 309 | contentScale = ContentScale.Crop 310 | ) 311 | } 312 | 313 | @Composable 314 | private fun DashedLine(modifier: Modifier) { 315 | val pathEffect = PathEffect.dashPathEffect(floatArrayOf(10f, 10f), 0f) 316 | Canvas(modifier) { 317 | 318 | drawLine( 319 | color = Color.Gray, 320 | start = Offset(0f, 0f), 321 | end = Offset(size.width, 0f), 322 | pathEffect = pathEffect 323 | ) 324 | } 325 | } -------------------------------------------------------------------------------- /iosApp/iosApp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 56; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A93A953B29CC810C00F8E227 /* iosApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = A93A953A29CC810C00F8E227 /* iosApp.swift */; }; 11 | A93A953F29CC810D00F8E227 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A93A953E29CC810D00F8E227 /* Assets.xcassets */; }; 12 | A93A954229CC810D00F8E227 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A93A954129CC810D00F8E227 /* Preview Assets.xcassets */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXFileReference section */ 16 | A93A953729CC810C00F8E227 /* ComposeMultiplatformScreenCapture.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ComposeMultiplatformScreenCapture.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 17 | A93A953A29CC810C00F8E227 /* iosApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iosApp.swift; sourceTree = ""; }; 18 | A93A953E29CC810D00F8E227 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 19 | A93A954129CC810D00F8E227 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 20 | /* End PBXFileReference section */ 21 | 22 | /* Begin PBXFrameworksBuildPhase section */ 23 | A93A953429CC810C00F8E227 /* Frameworks */ = { 24 | isa = PBXFrameworksBuildPhase; 25 | buildActionMask = 2147483647; 26 | files = ( 27 | ); 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXFrameworksBuildPhase section */ 31 | 32 | /* Begin PBXGroup section */ 33 | A93A952E29CC810C00F8E227 = { 34 | isa = PBXGroup; 35 | children = ( 36 | A93A953929CC810C00F8E227 /* iosApp */, 37 | A93A953829CC810C00F8E227 /* Products */, 38 | C4127409AE3703430489E7BC /* Frameworks */, 39 | ); 40 | sourceTree = ""; 41 | }; 42 | A93A953829CC810C00F8E227 /* Products */ = { 43 | isa = PBXGroup; 44 | children = ( 45 | A93A953729CC810C00F8E227 /* ComposeMultiplatformScreenCapture.app */, 46 | ); 47 | name = Products; 48 | sourceTree = ""; 49 | }; 50 | A93A953929CC810C00F8E227 /* iosApp */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | A93A953A29CC810C00F8E227 /* iosApp.swift */, 54 | A93A953E29CC810D00F8E227 /* Assets.xcassets */, 55 | A93A954029CC810D00F8E227 /* Preview Content */, 56 | ); 57 | path = iosApp; 58 | sourceTree = ""; 59 | }; 60 | A93A954029CC810D00F8E227 /* Preview Content */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | A93A954129CC810D00F8E227 /* Preview Assets.xcassets */, 64 | ); 65 | path = "Preview Content"; 66 | sourceTree = ""; 67 | }; 68 | C4127409AE3703430489E7BC /* Frameworks */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | ); 72 | name = Frameworks; 73 | sourceTree = ""; 74 | }; 75 | /* End PBXGroup section */ 76 | 77 | /* Begin PBXNativeTarget section */ 78 | A93A953629CC810C00F8E227 /* iosApp */ = { 79 | isa = PBXNativeTarget; 80 | buildConfigurationList = A93A954529CC810D00F8E227 /* Build configuration list for PBXNativeTarget "iosApp" */; 81 | buildPhases = ( 82 | A9D80A052AAB5CDE006C8738 /* ShellScript */, 83 | A93A953329CC810C00F8E227 /* Sources */, 84 | A93A953429CC810C00F8E227 /* Frameworks */, 85 | A93A953529CC810C00F8E227 /* Resources */, 86 | ); 87 | buildRules = ( 88 | ); 89 | dependencies = ( 90 | ); 91 | name = iosApp; 92 | productName = iosApp; 93 | productReference = A93A953729CC810C00F8E227 /* ComposeMultiplatformScreenCapture.app */; 94 | productType = "com.apple.product-type.application"; 95 | }; 96 | /* End PBXNativeTarget section */ 97 | 98 | /* Begin PBXProject section */ 99 | A93A952F29CC810C00F8E227 /* Project object */ = { 100 | isa = PBXProject; 101 | attributes = { 102 | LastSwiftUpdateCheck = 1420; 103 | LastUpgradeCheck = 1420; 104 | TargetAttributes = { 105 | A93A953629CC810C00F8E227 = { 106 | CreatedOnToolsVersion = 14.2; 107 | }; 108 | }; 109 | }; 110 | buildConfigurationList = A93A953229CC810C00F8E227 /* Build configuration list for PBXProject "iosApp" */; 111 | compatibilityVersion = "Xcode 14.0"; 112 | developmentRegion = en; 113 | hasScannedForEncodings = 0; 114 | knownRegions = ( 115 | en, 116 | Base, 117 | ); 118 | mainGroup = A93A952E29CC810C00F8E227; 119 | productRefGroup = A93A953829CC810C00F8E227 /* Products */; 120 | projectDirPath = ""; 121 | projectRoot = ""; 122 | targets = ( 123 | A93A953629CC810C00F8E227 /* iosApp */, 124 | ); 125 | }; 126 | /* End PBXProject section */ 127 | 128 | /* Begin PBXResourcesBuildPhase section */ 129 | A93A953529CC810C00F8E227 /* Resources */ = { 130 | isa = PBXResourcesBuildPhase; 131 | buildActionMask = 2147483647; 132 | files = ( 133 | A93A954229CC810D00F8E227 /* Preview Assets.xcassets in Resources */, 134 | A93A953F29CC810D00F8E227 /* Assets.xcassets in Resources */, 135 | ); 136 | runOnlyForDeploymentPostprocessing = 0; 137 | }; 138 | /* End PBXResourcesBuildPhase section */ 139 | 140 | /* Begin PBXShellScriptBuildPhase section */ 141 | A9D80A052AAB5CDE006C8738 /* ShellScript */ = { 142 | isa = PBXShellScriptBuildPhase; 143 | buildActionMask = 2147483647; 144 | files = ( 145 | ); 146 | inputFileListPaths = ( 147 | ); 148 | inputPaths = ( 149 | ); 150 | outputFileListPaths = ( 151 | ); 152 | outputPaths = ( 153 | ); 154 | runOnlyForDeploymentPostprocessing = 0; 155 | shellPath = /bin/sh; 156 | shellScript = "cd \"$SRCROOT/..\"\n./gradlew :composeApp:embedAndSignAppleFrameworkForXcode\n"; 157 | }; 158 | /* End PBXShellScriptBuildPhase section */ 159 | 160 | /* Begin PBXSourcesBuildPhase section */ 161 | A93A953329CC810C00F8E227 /* Sources */ = { 162 | isa = PBXSourcesBuildPhase; 163 | buildActionMask = 2147483647; 164 | files = ( 165 | A93A953B29CC810C00F8E227 /* iosApp.swift in Sources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXSourcesBuildPhase section */ 170 | 171 | /* Begin XCBuildConfiguration section */ 172 | A93A954329CC810D00F8E227 /* Debug */ = { 173 | isa = XCBuildConfiguration; 174 | buildSettings = { 175 | ALWAYS_SEARCH_USER_PATHS = NO; 176 | CLANG_ANALYZER_NONNULL = YES; 177 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 178 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 179 | CLANG_ENABLE_MODULES = YES; 180 | CLANG_ENABLE_OBJC_ARC = YES; 181 | CLANG_ENABLE_OBJC_WEAK = YES; 182 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 183 | CLANG_WARN_BOOL_CONVERSION = YES; 184 | CLANG_WARN_COMMA = YES; 185 | CLANG_WARN_CONSTANT_CONVERSION = YES; 186 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 187 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 188 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 189 | CLANG_WARN_EMPTY_BODY = YES; 190 | CLANG_WARN_ENUM_CONVERSION = YES; 191 | CLANG_WARN_INFINITE_RECURSION = YES; 192 | CLANG_WARN_INT_CONVERSION = YES; 193 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 194 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 195 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 196 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 197 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 198 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 199 | CLANG_WARN_STRICT_PROTOTYPES = YES; 200 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 201 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 202 | CLANG_WARN_UNREACHABLE_CODE = YES; 203 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 204 | COPY_PHASE_STRIP = NO; 205 | DEBUG_INFORMATION_FORMAT = dwarf; 206 | ENABLE_STRICT_OBJC_MSGSEND = YES; 207 | ENABLE_TESTABILITY = YES; 208 | GCC_C_LANGUAGE_STANDARD = gnu11; 209 | GCC_DYNAMIC_NO_PIC = NO; 210 | GCC_NO_COMMON_BLOCKS = YES; 211 | GCC_OPTIMIZATION_LEVEL = 0; 212 | GCC_PREPROCESSOR_DEFINITIONS = ( 213 | "DEBUG=1", 214 | "$(inherited)", 215 | ); 216 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 217 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 218 | GCC_WARN_UNDECLARED_SELECTOR = YES; 219 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 220 | GCC_WARN_UNUSED_FUNCTION = YES; 221 | GCC_WARN_UNUSED_VARIABLE = YES; 222 | IPHONEOS_DEPLOYMENT_TARGET = 16.2; 223 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 224 | MTL_FAST_MATH = YES; 225 | ONLY_ACTIVE_ARCH = YES; 226 | SDKROOT = iphoneos; 227 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 228 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 229 | }; 230 | name = Debug; 231 | }; 232 | A93A954429CC810D00F8E227 /* Release */ = { 233 | isa = XCBuildConfiguration; 234 | buildSettings = { 235 | ALWAYS_SEARCH_USER_PATHS = NO; 236 | CLANG_ANALYZER_NONNULL = YES; 237 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 238 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 239 | CLANG_ENABLE_MODULES = YES; 240 | CLANG_ENABLE_OBJC_ARC = YES; 241 | CLANG_ENABLE_OBJC_WEAK = YES; 242 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 243 | CLANG_WARN_BOOL_CONVERSION = YES; 244 | CLANG_WARN_COMMA = YES; 245 | CLANG_WARN_CONSTANT_CONVERSION = YES; 246 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 247 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 248 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 258 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 259 | CLANG_WARN_STRICT_PROTOTYPES = YES; 260 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 261 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 262 | CLANG_WARN_UNREACHABLE_CODE = YES; 263 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 264 | COPY_PHASE_STRIP = NO; 265 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 266 | ENABLE_NS_ASSERTIONS = NO; 267 | ENABLE_STRICT_OBJC_MSGSEND = YES; 268 | GCC_C_LANGUAGE_STANDARD = gnu11; 269 | GCC_NO_COMMON_BLOCKS = YES; 270 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 271 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 272 | GCC_WARN_UNDECLARED_SELECTOR = YES; 273 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 274 | GCC_WARN_UNUSED_FUNCTION = YES; 275 | GCC_WARN_UNUSED_VARIABLE = YES; 276 | IPHONEOS_DEPLOYMENT_TARGET = 16.2; 277 | MTL_ENABLE_DEBUG_INFO = NO; 278 | MTL_FAST_MATH = YES; 279 | SDKROOT = iphoneos; 280 | SWIFT_COMPILATION_MODE = wholemodule; 281 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 282 | VALIDATE_PRODUCT = YES; 283 | }; 284 | name = Release; 285 | }; 286 | A93A954629CC810D00F8E227 /* Debug */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 290 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 291 | CODE_SIGN_STYLE = Automatic; 292 | CURRENT_PROJECT_VERSION = 1; 293 | DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; 294 | ENABLE_PREVIEWS = YES; 295 | FRAMEWORK_SEARCH_PATHS = ( 296 | "${inherited}", 297 | "$(SRCROOT)/../composeApp/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)", 298 | ); 299 | GENERATE_INFOPLIST_FILE = YES; 300 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 301 | LD_RUNPATH_SEARCH_PATHS = ( 302 | "$(inherited)", 303 | "@executable_path/Frameworks", 304 | ); 305 | MARKETING_VERSION = 1.0; 306 | OTHER_LDFLAGS = ( 307 | "${inherited}", 308 | "-framework", 309 | ComposeApp, 310 | ); 311 | PRODUCT_BUNDLE_IDENTIFIER = network.chaintech.screencapture.iosApp; 312 | PRODUCT_NAME = "ComposeMultiplatformScreenCapture"; 313 | SWIFT_EMIT_LOC_STRINGS = YES; 314 | SWIFT_VERSION = 5.0; 315 | TARGETED_DEVICE_FAMILY = "1,2"; 316 | }; 317 | name = Debug; 318 | }; 319 | A93A954729CC810D00F8E227 /* Release */ = { 320 | isa = XCBuildConfiguration; 321 | buildSettings = { 322 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 323 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 324 | CODE_SIGN_STYLE = Automatic; 325 | CURRENT_PROJECT_VERSION = 1; 326 | DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; 327 | ENABLE_PREVIEWS = YES; 328 | FRAMEWORK_SEARCH_PATHS = ( 329 | "${inherited}", 330 | "$(SRCROOT)/../composeApp/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)", 331 | ); 332 | GENERATE_INFOPLIST_FILE = YES; 333 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 334 | LD_RUNPATH_SEARCH_PATHS = ( 335 | "$(inherited)", 336 | "@executable_path/Frameworks", 337 | ); 338 | MARKETING_VERSION = 1.0; 339 | OTHER_LDFLAGS = ( 340 | "${inherited}", 341 | "-framework", 342 | ComposeApp, 343 | ); 344 | PRODUCT_BUNDLE_IDENTIFIER = network.chaintech.screencapture.iosApp; 345 | PRODUCT_NAME = "ComposeMultiplatformScreenCapture"; 346 | SWIFT_EMIT_LOC_STRINGS = YES; 347 | SWIFT_VERSION = 5.0; 348 | TARGETED_DEVICE_FAMILY = "1,2"; 349 | }; 350 | name = Release; 351 | }; 352 | /* End XCBuildConfiguration section */ 353 | 354 | /* Begin XCConfigurationList section */ 355 | A93A953229CC810C00F8E227 /* Build configuration list for PBXProject "iosApp" */ = { 356 | isa = XCConfigurationList; 357 | buildConfigurations = ( 358 | A93A954329CC810D00F8E227 /* Debug */, 359 | A93A954429CC810D00F8E227 /* Release */, 360 | ); 361 | defaultConfigurationIsVisible = 0; 362 | defaultConfigurationName = Release; 363 | }; 364 | A93A954529CC810D00F8E227 /* Build configuration list for PBXNativeTarget "iosApp" */ = { 365 | isa = XCConfigurationList; 366 | buildConfigurations = ( 367 | A93A954629CC810D00F8E227 /* Debug */, 368 | A93A954729CC810D00F8E227 /* Release */, 369 | ); 370 | defaultConfigurationIsVisible = 0; 371 | defaultConfigurationName = Release; 372 | }; 373 | /* End XCConfigurationList section */ 374 | }; 375 | rootObject = A93A952F29CC810C00F8E227 /* Project object */; 376 | } 377 | --------------------------------------------------------------------------------