From b2b3b4a389f672f4515a55fff5d422268f0971db Mon Sep 17 00:00:00 2001 From: "Darryl L. Pierce" Date: Sun, 18 Feb 2024 07:35:09 -0500 Subject: [PATCH] Added viewing the list of servers on Android [#3] --- androidVariant/build.gradle.kts | 1 + .../android/view/main/HomeViewKtTest.kt | 85 +++++++++++ .../android/view/opds/ServerEntryKtTest.kt | 73 +++++++++ .../android/view/opds/ServerListKtTest.kt | 52 +++++++ .../variant/android/MainActivity.kt | 70 +++++---- ...{MyApplicationTheme.kt => VariantTheme.kt} | 2 +- .../variant/android/view/main/HomeView.kt | 142 ++++++++++++++++++ .../variant/android/view/opds/ServerEntry.kt | 80 ++++++++++ .../variant/android/view/opds/ServerList.kt | 85 +++++++++++ .../src/main/res/values/strings.xml | 5 + gradle/libs.versions.toml | 36 ++++- .../variant/model/OPDSServer.kt | 32 ++++ 12 files changed, 630 insertions(+), 33 deletions(-) create mode 100644 androidVariant/src/androidTest/java/org/comixedproject/variant/android/view/main/HomeViewKtTest.kt create mode 100644 androidVariant/src/androidTest/java/org/comixedproject/variant/android/view/opds/ServerEntryKtTest.kt create mode 100644 androidVariant/src/androidTest/java/org/comixedproject/variant/android/view/opds/ServerListKtTest.kt rename androidVariant/src/main/java/org/comixedproject/variant/android/{MyApplicationTheme.kt => VariantTheme.kt} (99%) create mode 100644 androidVariant/src/main/java/org/comixedproject/variant/android/view/main/HomeView.kt create mode 100644 androidVariant/src/main/java/org/comixedproject/variant/android/view/opds/ServerEntry.kt create mode 100644 androidVariant/src/main/java/org/comixedproject/variant/android/view/opds/ServerList.kt create mode 100644 androidVariant/src/main/res/values/strings.xml create mode 100644 shared/src/androidMain/kotlin/org/comixedproject/variant/model/OPDSServer.kt diff --git a/androidVariant/build.gradle.kts b/androidVariant/build.gradle.kts index ef6d5b2..b8ec662 100644 --- a/androidVariant/build.gradle.kts +++ b/androidVariant/build.gradle.kts @@ -8,6 +8,7 @@ android { compileSdk = 34 defaultConfig { applicationId = "org.comixedproject.variant.android" + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" minSdk = 24 targetSdk = 34 versionCode = 1 diff --git a/androidVariant/src/androidTest/java/org/comixedproject/variant/android/view/main/HomeViewKtTest.kt b/androidVariant/src/androidTest/java/org/comixedproject/variant/android/view/main/HomeViewKtTest.kt new file mode 100644 index 0000000..2ca0ac0 --- /dev/null +++ b/androidVariant/src/androidTest/java/org/comixedproject/variant/android/view/main/HomeViewKtTest.kt @@ -0,0 +1,85 @@ +/* + * Variant - A digital comic book reading application for the iPad and Android tablets. + * Copyright (C) 2024, The ComiXed Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package org.comixedproject.variant.android.view.main + +import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.test.onNodeWithTag +import org.comixedproject.variant.android.VariantTheme +import org.comixedproject.variant.model.OPDSServer +import org.junit.Rule +import org.junit.Test + +class HomeViewKtTest { + val SERVER_LIST = listOf( + OPDSServer( + "1", + "Home Server", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ) + ) + + @get:Rule + val composeTestRule = createComposeRule() + + @Test + fun testHomeViewHasTitle() { + composeTestRule.setContent { + VariantTheme { + HomeView(serverList = SERVER_LIST) + } + } + + composeTestRule.onNodeWithTag(TAG_TITLE_TEXT).assertExists() + } + + @Test + fun testHomeViewHasBottomBar() { + composeTestRule.setContent { + VariantTheme { + HomeView(serverList = SERVER_LIST) + } + } + + composeTestRule.onNodeWithTag(TAG_BOTTOM_BAR).assertExists() + } + + @Test + fun testHomeViewHasAddServerButton() { + composeTestRule.setContent { + VariantTheme { + HomeView(serverList = SERVER_LIST) + } + } + + composeTestRule.onNodeWithTag(TAG_ADD_SERVER_BUTTON).assertExists() + } + + @Test + fun testHomeViewHasAddServerList() { + composeTestRule.setContent { + VariantTheme { + HomeView(serverList = SERVER_LIST) + } + } + + composeTestRule.onNodeWithTag(TAG_SERVER_LIST).assertExists() + } +} \ No newline at end of file diff --git a/androidVariant/src/androidTest/java/org/comixedproject/variant/android/view/opds/ServerEntryKtTest.kt b/androidVariant/src/androidTest/java/org/comixedproject/variant/android/view/opds/ServerEntryKtTest.kt new file mode 100644 index 0000000..0f000c3 --- /dev/null +++ b/androidVariant/src/androidTest/java/org/comixedproject/variant/android/view/opds/ServerEntryKtTest.kt @@ -0,0 +1,73 @@ +/* + * Variant - A digital comic book reading application for the iPad and Android tablets. + * Copyright (C) 2024, The ComiXed Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package org.comixedproject.variant.android.view.opds + +import androidx.compose.ui.test.assertTextContains +import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.test.onNodeWithTag +import org.comixedproject.variant.android.VariantTheme +import org.comixedproject.variant.model.OPDSServer +import org.junit.Rule +import org.junit.Test + +class ServerEntryKtTest { + val SERVER = OPDSServer( + "1", + "Home Server", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ) + + @get:Rule + val composeTestRule = createComposeRule() + + @Test + fun testServerEntryServerName() { + composeTestRule.setContent { + VariantTheme { + ServerEntry(server = SERVER) + } + } + + composeTestRule.onNodeWithTag(TAG_SERVER_NAME).assertTextContains(SERVER.name) + } + + @Test + fun testServerEntryServerUrl() { + composeTestRule.setContent { + VariantTheme { + ServerEntry(server = SERVER) + } + } + + composeTestRule.onNodeWithTag(TAG_SERVER_URL).assertTextContains(SERVER.url) + } + + @Test + fun testServerEntryUsername() { + composeTestRule.setContent { + VariantTheme { + ServerEntry(server = SERVER) + } + } + + composeTestRule.onNodeWithTag(TAG_USERNAME).assertTextContains(SERVER.username) + } +} \ No newline at end of file diff --git a/androidVariant/src/androidTest/java/org/comixedproject/variant/android/view/opds/ServerListKtTest.kt b/androidVariant/src/androidTest/java/org/comixedproject/variant/android/view/opds/ServerListKtTest.kt new file mode 100644 index 0000000..4fa8e3a --- /dev/null +++ b/androidVariant/src/androidTest/java/org/comixedproject/variant/android/view/opds/ServerListKtTest.kt @@ -0,0 +1,52 @@ +/* + * Variant - A digital comic book reading application for the iPad and Android tablets. + * Copyright (C) 2024, The ComiXed Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package org.comixedproject.variant.android.view.opds + +import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.test.onNodeWithTag +import org.comixedproject.variant.android.VariantTheme +import org.comixedproject.variant.model.OPDSServer +import org.junit.Rule +import org.junit.Test + +class ServerListKtTest { + val SERVER_LIST = listOf( + OPDSServer( + "1", + "Home Server", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ) + ) + + @get:Rule + val composeTestRule = createComposeRule() + + @Test + fun testServerList() { + composeTestRule.setContent { + VariantTheme { + ServerList(serverList = SERVER_LIST) + } + } + + composeTestRule.onNodeWithTag(TAG_SERVER_LIST_COLUMN).assertExists() + } +} \ No newline at end of file diff --git a/androidVariant/src/main/java/org/comixedproject/variant/android/MainActivity.kt b/androidVariant/src/main/java/org/comixedproject/variant/android/MainActivity.kt index 8333587..d6eea94 100644 --- a/androidVariant/src/main/java/org/comixedproject/variant/android/MainActivity.kt +++ b/androidVariant/src/main/java/org/comixedproject/variant/android/MainActivity.kt @@ -21,38 +21,54 @@ package org.comixedproject.variant.android import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.material3.* -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.tooling.preview.Preview -import org.comixedproject.variant.Greeting +import org.comixedproject.variant.android.view.main.HomeView +import org.comixedproject.variant.model.OPDSServer class MainActivity : ComponentActivity() { + val serverList = listOf( + OPDSServer( + "1", + "Server 1", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + OPDSServer( + "2", + "Server 2", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + OPDSServer( + "3", + "Server 3", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + OPDSServer( + "4", + "Server 4", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + OPDSServer( + "5", + "Server 5", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + ) + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { - MyApplicationTheme { - Surface( - modifier = Modifier.fillMaxSize(), - color = MaterialTheme.colorScheme.background - ) { - GreetingView(Greeting().greet()) - } + VariantTheme { + HomeView(serverList) } } } -} - -@Composable -fun GreetingView(text: String) { - Text(text = text) -} - -@Preview -@Composable -fun DefaultPreview() { - MyApplicationTheme { - GreetingView("Hello, Android!") - } -} +} \ No newline at end of file diff --git a/androidVariant/src/main/java/org/comixedproject/variant/android/MyApplicationTheme.kt b/androidVariant/src/main/java/org/comixedproject/variant/android/VariantTheme.kt similarity index 99% rename from androidVariant/src/main/java/org/comixedproject/variant/android/MyApplicationTheme.kt rename to androidVariant/src/main/java/org/comixedproject/variant/android/VariantTheme.kt index b06be89..cd76dfb 100644 --- a/androidVariant/src/main/java/org/comixedproject/variant/android/MyApplicationTheme.kt +++ b/androidVariant/src/main/java/org/comixedproject/variant/android/VariantTheme.kt @@ -34,7 +34,7 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @Composable -fun MyApplicationTheme( +fun VariantTheme( darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit ) { diff --git a/androidVariant/src/main/java/org/comixedproject/variant/android/view/main/HomeView.kt b/androidVariant/src/main/java/org/comixedproject/variant/android/view/main/HomeView.kt new file mode 100644 index 0000000..7f5fefb --- /dev/null +++ b/androidVariant/src/main/java/org/comixedproject/variant/android/view/main/HomeView.kt @@ -0,0 +1,142 @@ +/* + * Variant - A digital comic book reading application for the iPad and Android tablets. + * Copyright (C) 2024, The ComiXed Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package org.comixedproject.variant.android.view.main + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.padding +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Add +import androidx.compose.material3.BottomAppBar +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.FloatingActionButton +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.material3.TopAppBarDefaults.topAppBarColors +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import org.comixedproject.variant.android.R +import org.comixedproject.variant.android.VariantTheme +import org.comixedproject.variant.android.view.opds.ServerList +import org.comixedproject.variant.model.OPDSServer + +val TAG_TITLE_TEXT = "tag.title-text" +val TAG_BOTTOM_BAR = "tag.bottom-bar" +val TAG_ADD_SERVER_BUTTON = "tag.add-server-button" +val TAG_SERVER_LIST = "tag.server-list" + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun HomeView(serverList: List) { + Scaffold( + topBar = { + TopAppBar( + colors = topAppBarColors( + containerColor = MaterialTheme.colorScheme.primaryContainer, + titleContentColor = MaterialTheme.colorScheme.primary + ), + title = { + Text( + modifier = Modifier.testTag(TAG_TITLE_TEXT), + text = stringResource(id = R.string.app_title_text) + ) + } + ) + }, + bottomBar = { + BottomAppBar( + modifier = Modifier.testTag(TAG_BOTTOM_BAR), + containerColor = MaterialTheme.colorScheme.primaryContainer, + contentColor = MaterialTheme.colorScheme.primary + ) { + Text("Bottom Bar Stuff") + } + }, + floatingActionButton = { + FloatingActionButton( + modifier = Modifier.testTag(TAG_ADD_SERVER_BUTTON), + onClick = { /*create a new entry*/ }) { + Icon( + Icons.Default.Add, + contentDescription = stringResource(id = R.string.add_server_button) + ) + } + } + ) { innerPadding -> + Column( + modifier = Modifier.padding(innerPadding), + verticalArrangement = Arrangement.spacedBy(16.dp) + ) { + ServerList(serverList, modifier = Modifier.testTag(TAG_SERVER_LIST)) + } + } +} + +@Preview +@Composable +fun HomeViewPreview() { + VariantTheme { + HomeView( + listOf( + OPDSServer( + "1", + "Server 1", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + OPDSServer( + "2", + "Server 2", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + OPDSServer( + "3", + "Server 3", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + OPDSServer( + "4", + "Server 4", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + OPDSServer( + "5", + "Server 5", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + ) + ) + } +} \ No newline at end of file diff --git a/androidVariant/src/main/java/org/comixedproject/variant/android/view/opds/ServerEntry.kt b/androidVariant/src/main/java/org/comixedproject/variant/android/view/opds/ServerEntry.kt new file mode 100644 index 0000000..a6bff1f --- /dev/null +++ b/androidVariant/src/main/java/org/comixedproject/variant/android/view/opds/ServerEntry.kt @@ -0,0 +1,80 @@ +/* + * Variant - A digital comic book reading application for the iPad and Android tablets. + * Copyright (C) 2024, The ComiXed Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package org.comixedproject.variant.android.view.opds + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import org.comixedproject.variant.android.VariantTheme +import org.comixedproject.variant.model.OPDSServer + +val TAG_SERVER_NAME = "tag.server-name" +val TAG_SERVER_URL = "tag.server-url" +val TAG_USERNAME = "tag.username" + +@Composable +fun ServerEntry(server: OPDSServer, modifier: Modifier = Modifier) { + Column( + modifier = Modifier + .fillMaxWidth() + .padding(8.dp) + ) { + Text( + modifier = Modifier.testTag(TAG_SERVER_NAME), + text = server.name, + maxLines = 1, + style = MaterialTheme.typography.bodyLarge + ) + Text( + modifier = Modifier.testTag(TAG_SERVER_URL), + text = server.url, + maxLines = 1, + style = MaterialTheme.typography.bodySmall + ) + Text( + modifier = Modifier.testTag(TAG_USERNAME), + text = server.username, + maxLines = 1, + style = MaterialTheme.typography.bodySmall + ) + } +} + +@Composable +@Preview +fun ServerEntryPreview() { + VariantTheme { + ServerEntry( + server = OPDSServer( + "1", + "Home Server", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ) + ) + } +} \ No newline at end of file diff --git a/androidVariant/src/main/java/org/comixedproject/variant/android/view/opds/ServerList.kt b/androidVariant/src/main/java/org/comixedproject/variant/android/view/opds/ServerList.kt new file mode 100644 index 0000000..af29b6b --- /dev/null +++ b/androidVariant/src/main/java/org/comixedproject/variant/android/view/opds/ServerList.kt @@ -0,0 +1,85 @@ +/* + * Variant - A digital comic book reading application for the iPad and Android tablets. + * Copyright (C) 2024, The ComiXed Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package org.comixedproject.variant.android.view.opds + +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.tooling.preview.Preview +import org.comixedproject.variant.android.VariantTheme +import org.comixedproject.variant.model.OPDSServer + +val TAG_SERVER_LIST_COLUMN = "tag.server-list-column" + +@Composable +fun ServerList(serverList: List, modifier: Modifier = Modifier) { + LazyColumn(modifier = modifier.testTag(TAG_SERVER_LIST_COLUMN)) { + items(serverList) { server -> + ServerEntry(server) + } + } +} + +@Preview +@Composable +fun ServerListPreview() { + VariantTheme { + ServerList( + listOf( + OPDSServer( + "1", + "Server 1", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + OPDSServer( + "2", + "Server 2", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + OPDSServer( + "3", + "Server 3", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + OPDSServer( + "4", + "Server 4", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + OPDSServer( + "5", + "Server 5", + "http://comixedproject.org:7171/opds", + "admin@comixedproject.org", + "my!password" + ), + ) + ) + } +} \ No newline at end of file diff --git a/androidVariant/src/main/res/values/strings.xml b/androidVariant/src/main/res/values/strings.xml new file mode 100644 index 0000000..b9a0490 --- /dev/null +++ b/androidVariant/src/main/res/values/strings.xml @@ -0,0 +1,5 @@ + + + Add new server + ComiXed Variant + \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7e71bb2..e34cf6b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,11 +5,14 @@ kotlin = "1.9.22" activity-compose = "1.8.0" activity-compose-compiler = "1.5.9" androidx-compose-bom = "2023.10.01" +androidx-foundation = "1.6.1" +androidx-material3-adaptive = "1.0.0-alpha06" core-ktx = "1.12.0" lifecycle-runtime-ktx = "2.6.2" androidx-junit = "1.1.5" espresso-core = "3.5.1" junit = "4.13.2" +test-runner = "1.5.2" [libraries] kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } @@ -17,7 +20,10 @@ androidx-activity-compose = { module = "androidx.activity:activity-compose", ver androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "core-ktx" } androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle-runtime-ktx" } androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidx-compose-bom" } +androidx-compose-runtime-saveable = { module = "androidx.compose.runtime:runtime-saveable-android" } +androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidx-foundation" } androidx-compose-material3 = { module = "androidx.compose.material3:material3" } +androidx-compose-material3-adaptive = { module = "androidx.compose.material3:material3-adaptive", version.ref = "androidx-material3-adaptive" } androidx-compose-ui-ui-graphics = { module = "androidx.compose.ui:ui-graphics" } androidx-compose-ui-ui = { module = "androidx.compose.ui:ui" } androidx-compose-ui-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } @@ -36,8 +42,28 @@ kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref sonarqube = { id = "org.sonarqube", version.ref = "sonarqube-plugin" } [bundles] -androidx = ["androidx-activity-compose", "androidx-core-ktx", "androidx-lifecycle-runtime-ktx"] -compose = ["androidx-compose-material3", "androidx-compose-ui-ui-graphics", "androidx-compose-ui-ui", "androidx-compose-ui-ui-tooling-preview"] -compose-debug = ["androidx-compose-ui-ui-tooling", "androidx-compose-ui-ui-test-manifest"] -instrumented-tests = ["androidx-junit", "androidx-espresso-core", "androidx-compose-ui-ui-test-junit4"] -unit-tests = ["junit"] \ No newline at end of file +androidx = [ + "androidx-activity-compose", + "androidx-core-ktx", "androidx-lifecycle-runtime-ktx" +] +compose = [ + "androidx-compose-material3", + "androidx-compose-foundation", + "androidx-compose-runtime-saveable", + "androidx-compose-material3-adaptive", + "androidx-compose-ui-ui-graphics", + "androidx-compose-ui-ui", + "androidx-compose-ui-ui-tooling-preview" +] +compose-debug = [ + "androidx-compose-ui-ui-tooling", + "androidx-compose-ui-ui-test-manifest" +] +instrumented-tests = [ + "androidx-junit", + "androidx-espresso-core", + "androidx-compose-ui-ui-test-junit4" +] +unit-tests = [ + "junit" +] \ No newline at end of file diff --git a/shared/src/androidMain/kotlin/org/comixedproject/variant/model/OPDSServer.kt b/shared/src/androidMain/kotlin/org/comixedproject/variant/model/OPDSServer.kt new file mode 100644 index 0000000..70b2b1d --- /dev/null +++ b/shared/src/androidMain/kotlin/org/comixedproject/variant/model/OPDSServer.kt @@ -0,0 +1,32 @@ +/* + * Variant - A digital comic book reading application for the iPad and Android tablets. + * Copyright (C) 2024, The ComiXed Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package org.comixedproject.variant.model + +/** + * OPDSServer represents the connection details for a remote server. + * + * @author Darryl L. Pierce + */ +data class OPDSServer( + var id: String, + var name: String, + var url: String, + var username: String, + var password: String +) \ No newline at end of file