This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
generated from OmicoDev/gradle-project-initializer-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
234 additions
and
0 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
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 @@ | ||
/build |
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,31 @@ | ||
plugins { | ||
kotlin("android") | ||
id("com.android.application") | ||
} | ||
|
||
kotlin { | ||
jvmToolchain(11) | ||
} | ||
|
||
android { | ||
namespace = "me.omico.gpi.android" | ||
defaultConfig { | ||
compileSdk = 34 | ||
targetSdk = 34 | ||
minSdk = 21 | ||
} | ||
buildFeatures { | ||
compose = true | ||
} | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
} | ||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.5.11" | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(project(":gpi-shared")) | ||
implementation(androidx.activity.compose) | ||
} |
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,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:enableOnBackInvokedCallback="true" | ||
tools:targetApi="tiramisu"> | ||
<profileable android:shell="true" /> | ||
<activity | ||
android:name=".MainActivity" | ||
android:configChanges="colorMode|density|fontScale|fontWeightAdjustment|grammaticalGender|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" | ||
android:exported="true" | ||
android:launchMode="singleTask" | ||
android:resizeableActivity="true" | ||
android:windowSoftInputMode="adjustResize"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
</manifest> |
15 changes: 15 additions & 0 deletions
15
gpi/android/src/main/kotlin/me/omico/gpi/android/MainActivity.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,15 @@ | ||
package me.omico.gpi.android | ||
|
||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import me.omico.gpi.shared.App | ||
|
||
class MainActivity : ComponentActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContent { | ||
App() | ||
} | ||
} | ||
} |
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 @@ | ||
/build |
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,17 @@ | ||
plugins { | ||
kotlin("jvm") | ||
id("org.jetbrains.compose") | ||
} | ||
|
||
compose { | ||
desktop { | ||
application { | ||
mainClass = "me.omico.gpi.desktop.DesktopKt" | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(project(":gpi-shared")) | ||
implementation(compose.desktop.currentOs) | ||
} |
10 changes: 10 additions & 0 deletions
10
gpi/desktop/src/main/kotlin/me/omico/gpi/desktop/Desktop.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,10 @@ | ||
package me.omico.gpi.desktop | ||
|
||
import androidx.compose.ui.window.singleWindowApplication | ||
import me.omico.gpi.shared.App | ||
|
||
fun main() { | ||
singleWindowApplication { | ||
App() | ||
} | ||
} |
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 @@ | ||
/build |
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,29 @@ | ||
plugins { | ||
kotlin("multiplatform") | ||
id("org.jetbrains.compose") | ||
id("com.android.library") | ||
} | ||
|
||
kotlin { | ||
androidTarget { | ||
jvmToolchain(11) | ||
} | ||
|
||
jvm("desktop") | ||
|
||
sourceSets { | ||
commonMain { | ||
dependencies { | ||
implementation(compose.material3) | ||
} | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace = "me.omico.gpi.shared" | ||
defaultConfig { | ||
compileSdk = 34 | ||
minSdk = 21 | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
gpi/shared/src/androidMain/kotlin/me/omico/gpi/shared/App.android.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,9 @@ | ||
package me.omico.gpi.shared | ||
|
||
import androidx.compose.ui.text.font.Font | ||
import androidx.compose.ui.text.font.FontFamily | ||
|
||
actual val FontFamily_IndieFlower: FontFamily = | ||
FontFamily( | ||
Font(resId = R.font.indie_flower_regular), | ||
) |
Binary file not shown.
66 changes: 66 additions & 0 deletions
66
gpi/shared/src/commonMain/kotlin/me/omico/gpi/shared/App.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,66 @@ | ||
package me.omico.gpi.shared | ||
|
||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.width | ||
import androidx.compose.material3.AlertDialog | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.text.font.FontFamily | ||
import androidx.compose.ui.unit.dp | ||
|
||
@Composable | ||
fun App() { | ||
val defaultTypography = MaterialTheme.typography | ||
val indieFlowerTypography = remember { | ||
defaultTypography.copy( | ||
displayLarge = defaultTypography.displayLarge.copy(fontFamily = FontFamily_IndieFlower), | ||
displayMedium = defaultTypography.displayMedium.copy(fontFamily = FontFamily_IndieFlower), | ||
displaySmall = defaultTypography.displaySmall.copy(fontFamily = FontFamily_IndieFlower), | ||
headlineLarge = defaultTypography.headlineLarge.copy(fontFamily = FontFamily_IndieFlower), | ||
headlineMedium = defaultTypography.headlineMedium.copy(fontFamily = FontFamily_IndieFlower), | ||
headlineSmall = defaultTypography.headlineSmall.copy(fontFamily = FontFamily_IndieFlower), | ||
titleLarge = defaultTypography.titleLarge.copy(fontFamily = FontFamily_IndieFlower), | ||
titleMedium = defaultTypography.titleMedium.copy(fontFamily = FontFamily_IndieFlower), | ||
titleSmall = defaultTypography.titleSmall.copy(fontFamily = FontFamily_IndieFlower), | ||
bodyLarge = defaultTypography.bodyLarge.copy(fontFamily = FontFamily_IndieFlower), | ||
bodyMedium = defaultTypography.bodyMedium.copy(fontFamily = FontFamily_IndieFlower), | ||
bodySmall = defaultTypography.bodySmall.copy(fontFamily = FontFamily_IndieFlower), | ||
labelLarge = defaultTypography.labelLarge.copy(fontFamily = FontFamily_IndieFlower), | ||
labelMedium = defaultTypography.labelMedium.copy(fontFamily = FontFamily_IndieFlower), | ||
labelSmall = defaultTypography.labelSmall.copy(fontFamily = FontFamily_IndieFlower), | ||
) | ||
} | ||
|
||
var currentTypography by remember { mutableStateOf(defaultTypography) } | ||
MaterialTheme(typography = currentTypography) { | ||
AlertDialog( | ||
onDismissRequest = { }, | ||
title = { Text("Select Typography") }, | ||
text = { | ||
Row { | ||
Button( | ||
onClick = { currentTypography = defaultTypography }, | ||
content = { Text("Default") }, | ||
) | ||
Spacer(modifier = Modifier.width(8.dp)) | ||
Button( | ||
onClick = { currentTypography = indieFlowerTypography }, | ||
content = { Text("Indie Flower") }, | ||
) | ||
} | ||
}, | ||
confirmButton = { }, | ||
dismissButton = { }, | ||
) | ||
} | ||
} | ||
|
||
expect val FontFamily_IndieFlower: FontFamily |
9 changes: 9 additions & 0 deletions
9
gpi/shared/src/desktopMain/kotlin/me/omico/gpi/shared/App.desktop.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,9 @@ | ||
package me.omico.gpi.shared | ||
|
||
import androidx.compose.ui.text.font.FontFamily | ||
import androidx.compose.ui.text.platform.Font | ||
|
||
actual val FontFamily_IndieFlower: FontFamily = | ||
FontFamily( | ||
Font(resource = "font/indie_flower_regular.ttf"), | ||
) |
Binary file not shown.
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