-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
1 parent
1919174
commit f79acc2
Showing
37 changed files
with
976 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
*.iml | ||
.gradle | ||
.idea | ||
.DS_Store | ||
build | ||
captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties | ||
xcuserdata |
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,51 @@ | ||
import com.mocoding.pokedex.Configuration | ||
|
||
plugins { | ||
id("com.android.application") | ||
kotlin("android") | ||
} | ||
|
||
android { | ||
namespace = "com.mocoding.pokedex.android" | ||
compileSdk = Configuration.compileSdk | ||
defaultConfig { | ||
applicationId = "com.mocoding.pokedex.android" | ||
minSdk = Configuration.minSdk | ||
targetSdk = Configuration.targetSdk | ||
versionCode = Configuration.versionCode | ||
versionName = Configuration.versionName | ||
} | ||
buildFeatures { | ||
compose = true | ||
} | ||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.4.0" | ||
} | ||
packagingOptions { | ||
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(project(":shared")) | ||
implementation("androidx.compose.ui:ui:1.3.1") | ||
implementation("androidx.compose.ui:ui-tooling:1.3.1") | ||
implementation("androidx.compose.ui:ui-tooling-preview:1.3.1") | ||
implementation("androidx.compose.foundation:foundation:1.3.1") | ||
implementation("androidx.compose.material:material:1.3.1") | ||
implementation("androidx.activity:activity-compose:1.6.1") | ||
} |
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,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http:https://schemas.android.com/apk/res/android"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
|
||
<application | ||
android:allowBackup="false" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity | ||
android:name=".MainActivity" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
</manifest> |
40 changes: 40 additions & 0 deletions
40
android/src/main/java/com/mocoding/pokedex/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,40 @@ | ||
package com.mocoding.pokedex.android | ||
|
||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.material.* | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import com.mocoding.pokedex.Greeting | ||
|
||
class MainActivity : ComponentActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContent { | ||
MyApplicationTheme { | ||
Surface( | ||
modifier = Modifier.fillMaxSize(), | ||
color = MaterialTheme.colors.background | ||
) { | ||
GreetingView(Greeting().greet()) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
fun GreetingView(text: String) { | ||
Text(text = text) | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun DefaultPreview() { | ||
MyApplicationTheme { | ||
GreetingView("Hello, Android!") | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
android/src/main/java/com/mocoding/pokedex/android/MyApplicationTheme.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,55 @@ | ||
package com.mocoding.pokedex.android | ||
|
||
import androidx.compose.foundation.isSystemInDarkTheme | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.material.Shapes | ||
import androidx.compose.material.Typography | ||
import androidx.compose.material.darkColors | ||
import androidx.compose.material.lightColors | ||
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) { | ||
darkColors( | ||
primary = Color(0xFFBB86FC), | ||
primaryVariant = Color(0xFF3700B3), | ||
secondary = Color(0xFF03DAC5) | ||
) | ||
} else { | ||
lightColors( | ||
primary = Color(0xFF6200EE), | ||
primaryVariant = Color(0xFF3700B3), | ||
secondary = Color(0xFF03DAC5) | ||
) | ||
} | ||
val typography = Typography( | ||
body1 = 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( | ||
colors = colors, | ||
typography = typography, | ||
shapes = shapes, | ||
content = content | ||
) | ||
} |
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,3 @@ | ||
<resources> | ||
<style name="AppTheme" parent="android:Theme.Material.NoActionBar"/> | ||
</resources> |
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 @@ | ||
plugins { | ||
//trick: for the same plugin versions in all sub-modules | ||
kotlin("jvm") version "1.8.0" apply false | ||
kotlin("android") version "1.8.0" apply false | ||
kotlin("multiplatform") version "1.8.0" apply false | ||
kotlin("plugin.serialization") version "1.8.0" apply false | ||
id("app.cash.sqldelight") version "2.0.0-alpha05" apply false | ||
id("com.android.application") version "7.4.0" apply false | ||
id("com.android.library") version "7.4.0" apply false | ||
id("org.jetbrains.compose") version "1.3.0" apply false | ||
} | ||
|
||
tasks.register("clean", Delete::class) { | ||
delete(rootProject.buildDir) | ||
} |
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,7 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} |
12 changes: 12 additions & 0 deletions
12
buildSrc/src/main/java/com/mocoding/pokedex/Configuration.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,12 @@ | ||
package com.mocoding.pokedex | ||
|
||
object Configuration { | ||
const val compileSdk = 33 | ||
const val targetSdk = 33 | ||
const val minSdk = 24 | ||
const val majorVersion = 1 | ||
const val minorVersion = 0 | ||
const val patchVersion = 0 | ||
const val versionName = "$majorVersion.$minorVersion.$patchVersion" | ||
const val versionCode = 1 | ||
} |
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 com.mocoding.pokedex | ||
|
||
object Deps { | ||
object Android { | ||
object Tools { | ||
object Build { | ||
const val gradlePlugin = "com.android.tools.build:gradle:${Versions.gradlePlugin}" | ||
} | ||
} | ||
} | ||
|
||
object Org { | ||
object JetBrains { | ||
object Kotlinx { | ||
const val coroutinesCore = "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.coroutines}" | ||
|
||
const val kotlinxSerializationJson = "org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions.serialization}" | ||
} | ||
} | ||
} | ||
|
||
object Io { | ||
object Ktor { | ||
const val ktorClientCore = "io.ktor:ktor-client-core:${Versions.ktor}" | ||
const val ktorSerializationKotlinxJson = "io.ktor:ktor-serialization-kotlinx-json:${Versions.ktor}" | ||
const val ktorClientContentNegotiation = "io.ktor:ktor-client-content-negotiation:${Versions.ktor}" | ||
|
||
const val ktorClientAndroid = "io.ktor:ktor-client-android:${Versions.ktor}" | ||
const val ktorClientOkhttp = "io.ktor:ktor-client-okhttp:${Versions.ktor}" | ||
|
||
const val ktorClientDarwin = "io.ktor:ktor-client-darwin:${Versions.ktor}" | ||
const val ktorClientIos = "io.ktor:ktor-client-ios:${Versions.ktor}" | ||
} | ||
} | ||
|
||
object CashApp { | ||
object SQLDelight { | ||
const val gradlePlugin = "app.cash.sqldelight:gradle-plugin:${Versions.sqlDelight}" | ||
const val androidDriver = "app.cash.sqldelight:android-driver:${Versions.sqlDelight}" | ||
const val sqliteDriver = "app.cash.sqldelight:sqlite-driver:${Versions.sqlDelight}" | ||
const val nativeDriver = "app.cash.sqldelight:native-driver:${Versions.sqlDelight}" | ||
const val sqljsDriver = "app.cash.sqldelight:sqljs-driver:${Versions.sqlDelight}" | ||
|
||
const val coroutinesExtensions = "app.cash.sqldelight:coroutines-extensions:${Versions.sqlDelight}" | ||
} | ||
} | ||
|
||
object Koin { | ||
const val core = "io.insert-koin:koin-core:${Versions.koin}" | ||
const val test = "io.insert-koin:koin-test:${Versions.koin}" | ||
const val android = "io.insert-koin:koin-android:${Versions.koin}" | ||
} | ||
|
||
object ArkIvanov { | ||
object MVIKotlin { | ||
const val mvikotlin = "com.arkivanov.mvikotlin:mvikotlin:${Versions.mviKotlin}" | ||
const val mvikotlinMain = "com.arkivanov.mvikotlin:mvikotlin-main:${Versions.mviKotlin}" | ||
const val mvikotlinExtensionsCoroutines = "com.arkivanov.mvikotlin:mvikotlin-extensions-coroutines:${Versions.mviKotlin}" | ||
} | ||
|
||
object Decompose { | ||
const val decompose = "com.arkivanov.decompose:decompose:${Versions.decompose}" | ||
const val extensionsCompose = "com.arkivanov.decompose:extensions-compose-jetbrains:${Versions.decompose}" | ||
} | ||
} | ||
} |
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 com.mocoding.pokedex | ||
|
||
object Versions { | ||
const val gradlePlugin = "7.4.0" | ||
const val kotlin = "1.8.0" | ||
const val compose = "1.3.0" | ||
const val coroutines = "1.6.4" | ||
const val serialization = "1.4.1" | ||
const val mviKotlin = "3.0.0" | ||
const val decompose = "1.0.0-alpha-05" | ||
const val ktor = "2.2.3" | ||
const val sqlDelight = "2.0.0-alpha05" | ||
const val koin = "3.2.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#Gradle | ||
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M" | ||
|
||
#Kotlin | ||
kotlin.code.style=official | ||
|
||
#Android | ||
android.useAndroidX=true | ||
android.nonTransitiveRClass=true | ||
|
||
#MPP | ||
kotlin.mpp.enableCInteropCommonization=true | ||
kotlin.mpp.androidSourceSetLayoutVersion=2 | ||
|
||
#IOS | ||
org.jetbrains.compose.experimental.uikit.enabled=true | ||
|
||
#Versions | ||
kotlin.version=1.8.0 | ||
agp.version=7.4.0 | ||
compose.version=1.3.0 | ||
sqldelight.version=2.0.0-alpha05 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Fri Feb 24 08:25:46 CET 2023 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\:https://services.gradle.org/distributions/gradle-8.0-rc-1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.