mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-14 21:18:51 -06:00
Creating the Habitgroup model
This commit is contained in:
@@ -79,6 +79,10 @@ class HabitsApplication : Application() {
|
||||
val habitList = component.habitList
|
||||
for (h in habitList) h.recompute()
|
||||
|
||||
val habitGroupList = component.habitGroupList
|
||||
for (hgr in habitGroupList) hgr.recompute()
|
||||
habitGroupList.populateGroupsWith(habitList)
|
||||
|
||||
widgetUpdater = component.widgetUpdater.apply {
|
||||
startListening()
|
||||
scheduleStartDayWidgetUpdate()
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.isoron.uhabits.core.AppScope
|
||||
import org.isoron.uhabits.core.commands.CommandRunner
|
||||
import org.isoron.uhabits.core.io.GenericImporter
|
||||
import org.isoron.uhabits.core.io.Logging
|
||||
import org.isoron.uhabits.core.models.HabitGroupList
|
||||
import org.isoron.uhabits.core.models.HabitList
|
||||
import org.isoron.uhabits.core.models.ModelFactory
|
||||
import org.isoron.uhabits.core.preferences.Preferences
|
||||
@@ -50,6 +51,7 @@ interface HabitsApplicationComponent {
|
||||
val genericImporter: GenericImporter
|
||||
val habitCardListCache: HabitCardListCache
|
||||
val habitList: HabitList
|
||||
val habitGroupList: HabitGroupList
|
||||
val intentFactory: IntentFactory
|
||||
val intentParser: IntentParser
|
||||
val logging: Logging
|
||||
|
||||
@@ -26,9 +26,11 @@ import org.isoron.uhabits.core.commands.CommandRunner
|
||||
import org.isoron.uhabits.core.database.Database
|
||||
import org.isoron.uhabits.core.database.DatabaseOpener
|
||||
import org.isoron.uhabits.core.io.Logging
|
||||
import org.isoron.uhabits.core.models.HabitGroupList
|
||||
import org.isoron.uhabits.core.models.HabitList
|
||||
import org.isoron.uhabits.core.models.ModelFactory
|
||||
import org.isoron.uhabits.core.models.sqlite.SQLModelFactory
|
||||
import org.isoron.uhabits.core.models.sqlite.SQLiteHabitGroupList
|
||||
import org.isoron.uhabits.core.models.sqlite.SQLiteHabitList
|
||||
import org.isoron.uhabits.core.preferences.Preferences
|
||||
import org.isoron.uhabits.core.preferences.WidgetPreferences
|
||||
@@ -97,6 +99,12 @@ class HabitsModule(dbFile: File) {
|
||||
return list
|
||||
}
|
||||
|
||||
@Provides
|
||||
@AppScope
|
||||
fun getHabitGroupList(list: SQLiteHabitGroupList): HabitGroupList {
|
||||
return list
|
||||
}
|
||||
|
||||
@Provides
|
||||
@AppScope
|
||||
fun getDatabaseOpener(opener: AndroidDatabaseOpener): DatabaseOpener {
|
||||
|
||||
Reference in New Issue
Block a user