Skip to content

Commit cd178dc

Browse files
committed
Add a demo app
1 parent 9a9e59e commit cd178dc

File tree

43 files changed

+563
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+563
-2
lines changed

compose/README.MD

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Fluent UI System Icons for Compose Multiplatform
22

3+
### Run the demo app
4+
5+
Desktop `./gradlew :demo:run`
6+
Web `./gradlew :demo:wasmJsBrowserDevelopmentRun`
7+
Android `./gradlew :demo:assembleDebug`
8+
39
### Publish to MavenLocal
410

511
1) Run `./gradlew :library:publishToMavenLocal`

compose/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ plugins {
44
alias(libs.plugins.maven.publish).apply(false)
55
alias(libs.plugins.compose.compiler).apply(false)
66
alias(libs.plugins.compose).apply(false)
7+
alias(libs.plugins.android.application).apply(false)
78
}

compose/demo/build.gradle.kts

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import org.jetbrains.compose.desktop.application.dsl.TargetFormat.*
2+
3+
plugins {
4+
alias(libs.plugins.multiplatform)
5+
alias(libs.plugins.compose.compiler)
6+
alias(libs.plugins.compose)
7+
alias(libs.plugins.android.application)
8+
}
9+
10+
kotlin {
11+
androidTarget()
12+
jvm()
13+
js {
14+
browser()
15+
binaries.executable()
16+
}
17+
wasmJs {
18+
browser()
19+
binaries.executable()
20+
}
21+
listOf(
22+
iosX64(),
23+
iosArm64(),
24+
iosSimulatorArm64()
25+
).forEach {
26+
it.binaries.framework {
27+
baseName = "ComposeApp"
28+
isStatic = true
29+
}
30+
}
31+
32+
sourceSets {
33+
commonMain.dependencies {
34+
implementation(compose.runtime)
35+
implementation(compose.foundation)
36+
implementation(compose.material3)
37+
implementation(compose.components.resources)
38+
39+
implementation(project(":library"))
40+
}
41+
42+
androidMain.dependencies {
43+
implementation(libs.androidx.activityCompose)
44+
}
45+
46+
jvmMain.dependencies {
47+
implementation(compose.desktop.currentOs)
48+
}
49+
50+
}
51+
}
52+
53+
android {
54+
namespace = "com.microsoft.design.compose.demo"
55+
compileSdk = 35
56+
57+
defaultConfig {
58+
minSdk = 21
59+
targetSdk = 35
60+
61+
applicationId = "com.microsoft.design.compose.demo.androidApp"
62+
versionCode = 1
63+
versionName = "1.0.0"
64+
}
65+
}
66+
67+
compose.desktop {
68+
application {
69+
mainClass = "MainKt"
70+
71+
nativeDistributions {
72+
targetFormats(Dmg, Msi, Deb)
73+
packageName = "Multiplatform App"
74+
packageVersion = "1.0.0"
75+
76+
macOS {
77+
bundleID = "com.microsoft.design.compose.demo.desktopApp"
78+
}
79+
}
80+
}
81+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<application
5+
android:icon="@mipmap/ic_launcher"
6+
android:label="Multiplatform App"
7+
android:theme="@android:style/Theme.Material.NoActionBar">
8+
<activity
9+
android:name=".AppActivity"
10+
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
11+
android:launchMode="singleInstance"
12+
android:windowSoftInputMode="adjustPan"
13+
android:exported="true">
14+
<intent-filter>
15+
<action android:name="android.intent.action.MAIN" />
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
</application>
20+
21+
</manifest>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.microsoft.design.compose.demo
2+
3+
import android.os.Bundle
4+
import androidx.activity.ComponentActivity
5+
import androidx.activity.compose.setContent
6+
import androidx.activity.enableEdgeToEdge
7+
8+
class AppActivity : ComponentActivity() {
9+
override fun onCreate(savedInstanceState: Bundle?) {
10+
super.onCreate(savedInstanceState)
11+
enableEdgeToEdge()
12+
setContent { App() }
13+
}
14+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.microsoft.design.compose.demo.theme
2+
3+
import android.app.Activity
4+
import androidx.compose.runtime.Composable
5+
import androidx.compose.runtime.LaunchedEffect
6+
import androidx.compose.ui.platform.LocalView
7+
import androidx.core.view.WindowInsetsControllerCompat
8+
9+
@Composable
10+
internal actual fun SystemAppearance(isDark: Boolean) {
11+
val view = LocalView.current
12+
LaunchedEffect(isDark) {
13+
val window = (view.context as Activity).window
14+
WindowInsetsControllerCompat(window, window.decorView).apply {
15+
isAppearanceLightStatusBars = isDark
16+
isAppearanceLightNavigationBars = isDark
17+
}
18+
}
19+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@mipmap/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5+
<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/>
6+
</adaptive-icon>
5.89 KB
Loading
841 Bytes
Loading
4.8 KB
Loading

0 commit comments

Comments
 (0)