├── screenshot.png ├── iosApp ├── Configuration │ └── Config.xcconfig ├── iosApp │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── AppIcon.appiconset │ │ │ ├── app-icon-1024.png │ │ │ └── Contents.json │ │ └── AccentColor.colorset │ │ │ └── Contents.json │ ├── Preview Content │ │ └── Preview Assets.xcassets │ │ │ └── Contents.json │ ├── iOSApp.swift │ ├── ContentView.swift │ └── Info.plist └── iosApp.xcodeproj │ └── project.pbxproj ├── composeApp ├── src │ ├── androidMain │ │ ├── res │ │ │ ├── values │ │ │ │ └── strings.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── drawable │ │ │ │ └── ic_launcher_background.xml │ │ ├── kotlin │ │ │ └── me │ │ │ │ └── fsfaysalcse │ │ │ │ └── smarthome │ │ │ │ └── MainActivity.kt │ │ └── AndroidManifest.xml │ ├── commonMain │ │ ├── composeResources │ │ │ ├── font │ │ │ │ ├── barlow_bold.ttf │ │ │ │ ├── barlow_regular.ttf │ │ │ │ ├── open_sans_bold.ttf │ │ │ │ ├── nunito_sans_bold.ttf │ │ │ │ ├── open_sans_light.ttf │ │ │ │ ├── barlow_extra_bold.ttf │ │ │ │ ├── nunito_nans_regular.ttf │ │ │ │ ├── nunito_sans_italic.ttf │ │ │ │ ├── nunito_sans_light.ttf │ │ │ │ ├── nunito_sans_medium.ttf │ │ │ │ ├── open_sans_regular.ttf │ │ │ │ ├── product_sans_black.ttf │ │ │ │ ├── product_sans_bold.ttf │ │ │ │ ├── product_sans_italic.ttf │ │ │ │ ├── product_sans_light.ttf │ │ │ │ ├── product_sans_medium.ttf │ │ │ │ ├── product_sans_thin.ttf │ │ │ │ ├── product_sans_regular.ttf │ │ │ │ └── product_sans_black_italic.ttf │ │ │ └── drawable │ │ │ │ ├── img_black_light.png │ │ │ │ ├── img_red_light.png │ │ │ │ └── compose-multiplatform.xml │ │ └── kotlin │ │ │ └── me │ │ │ └── fsfaysalcse │ │ │ └── smarthome │ │ │ ├── App.kt │ │ │ ├── theme │ │ │ └── Type.kt │ │ │ ├── widgets │ │ │ ├── ColorItem.kt │ │ │ ├── LightBeamCanvas.kt │ │ │ ├── CustomSeekBar.kt │ │ │ └── RealisticRopeLightSwitch.kt │ │ │ └── LightScreen.kt │ └── iosMain │ │ └── kotlin │ │ └── me │ │ └── fsfaysalcse │ │ └── smarthome │ │ └── MainViewController.kt └── build.gradle.kts ├── gradle ├── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties └── libs.versions.toml ├── gradle.properties ├── .gitignore ├── .fleet └── receipt.json ├── settings.gradle.kts ├── README.md ├── gradlew.bat └── gradlew /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/screenshot.png -------------------------------------------------------------------------------- /iosApp/Configuration/Config.xcconfig: -------------------------------------------------------------------------------- 1 | TEAM_ID= 2 | BUNDLE_ID=me.fsfaysalcse.smarthome.SmartHome 3 | APP_NAME=Smart Home -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Smart Home 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/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 | } -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/barlow_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/barlow_bold.ttf -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/barlow_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/barlow_regular.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/open_sans_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/open_sans_bold.ttf -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/nunito_sans_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/nunito_sans_bold.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/open_sans_light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/open_sans_light.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/drawable/img_black_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/drawable/img_black_light.png -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/drawable/img_red_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/drawable/img_red_light.png -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/barlow_extra_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/barlow_extra_bold.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/nunito_nans_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/nunito_nans_regular.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/nunito_sans_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/nunito_sans_italic.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/nunito_sans_light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/nunito_sans_light.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/nunito_sans_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/nunito_sans_medium.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/open_sans_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/open_sans_regular.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/product_sans_black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/product_sans_black.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/product_sans_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/product_sans_bold.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/product_sans_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/product_sans_italic.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/product_sans_light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/product_sans_light.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/product_sans_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/product_sans_medium.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/product_sans_thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/product_sans_thin.ttf -------------------------------------------------------------------------------- /iosApp/iosApp/iOSApp.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | @main 4 | struct iOSApp: App { 5 | var body: some Scene { 6 | WindowGroup { 7 | ContentView() 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/product_sans_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/product_sans_regular.ttf -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/font/product_sans_black_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsfaysalcse/SmartHomeKotlinKMP/HEAD/composeApp/src/commonMain/composeResources/font/product_sans_black_italic.ttf -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /composeApp/src/iosMain/kotlin/me/fsfaysalcse/smarthome/MainViewController.kt: -------------------------------------------------------------------------------- 1 | package me.fsfaysalcse.smarthome 2 | 3 | import androidx.compose.ui.window.ComposeUIViewController 4 | 5 | fun MainViewController() = ComposeUIViewController { App() } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | #Kotlin 2 | kotlin.code.style=official 3 | kotlin.daemon.jvmargs=-Xmx2048M 4 | 5 | #Gradle 6 | org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 7 | 8 | #Android 9 | android.nonTransitiveRClass=true 10 | android.useAndroidX=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "app-icon-1024.png", 5 | "idiom" : "universal", 6 | "platform" : "ios", 7 | "size" : "1024x1024" 8 | } 9 | ], 10 | "info" : { 11 | "author" : "xcode", 12 | "version" : 1 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/me/fsfaysalcse/smarthome/App.kt: -------------------------------------------------------------------------------- 1 | package me.fsfaysalcse.smarthome 2 | 3 | import androidx.compose.material3.MaterialTheme 4 | import androidx.compose.runtime.Composable 5 | import org.jetbrains.compose.ui.tooling.preview.Preview 6 | 7 | @Composable 8 | @Preview 9 | fun App() { 10 | MaterialTheme { 11 | LightScreen() 12 | } 13 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .kotlin 3 | .gradle 4 | **/build/ 5 | xcuserdata 6 | !src/**/build/ 7 | local.properties 8 | .idea 9 | .DS_Store 10 | captures 11 | .externalNativeBuild 12 | .cxx 13 | *.xcodeproj/* 14 | !*.xcodeproj/project.pbxproj 15 | !*.xcodeproj/xcshareddata/ 16 | !*.xcodeproj/project.xcworkspace/ 17 | !*.xcworkspace/contents.xcworkspacedata 18 | **/xcshareddata/WorkspaceSettings.xcsettings 19 | -------------------------------------------------------------------------------- /.fleet/receipt.json: -------------------------------------------------------------------------------- 1 | // Project generated by Kotlin Multiplatform Wizard 2 | { 3 | "spec": { 4 | "template_id": "kmt", 5 | "targets": { 6 | "android": { 7 | "ui": [ 8 | "compose" 9 | ] 10 | }, 11 | "ios": { 12 | "ui": [ 13 | "compose" 14 | ] 15 | } 16 | } 17 | }, 18 | "timestamp": "2024-12-17T11:37:34.745047430Z" 19 | } -------------------------------------------------------------------------------- /iosApp/iosApp/ContentView.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import SwiftUI 3 | import ComposeApp 4 | 5 | struct ComposeView: UIViewControllerRepresentable { 6 | func makeUIViewController(context: Context) -> UIViewController { 7 | MainViewControllerKt.MainViewController() 8 | } 9 | 10 | func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} 11 | } 12 | 13 | struct ContentView: View { 14 | var body: some View { 15 | ComposeView() 16 | .ignoresSafeArea(edges: .all) 17 | .ignoresSafeArea(.keyboard) // Compose has own keyboard handler 18 | } 19 | } 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/kotlin/me/fsfaysalcse/smarthome/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package me.fsfaysalcse.smarthome 2 | 3 | import android.os.Bundle 4 | import androidx.activity.ComponentActivity 5 | import androidx.activity.compose.setContent 6 | import androidx.compose.runtime.Composable 7 | import androidx.compose.ui.tooling.preview.Preview 8 | 9 | class MainActivity : ComponentActivity() { 10 | override fun onCreate(savedInstanceState: Bundle?) { 11 | super.onCreate(savedInstanceState) 12 | 13 | setContent { 14 | App() 15 | } 16 | } 17 | } 18 | 19 | @Preview 20 | @Composable 21 | fun AppAndroidPreview() { 22 | App() 23 | } -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "SmartHome" 2 | enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") 3 | 4 | pluginManagement { 5 | repositories { 6 | google { 7 | mavenContent { 8 | includeGroupAndSubgroups("androidx") 9 | includeGroupAndSubgroups("com.android") 10 | includeGroupAndSubgroups("com.google") 11 | } 12 | } 13 | mavenCentral() 14 | gradlePluginPortal() 15 | } 16 | } 17 | 18 | dependencyResolutionManagement { 19 | repositories { 20 | google { 21 | mavenContent { 22 | includeGroupAndSubgroups("androidx") 23 | includeGroupAndSubgroups("com.android") 24 | includeGroupAndSubgroups("com.google") 25 | } 26 | } 27 | mavenCentral() 28 | } 29 | } 30 | 31 | include(":composeApp") -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## iOS 18 Flashlight Demo 2 | 3 | ![image](https://github.com/fsfaysalcse/SmartHomeKotlinKMP/raw/main/screenshot.png) 4 | 5 | 6 | ### Folder Structure 7 | 8 | This is a Kotlin Multiplatform project targeting Android, iOS. 9 | 10 | * `/composeApp` is for code that will be shared across your Compose Multiplatform applications. 11 | It contains several subfolders: 12 | - `commonMain` is for code that’s common for all targets. 13 | - Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. 14 | For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app, 15 | `iosMain` would be the right folder for such calls. 16 | 17 | * `/iosApp` contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform, 18 | you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project. 19 | 20 | 21 | Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html)… -------------------------------------------------------------------------------- /composeApp/src/androidMain/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/me/fsfaysalcse/smarthome/theme/Type.kt: -------------------------------------------------------------------------------- 1 | package me.fsfaysalcse.smarthome.theme 2 | 3 | import androidx.compose.runtime.Composable 4 | import org.jetbrains.compose.resources.Font 5 | import androidx.compose.ui.text.font.FontFamily 6 | import androidx.compose.ui.text.font.FontWeight 7 | import smarthome.composeapp.generated.resources.Res 8 | import smarthome.composeapp.generated.resources.product_sans_black 9 | import smarthome.composeapp.generated.resources.product_sans_bold 10 | import smarthome.composeapp.generated.resources.product_sans_light 11 | import smarthome.composeapp.generated.resources.product_sans_medium 12 | import smarthome.composeapp.generated.resources.product_sans_regular 13 | import smarthome.composeapp.generated.resources.product_sans_thin 14 | 15 | 16 | @Composable 17 | fun getProductSansFont() = FontFamily( 18 | Font(Res.font.product_sans_regular, FontWeight.Normal), 19 | Font(Res.font.product_sans_bold, FontWeight.Bold), 20 | Font(Res.font.product_sans_light, FontWeight.Light), 21 | Font(Res.font.product_sans_medium, FontWeight.Medium), 22 | Font(Res.font.product_sans_thin, FontWeight.Thin), 23 | Font(Res.font.product_sans_black, FontWeight.Black) 24 | ) 25 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/me/fsfaysalcse/smarthome/widgets/ColorItem.kt: -------------------------------------------------------------------------------- 1 | package com.swiftie.iosflighlight 2 | 3 | import androidx.compose.foundation.background 4 | import androidx.compose.foundation.border 5 | import androidx.compose.foundation.clickable 6 | import androidx.compose.foundation.layout.Box 7 | import androidx.compose.foundation.layout.size 8 | import androidx.compose.foundation.shape.CircleShape 9 | import androidx.compose.runtime.Composable 10 | import androidx.compose.ui.Modifier 11 | import androidx.compose.ui.draw.clip 12 | import androidx.compose.ui.graphics.Brush 13 | import androidx.compose.ui.graphics.Color 14 | import androidx.compose.ui.unit.dp 15 | 16 | 17 | @Composable 18 | fun ColorItem(color: Color, isSelected: Boolean, onClick: () -> Unit) { 19 | Box( 20 | modifier = Modifier 21 | .size(50.dp) 22 | .clip(CircleShape) 23 | .background(color, shape = CircleShape) 24 | .border( 25 | width = 5.dp, 26 | brush = if (isSelected) { 27 | Brush.linearGradient( 28 | colors = listOf(Color.Black, Color.Black) 29 | ) 30 | } else { 31 | Brush.linearGradient( 32 | colors = listOf(Color.Transparent,Color.Transparent) 33 | ) 34 | }, 35 | shape = CircleShape 36 | ) 37 | .clickable { onClick() } 38 | ) 39 | } 40 | 41 | 42 | val COLOR_LIST = listOf( 43 | Color(0xFF5B42F9), 44 | Color(0xFFFB9700), 45 | Color(0xFF00B6D1), 46 | Color(0xFF4AB27A), 47 | Color(0xFFFF6161), 48 | Color(0xFFA97C50) 49 | ) -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/me/fsfaysalcse/smarthome/widgets/LightBeamCanvas.kt: -------------------------------------------------------------------------------- 1 | package me.fsfaysalcse.smarthome.widgets 2 | 3 | import androidx.compose.foundation.Canvas 4 | import androidx.compose.runtime.Composable 5 | import androidx.compose.ui.Modifier 6 | import androidx.compose.ui.graphics.Brush 7 | import androidx.compose.ui.graphics.Color 8 | import androidx.compose.ui.graphics.Path 9 | 10 | @Composable 11 | fun LightBeamCanvas( 12 | modifier: Modifier = Modifier, 13 | isVisible: Boolean = true, 14 | lightOpacity: Float = 0.6f, 15 | lightColor: Color = Color.White, 16 | topConeWidth : Float = 220f, 17 | bottomConeWidth : Float = 600f, 18 | coneHeight : Float = 500f 19 | ) { 20 | 21 | Canvas( 22 | modifier = modifier 23 | ) { 24 | if (isVisible) { 25 | val canvasWidth = size.width 26 | val centerX = canvasWidth / 2 27 | val topY = 0f 28 | val bottomY = coneHeight 29 | 30 | val path = Path().apply { 31 | moveTo(centerX - topConeWidth / 2, topY) 32 | lineTo(centerX + topConeWidth / 2, topY) 33 | lineTo(centerX + bottomConeWidth / 2, bottomY) 34 | lineTo(centerX - bottomConeWidth / 2, bottomY) 35 | close() 36 | } 37 | 38 | drawPath( 39 | path = path, 40 | brush = Brush.verticalGradient( 41 | colors = listOf( 42 | lightColor.copy(alpha = lightOpacity), 43 | Color.Transparent 44 | ), 45 | startY = topY, 46 | endY = bottomY 47 | ) 48 | ) 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /iosApp/iosApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | CADisableMinimumFrameDurationOnPhone 24 | 25 | UIApplicationSceneManifest 26 | 27 | UIApplicationSupportsMultipleScenes 28 | 29 | 30 | UILaunchScreen 31 | 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /gradle/libs.versions.toml: -------------------------------------------------------------------------------- 1 | [versions] 2 | agp = "8.5.2" 3 | android-compileSdk = "34" 4 | android-minSdk = "24" 5 | android-targetSdk = "34" 6 | androidx-activityCompose = "1.9.3" 7 | androidx-appcompat = "1.7.0" 8 | androidx-constraintlayout = "2.2.0" 9 | androidx-core-ktx = "1.15.0" 10 | androidx-espresso-core = "3.6.1" 11 | androidx-lifecycle = "2.8.4" 12 | androidx-material = "1.12.0" 13 | androidx-test-junit = "1.2.1" 14 | compose-multiplatform = "1.7.0" 15 | junit = "4.13.2" 16 | kotlin = "2.1.0" 17 | 18 | [libraries] 19 | kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } 20 | kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" } 21 | junit = { group = "junit", name = "junit", version.ref = "junit" } 22 | androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidx-core-ktx" } 23 | androidx-test-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-junit" } 24 | androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "androidx-espresso-core" } 25 | androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidx-appcompat" } 26 | androidx-material = { group = "com.google.android.material", name = "material", version.ref = "androidx-material" } 27 | androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "androidx-constraintlayout" } 28 | androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" } 29 | androidx-lifecycle-viewmodel = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-viewmodel", version.ref = "androidx-lifecycle" } 30 | androidx-lifecycle-runtime-compose = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidx-lifecycle" } 31 | 32 | [plugins] 33 | androidApplication = { id = "com.android.application", version.ref = "agp" } 34 | androidLibrary = { id = "com.android.library", version.ref = "agp" } 35 | composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" } 36 | composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } 37 | kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } -------------------------------------------------------------------------------- /composeApp/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import org.jetbrains.compose.desktop.application.dsl.TargetFormat 2 | import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi 3 | import org.jetbrains.kotlin.gradle.dsl.JvmTarget 4 | 5 | plugins { 6 | alias(libs.plugins.kotlinMultiplatform) 7 | alias(libs.plugins.androidApplication) 8 | alias(libs.plugins.composeMultiplatform) 9 | alias(libs.plugins.composeCompiler) 10 | } 11 | 12 | kotlin { 13 | androidTarget { 14 | @OptIn(ExperimentalKotlinGradlePluginApi::class) 15 | compilerOptions { 16 | jvmTarget.set(JvmTarget.JVM_11) 17 | } 18 | } 19 | 20 | listOf( 21 | iosX64(), 22 | iosArm64(), 23 | iosSimulatorArm64() 24 | ).forEach { iosTarget -> 25 | iosTarget.binaries.framework { 26 | baseName = "ComposeApp" 27 | isStatic = true 28 | } 29 | } 30 | 31 | sourceSets { 32 | 33 | androidMain.dependencies { 34 | implementation(compose.preview) 35 | implementation(libs.androidx.activity.compose) 36 | } 37 | commonMain.dependencies { 38 | implementation(compose.runtime) 39 | implementation(compose.foundation) 40 | implementation(compose.material3) 41 | implementation(compose.ui) 42 | implementation(compose.components.resources) 43 | implementation(compose.components.uiToolingPreview) 44 | implementation(libs.androidx.lifecycle.viewmodel) 45 | implementation(libs.androidx.lifecycle.runtime.compose) 46 | } 47 | } 48 | } 49 | 50 | android { 51 | namespace = "me.fsfaysalcse.smarthome" 52 | compileSdk = libs.versions.android.compileSdk.get().toInt() 53 | 54 | defaultConfig { 55 | applicationId = "me.fsfaysalcse.smarthome" 56 | minSdk = libs.versions.android.minSdk.get().toInt() 57 | targetSdk = libs.versions.android.targetSdk.get().toInt() 58 | versionCode = 1 59 | versionName = "1.0" 60 | } 61 | packaging { 62 | resources { 63 | excludes += "/META-INF/{AL2.0,LGPL2.1}" 64 | } 65 | } 66 | buildTypes { 67 | getByName("release") { 68 | isMinifyEnabled = false 69 | } 70 | } 71 | compileOptions { 72 | sourceCompatibility = JavaVersion.VERSION_11 73 | targetCompatibility = JavaVersion.VERSION_11 74 | } 75 | } 76 | 77 | dependencies { 78 | debugImplementation(compose.uiTooling) 79 | } 80 | 81 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/me/fsfaysalcse/smarthome/widgets/CustomSeekBar.kt: -------------------------------------------------------------------------------- 1 | package me.fsfaysalcse.smarthome.widgets 2 | 3 | import androidx.compose.foundation.Canvas 4 | import androidx.compose.foundation.gestures.detectHorizontalDragGestures 5 | import androidx.compose.foundation.layout.Box 6 | import androidx.compose.foundation.layout.fillMaxWidth 7 | import androidx.compose.foundation.layout.height 8 | import androidx.compose.runtime.Composable 9 | import androidx.compose.runtime.mutableStateOf 10 | import androidx.compose.runtime.remember 11 | import androidx.compose.ui.Modifier 12 | import androidx.compose.ui.geometry.CornerRadius 13 | import androidx.compose.ui.geometry.Offset 14 | import androidx.compose.ui.geometry.Size 15 | import androidx.compose.ui.graphics.Color 16 | import androidx.compose.ui.input.pointer.pointerInput 17 | import androidx.compose.ui.platform.LocalDensity 18 | import androidx.compose.ui.unit.dp 19 | 20 | 21 | @Composable 22 | fun CustomSeekBar( 23 | modifier: Modifier = Modifier, 24 | progress: Float, 25 | onProgressChanged: (Float) -> Unit 26 | ) { 27 | val stepCount = 10 28 | val steps = List(stepCount) { it * 100f / (stepCount - 1) } 29 | val progressState = remember { mutableStateOf(progress) } 30 | val dragOffset = remember { mutableStateOf(0f) } 31 | 32 | val localDensity = LocalDensity.current 33 | 34 | Box(modifier = modifier) { 35 | Canvas(modifier = Modifier.fillMaxWidth().height(50.dp).pointerInput(Unit) { 36 | detectHorizontalDragGestures { _, dragAmount -> 37 | val newOffset = dragOffset.value + dragAmount 38 | dragOffset.value = newOffset.coerceIn(0f, size.width.toFloat()) 39 | progressState.value = dragOffset.value / size.width 40 | onProgressChanged(progressState.value) 41 | } 42 | }) { 43 | val width = size.width 44 | val height = size.height 45 | val progressBarHeight = with(localDensity) { 50.dp.toPx() } 46 | val stepHeight = with(localDensity) { 10.dp.toPx() } 47 | val cornerRadius = with(localDensity) { 10.dp.toPx() } 48 | val progressWidth = progressState.value * width 49 | 50 | drawRoundRect( 51 | color = Color.Black.copy(alpha = 0.5f), 52 | size = Size(width, progressBarHeight), 53 | cornerRadius = CornerRadius(cornerRadius, cornerRadius) 54 | ) 55 | 56 | drawRoundRect( 57 | color = Color.Black, 58 | size = Size(progressWidth, progressBarHeight), 59 | cornerRadius = CornerRadius(cornerRadius, cornerRadius) 60 | ) 61 | 62 | steps.forEachIndexed { index, step -> 63 | val x = width * step / 100f 64 | if (index != 0 && index != steps.lastIndex) { 65 | drawLine( 66 | color = Color.White, 67 | start = Offset(x, (height - stepHeight) / 2), 68 | end = Offset(x, (height + stepHeight) / 2), 69 | strokeWidth = 2f 70 | ) 71 | } 72 | } 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /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 | @rem SPDX-License-Identifier: Apache-2.0 17 | @rem 18 | 19 | @if "%DEBUG%"=="" @echo off 20 | @rem ########################################################################## 21 | @rem 22 | @rem Gradle startup script for Windows 23 | @rem 24 | @rem ########################################################################## 25 | 26 | @rem Set local scope for the variables with windows NT shell 27 | if "%OS%"=="Windows_NT" setlocal 28 | 29 | set DIRNAME=%~dp0 30 | if "%DIRNAME%"=="" set DIRNAME=. 31 | @rem This is normally unused 32 | set APP_BASE_NAME=%~n0 33 | set APP_HOME=%DIRNAME% 34 | 35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 37 | 38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 40 | 41 | @rem Find java.exe 42 | if defined JAVA_HOME goto findJavaFromJavaHome 43 | 44 | set JAVA_EXE=java.exe 45 | %JAVA_EXE% -version >NUL 2>&1 46 | if %ERRORLEVEL% equ 0 goto execute 47 | 48 | echo. 1>&2 49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 50 | echo. 1>&2 51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 52 | echo location of your Java installation. 1>&2 53 | 54 | goto fail 55 | 56 | :findJavaFromJavaHome 57 | set JAVA_HOME=%JAVA_HOME:"=% 58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 59 | 60 | if exist "%JAVA_EXE%" goto execute 61 | 62 | echo. 1>&2 63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 64 | echo. 1>&2 65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 66 | echo location of your Java installation. 1>&2 67 | 68 | goto fail 69 | 70 | :execute 71 | @rem Setup the command line 72 | 73 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 74 | 75 | 76 | @rem Execute Gradle 77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 78 | 79 | :end 80 | @rem End local scope for the variables with windows NT shell 81 | if %ERRORLEVEL% equ 0 goto mainEnd 82 | 83 | :fail 84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 85 | rem the _cmd.exe /c_ return code! 86 | set EXIT_CODE=%ERRORLEVEL% 87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 89 | exit /b %EXIT_CODE% 90 | 91 | :mainEnd 92 | if "%OS%"=="Windows_NT" endlocal 93 | 94 | :omega 95 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/drawable/compose-multiplatform.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 14 | 18 | 24 | 30 | 36 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/me/fsfaysalcse/smarthome/widgets/RealisticRopeLightSwitch.kt: -------------------------------------------------------------------------------- 1 | package me.fsfaysalcse.smarthome.widgets 2 | 3 | import androidx.compose.animation.core.Animatable 4 | import androidx.compose.animation.core.RepeatMode 5 | import androidx.compose.animation.core.Spring 6 | import androidx.compose.animation.core.repeatable 7 | import androidx.compose.animation.core.spring 8 | import androidx.compose.animation.core.tween 9 | import androidx.compose.foundation.Canvas 10 | import androidx.compose.foundation.gestures.detectDragGestures 11 | import androidx.compose.foundation.layout.Box 12 | import androidx.compose.foundation.layout.fillMaxSize 13 | import androidx.compose.runtime.Composable 14 | import androidx.compose.runtime.getValue 15 | import androidx.compose.runtime.mutableStateOf 16 | import androidx.compose.runtime.remember 17 | import androidx.compose.runtime.rememberCoroutineScope 18 | import androidx.compose.runtime.setValue 19 | import androidx.compose.ui.Alignment 20 | import androidx.compose.ui.Modifier 21 | import androidx.compose.ui.geometry.CornerRadius 22 | import androidx.compose.ui.geometry.Offset 23 | import androidx.compose.ui.graphics.Color 24 | import androidx.compose.ui.graphics.drawscope.Stroke 25 | import androidx.compose.ui.input.pointer.pointerInput 26 | import androidx.compose.ui.platform.LocalDensity 27 | import androidx.compose.ui.unit.dp 28 | import kotlinx.coroutines.launch 29 | import kotlin.math.sin 30 | 31 | @Composable 32 | fun RealisticRopeLightSwitch( 33 | modifier: Modifier = Modifier, 34 | ropeColor: Color = Color.Gray, 35 | handleColor: Color = Color.Red, 36 | onLightSwitch: (Boolean) -> Unit 37 | ) { 38 | val scope = rememberCoroutineScope() 39 | val lineTop = remember { Animatable(0f) } 40 | val lineBottom = 600f 41 | val handleRadius = with(LocalDensity.current) { 20.dp.toPx() } 42 | val innerHandleRadius = handleRadius * 0.5f 43 | val handlerOffsetY = remember { Animatable(lineBottom) } 44 | val shakeAnimation = remember { Animatable(0f) } 45 | var isLightOn by remember { mutableStateOf(false) } 46 | var isPulledDown by remember { mutableStateOf(false) } 47 | 48 | Box(modifier = modifier.fillMaxSize(), contentAlignment = Alignment.Center) { 49 | Canvas( 50 | modifier = Modifier 51 | .fillMaxSize() 52 | .pointerInput(Unit) { 53 | detectDragGestures( 54 | onDrag = { _, dragAmount -> 55 | scope.launch { 56 | val newOffsetY = handlerOffsetY.value + dragAmount.y 57 | if (newOffsetY in 0f..(lineBottom + handleRadius * 2)) { 58 | handlerOffsetY.snapTo(newOffsetY) 59 | } 60 | } 61 | }, 62 | onDragEnd = { 63 | scope.launch { 64 | if (handlerOffsetY.value > lineBottom + 50f) { 65 | isLightOn = !isLightOn 66 | isPulledDown = true 67 | onLightSwitch(isLightOn) 68 | shakeAnimation.animateTo( 69 | targetValue = 20f, 70 | animationSpec = repeatable( 71 | iterations = 6, 72 | animation = tween(durationMillis = 100), 73 | repeatMode = RepeatMode.Reverse 74 | ) 75 | ) 76 | shakeAnimation.snapTo(0f) 77 | isPulledDown = false 78 | } 79 | 80 | handlerOffsetY.animateTo( 81 | targetValue = lineBottom, 82 | animationSpec = spring( 83 | dampingRatio = Spring.DampingRatioMediumBouncy, 84 | stiffness = Spring.StiffnessHigh 85 | ) 86 | ) 87 | 88 | lineTop.animateTo( 89 | targetValue = -30f, 90 | animationSpec = spring( 91 | dampingRatio = Spring.DampingRatioMediumBouncy, 92 | stiffness = Spring.StiffnessLow 93 | ) 94 | ) 95 | 96 | lineTop.animateTo( 97 | targetValue = 0f, 98 | animationSpec = spring( 99 | dampingRatio = Spring.DampingRatioMediumBouncy, 100 | stiffness = Spring.StiffnessLow 101 | ) 102 | ) 103 | } 104 | } 105 | ) 106 | } 107 | ) { 108 | val centerX = size.width / 2 109 | val horizontalShake = if (isPulledDown) shakeAnimation.value * sin(handlerOffsetY.value * 0.1f) else 0f 110 | val mouseShapeWidth = handleRadius * 2f 111 | val mouseShapeHeight = handleRadius * 2.5f 112 | 113 | drawLine( 114 | color = ropeColor, 115 | start = Offset(centerX, lineTop.value), 116 | end = Offset(centerX + horizontalShake, handlerOffsetY.value), 117 | strokeWidth = 8f 118 | ) 119 | 120 | drawLine( 121 | color = handleColor, 122 | start = Offset(centerX, lineTop.value), 123 | end = Offset(centerX + horizontalShake, handlerOffsetY.value), 124 | strokeWidth = 12f 125 | ) 126 | 127 | drawRoundRect( 128 | color = ropeColor, 129 | topLeft = Offset( 130 | centerX - mouseShapeWidth / 2 + horizontalShake, 131 | handlerOffsetY.value - mouseShapeHeight / 2 132 | ), 133 | size = androidx.compose.ui.geometry.Size(mouseShapeWidth, mouseShapeHeight), 134 | cornerRadius = CornerRadius(handleRadius, handleRadius), 135 | style = Stroke(width = 6f) 136 | ) 137 | drawCircle( 138 | color = handleColor, 139 | center = Offset(centerX + horizontalShake, handlerOffsetY.value), 140 | radius = innerHandleRadius 141 | ) 142 | } 143 | } 144 | } -------------------------------------------------------------------------------- /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 | # SPDX-License-Identifier: Apache-2.0 19 | # 20 | 21 | ############################################################################## 22 | # 23 | # Gradle start up script for POSIX generated by Gradle. 24 | # 25 | # Important for running: 26 | # 27 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 28 | # noncompliant, but you have some other compliant shell such as ksh or 29 | # bash, then to run this script, type that shell name before the whole 30 | # command line, like: 31 | # 32 | # ksh Gradle 33 | # 34 | # Busybox and similar reduced shells will NOT work, because this script 35 | # requires all of these POSIX shell features: 36 | # * functions; 37 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 38 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 39 | # * compound commands having a testable exit status, especially «case»; 40 | # * various built-in commands including «command», «set», and «ulimit». 41 | # 42 | # Important for patching: 43 | # 44 | # (2) This script targets any POSIX shell, so it avoids extensions provided 45 | # by Bash, Ksh, etc; in particular arrays are avoided. 46 | # 47 | # The "traditional" practice of packing multiple parameters into a 48 | # space-separated string is a well documented source of bugs and security 49 | # problems, so this is (mostly) avoided, by progressively accumulating 50 | # options in "$@", and eventually passing that to Java. 51 | # 52 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 53 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 54 | # see the in-line comments for details. 55 | # 56 | # There are tweaks for specific operating systems such as AIX, CygWin, 57 | # Darwin, MinGW, and NonStop. 58 | # 59 | # (3) This script is generated from the Groovy template 60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 61 | # within the Gradle project. 62 | # 63 | # You can find Gradle at https://github.com/gradle/gradle/. 64 | # 65 | ############################################################################## 66 | 67 | # Attempt to set APP_HOME 68 | 69 | # Resolve links: $0 may be a link 70 | app_path=$0 71 | 72 | # Need this for daisy-chained symlinks. 73 | while 74 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 75 | [ -h "$app_path" ] 76 | do 77 | ls=$( ls -ld "$app_path" ) 78 | link=${ls#*' -> '} 79 | case $link in #( 80 | /*) app_path=$link ;; #( 81 | *) app_path=$APP_HOME$link ;; 82 | esac 83 | done 84 | 85 | # This is normally unused 86 | # shellcheck disable=SC2034 87 | APP_BASE_NAME=${0##*/} 88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s 90 | ' "$PWD" ) || exit 91 | 92 | # Use the maximum available, or set MAX_FD != -1 to use that value. 93 | MAX_FD=maximum 94 | 95 | warn () { 96 | echo "$*" 97 | } >&2 98 | 99 | die () { 100 | echo 101 | echo "$*" 102 | echo 103 | exit 1 104 | } >&2 105 | 106 | # OS specific support (must be 'true' or 'false'). 107 | cygwin=false 108 | msys=false 109 | darwin=false 110 | nonstop=false 111 | case "$( uname )" in #( 112 | CYGWIN* ) cygwin=true ;; #( 113 | Darwin* ) darwin=true ;; #( 114 | MSYS* | MINGW* ) msys=true ;; #( 115 | NONSTOP* ) nonstop=true ;; 116 | esac 117 | 118 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 119 | 120 | 121 | # Determine the Java command to use to start the JVM. 122 | if [ -n "$JAVA_HOME" ] ; then 123 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 124 | # IBM's JDK on AIX uses strange locations for the executables 125 | JAVACMD=$JAVA_HOME/jre/sh/java 126 | else 127 | JAVACMD=$JAVA_HOME/bin/java 128 | fi 129 | if [ ! -x "$JAVACMD" ] ; then 130 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 131 | 132 | Please set the JAVA_HOME variable in your environment to match the 133 | location of your Java installation." 134 | fi 135 | else 136 | JAVACMD=java 137 | if ! command -v java >/dev/null 2>&1 138 | then 139 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 140 | 141 | Please set the JAVA_HOME variable in your environment to match the 142 | location of your Java installation." 143 | fi 144 | fi 145 | 146 | # Increase the maximum file descriptors if we can. 147 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 148 | case $MAX_FD in #( 149 | max*) 150 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 151 | # shellcheck disable=SC2039,SC3045 152 | MAX_FD=$( ulimit -H -n ) || 153 | warn "Could not query maximum file descriptor limit" 154 | esac 155 | case $MAX_FD in #( 156 | '' | soft) :;; #( 157 | *) 158 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 159 | # shellcheck disable=SC2039,SC3045 160 | ulimit -n "$MAX_FD" || 161 | warn "Could not set maximum file descriptor limit to $MAX_FD" 162 | esac 163 | fi 164 | 165 | # Collect all arguments for the java command, stacking in reverse order: 166 | # * args from the command line 167 | # * the main class name 168 | # * -classpath 169 | # * -D...appname settings 170 | # * --module-path (only if needed) 171 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 172 | 173 | # For Cygwin or MSYS, switch paths to Windows format before running java 174 | if "$cygwin" || "$msys" ; then 175 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 176 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 177 | 178 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 179 | 180 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 181 | for arg do 182 | if 183 | case $arg in #( 184 | -*) false ;; # don't mess with options #( 185 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 186 | [ -e "$t" ] ;; #( 187 | *) false ;; 188 | esac 189 | then 190 | arg=$( cygpath --path --ignore --mixed "$arg" ) 191 | fi 192 | # Roll the args list around exactly as many times as the number of 193 | # args, so each arg winds up back in the position where it started, but 194 | # possibly modified. 195 | # 196 | # NB: a `for` loop captures its iteration list before it begins, so 197 | # changing the positional parameters here affects neither the number of 198 | # iterations, nor the values presented in `arg`. 199 | shift # remove old arg 200 | set -- "$@" "$arg" # push replacement arg 201 | done 202 | fi 203 | 204 | 205 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 206 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 207 | 208 | # Collect all arguments for the java command: 209 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 210 | # and any embedded shellness will be escaped. 211 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 212 | # treated as '${Hostname}' itself on the command line. 213 | 214 | set -- \ 215 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 216 | -classpath "$CLASSPATH" \ 217 | org.gradle.wrapper.GradleWrapperMain \ 218 | "$@" 219 | 220 | # Stop when "xargs" is not available. 221 | if ! command -v xargs >/dev/null 2>&1 222 | then 223 | die "xargs is not available" 224 | fi 225 | 226 | # Use "xargs" to parse quoted args. 227 | # 228 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 229 | # 230 | # In Bash we could simply go: 231 | # 232 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 233 | # set -- "${ARGS[@]}" "$@" 234 | # 235 | # but POSIX shell has neither arrays nor command substitution, so instead we 236 | # post-process each arg (as a line of input to sed) to backslash-escape any 237 | # character that might be a shell metacharacter, then use eval to reverse 238 | # that process (while maintaining the separation between arguments), and wrap 239 | # the whole thing up as a single "set" statement. 240 | # 241 | # This will of course break if any of these variables contains a newline or 242 | # an unmatched quote. 243 | # 244 | 245 | eval "set -- $( 246 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 247 | xargs -n1 | 248 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 249 | tr '\n' ' ' 250 | )" '"$@"' 251 | 252 | exec "$JAVACMD" "$@" 253 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/me/fsfaysalcse/smarthome/LightScreen.kt: -------------------------------------------------------------------------------- 1 | package me.fsfaysalcse.smarthome 2 | 3 | import androidx.compose.animation.animateColorAsState 4 | import androidx.compose.foundation.Image 5 | import androidx.compose.foundation.background 6 | import androidx.compose.foundation.layout.Arrangement 7 | import androidx.compose.foundation.layout.Box 8 | import androidx.compose.foundation.layout.Column 9 | import androidx.compose.foundation.layout.Row 10 | import androidx.compose.foundation.layout.fillMaxSize 11 | import androidx.compose.foundation.layout.fillMaxWidth 12 | import androidx.compose.foundation.layout.height 13 | import androidx.compose.foundation.layout.offset 14 | import androidx.compose.foundation.layout.padding 15 | import androidx.compose.foundation.layout.size 16 | import androidx.compose.foundation.layout.width 17 | import androidx.compose.foundation.lazy.LazyRow 18 | import androidx.compose.material3.Text 19 | import androidx.compose.runtime.Composable 20 | import androidx.compose.runtime.getValue 21 | import androidx.compose.runtime.mutableFloatStateOf 22 | import androidx.compose.runtime.mutableIntStateOf 23 | import androidx.compose.runtime.mutableStateOf 24 | import androidx.compose.runtime.remember 25 | import androidx.compose.runtime.setValue 26 | import androidx.compose.ui.Alignment 27 | import androidx.compose.ui.Modifier 28 | import androidx.compose.ui.graphics.Brush 29 | import androidx.compose.ui.graphics.Color 30 | import androidx.compose.ui.text.SpanStyle 31 | import androidx.compose.ui.text.buildAnnotatedString 32 | import androidx.compose.ui.text.font.FontWeight 33 | import androidx.compose.ui.text.withStyle 34 | import androidx.compose.ui.unit.dp 35 | import androidx.compose.ui.unit.sp 36 | import com.swiftie.iosflighlight.COLOR_LIST 37 | import com.swiftie.iosflighlight.ColorItem 38 | import me.fsfaysalcse.smarthome.theme.getProductSansFont 39 | import me.fsfaysalcse.smarthome.widgets.CustomSeekBar 40 | import me.fsfaysalcse.smarthome.widgets.LightBeamCanvas 41 | import me.fsfaysalcse.smarthome.widgets.RealisticRopeLightSwitch 42 | import org.jetbrains.compose.resources.painterResource 43 | import smarthome.composeapp.generated.resources.Res 44 | import smarthome.composeapp.generated.resources.img_black_light 45 | import smarthome.composeapp.generated.resources.img_red_light 46 | import kotlin.math.roundToInt 47 | 48 | @Composable 49 | fun LightScreen(modifier: Modifier = Modifier) { 50 | 51 | var selectedColorIndex by remember { mutableIntStateOf(2) } 52 | var progress by remember { mutableFloatStateOf(0.6f) } 53 | var isLightOn by remember { mutableStateOf(false) } 54 | 55 | val animateBeamColor by animateColorAsState( 56 | targetValue = if (isLightOn) COLOR_LIST[selectedColorIndex] else Color.Red, 57 | label = "" 58 | ) 59 | 60 | 61 | Column( 62 | modifier = Modifier 63 | .fillMaxSize() 64 | .background(Color.White), 65 | ) { 66 | Box( 67 | modifier = Modifier 68 | .padding(horizontal = 16.dp) 69 | .fillMaxWidth() 70 | .height(400.dp) 71 | ) { 72 | 73 | LightBeamCanvas( 74 | modifier = Modifier 75 | .padding(start = 50.dp) 76 | .padding(top = 230.dp) 77 | .size( 78 | width = 200.dp, 79 | height = 300.dp 80 | ), 81 | isVisible = isLightOn, 82 | lightOpacity = progress, 83 | lightColor = animateBeamColor 84 | ) 85 | 86 | Image( 87 | painter = painterResource(Res.drawable.img_red_light), 88 | contentDescription = null, 89 | modifier = Modifier 90 | .padding(start = 50.dp) 91 | .size( 92 | height = 250.dp, 93 | width = 200.dp 94 | ) 95 | ) 96 | 97 | 98 | LightBeamCanvas( 99 | modifier = Modifier 100 | .padding(top = 180.dp) 101 | .offset(x = (-25).dp) 102 | .size( 103 | width = 200.dp, 104 | height = 300.dp 105 | ), 106 | isVisible = isLightOn, 107 | lightOpacity = progress, 108 | topConeWidth = 280f, 109 | lightColor = animateBeamColor 110 | ) 111 | 112 | Image( 113 | painter = painterResource(Res.drawable.img_black_light), 114 | contentDescription = null, 115 | modifier = Modifier 116 | .size( 117 | height = 200.dp, 118 | width = 150.dp 119 | ) 120 | ) 121 | 122 | RealisticRopeLightSwitch( 123 | modifier = Modifier 124 | .align(Alignment.TopEnd) 125 | .width(100.dp) 126 | .height(400.dp), 127 | ropeColor = Color.Gray, 128 | handleColor = Color.Black, 129 | onLightSwitch = { isOn -> 130 | isLightOn = isOn 131 | } 132 | ) 133 | 134 | Box( 135 | modifier = Modifier 136 | .fillMaxWidth() 137 | .height(70.dp) 138 | .background( 139 | brush = Brush.verticalGradient( 140 | colors = listOf( 141 | Color.White, 142 | Color.White, 143 | Color.Transparent 144 | ) 145 | ) 146 | ) 147 | ) 148 | } 149 | 150 | 151 | Column( 152 | modifier = Modifier.fillMaxSize() 153 | .padding(horizontal = 16.dp) 154 | ) { 155 | 156 | Text( 157 | text = "Schedule", 158 | fontFamily = getProductSansFont(), 159 | fontWeight = FontWeight.Bold, 160 | color = Color.Black, 161 | fontSize = 28.sp 162 | ) 163 | 164 | Text( 165 | text = "Form", 166 | fontFamily = getProductSansFont(), 167 | fontWeight = FontWeight.Bold, 168 | color = Color.Gray, 169 | fontSize = 14.sp, 170 | modifier = Modifier.padding(top = 20.dp) 171 | ) 172 | 173 | val scheduleText = buildAnnotatedString { 174 | withStyle( 175 | style = SpanStyle( 176 | fontSize = 26.sp, 177 | fontWeight = FontWeight.Bold, 178 | color = Color.Black, 179 | ) 180 | ) { 181 | append("06:00") 182 | } 183 | 184 | withStyle( 185 | style = SpanStyle( 186 | fontSize = 15.sp, 187 | fontWeight = FontWeight.Bold, 188 | color = Color.Gray, 189 | ) 190 | ) { 191 | append(" PM") 192 | } 193 | 194 | withStyle( 195 | style = SpanStyle( 196 | fontSize = 20.sp, 197 | fontWeight = FontWeight.Bold, 198 | color = Color.Gray, 199 | ) 200 | ) { 201 | append(" To ") 202 | } 203 | 204 | withStyle( 205 | style = SpanStyle( 206 | fontSize = 26.sp, 207 | fontWeight = FontWeight.Bold, 208 | color = Color.Black, 209 | ) 210 | ) { 211 | append("11:00") 212 | } 213 | 214 | withStyle( 215 | style = SpanStyle( 216 | fontSize = 15.sp, 217 | fontWeight = FontWeight.Bold, 218 | color = Color.Gray, 219 | ) 220 | ) { 221 | append(" PM") 222 | } 223 | 224 | } 225 | 226 | Text( 227 | text = scheduleText, 228 | fontFamily = getProductSansFont(), 229 | fontWeight = FontWeight.Bold, 230 | color = Color.Gray, 231 | modifier = Modifier.padding(top = 10.dp) 232 | ) 233 | 234 | Row( 235 | verticalAlignment = Alignment.CenterVertically, 236 | horizontalArrangement = Arrangement.SpaceBetween, 237 | modifier = Modifier 238 | .padding(top = 20.dp) 239 | .fillMaxWidth() 240 | ) { 241 | Text( 242 | text = "Brightness", 243 | fontFamily = getProductSansFont(), 244 | fontWeight = FontWeight.Bold, 245 | color = Color.Black, 246 | fontSize = 18.sp, 247 | modifier = Modifier 248 | ) 249 | 250 | Text( 251 | text = "${(progress * 100).roundToInt()}%", 252 | fontFamily = getProductSansFont(), 253 | fontWeight = FontWeight.Bold, 254 | color = Color.Black, 255 | fontSize = 18.sp, 256 | modifier = Modifier 257 | ) 258 | } 259 | 260 | 261 | 262 | 263 | 264 | CustomSeekBar( 265 | progress = progress, 266 | onProgressChanged = { progress = it }, 267 | modifier = Modifier 268 | .fillMaxWidth() 269 | .padding(vertical = 16.dp) 270 | ) 271 | 272 | Text( 273 | text = "Color of Lights", 274 | fontFamily = getProductSansFont(), 275 | fontWeight = FontWeight.Bold, 276 | color = Color.Black, 277 | fontSize = 21.sp, 278 | modifier = Modifier.padding(top = 10.dp) 279 | ) 280 | 281 | 282 | LazyRow( 283 | modifier = Modifier 284 | .fillMaxWidth() 285 | .padding(top = 20.dp), 286 | horizontalArrangement = Arrangement.spacedBy(10.dp) 287 | ) { 288 | items(COLOR_LIST.size) { index -> 289 | ColorItem( 290 | color = COLOR_LIST[index], 291 | isSelected = selectedColorIndex == index, 292 | onClick = { 293 | selectedColorIndex = if (selectedColorIndex == index) -1 else index 294 | } 295 | ) 296 | } 297 | } 298 | 299 | } 300 | } 301 | } 302 | 303 | -------------------------------------------------------------------------------- /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 | 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; }; 11 | 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; }; 12 | 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; }; 13 | 7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXFileReference section */ 17 | 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 18 | 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 19 | 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = ""; }; 20 | 7555FF7B242A565900829871 /* Smart Home.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Smart Home.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 22 | 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 23 | AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; 24 | /* End PBXFileReference section */ 25 | 26 | /* Begin PBXFrameworksBuildPhase section */ 27 | B92378962B6B1156000C7307 /* Frameworks */ = { 28 | isa = PBXFrameworksBuildPhase; 29 | buildActionMask = 2147483647; 30 | files = ( 31 | ); 32 | runOnlyForDeploymentPostprocessing = 0; 33 | }; 34 | /* End PBXFrameworksBuildPhase section */ 35 | 36 | /* Begin PBXGroup section */ 37 | 058557D7273AAEEB004C7B11 /* Preview Content */ = { 38 | isa = PBXGroup; 39 | children = ( 40 | 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */, 41 | ); 42 | path = "Preview Content"; 43 | sourceTree = ""; 44 | }; 45 | 42799AB246E5F90AF97AA0EF /* Frameworks */ = { 46 | isa = PBXGroup; 47 | children = ( 48 | ); 49 | name = Frameworks; 50 | sourceTree = ""; 51 | }; 52 | 7555FF72242A565900829871 = { 53 | isa = PBXGroup; 54 | children = ( 55 | AB1DB47929225F7C00F7AF9C /* Configuration */, 56 | 7555FF7D242A565900829871 /* iosApp */, 57 | 7555FF7C242A565900829871 /* Products */, 58 | 42799AB246E5F90AF97AA0EF /* Frameworks */, 59 | ); 60 | sourceTree = ""; 61 | }; 62 | 7555FF7C242A565900829871 /* Products */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 7555FF7B242A565900829871 /* Smart Home.app */, 66 | ); 67 | name = Products; 68 | sourceTree = ""; 69 | }; 70 | 7555FF7D242A565900829871 /* iosApp */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 058557BA273AAA24004C7B11 /* Assets.xcassets */, 74 | 7555FF82242A565900829871 /* ContentView.swift */, 75 | 7555FF8C242A565B00829871 /* Info.plist */, 76 | 2152FB032600AC8F00CF470E /* iOSApp.swift */, 77 | 058557D7273AAEEB004C7B11 /* Preview Content */, 78 | ); 79 | path = iosApp; 80 | sourceTree = ""; 81 | }; 82 | AB1DB47929225F7C00F7AF9C /* Configuration */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | AB3632DC29227652001CCB65 /* Config.xcconfig */, 86 | ); 87 | path = Configuration; 88 | sourceTree = ""; 89 | }; 90 | /* End PBXGroup section */ 91 | 92 | /* Begin PBXNativeTarget section */ 93 | 7555FF7A242A565900829871 /* iosApp */ = { 94 | isa = PBXNativeTarget; 95 | buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */; 96 | buildPhases = ( 97 | F36B1CEB2AD83DDC00CB74D5 /* Compile Kotlin Framework */, 98 | 7555FF77242A565900829871 /* Sources */, 99 | B92378962B6B1156000C7307 /* Frameworks */, 100 | 7555FF79242A565900829871 /* Resources */, 101 | ); 102 | buildRules = ( 103 | ); 104 | dependencies = ( 105 | ); 106 | name = iosApp; 107 | packageProductDependencies = ( 108 | ); 109 | productName = iosApp; 110 | productReference = 7555FF7B242A565900829871 /* Smart Home.app */; 111 | productType = "com.apple.product-type.application"; 112 | }; 113 | /* End PBXNativeTarget section */ 114 | 115 | /* Begin PBXProject section */ 116 | 7555FF73242A565900829871 /* Project object */ = { 117 | isa = PBXProject; 118 | attributes = { 119 | BuildIndependentTargetsInParallel = YES; 120 | LastSwiftUpdateCheck = 1130; 121 | LastUpgradeCheck = 1540; 122 | ORGANIZATIONNAME = orgName; 123 | TargetAttributes = { 124 | 7555FF7A242A565900829871 = { 125 | CreatedOnToolsVersion = 11.3.1; 126 | }; 127 | }; 128 | }; 129 | buildConfigurationList = 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */; 130 | compatibilityVersion = "Xcode 14.0"; 131 | developmentRegion = en; 132 | hasScannedForEncodings = 0; 133 | knownRegions = ( 134 | en, 135 | Base, 136 | ); 137 | mainGroup = 7555FF72242A565900829871; 138 | packageReferences = ( 139 | ); 140 | productRefGroup = 7555FF7C242A565900829871 /* Products */; 141 | projectDirPath = ""; 142 | projectRoot = ""; 143 | targets = ( 144 | 7555FF7A242A565900829871 /* iosApp */, 145 | ); 146 | }; 147 | /* End PBXProject section */ 148 | 149 | /* Begin PBXResourcesBuildPhase section */ 150 | 7555FF79242A565900829871 /* Resources */ = { 151 | isa = PBXResourcesBuildPhase; 152 | buildActionMask = 2147483647; 153 | files = ( 154 | 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */, 155 | 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */, 156 | ); 157 | runOnlyForDeploymentPostprocessing = 0; 158 | }; 159 | /* End PBXResourcesBuildPhase section */ 160 | 161 | /* Begin PBXShellScriptBuildPhase section */ 162 | F36B1CEB2AD83DDC00CB74D5 /* Compile Kotlin Framework */ = { 163 | isa = PBXShellScriptBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | ); 167 | inputFileListPaths = ( 168 | ); 169 | inputPaths = ( 170 | ); 171 | name = "Compile Kotlin Framework"; 172 | outputFileListPaths = ( 173 | ); 174 | outputPaths = ( 175 | ); 176 | runOnlyForDeploymentPostprocessing = 0; 177 | shellPath = /bin/sh; 178 | shellScript = "if [ \"YES\" = \"$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED\" ]; then\n echo \"Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \\\"YES\\\"\"\n exit 0\nfi\ncd \"$SRCROOT/..\"\n./gradlew :composeApp:embedAndSignAppleFrameworkForXcode\n"; 179 | }; 180 | /* End PBXShellScriptBuildPhase section */ 181 | 182 | /* Begin PBXSourcesBuildPhase section */ 183 | 7555FF77242A565900829871 /* Sources */ = { 184 | isa = PBXSourcesBuildPhase; 185 | buildActionMask = 2147483647; 186 | files = ( 187 | 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */, 188 | 7555FF83242A565900829871 /* ContentView.swift in Sources */, 189 | ); 190 | runOnlyForDeploymentPostprocessing = 0; 191 | }; 192 | /* End PBXSourcesBuildPhase section */ 193 | 194 | /* Begin XCBuildConfiguration section */ 195 | 7555FFA3242A565B00829871 /* Debug */ = { 196 | isa = XCBuildConfiguration; 197 | baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; 198 | buildSettings = { 199 | ALWAYS_SEARCH_USER_PATHS = NO; 200 | CLANG_ANALYZER_NONNULL = YES; 201 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 202 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 203 | CLANG_CXX_LIBRARY = "libc++"; 204 | CLANG_ENABLE_MODULES = YES; 205 | CLANG_ENABLE_OBJC_ARC = YES; 206 | CLANG_ENABLE_OBJC_WEAK = YES; 207 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 208 | CLANG_WARN_BOOL_CONVERSION = YES; 209 | CLANG_WARN_COMMA = YES; 210 | CLANG_WARN_CONSTANT_CONVERSION = YES; 211 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 212 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 213 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 214 | CLANG_WARN_EMPTY_BODY = YES; 215 | CLANG_WARN_ENUM_CONVERSION = YES; 216 | CLANG_WARN_INFINITE_RECURSION = YES; 217 | CLANG_WARN_INT_CONVERSION = YES; 218 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 219 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 220 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 221 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 222 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 223 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 224 | CLANG_WARN_STRICT_PROTOTYPES = YES; 225 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 226 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 227 | CLANG_WARN_UNREACHABLE_CODE = YES; 228 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 229 | COPY_PHASE_STRIP = NO; 230 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 231 | ENABLE_STRICT_OBJC_MSGSEND = YES; 232 | ENABLE_TESTABILITY = YES; 233 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 234 | GCC_C_LANGUAGE_STANDARD = gnu11; 235 | GCC_DYNAMIC_NO_PIC = NO; 236 | GCC_NO_COMMON_BLOCKS = YES; 237 | GCC_OPTIMIZATION_LEVEL = 0; 238 | GCC_PREPROCESSOR_DEFINITIONS = ( 239 | "DEBUG=1", 240 | "$(inherited)", 241 | ); 242 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 243 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 244 | GCC_WARN_UNDECLARED_SELECTOR = YES; 245 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 246 | GCC_WARN_UNUSED_FUNCTION = YES; 247 | GCC_WARN_UNUSED_VARIABLE = YES; 248 | IPHONEOS_DEPLOYMENT_TARGET = 15.3; 249 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 250 | MTL_FAST_MATH = YES; 251 | ONLY_ACTIVE_ARCH = YES; 252 | SDKROOT = iphoneos; 253 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 254 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 255 | }; 256 | name = Debug; 257 | }; 258 | 7555FFA4242A565B00829871 /* Release */ = { 259 | isa = XCBuildConfiguration; 260 | baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; 261 | buildSettings = { 262 | ALWAYS_SEARCH_USER_PATHS = NO; 263 | CLANG_ANALYZER_NONNULL = YES; 264 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 265 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 266 | CLANG_CXX_LIBRARY = "libc++"; 267 | CLANG_ENABLE_MODULES = YES; 268 | CLANG_ENABLE_OBJC_ARC = YES; 269 | CLANG_ENABLE_OBJC_WEAK = YES; 270 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 271 | CLANG_WARN_BOOL_CONVERSION = YES; 272 | CLANG_WARN_COMMA = YES; 273 | CLANG_WARN_CONSTANT_CONVERSION = YES; 274 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 275 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 276 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 277 | CLANG_WARN_EMPTY_BODY = YES; 278 | CLANG_WARN_ENUM_CONVERSION = YES; 279 | CLANG_WARN_INFINITE_RECURSION = YES; 280 | CLANG_WARN_INT_CONVERSION = YES; 281 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 282 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 283 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 284 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 285 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 286 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 287 | CLANG_WARN_STRICT_PROTOTYPES = YES; 288 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 289 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 290 | CLANG_WARN_UNREACHABLE_CODE = YES; 291 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 292 | COPY_PHASE_STRIP = NO; 293 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 294 | ENABLE_NS_ASSERTIONS = NO; 295 | ENABLE_STRICT_OBJC_MSGSEND = YES; 296 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 297 | GCC_C_LANGUAGE_STANDARD = gnu11; 298 | GCC_NO_COMMON_BLOCKS = YES; 299 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 300 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 301 | GCC_WARN_UNDECLARED_SELECTOR = YES; 302 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 303 | GCC_WARN_UNUSED_FUNCTION = YES; 304 | GCC_WARN_UNUSED_VARIABLE = YES; 305 | IPHONEOS_DEPLOYMENT_TARGET = 15.3; 306 | MTL_ENABLE_DEBUG_INFO = NO; 307 | MTL_FAST_MATH = YES; 308 | SDKROOT = iphoneos; 309 | SWIFT_COMPILATION_MODE = wholemodule; 310 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 311 | VALIDATE_PRODUCT = YES; 312 | }; 313 | name = Release; 314 | }; 315 | 7555FFA6242A565B00829871 /* Debug */ = { 316 | isa = XCBuildConfiguration; 317 | buildSettings = { 318 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 319 | CODE_SIGN_IDENTITY = "Apple Development"; 320 | CODE_SIGN_STYLE = Automatic; 321 | DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; 322 | DEVELOPMENT_TEAM = NLS6CV6QQ9; 323 | ENABLE_PREVIEWS = YES; 324 | FRAMEWORK_SEARCH_PATHS = ( 325 | "$(inherited)", 326 | "$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\n$(SRCROOT)/../composeApp/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)", 327 | ); 328 | INFOPLIST_FILE = iosApp/Info.plist; 329 | IPHONEOS_DEPLOYMENT_TARGET = 15.3; 330 | LD_RUNPATH_SEARCH_PATHS = ( 331 | "$(inherited)", 332 | "@executable_path/Frameworks", 333 | ); 334 | PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; 335 | PRODUCT_NAME = "${APP_NAME}"; 336 | PROVISIONING_PROFILE_SPECIFIER = ""; 337 | SWIFT_VERSION = 5.0; 338 | TARGETED_DEVICE_FAMILY = "1,2"; 339 | }; 340 | name = Debug; 341 | }; 342 | 7555FFA7242A565B00829871 /* Release */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 346 | CODE_SIGN_IDENTITY = "Apple Development"; 347 | CODE_SIGN_STYLE = Automatic; 348 | DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; 349 | DEVELOPMENT_TEAM = NLS6CV6QQ9; 350 | ENABLE_PREVIEWS = YES; 351 | FRAMEWORK_SEARCH_PATHS = ( 352 | "$(inherited)", 353 | "$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\n$(SRCROOT)/../composeApp/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)", 354 | ); 355 | INFOPLIST_FILE = iosApp/Info.plist; 356 | IPHONEOS_DEPLOYMENT_TARGET = 15.3; 357 | LD_RUNPATH_SEARCH_PATHS = ( 358 | "$(inherited)", 359 | "@executable_path/Frameworks", 360 | ); 361 | PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; 362 | PRODUCT_NAME = "${APP_NAME}"; 363 | PROVISIONING_PROFILE_SPECIFIER = ""; 364 | SWIFT_VERSION = 5.0; 365 | TARGETED_DEVICE_FAMILY = "1,2"; 366 | }; 367 | name = Release; 368 | }; 369 | /* End XCBuildConfiguration section */ 370 | 371 | /* Begin XCConfigurationList section */ 372 | 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */ = { 373 | isa = XCConfigurationList; 374 | buildConfigurations = ( 375 | 7555FFA3242A565B00829871 /* Debug */, 376 | 7555FFA4242A565B00829871 /* Release */, 377 | ); 378 | defaultConfigurationIsVisible = 0; 379 | defaultConfigurationName = Release; 380 | }; 381 | 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */ = { 382 | isa = XCConfigurationList; 383 | buildConfigurations = ( 384 | 7555FFA6242A565B00829871 /* Debug */, 385 | 7555FFA7242A565B00829871 /* Release */, 386 | ); 387 | defaultConfigurationIsVisible = 0; 388 | defaultConfigurationName = Release; 389 | }; 390 | /* End XCConfigurationList section */ 391 | }; 392 | rootObject = 7555FF73242A565900829871 /* Project object */; 393 | } 394 | --------------------------------------------------------------------------------