-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from abdallahmehiz/temp
Migrate the project to Compose Multiplatform
- Loading branch information
Showing
69 changed files
with
950 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ | |
.externalNativeBuild | ||
.cxx | ||
local.properties | ||
.idea | ||
.idea | ||
.kotlin |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat | ||
|
||
plugins { | ||
id("com.android.application") | ||
kotlin("multiplatform") | ||
kotlin("plugin.compose") | ||
id("org.jetbrains.compose") | ||
} | ||
|
||
|
||
// https://github.com/JetBrains/compose-multiplatform/issues/3123#issuecomment-1647435023 | ||
val osName = System.getProperty("os.name") | ||
val targetOs = when { | ||
osName == "Mac OS X" -> "macos" | ||
osName.startsWith("Win") -> "windows" | ||
osName.startsWith("Linux") -> "linux" | ||
else -> error("Unsupported OS: $osName") | ||
} | ||
|
||
val targetArch = when (val osArch = System.getProperty("os.arch")) { | ||
"x86_64", "amd64" -> "x64" | ||
"aarch64" -> "arm64" | ||
else -> error("Unsupported arch: $osArch") | ||
} | ||
|
||
val version = "0.8.8" // or any more recent version | ||
val target = "${targetOs}-${targetArch}" | ||
|
||
android { | ||
namespace = "dev.vivvvek.seekerdemo" | ||
compileSdk = 34 | ||
|
||
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") | ||
|
||
defaultConfig { | ||
applicationId = "dev.vivvvek.seekerdemo" | ||
minSdk = 21 | ||
targetSdk = 34 | ||
versionCode = 1 | ||
versionName = "1.0" | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
vectorDrawables { | ||
useSupportLibrary = true | ||
} | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
buildFeatures { | ||
compose = true | ||
} | ||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.5.2" | ||
} | ||
packagingOptions { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
} | ||
} | ||
|
||
kotlin { | ||
androidTarget() | ||
|
||
jvm() | ||
|
||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64(), | ||
).forEach { iosTarget -> | ||
iosTarget.binaries.framework { | ||
baseName = "app" | ||
isStatic = true | ||
} | ||
} | ||
|
||
sourceSets { | ||
val commonMain by getting | ||
commonMain.dependencies { | ||
implementation(project(":seeker")) | ||
|
||
implementation(compose.material) | ||
implementation(compose.ui) | ||
implementation(compose.components.resources) | ||
implementation(compose.runtime) | ||
implementation("org.jetbrains.androidx.navigation:navigation-compose:2.7.0-alpha07") | ||
implementation("androidx.lifecycle:lifecycle-viewmodel:2.8.0") | ||
} | ||
androidMain { | ||
dependsOn(commonMain) | ||
dependencies { | ||
implementation("androidx.activity:activity-compose:1.7.2") | ||
implementation("androidx.compose.material:material:1.5.1") | ||
implementation(compose.preview) | ||
} | ||
} | ||
val iosX64Main by getting | ||
val iosArm64Main by getting | ||
val iosSimulatorArm64Main by getting | ||
val iosMain by creating { | ||
iosX64Main.dependsOn(this) | ||
iosArm64Main.dependsOn(this) | ||
iosSimulatorArm64Main.dependsOn(this) | ||
} | ||
iosMain.dependsOn(commonMain) | ||
|
||
val jvmMain by getting | ||
jvmMain.dependencies { | ||
implementation("org.jetbrains.skiko:skiko-awt-runtime-$target:$version") | ||
implementation("androidx.collection:collection:1.4.0") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.8.1") | ||
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.0") | ||
implementation(compose.desktop.currentOs) | ||
} | ||
jvmMain.dependsOn(commonMain) | ||
} | ||
} | ||
|
||
val compose_ui_version: String by extra | ||
|
||
dependencies { | ||
testImplementation("junit:junit:4.13.2") | ||
androidTestImplementation("androidx.test.ext:junit:1.1.5") | ||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") | ||
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_ui_version") | ||
debugImplementation("androidx.compose.ui:ui-tooling:$compose_ui_version") | ||
debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_ui_version") | ||
} | ||
|
||
compose.desktop { | ||
application { | ||
mainClass = "dev.vivvvek.seekerdemo.MainKt" | ||
|
||
nativeDistributions { | ||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) | ||
packageName = "dev.vivvvek.seekerdemo" | ||
packageVersion = "1.0.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
app/src/androidMain/kotlin/dev/vivvvek/seekerdemo/ui/PreviewNowPlayingScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package dev.vivvvek.seekerdemo.ui | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import dev.vivvvek.seekerdemo.ui.theme.SeekerTheme | ||
import dev.vivvvek.seekerdemo.NowPlayingScreen | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
fun PreView() { | ||
SeekerTheme { | ||
NowPlayingScreen() | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
app/src/commonMain/composeResources/drawable/baseline_more_vert_24.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<vector android:height="24dp" android:tint="#000000" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="#FFF" android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/> | ||
</vector> |
5 changes: 5 additions & 0 deletions
5
app/src/commonMain/composeResources/drawable/round_keyboard_arrow_down_24.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<vector android:height="24dp" android:tint="#000000" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="#FFF" android:pathData="M8.12,9.29L12,13.17l3.88,-3.88c0.39,-0.39 1.02,-0.39 1.41,0 0.39,0.39 0.39,1.02 0,1.41l-4.59,4.59c-0.39,0.39 -1.02,0.39 -1.41,0L6.7,10.7c-0.39,-0.39 -0.39,-1.02 0,-1.41 0.39,-0.38 1.03,-0.39 1.42,0z"/> | ||
</vector> |
5 changes: 5 additions & 0 deletions
5
app/src/commonMain/composeResources/drawable/round_pause_24.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<vector android:height="24dp" android:tint="#000000" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="#FFF" android:pathData="M8,19c1.1,0 2,-0.9 2,-2L10,7c0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2v10c0,1.1 0.9,2 2,2zM14,7v10c0,1.1 0.9,2 2,2s2,-0.9 2,-2L18,7c0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2z"/> | ||
</vector> |
2 changes: 1 addition & 1 deletion
2
...main/res/drawable/round_play_arrow_24.xml → ...esources/drawable/round_play_arrow_24.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<vector android:height="24dp" android:tint="#000000" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M8,6.82v10.36c0,0.79 0.87,1.27 1.54,0.84l8.14,-5.18c0.62,-0.39 0.62,-1.29 0,-1.69L9.54,5.98C8.87,5.55 8,6.03 8,6.82z"/> | ||
<path android:fillColor="#FFF" android:pathData="M8,6.82v10.36c0,0.79 0.87,1.27 1.54,0.84l8.14,-5.18c0.62,-0.39 0.62,-1.29 0,-1.69L9.54,5.98C8.87,5.55 8,6.03 8,6.82z"/> | ||
</vector> |
5 changes: 5 additions & 0 deletions
5
app/src/commonMain/composeResources/drawable/round_skip_next_24.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<vector android:height="24dp" android:tint="#000000" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="#FFF" android:pathData="M7.58,16.89l5.77,-4.07c0.56,-0.4 0.56,-1.24 0,-1.63L7.58,7.11C6.91,6.65 6,7.12 6,7.93v8.14c0,0.81 0.91,1.28 1.58,0.82zM16,7v10c0,0.55 0.45,1 1,1s1,-0.45 1,-1V7c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1z"/> | ||
</vector> |
5 changes: 5 additions & 0 deletions
5
app/src/commonMain/composeResources/drawable/round_skip_previous_24.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<vector android:height="24dp" android:tint="#000000" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="#FFF" android:pathData="M7,6c0.55,0 1,0.45 1,1v10c0,0.55 -0.45,1 -1,1s-1,-0.45 -1,-1L6,7c0,-0.55 0.45,-1 1,-1zM10.66,12.82l5.77,4.07c0.66,0.47 1.58,-0.01 1.58,-0.82L18.01,7.93c0,-0.81 -0.91,-1.28 -1.58,-0.82l-5.77,4.07c-0.57,0.4 -0.57,1.24 0,1.64z"/> | ||
</vector> |
Oops, something went wrong.