diff --git a/.gitignore b/.gitignore
index 1dd10d6..62f4d86 100644
--- a/.gitignore
+++ b/.gitignore
@@ -169,4 +169,101 @@ cython_debug/
#.idea/
tasks.db
-credentials.json
\ No newline at end of file
+credentials.json
+
+# ---> Android
+# Built application files
+*.apk
+*.ap_
+*.aab
+
+# Files for the ART/Dalvik VM
+*.dex
+
+# Java class files
+*.class
+
+# Generated files
+bin/
+gen/
+out/
+# Uncomment the following line in case you need and you don't have the release build type files in your app
+# release/
+
+# Gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Proguard folder generated by Eclipse
+proguard/
+
+# Log Files
+*.log
+
+# Android Studio Navigation editor temp files
+.navigation/
+
+# Android Studio captures folder
+captures/
+
+# IntelliJ
+*.iml
+.idea/workspace.xml
+.idea/tasks.xml
+.idea/gradle.xml
+.idea/assetWizardSettings.xml
+.idea/dictionaries
+.idea/libraries
+# Android Studio 3 in .gitignore file.
+.idea/caches
+.idea/modules.xml
+# Comment next line if keeping position of elements in Navigation Editor is relevant for you
+.idea/navEditor.xml
+
+# Keystore files
+# Uncomment the following lines if you do not want to check your keystore files in.
+#*.jks
+#*.keystore
+
+# External native build folder generated in Android Studio 2.2 and later
+.externalNativeBuild
+.cxx/
+
+# Google Services (e.g. APIs or Firebase)
+# google-services.json
+
+# Freeline
+freeline.py
+freeline/
+freeline_project_description.json
+
+# fastlane
+fastlane/report.xml
+fastlane/Preview.html
+fastlane/screenshots
+fastlane/test_output
+fastlane/readme.md
+
+# Version control
+vcs.xml
+
+# lint
+lint/intermediates/
+lint/generated/
+lint/outputs/
+lint/tmp/
+# lint/reports/
+
+# ---> IDEs
+# IDE configuration files
+.idea/
+.vscode/
+*.swp
+*.swo
+*~
+
+# Claude AI
+.claude/
\ No newline at end of file
diff --git a/android-app/app/build.gradle.kts b/android-app/app/build.gradle.kts
index 7ea3bb6..a042f8b 100644
--- a/android-app/app/build.gradle.kts
+++ b/android-app/app/build.gradle.kts
@@ -1,7 +1,7 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
- id("kotlin-kapt")
+ id("com.google.devtools.ksp")
id("com.google.dagger.hilt.android")
}
@@ -60,6 +60,9 @@ dependencies {
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.8.0")
+ // Material Components
+ implementation("com.google.android.material:material:1.10.0")
+
// Compose
implementation(platform("androidx.compose:compose-bom:2023.10.01"))
implementation("androidx.compose.ui:ui")
@@ -80,13 +83,13 @@ dependencies {
// Hilt
implementation("com.google.dagger:hilt-android:2.48")
- kapt("com.google.dagger:hilt-compiler:2.48")
+ ksp("com.google.dagger:hilt-compiler:2.48")
implementation("androidx.hilt:hilt-navigation-compose:1.1.0")
-
+
// Room
implementation("androidx.room:room-runtime:2.6.0")
implementation("androidx.room:room-ktx:2.6.0")
- kapt("androidx.room:room-compiler:2.6.0")
+ ksp("androidx.room:room-compiler:2.6.0")
// Retrofit
implementation("com.squareup.retrofit2:retrofit:2.9.0")
diff --git a/android-app/app/src/main/java/com/tunpok/calendarwidget/CalendarWidgetApplication.kt b/android-app/app/src/main/java/com/tunpok/calendarwidget/CalendarWidgetApplication.kt
index ec14890..30881e7 100644
--- a/android-app/app/src/main/java/com/tunpok/calendarwidget/CalendarWidgetApplication.kt
+++ b/android-app/app/src/main/java/com/tunpok/calendarwidget/CalendarWidgetApplication.kt
@@ -1,7 +1,13 @@
package com.tunpok.calendarwidget
import android.app.Application
+import com.tunpok.calendarwidget.data.repository.TaskRepository
import dagger.hilt.android.HiltAndroidApp
+import javax.inject.Inject
@HiltAndroidApp
-class CalendarWidgetApplication : Application()
\ No newline at end of file
+class CalendarWidgetApplication : Application() {
+
+ @Inject
+ lateinit var taskRepository: TaskRepository
+}
\ No newline at end of file
diff --git a/android-app/app/src/main/java/com/tunpok/calendarwidget/MainActivity.kt b/android-app/app/src/main/java/com/tunpok/calendarwidget/MainActivity.kt
index bd4ae55..1e2123d 100644
--- a/android-app/app/src/main/java/com/tunpok/calendarwidget/MainActivity.kt
+++ b/android-app/app/src/main/java/com/tunpok/calendarwidget/MainActivity.kt
@@ -3,6 +3,7 @@ package com.tunpok.calendarwidget
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
+import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
@@ -12,6 +13,7 @@ import androidx.compose.material.icons.filled.Settings
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
import androidx.navigation.NavDestination.Companion.hierarchy
import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.compose.NavHost
diff --git a/android-app/app/src/main/java/com/tunpok/calendarwidget/ui/components/TaskCard.kt b/android-app/app/src/main/java/com/tunpok/calendarwidget/ui/components/TaskCard.kt
index b1963b4..ea67cd4 100644
--- a/android-app/app/src/main/java/com/tunpok/calendarwidget/ui/components/TaskCard.kt
+++ b/android-app/app/src/main/java/com/tunpok/calendarwidget/ui/components/TaskCard.kt
@@ -1,6 +1,7 @@
package com.tunpok.calendarwidget.ui.components
import androidx.compose.foundation.background
+import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
@@ -121,10 +122,10 @@ fun TaskDisplayCard(
modifier: Modifier = Modifier
) {
Card(
- onClick = onClick,
modifier = modifier
.fillMaxWidth()
- .height(80.dp),
+ .height(80.dp)
+ .clickable { onClick() },
shape = RoundedCornerShape(16.dp),
colors = CardDefaults.cardColors(
containerColor = SurfaceColor
diff --git a/android-app/app/src/main/java/com/tunpok/calendarwidget/ui/theme/Theme.kt b/android-app/app/src/main/java/com/tunpok/calendarwidget/ui/theme/Theme.kt
index 2624491..891469e 100644
--- a/android-app/app/src/main/java/com/tunpok/calendarwidget/ui/theme/Theme.kt
+++ b/android-app/app/src/main/java/com/tunpok/calendarwidget/ui/theme/Theme.kt
@@ -10,6 +10,7 @@ import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
+import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
diff --git a/android-app/app/src/main/java/com/tunpok/calendarwidget/ui/widget/TaskWidgetProvider.kt b/android-app/app/src/main/java/com/tunpok/calendarwidget/ui/widget/TaskWidgetProvider.kt
index 6c4c110..4de2d5e 100644
--- a/android-app/app/src/main/java/com/tunpok/calendarwidget/ui/widget/TaskWidgetProvider.kt
+++ b/android-app/app/src/main/java/com/tunpok/calendarwidget/ui/widget/TaskWidgetProvider.kt
@@ -8,19 +8,18 @@ import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.widget.RemoteViews
+import com.tunpok.calendarwidget.CalendarWidgetApplication
import com.tunpok.calendarwidget.R
import com.tunpok.calendarwidget.data.repository.TaskRepository
-import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
-import javax.inject.Inject
-@AndroidEntryPoint
class TaskWidgetProvider : AppWidgetProvider() {
-
- @Inject
- lateinit var repository: TaskRepository
+
+ private fun getRepository(context: Context): TaskRepository {
+ return (context.applicationContext as CalendarWidgetApplication).taskRepository
+ }
override fun onUpdate(
context: Context,
@@ -124,6 +123,7 @@ class TaskWidgetProvider : AppWidgetProvider() {
}
private fun handleTaskClick(context: Context, taskId: Int) {
+ val repository = getRepository(context)
CoroutineScope(Dispatchers.IO).launch {
repository.scheduleTask(taskId)
refreshWidget(context)
diff --git a/android-app/app/src/main/java/com/tunpok/calendarwidget/utils/AppSettings.kt b/android-app/app/src/main/java/com/tunpok/calendarwidget/utils/AppSettings.kt
index eb56114..415d6dd 100644
--- a/android-app/app/src/main/java/com/tunpok/calendarwidget/utils/AppSettings.kt
+++ b/android-app/app/src/main/java/com/tunpok/calendarwidget/utils/AppSettings.kt
@@ -6,6 +6,7 @@ import androidx.datastore.preferences.core.*
import androidx.datastore.preferences.preferencesDataStore
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.map
import javax.inject.Inject
import javax.inject.Singleton
@@ -35,7 +36,7 @@ class AppSettings @Inject constructor(
.map { preferences ->
preferences[PreferenceKeys.API_KEY] ?: "change-me"
}
- .collect { it }
+ .first()
}
suspend fun saveApiHost(apiHost: String) {
diff --git a/android-app/app/src/main/res/drawable/ic_launcher_background.xml b/android-app/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..0b03907
--- /dev/null
+++ b/android-app/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,10 @@
+
+
+
+
\ No newline at end of file
diff --git a/android-app/app/src/main/res/drawable/ic_launcher_foreground.xml b/android-app/app/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..aea25aa
--- /dev/null
+++ b/android-app/app/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android-app/app/src/main/res/mipmap-hdpi/ic_launcher.xml b/android-app/app/src/main/res/mipmap-hdpi/ic_launcher.xml
new file mode 100644
index 0000000..9cdac34
--- /dev/null
+++ b/android-app/app/src/main/res/mipmap-hdpi/ic_launcher.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android-app/app/src/main/res/mipmap-hdpi/ic_launcher_round.xml b/android-app/app/src/main/res/mipmap-hdpi/ic_launcher_round.xml
new file mode 100644
index 0000000..23bc8e7
--- /dev/null
+++ b/android-app/app/src/main/res/mipmap-hdpi/ic_launcher_round.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android-app/app/src/main/res/mipmap-mdpi/ic_launcher.xml b/android-app/app/src/main/res/mipmap-mdpi/ic_launcher.xml
new file mode 100644
index 0000000..9cdac34
--- /dev/null
+++ b/android-app/app/src/main/res/mipmap-mdpi/ic_launcher.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android-app/app/src/main/res/mipmap-mdpi/ic_launcher_round.xml b/android-app/app/src/main/res/mipmap-mdpi/ic_launcher_round.xml
new file mode 100644
index 0000000..23bc8e7
--- /dev/null
+++ b/android-app/app/src/main/res/mipmap-mdpi/ic_launcher_round.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android-app/app/src/main/res/mipmap-xhdpi/ic_launcher.xml b/android-app/app/src/main/res/mipmap-xhdpi/ic_launcher.xml
new file mode 100644
index 0000000..9cdac34
--- /dev/null
+++ b/android-app/app/src/main/res/mipmap-xhdpi/ic_launcher.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android-app/app/src/main/res/mipmap-xhdpi/ic_launcher_round.xml b/android-app/app/src/main/res/mipmap-xhdpi/ic_launcher_round.xml
new file mode 100644
index 0000000..23bc8e7
--- /dev/null
+++ b/android-app/app/src/main/res/mipmap-xhdpi/ic_launcher_round.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android-app/app/src/main/res/mipmap-xxhdpi/ic_launcher.xml b/android-app/app/src/main/res/mipmap-xxhdpi/ic_launcher.xml
new file mode 100644
index 0000000..9cdac34
--- /dev/null
+++ b/android-app/app/src/main/res/mipmap-xxhdpi/ic_launcher.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android-app/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.xml b/android-app/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.xml
new file mode 100644
index 0000000..23bc8e7
--- /dev/null
+++ b/android-app/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.xml b/android-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.xml
new file mode 100644
index 0000000..9cdac34
--- /dev/null
+++ b/android-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.xml b/android-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.xml
new file mode 100644
index 0000000..23bc8e7
--- /dev/null
+++ b/android-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android-app/build.gradle.kts b/android-app/build.gradle.kts
index 0d91674..52eb54e 100644
--- a/android-app/build.gradle.kts
+++ b/android-app/build.gradle.kts
@@ -1,6 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
- id("com.android.application") version "8.2.0" apply false
+ id("com.android.application") version "8.13.1" apply false
id("org.jetbrains.kotlin.android") version "1.9.20" apply false
id("com.google.dagger.hilt.android") version "2.48" apply false
+ id("com.google.devtools.ksp") version "1.9.20-1.0.14" apply false
}
\ No newline at end of file
diff --git a/android-app/gradle/wrapper/gradle-wrapper.properties b/android-app/gradle/wrapper/gradle-wrapper.properties
index 332218b..37f853b 100644
--- a/android-app/gradle/wrapper/gradle-wrapper.properties
+++ b/android-app/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
\ No newline at end of file
+zipStorePath=wrapper/dists