diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e510fa9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +*.iml +.gradle +.idea +.DS_Store +build +captures +.externalNativeBuild +.cxx +local.properties +xcuserdata \ No newline at end of file diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts new file mode 100644 index 0000000..860ad3e --- /dev/null +++ b/androidApp/build.gradle.kts @@ -0,0 +1,54 @@ +plugins { + alias(libs.plugins.androidApplication) + alias(libs.plugins.kotlinAndroid) +} + +android { + namespace = "io.github.yahiaangelo.filmsimulator.android" + compileSdk = 34 + defaultConfig { + applicationId = "io.github.yahiaangelo.filmsimulator.android" + minSdk = 24 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + } + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() + } + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } + buildTypes { + getByName("release") { + isMinifyEnabled = false + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + implementation(projects.shared) + implementation(libs.compose.ui) + implementation(libs.compose.ui.tooling.preview) + implementation(libs.compose.material3) + implementation(libs.androidx.activity.compose) + debugImplementation(libs.compose.ui.tooling) + implementation(libs.ktor.client.android) + implementation(libs.androidx.lifecycle.viewmodel.ktx) + implementation(libs.androidx.lifecycle.runtime.compose) + implementation(libs.androidx.lifecycle.viewmodel.compose) + implementation(libs.koin.android) + implementation (libs.ffmpeg.kit.min) +} \ No newline at end of file diff --git a/androidApp/src/main/AndroidManifest.xml b/androidApp/src/main/AndroidManifest.xml new file mode 100644 index 0000000..59eed85 --- /dev/null +++ b/androidApp/src/main/AndroidManifest.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/androidApp/src/main/java/io/github/yahiaangelo/filmsimulator/android/MainActivity.kt b/androidApp/src/main/java/io/github/yahiaangelo/filmsimulator/android/MainActivity.kt new file mode 100644 index 0000000..124618b --- /dev/null +++ b/androidApp/src/main/java/io/github/yahiaangelo/filmsimulator/android/MainActivity.kt @@ -0,0 +1,33 @@ +package io.github.yahiaangelo.filmsimulator.android + +import App +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge +import androidx.compose.material3.* +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContent { + App() + } + } +} + +@Composable +fun GreetingView(text: String) { + Text(text = text) +} + +@Preview +@Composable +fun DefaultPreview() { + MyApplicationTheme { + GreetingView("Hello, Android!") + } +} diff --git a/androidApp/src/main/java/io/github/yahiaangelo/filmsimulator/android/MainApplication.kt b/androidApp/src/main/java/io/github/yahiaangelo/filmsimulator/android/MainApplication.kt new file mode 100644 index 0000000..aee408a --- /dev/null +++ b/androidApp/src/main/java/io/github/yahiaangelo/filmsimulator/android/MainApplication.kt @@ -0,0 +1,29 @@ +package io.github.yahiaangelo.filmsimulator.android + +import android.app.Application +import di.appModule +import io.github.yahiaangelo.filmsimulator.FilmSimulator +import io.github.yahiaangelo.filmsimulator.FilmSimulatorConfig +import io.github.yahiaangelo.filmsimulator.util.AppContext +import org.koin.android.ext.koin.androidContext +import org.koin.android.ext.koin.androidLogger +import org.koin.core.context.startKoin + +class MainApplication: Application() { + + override fun onCreate() { + super.onCreate() + + startKoin { + androidContext(this@MainApplication) + androidLogger() + modules(appModule()) + } + + FilmSimulator.initialize( + FilmSimulatorConfig( + appContext = AppContext.apply { set(applicationContext) } + ) + ) + } +} \ No newline at end of file diff --git a/androidApp/src/main/java/io/github/yahiaangelo/filmsimulator/android/MyApplicationTheme.kt b/androidApp/src/main/java/io/github/yahiaangelo/filmsimulator/android/MyApplicationTheme.kt new file mode 100644 index 0000000..80cc822 --- /dev/null +++ b/androidApp/src/main/java/io/github/yahiaangelo/filmsimulator/android/MyApplicationTheme.kt @@ -0,0 +1,55 @@ +package io.github.yahiaangelo.filmsimulator.android + +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Shapes +import androidx.compose.material3.Typography +import androidx.compose.material3.darkColorScheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp + +@Composable +fun MyApplicationTheme( + darkTheme: Boolean = isSystemInDarkTheme(), + content: @Composable () -> Unit +) { + val colors = if (darkTheme) { + darkColorScheme( + primary = Color(0xFFBB86FC), + secondary = Color(0xFF03DAC5), + tertiary = Color(0xFF3700B3) + ) + } else { + lightColorScheme( + primary = Color(0xFF6200EE), + secondary = Color(0xFF03DAC5), + tertiary = Color(0xFF3700B3) + ) + } + val typography = Typography( + bodyMedium = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 16.sp + ) + ) + val shapes = Shapes( + small = RoundedCornerShape(4.dp), + medium = RoundedCornerShape(4.dp), + large = RoundedCornerShape(0.dp) + ) + + MaterialTheme( + colorScheme = colors, + typography = typography, + shapes = shapes, + content = content + ) +} diff --git a/androidApp/src/main/res/values/strings.xml b/androidApp/src/main/res/values/strings.xml new file mode 100644 index 0000000..55344e5 --- /dev/null +++ b/androidApp/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/androidApp/src/main/res/values/styles.xml b/androidApp/src/main/res/values/styles.xml new file mode 100644 index 0000000..6b4fa3d --- /dev/null +++ b/androidApp/src/main/res/values/styles.xml @@ -0,0 +1,3 @@ + +