mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2025-12-10 06:42:05 +01:00
Update Voyager and improve dependency addition
This commit is contained in:
@@ -23,7 +23,7 @@ dependencies {
|
||||
implementation(libs.voyager.core)
|
||||
implementation(libs.voyager.navigation)
|
||||
implementation(libs.voyager.transitions)
|
||||
implementation(libs.voyager.androidx)
|
||||
implementation(libs.voyager.screenmodel)
|
||||
implementation(libs.accompanist.pager)
|
||||
implementation(libs.accompanist.pagerIndicators)
|
||||
implementation(libs.accompanist.flowLayout)
|
||||
@@ -68,6 +68,10 @@ dependencies {
|
||||
implementation(libs.ktorfit.lib)
|
||||
ksp(libs.ktorfit.ksp)
|
||||
|
||||
// Apollo GraphQL
|
||||
implementation(libs.apollo.runtime)
|
||||
implementation(libs.apollo.engine.ktor)
|
||||
|
||||
// Logging
|
||||
implementation(libs.logging.kmlogging)
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ plugins {
|
||||
id(libs.plugins.ksp.get().pluginId)
|
||||
id(libs.plugins.buildkonfig.get().pluginId)
|
||||
id(libs.plugins.kotlinter.get().pluginId)
|
||||
id(libs.plugins.ktorfit.get().pluginId)
|
||||
id(libs.plugins.apollo.get().pluginId)
|
||||
}
|
||||
|
||||
@@ -128,5 +129,9 @@ apollo {
|
||||
packageName.set("ca.gosyer.jui.data.graphql")
|
||||
generateMethods.set(listOf("equalsHashCode"))
|
||||
mapScalar("LongString","kotlin.Long", "ca.gosyer.jui.data.scalars.LongStringScalar")
|
||||
introspection {
|
||||
endpointUrl.set("http://localhost:4567/api/graphql")
|
||||
schemaFile.set(file("src/main/graphql/schema.graphqls"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,11 @@ import ca.gosyer.jui.domain.settings.service.SettingsRepository
|
||||
import ca.gosyer.jui.domain.source.service.SourceRepository
|
||||
import ca.gosyer.jui.domain.updates.service.UpdatesRepository
|
||||
import com.apollographql.apollo3.ApolloClient
|
||||
import com.apollographql.apollo3.annotations.ApolloExperimental
|
||||
import com.apollographql.apollo3.network.ktorClient
|
||||
import de.jensklingenberg.ktorfit.Ktorfit
|
||||
import io.ktor.http.URLBuilder
|
||||
import io.ktor.http.appendPathSegments
|
||||
import me.tatarka.inject.annotations.Provides
|
||||
|
||||
interface DataComponent {
|
||||
@@ -37,12 +40,17 @@ interface DataComponent {
|
||||
.baseUrl(serverPreferences.serverUrl().get().toString().addSuffix('/'))
|
||||
.build()
|
||||
|
||||
@OptIn(ApolloExperimental::class)
|
||||
@Provides
|
||||
fun apolloClient(
|
||||
http: Http,
|
||||
serverPreferences: ServerPreferences,
|
||||
) = ApolloClient.Builder()
|
||||
.serverUrl(serverPreferences.serverUrl().get().toString())
|
||||
.serverUrl(
|
||||
URLBuilder(serverPreferences.serverUrl().get())
|
||||
.appendPathSegments("api", "graphql")
|
||||
.buildString()
|
||||
)
|
||||
.ktorClient(http)
|
||||
.build()
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ dependencies {
|
||||
implementation(libs.voyager.core)
|
||||
implementation(libs.voyager.navigation)
|
||||
implementation(libs.voyager.transitions)
|
||||
implementation(libs.voyager.screenmodel)
|
||||
implementation(libs.accompanist.pager)
|
||||
implementation(libs.accompanist.pagerIndicators)
|
||||
implementation(libs.accompanist.flowLayout)
|
||||
@@ -67,6 +68,10 @@ dependencies {
|
||||
implementation(libs.ktorfit.lib)
|
||||
ksp(libs.ktorfit.ksp)
|
||||
|
||||
// Apollo GraphQL
|
||||
implementation(libs.apollo.runtime)
|
||||
implementation(libs.apollo.engine.ktor)
|
||||
|
||||
// Logging
|
||||
implementation(libs.logging.slf4j.api)
|
||||
implementation(libs.logging.slf4j.jul)
|
||||
|
||||
@@ -10,7 +10,7 @@ json = "1.6.3"
|
||||
composeGradle = "1.6.1"
|
||||
|
||||
# Compose Libraries
|
||||
voyager = "1.0.0-rc10"
|
||||
voyager = "1.0.0"
|
||||
accompanist = "0.30.1"
|
||||
googleAccompanist = "0.30.1"
|
||||
imageloader = "1.7.8"
|
||||
@@ -91,7 +91,7 @@ serialization-json-okio = { module = "org.jetbrains.kotlinx:kotlinx-serializatio
|
||||
voyager-core = { module = "cafe.adriel.voyager:voyager-core", version.ref = "voyager" }
|
||||
voyager-navigation = { module = "cafe.adriel.voyager:voyager-navigator", version.ref = "voyager" }
|
||||
voyager-transitions = { module = "cafe.adriel.voyager:voyager-transitions", version.ref = "voyager" }
|
||||
voyager-androidx = { module = "cafe.adriel.voyager:voyager-androidx", version.ref = "voyager" }
|
||||
voyager-screenmodel = { module = "cafe.adriel.voyager:voyager-screenmodel", version.ref = "voyager" }
|
||||
accompanist-pager = { module = "ca.gosyer:accompanist-pager", version.ref = "accompanist" }
|
||||
accompanist-pagerIndicators = { module = "ca.gosyer:accompanist-pager-indicators", version.ref = "accompanist" }
|
||||
accompanist-flowLayout = { module = "ca.gosyer:accompanist-flowlayout", version.ref = "accompanist" }
|
||||
|
||||
@@ -53,6 +53,7 @@ kotlin {
|
||||
implementation(libs.voyager.core)
|
||||
implementation(libs.voyager.navigation)
|
||||
implementation(libs.voyager.transitions)
|
||||
implementation(libs.voyager.screenmodel)
|
||||
implementation(libs.accompanist.pager)
|
||||
implementation(libs.accompanist.pagerIndicators)
|
||||
implementation(libs.accompanist.flowLayout)
|
||||
@@ -82,6 +83,10 @@ kotlin {
|
||||
// Ktorfit
|
||||
implementation(libs.ktorfit.lib)
|
||||
|
||||
// Apollo GraphQL
|
||||
implementation(libs.apollo.runtime)
|
||||
implementation(libs.apollo.engine.ktor)
|
||||
|
||||
// Logging
|
||||
implementation(libs.logging.kmlogging)
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ kotlin {
|
||||
api(libs.voyager.core)
|
||||
api(libs.voyager.navigation)
|
||||
api(libs.voyager.transitions)
|
||||
api(libs.voyager.screenmodel)
|
||||
api(libs.materialDialogs.core)
|
||||
api(libs.accompanist.pager)
|
||||
api(libs.accompanist.pagerIndicators)
|
||||
@@ -120,7 +121,6 @@ kotlin {
|
||||
api(libs.androidx.core)
|
||||
api(libs.androidx.appCompat)
|
||||
api(libs.androidx.activity.compose)
|
||||
api(libs.voyager.androidx)
|
||||
}
|
||||
}
|
||||
val androidUnitTest by getting {
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
|
||||
package ca.gosyer.jui.ui.base.screen
|
||||
|
||||
import cafe.adriel.voyager.androidx.AndroidScreen
|
||||
import cafe.adriel.voyager.core.screen.Screen
|
||||
import cafe.adriel.voyager.core.screen.ScreenKey
|
||||
import cafe.adriel.voyager.core.screen.uniqueScreenKey
|
||||
|
||||
actual typealias BaseScreen = AndroidScreen
|
||||
actual abstract class BaseScreen : Screen {
|
||||
override val key: ScreenKey = uniqueScreenKey
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ kotlin {
|
||||
api(libs.imageloader.core)
|
||||
api(libs.imageloader.moko)
|
||||
api(libs.voyager.core)
|
||||
api(libs.voyager.screenmodel)
|
||||
api(libs.dateTime)
|
||||
api(libs.immutableCollections)
|
||||
api(projects.core)
|
||||
|
||||
Reference in New Issue
Block a user