Skip to content
Draft
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
local.properties
/.kotlin/
/.idea/
/app/kotzilla.json
2 changes: 2 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ plugins {
alias(libs.plugins.detekt)
alias(libs.plugins.google.secrets.gradle.plugin)
alias(libs.plugins.automattic.measure.builds)
id("io.kotzilla.kotzilla-plugin")
}
apply("$rootDir/gradle/report.gradle")

Expand Down Expand Up @@ -147,6 +148,7 @@ dependencies {
implementation(libs.koin.android)
implementation(libs.koin.androidx.compose)
implementation(libs.koin.androidx.startup)
implementation("io.kotzilla:kotzilla-sdk:0.13.6")

compileOnly(libs.koin.annotations.core)
ksp(libs.koin.annotations.compiler)
Expand Down
23 changes: 20 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand All @@ -12,6 +13,22 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.EntertainmentApp">
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">
<meta-data
android:name="org.koin.androix.startup.KoinInitializer"
tools:node="remove" />
<meta-data
android:name="com.santimattius.template.koin.KotzillaInitializer"
android:value="androidx.startup" />
<meta-data
android:name="com.santimattius.template.koin.KoinInitializer"
android:value="androidx.startup" />
</provider>

<activity
android:name=".ui.compose.HomeComposeActivity"
android:exported="true"
Expand All @@ -24,8 +41,8 @@
</activity>
<activity
android:name=".ui.xml.home.HomeViewActivity"
android:label="@string/title_activity_home_view"
android:exported="true" />
android:exported="true"
android:label="@string/title_activity_home_view" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.santimattius.template

import android.app.Application
import io.kotzilla.sdk.analytics.koin.analyticsLogger
import org.koin.android.ext.koin.androidContext
import org.koin.android.logger.AndroidLogger
import org.koin.androix.startup.KoinStartup
Expand All @@ -15,6 +16,7 @@ class MainApplication : Application(), KoinStartup {
override fun onKoinStartup(): KoinConfiguration {
return KoinConfiguration {
androidContext(this@MainApplication)
analyticsLogger()
Comment thread
santimattius marked this conversation as resolved.
Outdated
logger(AndroidLogger())
modules(
com_santimattius_template_di_DataModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.santimattius.template.koin

import androidx.startup.Initializer
import org.koin.core.Koin
import org.koin.androix.startup.KoinInitializer as KoinOriginalInitializer

class KoinInitializer : Initializer<Koin> by KoinOriginalInitializer() {
Comment thread
santimattius marked this conversation as resolved.
Outdated
override fun dependencies(): MutableList<Class<out Initializer<*>>> {
return mutableListOf(KotzillaInitializer::class.java)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.santimattius.template.koin

import android.content.Context
import androidx.startup.Initializer
import io.kotzilla.sdk.KotzillaSDK

class KotzillaInitializer : Initializer<Unit> {
override fun create(context: Context) {
KotzillaSDK.setup(context)
}

override fun dependencies(): List<Class<out Initializer<*>>> {
return emptyList()
}
}
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ plugins {
buildscript {
dependencies {
classpath(libs.dep.google.secrets.gradle.plugin)
classpath("io.kotzilla:kotzilla-plugin:0.13.6")
}
}