Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix-Kariuki committed Nov 26, 2023
0 parents commit 2dcefad
Show file tree
Hide file tree
Showing 64 changed files with 3,332 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
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
56 changes: 56 additions & 0 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.composeMultiplatform)
}

android {
namespace = "com.flexcode.freetogame.android"
compileSdk = 34
defaultConfig {
applicationId = "com.flexcode.freetogame.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}"
excludes += "META-INF/*"
excludes += "META-INF/DEPENDENCIES"
}
}
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.koin.core)
implementation(libs.koin.compose)
implementation(libs.koin.android)
}
19 changes: 19 additions & 0 deletions androidApp/src/main/AndroidManifest.xml
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://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET"/>
<application
android:name=".FreeToGameApp"
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.flexcode.freetogame.android

import android.app.Application
import com.flexcode.freetogame.di.initKoin
import org.koin.android.BuildConfig
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.logger.Level

class FreeToGameApp: Application() {

override fun onCreate() {
super.onCreate()

initKoin{
androidLogger(level = if (BuildConfig.DEBUG) Level.INFO else Level.NONE)
androidContext(androidContext = this@FreeToGameApp)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.flexcode.freetogame.android

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import com.flexcode.freetogame.App

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {

App(darkTheme = isSystemInDarkTheme(), dynamicColor = false)

}
}
}

3 changes: 3 additions & 0 deletions androidApp/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<style name="AppTheme" parent="android:Theme.Material.NoActionBar"/>
</resources>
13 changes: 13 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
buildscript {
dependencies {
classpath(libs.gradle.plugin)
}
}
plugins {
//trick: for the same plugin versions in all sub-modules
alias(libs.plugins.androidApplication).apply(false)
alias(libs.plugins.androidLibrary).apply(false)
alias(libs.plugins.kotlinAndroid).apply(false)
alias(libs.plugins.kotlinMultiplatform).apply(false)
alias(libs.plugins.composeMultiplatform).apply(false)
}
16 changes: 16 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#Gradle
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
org.gradle.caching=true
org.gradle.configuration-cache=true

#Kotlin
kotlin.code.style=official

#Android
android.useAndroidX=true
android.nonTransitiveRClass=true

#Versions
kotlin.version=1.9.20
agp.version=8.1.4
compose.version=1.5.4
82 changes: 82 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

[versions]
agp = "8.1.4"
appcompat = "1.6.1"
core = "1.12.0"
datastore-preferences = "1.0.0"
gradle-plugin = "1.5.5"
kamel-image = "0.7.1"
kotlin = "1.9.20"
compose = "1.5.11"
compose-material3 = "1.1.2"
compose-compiler = "1.5.4"
activity-compose = "1.8.1"
kotlinx-coroutines-core = "1.7.3"
kotlinx-datetime = "0.4.0"
mvvm-core = "0.16.1"
voyager = "1.0.0-rc10"
ktor = "2.3.6"
activity-ktx = "1.8.1"


koin = "3.4.3"
koin-compose = "1.0.4"

[libraries]
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activity-compose" }
compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose-compiler" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose-compiler" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose-compiler" }
compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose-compiler" }
compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" }
#material-icons = { group = "androidx.compose.material", name = "material-icons-extended" }
#compose-runtime = { group = "androidx.compose.runtime", name = "runtime" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }

android-driver = { module = "com.squareup.sqldelight:android-driver", version.ref = "gradle-plugin" }
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
core = { module = "androidx.core:core", version.ref = "core" }
coroutines-extensions = { module = "com.squareup.sqldelight:coroutines-extensions", version.ref = "gradle-plugin" }
datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastore-preferences" }
gradle-plugin = { module = "com.squareup.sqldelight:gradle-plugin", version.ref = "gradle-plugin" }
jetbrains-compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "compose" }
jetbrains-compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "compose" }
jetbrains-compose-material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "compose" }
jetbrains-compose-materialIconsExtended = { module = "org.jetbrains.compose.material:material-icons-extended", version.ref = "compose" }
jetbrains-compose-resources = { module = "org.jetbrains.compose.components:components-resources", version.ref = "compose" }

kamel-image = { module = "media.kamel:kamel-image", version.ref = "kamel-image" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines-core" }
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
mvvm-compose = { module = "dev.icerock.moko:mvvm-compose", version.ref = "mvvm-core" }
mvvm-core = { module = "dev.icerock.moko:mvvm-core", version.ref = "mvvm-core" }
mvvm-flow = { module = "dev.icerock.moko:mvvm-flow", version.ref = "mvvm-core" }
mvvm-flow-compose = { module = "dev.icerock.moko:mvvm-flow-compose", version.ref = "mvvm-core" }
native-driver = { module = "com.squareup.sqldelight:native-driver", version.ref = "gradle-plugin" }
runtime = { module = "com.squareup.sqldelight:runtime", version.ref = "gradle-plugin" }
voyager-koin = { module = "cafe.adriel.voyager:voyager-koin", version.ref = "voyager" }
voyager-navigator = { module = "cafe.adriel.voyager:voyager-navigator", version.ref = "voyager" }
voyager-tab-navigator = { module = "cafe.adriel.voyager:voyager-tab-navigator", version.ref = "voyager" }
voyager-transitions = { module = "cafe.adriel.voyager:voyager-transitions", version.ref = "voyager" }
activity-ktx = { group = "androidx.activity", name = "activity-ktx", version.ref = "activity-ktx" }

ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
ktor-client-android = { module = "io.ktor:ktor-client-android", version.ref = "ktor" }
ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" }
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" }
ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }
ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" }
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }

koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" }
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koin-compose"}

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
androidLibrary = { id = "com.android.library", version.ref = "agp" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose" }
kotlinNativeCocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" }
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sun Nov 19 13:42:58 EAT 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 2dcefad

Please sign in to comment.