Cleaner - Needs UI rebuild from Master TBD
This commit is contained in:
@@ -18,12 +18,6 @@ android {
|
|||||||
versionName = "1.0"
|
versionName = "1.0"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
javaCompileOptions {
|
|
||||||
annotationProcessorOptions {
|
|
||||||
// Correct Kotlin DSL syntax: use put() instead of += with a map literal
|
|
||||||
arguments["room.schemaLocation"] = "$projectDir/schemas"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@@ -48,37 +42,34 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// AndroidX & Lifecycle
|
// Core & Lifecycle
|
||||||
implementation(libs.androidx.core.ktx)
|
implementation(libs.androidx.core.ktx)
|
||||||
implementation(libs.androidx.lifecycle.runtime.ktx)
|
implementation(libs.androidx.lifecycle.runtime.ktx)
|
||||||
implementation(libs.androidx.lifecycle.viewmodel.compose)
|
implementation(libs.androidx.lifecycle.viewmodel.compose)
|
||||||
implementation(libs.androidx.activity.compose)
|
implementation(libs.androidx.activity.compose)
|
||||||
|
|
||||||
// Compose (Using BOM)
|
// Compose
|
||||||
implementation(platform(libs.androidx.compose.bom))
|
implementation(platform(libs.androidx.compose.bom))
|
||||||
implementation(libs.androidx.compose.ui)
|
implementation(libs.androidx.compose.ui)
|
||||||
implementation(libs.androidx.compose.ui.graphics)
|
implementation(libs.androidx.compose.ui.graphics)
|
||||||
implementation(libs.androidx.compose.ui.tooling.preview)
|
implementation(libs.androidx.compose.ui.tooling.preview)
|
||||||
implementation(libs.androidx.compose.material3)
|
implementation(libs.androidx.compose.material3)
|
||||||
implementation(libs.androidx.compose.material.icons)
|
implementation(libs.androidx.compose.material.icons)
|
||||||
|
|
||||||
// Navigation & Hilt Integration
|
|
||||||
implementation(libs.androidx.navigation.compose)
|
|
||||||
implementation(libs.androidx.hilt.navigation.compose)
|
|
||||||
implementation(libs.hilt.android)
|
|
||||||
implementation(libs.compose.material3)
|
|
||||||
implementation(libs.androidx.material3)
|
|
||||||
ksp(libs.hilt.compiler)
|
|
||||||
|
|
||||||
// Images
|
|
||||||
implementation(libs.coil.compose)
|
|
||||||
|
|
||||||
// Tooling (Fixed to use TOML alias)
|
|
||||||
debugImplementation(libs.androidx.compose.ui.tooling)
|
debugImplementation(libs.androidx.compose.ui.tooling)
|
||||||
|
|
||||||
//backend2
|
// Hilt DI
|
||||||
//room addon
|
implementation(libs.hilt.android)
|
||||||
|
ksp(libs.hilt.compiler)
|
||||||
|
implementation(libs.androidx.hilt.navigation.compose)
|
||||||
|
|
||||||
|
// Navigation
|
||||||
|
implementation(libs.androidx.navigation.compose)
|
||||||
|
|
||||||
|
// Room Database
|
||||||
implementation(libs.room.runtime)
|
implementation(libs.room.runtime)
|
||||||
implementation(libs.room.ktx)
|
implementation(libs.room.ktx)
|
||||||
ksp(libs.room.compiler)
|
ksp(libs.room.compiler)
|
||||||
|
|
||||||
|
// Coil Images
|
||||||
|
implementation(libs.coil.compose)
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.placeholder.sherpai2
|
package com.placeholder.sherpai2
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
|
import dagger.hilt.android.HiltAndroidApp
|
||||||
|
|
||||||
class SherpAIApplication : Application() {
|
@HiltAndroidApp
|
||||||
|
class SherpAIApplication : Application()
|
||||||
}
|
|
||||||
@@ -3,6 +3,10 @@ package com.placeholder.sherpai2.di
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.room.Room
|
import androidx.room.Room
|
||||||
import com.placeholder.sherpai2.data.local.AppDatabase
|
import com.placeholder.sherpai2.data.local.AppDatabase
|
||||||
|
import com.placeholder.sherpai2.data.local.dao.ImageAggregateDao
|
||||||
|
import com.placeholder.sherpai2.data.local.dao.ImageEventDao
|
||||||
|
import com.placeholder.sherpai2.data.local.dao.ImageTagDao
|
||||||
|
import com.placeholder.sherpai2.data.local.dao.TagDao
|
||||||
import dagger.Module
|
import dagger.Module
|
||||||
import dagger.Provides
|
import dagger.Provides
|
||||||
import dagger.hilt.InstallIn
|
import dagger.hilt.InstallIn
|
||||||
@@ -25,4 +29,33 @@ object DatabaseModule {
|
|||||||
"sherpai.db"
|
"sherpai.db"
|
||||||
).build()
|
).build()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- Add these DAO providers ---
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
fun provideTagDao(database: AppDatabase): TagDao {
|
||||||
|
return database.tagDao()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
fun provideImageTagDao(database: AppDatabase): ImageTagDao {
|
||||||
|
return database.imageTagDao()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add providers for your other DAOs now to avoid future errors
|
||||||
|
@Provides
|
||||||
|
fun provideImageDao(database: AppDatabase) = database.imageDao()
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
fun providePersonDao(database: AppDatabase) = database.personDao()
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
fun provideEventDao(database: AppDatabase) = database.eventDao()
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
fun provideImageEventDao(database: AppDatabase): ImageEventDao = database.imageEventDao()
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
fun provideImageAggregateDao(database: AppDatabase): ImageAggregateDao = database.imageAggregateDao()
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import androidx.lifecycle.viewModelScope
|
|||||||
import com.placeholder.sherpai2.data.local.entity.TagEntity
|
import com.placeholder.sherpai2.data.local.entity.TagEntity
|
||||||
import com.placeholder.sherpai2.domain.repository.TaggingRepository
|
import com.placeholder.sherpai2.domain.repository.TaggingRepository
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
import kotlinx.coroutines.flow.*
|
import kotlinx.coroutines.flow.*
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
@@ -17,6 +18,7 @@ import javax.inject.Inject
|
|||||||
* - Tag write operations
|
* - Tag write operations
|
||||||
*/
|
*/
|
||||||
@HiltViewModel
|
@HiltViewModel
|
||||||
|
@OptIn(ExperimentalCoroutinesApi::class)
|
||||||
class ImageDetailViewModel @Inject constructor(
|
class ImageDetailViewModel @Inject constructor(
|
||||||
private val tagRepository: TaggingRepository
|
private val tagRepository: TaggingRepository
|
||||||
) : ViewModel() {
|
) : ViewModel() {
|
||||||
|
|||||||
@@ -3,5 +3,9 @@ plugins {
|
|||||||
alias(libs.plugins.android.application) apply false
|
alias(libs.plugins.android.application) apply false
|
||||||
alias(libs.plugins.kotlin.android) apply false
|
alias(libs.plugins.kotlin.android) apply false
|
||||||
alias(libs.plugins.kotlin.compose) apply false
|
alias(libs.plugins.kotlin.compose) apply false
|
||||||
|
|
||||||
|
//Adding these two fixes the conflicts between hilt / room / ksp and javbapoet (cannonicalName())
|
||||||
|
//https://github.com/google/dagger/issues/4048#issuecomment-1864237679
|
||||||
alias(libs.plugins.ksp) apply false
|
alias(libs.plugins.ksp) apply false
|
||||||
|
alias(libs.plugins.hilt.android) apply false
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[versions]
|
[versions]
|
||||||
# Tooling
|
# Tooling
|
||||||
agp = "8.7.3"
|
agp = "8.13.2"
|
||||||
kotlin = "2.0.21"
|
kotlin = "2.0.21"
|
||||||
ksp = "2.0.21-1.0.28"
|
ksp = "2.0.21-1.0.28"
|
||||||
|
|
||||||
@@ -8,34 +8,28 @@ ksp = "2.0.21-1.0.28"
|
|||||||
coreKtx = "1.15.0"
|
coreKtx = "1.15.0"
|
||||||
lifecycle = "2.8.7"
|
lifecycle = "2.8.7"
|
||||||
activityCompose = "1.9.3"
|
activityCompose = "1.9.3"
|
||||||
composeBom = "2024.12.01"
|
composeBom = "2025.12.01"
|
||||||
navigationCompose = "2.8.5"
|
navigationCompose = "2.8.5"
|
||||||
hiltNavigationCompose = "1.2.0"
|
hiltNavigationCompose = "1.3.0"
|
||||||
|
|
||||||
# DI
|
# DI & Database
|
||||||
hilt = "2.52"
|
hilt = "2.57.2"
|
||||||
|
room = "2.8.4"
|
||||||
|
|
||||||
# Images
|
# Images
|
||||||
coil = "2.7.0"
|
coil = "2.7.0"
|
||||||
|
|
||||||
#backend2
|
|
||||||
#Room
|
|
||||||
room = "2.6.1"
|
|
||||||
composeMaterial3 = "1.5.6"
|
|
||||||
material3 = "1.4.0"
|
|
||||||
|
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||||
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" }
|
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" }
|
||||||
androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" }
|
androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" }
|
||||||
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
|
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
|
||||||
|
|
||||||
# Compose BOM & UI
|
# Compose
|
||||||
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
|
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
|
||||||
androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" }
|
androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" }
|
||||||
androidx-compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
|
androidx-compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
|
||||||
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" } # ADDED THIS
|
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
|
||||||
androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
|
androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
|
||||||
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
|
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
|
||||||
androidx-compose-material-icons = { group = "androidx.compose.material", name = "material-icons-extended" }
|
androidx-compose-material-icons = { group = "androidx.compose.material", name = "material-icons-extended" }
|
||||||
@@ -46,17 +40,13 @@ androidx-hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navig
|
|||||||
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
|
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
|
||||||
hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" }
|
hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" }
|
||||||
|
|
||||||
# Misc
|
|
||||||
coil-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" }
|
|
||||||
|
|
||||||
#backend2
|
|
||||||
# Room
|
# Room
|
||||||
room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
|
room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
|
||||||
room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
|
room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
|
||||||
room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
|
room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
|
||||||
compose-material3 = { group = "androidx.wear.compose", name = "compose-material3", version.ref = "composeMaterial3" }
|
|
||||||
androidx-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" }
|
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
coil-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" }
|
||||||
|
|
||||||
[plugins]
|
[plugins]
|
||||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||||
|
|||||||
Reference in New Issue
Block a user