Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change folder structure #161

Merged
merged 6 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import dk.scheduling.schedulingfrontend.pages.AccountPage
import dk.scheduling.schedulingfrontend.pages.CreateDevicePage
import dk.scheduling.schedulingfrontend.pages.CreateTaskPage
import dk.scheduling.schedulingfrontend.pages.HomePage
import dk.scheduling.schedulingfrontend.pages.LoginPage
import dk.scheduling.schedulingfrontend.pages.Page
import dk.scheduling.schedulingfrontend.pages.SignUpPage
import dk.scheduling.schedulingfrontend.pages.TaskOverviewPage
import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme
import dk.scheduling.schedulingfrontend.gui.pages.AccountPage
import dk.scheduling.schedulingfrontend.gui.pages.CreateDevicePage
import dk.scheduling.schedulingfrontend.gui.pages.CreateTaskPage
import dk.scheduling.schedulingfrontend.gui.pages.HomePage
import dk.scheduling.schedulingfrontend.gui.pages.LoginPage
import dk.scheduling.schedulingfrontend.gui.pages.Page
import dk.scheduling.schedulingfrontend.gui.pages.SignUpPage
import dk.scheduling.schedulingfrontend.gui.pages.TaskOverviewPage
import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme
import kotlinx.coroutines.runBlocking

class MainActivity : ComponentActivity() {
Expand Down Expand Up @@ -96,7 +96,11 @@ class MainActivity : ComponentActivity() {
CreateDevicePage(
deviceRepository = App.appModule.deviceRepo,
navigateOnValidCreation = { appState.navHostController.navigate(Page.DeviceOverview.route) },
navigateOnCancelCreation = { appState.navHostController.navigate(Page.DeviceOverview.route) },
navigateOnCancelCreation = {
appState.navHostController.navigate(
Page.DeviceOverview.route,
)
},
)
}
composable(
Expand All @@ -107,7 +111,11 @@ class MainActivity : ComponentActivity() {
deviceRepository = App.appModule.deviceRepo,
taskRepository = App.appModule.taskRepo,
navigateOnValidCreation = { appState.navHostController.navigate(Page.TaskOverview.route) },
navigateOnCancelCreation = { appState.navHostController.navigate(Page.TaskOverview.route) },
navigateOnCancelCreation = {
appState.navHostController.navigate(
Page.TaskOverview.route,
)
},
)
}
composable(Page.Account.route) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import androidx.navigation.NavController
import androidx.navigation.NavDestination.Companion.hierarchy
import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.compose.currentBackStackEntryAsState
import dk.scheduling.schedulingfrontend.pages.Page
import dk.scheduling.schedulingfrontend.gui.pages.Page

@Composable
fun BottomNavigationBar(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dk.scheduling.schedulingfrontend.api
package dk.scheduling.schedulingfrontend.datasources.api

import com.google.gson.Gson
import com.google.gson.GsonBuilder
import dk.scheduling.schedulingfrontend.api.typeadapters.LocalDateTimeTypeAdapter
import dk.scheduling.schedulingfrontend.datasources.api.typeadapters.LocalDateTimeTypeAdapter
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package dk.scheduling.schedulingfrontend.api
import dk.scheduling.schedulingfrontend.api.protocol.CreateDeviceRequest
import dk.scheduling.schedulingfrontend.api.protocol.CreateDeviceResponse
import dk.scheduling.schedulingfrontend.api.protocol.CreateTaskRequest
import dk.scheduling.schedulingfrontend.api.protocol.GetDevicesResponse
import dk.scheduling.schedulingfrontend.api.protocol.GetEventsResponse
import dk.scheduling.schedulingfrontend.api.protocol.GetTasksResponse
import dk.scheduling.schedulingfrontend.api.protocol.RegisterOrLoginRequest
import dk.scheduling.schedulingfrontend.api.protocol.RegisterOrLoginResponse
import dk.scheduling.schedulingfrontend.api.protocol.Task
package dk.scheduling.schedulingfrontend.datasources.api
import dk.scheduling.schedulingfrontend.datasources.api.protocol.CreateDeviceRequest
import dk.scheduling.schedulingfrontend.datasources.api.protocol.CreateDeviceResponse
import dk.scheduling.schedulingfrontend.datasources.api.protocol.CreateTaskRequest
import dk.scheduling.schedulingfrontend.datasources.api.protocol.GetDevicesResponse
import dk.scheduling.schedulingfrontend.datasources.api.protocol.GetEventsResponse
import dk.scheduling.schedulingfrontend.datasources.api.protocol.GetTasksResponse
import dk.scheduling.schedulingfrontend.datasources.api.protocol.RegisterOrLoginRequest
import dk.scheduling.schedulingfrontend.datasources.api.protocol.RegisterOrLoginResponse
import dk.scheduling.schedulingfrontend.datasources.api.protocol.Task
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.DELETE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("PropertyName")

package dk.scheduling.schedulingfrontend.api.protocol
package dk.scheduling.schedulingfrontend.datasources.api.protocol

import java.util.UUID

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.api.protocol
package dk.scheduling.schedulingfrontend.datasources.api.protocol

data class Device(
val id: Long,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("PropertyName")

package dk.scheduling.schedulingfrontend.api.protocol
package dk.scheduling.schedulingfrontend.datasources.api.protocol

import java.time.LocalDateTime

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("PropertyName")

package dk.scheduling.schedulingfrontend.api.protocol
package dk.scheduling.schedulingfrontend.datasources.api.protocol

data class Task(
val id: Long,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.api.protocol
package dk.scheduling.schedulingfrontend.datasources.api.protocol

import java.time.LocalDateTime

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.api.typeadapters
package dk.scheduling.schedulingfrontend.datasources.api.typeadapters

import com.google.gson.JsonDeserializationContext
import com.google.gson.JsonDeserializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat.getString
import dk.scheduling.schedulingfrontend.App
import dk.scheduling.schedulingfrontend.R
import dk.scheduling.schedulingfrontend.components.DATE_AND_TIME_FORMAT
import dk.scheduling.schedulingfrontend.database.EventAlarm
import dk.scheduling.schedulingfrontend.gui.components.DATE_AND_TIME_FORMAT
import java.time.Duration
import java.time.LocalDateTime
import java.time.temporal.ChronoUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.components
package dk.scheduling.schedulingfrontend.gui.components

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.components
package dk.scheduling.schedulingfrontend.gui.components

import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.AlertDialog
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.components
package dk.scheduling.schedulingfrontend.gui.components

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -27,8 +27,8 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.window.DialogProperties
import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme
import dk.scheduling.schedulingfrontend.model.Status
import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme
import java.time.Instant
import java.time.LocalDateTime
import java.time.LocalTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.components
package dk.scheduling.schedulingfrontend.gui.components

import java.time.format.DateTimeFormatter
import java.util.Locale
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.components
package dk.scheduling.schedulingfrontend.gui.components

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.components
package dk.scheduling.schedulingfrontend.gui.components

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand All @@ -16,7 +16,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme
import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme
import kotlinx.coroutines.delay

@Composable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:OptIn(ExperimentalMaterial3Api::class)

package dk.scheduling.schedulingfrontend.components
package dk.scheduling.schedulingfrontend.gui.components

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand All @@ -22,7 +22,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme
import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme

@Composable
fun <T> StandardDropDownMenu(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.components
package dk.scheduling.schedulingfrontend.gui.components

import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.text.KeyboardOptions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.components
package dk.scheduling.schedulingfrontend.gui.components
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand Down Expand Up @@ -29,7 +29,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.DialogProperties
import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme
import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.pages
package dk.scheduling.schedulingfrontend.gui.pages

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand All @@ -21,10 +21,10 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.TextUnitType
import androidx.compose.ui.unit.dp
import dk.scheduling.schedulingfrontend.components.FilledButton
import dk.scheduling.schedulingfrontend.components.OutlinedButton
import dk.scheduling.schedulingfrontend.gui.components.FilledButton
import dk.scheduling.schedulingfrontend.gui.components.OutlinedButton
import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme
import dk.scheduling.schedulingfrontend.repositories.account.IAccountRepository
import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme
import kotlinx.coroutines.launch
import testdata.DummyAccountRepository

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.pages
package dk.scheduling.schedulingfrontend.gui.pages

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand All @@ -23,10 +23,10 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.em
import dk.scheduling.schedulingfrontend.api.protocol.Device
import dk.scheduling.schedulingfrontend.components.FilledButton
import dk.scheduling.schedulingfrontend.components.OutlinedButton
import dk.scheduling.schedulingfrontend.components.StandardTextField
import dk.scheduling.schedulingfrontend.datasources.api.protocol.Device
import dk.scheduling.schedulingfrontend.gui.components.FilledButton
import dk.scheduling.schedulingfrontend.gui.components.OutlinedButton
import dk.scheduling.schedulingfrontend.gui.components.StandardTextField
import dk.scheduling.schedulingfrontend.repositories.device.IDeviceRepository
import kotlinx.coroutines.launch
import testdata.DummyDeviceRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ExperimentalMaterial3Api::class,
)

package dk.scheduling.schedulingfrontend.pages
package dk.scheduling.schedulingfrontend.gui.pages

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -32,20 +32,20 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import dk.scheduling.schedulingfrontend.api.protocol.Device
import dk.scheduling.schedulingfrontend.api.protocol.Timespan
import dk.scheduling.schedulingfrontend.components.DateRange
import dk.scheduling.schedulingfrontend.components.FilledButton
import dk.scheduling.schedulingfrontend.components.Loading
import dk.scheduling.schedulingfrontend.components.StandardDateRangePicker
import dk.scheduling.schedulingfrontend.components.StandardDropDownMenu
import dk.scheduling.schedulingfrontend.components.StandardTimePickerDialog
import dk.scheduling.schedulingfrontend.components.Title
import dk.scheduling.schedulingfrontend.datasources.api.protocol.Device
import dk.scheduling.schedulingfrontend.datasources.api.protocol.Timespan
import dk.scheduling.schedulingfrontend.gui.components.DateRange
import dk.scheduling.schedulingfrontend.gui.components.FilledButton
import dk.scheduling.schedulingfrontend.gui.components.Loading
import dk.scheduling.schedulingfrontend.gui.components.StandardDateRangePicker
import dk.scheduling.schedulingfrontend.gui.components.StandardDropDownMenu
import dk.scheduling.schedulingfrontend.gui.components.StandardTimePickerDialog
import dk.scheduling.schedulingfrontend.gui.components.Title
import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme
import dk.scheduling.schedulingfrontend.model.Duration
import dk.scheduling.schedulingfrontend.model.TaskForm
import dk.scheduling.schedulingfrontend.repositories.device.IDeviceRepository
import dk.scheduling.schedulingfrontend.repositories.task.ITaskRepository
import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme
import kotlinx.coroutines.launch
import testdata.DummyDeviceRepository
import testdata.DummyTaskRepository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.pages
package dk.scheduling.schedulingfrontend.gui.pages

import androidx.compose.animation.animateContentSize
import androidx.compose.animation.core.animateFloatAsState
Expand Down Expand Up @@ -44,19 +44,19 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import dk.scheduling.schedulingfrontend.api.protocol.Device
import dk.scheduling.schedulingfrontend.components.ConfirmAlertDialog
import dk.scheduling.schedulingfrontend.components.DATE_FORMATTER
import dk.scheduling.schedulingfrontend.components.Loading
import dk.scheduling.schedulingfrontend.datasources.api.protocol.Device
import dk.scheduling.schedulingfrontend.gui.components.ConfirmAlertDialog
import dk.scheduling.schedulingfrontend.gui.components.DATE_FORMATTER
import dk.scheduling.schedulingfrontend.gui.components.Loading
import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme
import dk.scheduling.schedulingfrontend.gui.theme.scheduled
import dk.scheduling.schedulingfrontend.gui.theme.success
import dk.scheduling.schedulingfrontend.model.DeviceOverview
import dk.scheduling.schedulingfrontend.model.DeviceState
import dk.scheduling.schedulingfrontend.model.getDeviceState
import dk.scheduling.schedulingfrontend.repositories.device.IDeviceRepository
import dk.scheduling.schedulingfrontend.repositories.overviews.IOverviewsRepository
import dk.scheduling.schedulingfrontend.repositories.overviews.OverviewRepository
import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme
import dk.scheduling.schedulingfrontend.ui.theme.scheduled
import dk.scheduling.schedulingfrontend.ui.theme.success
import kotlinx.coroutines.launch
import testdata.DummyDeviceRepository
import testdata.DummyEventRepository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.pages
package dk.scheduling.schedulingfrontend.gui.pages

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand All @@ -20,12 +20,12 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import dk.scheduling.schedulingfrontend.components.FilledButton
import dk.scheduling.schedulingfrontend.components.PasswordTextField
import dk.scheduling.schedulingfrontend.components.StandardTextField
import dk.scheduling.schedulingfrontend.components.Title
import dk.scheduling.schedulingfrontend.gui.components.FilledButton
import dk.scheduling.schedulingfrontend.gui.components.PasswordTextField
import dk.scheduling.schedulingfrontend.gui.components.StandardTextField
import dk.scheduling.schedulingfrontend.gui.components.Title
import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme
import dk.scheduling.schedulingfrontend.repositories.account.IAccountRepository
import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme
import kotlinx.coroutines.launch
import testdata.DummyAccountRepository

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dk.scheduling.schedulingfrontend.pages
package dk.scheduling.schedulingfrontend.gui.pages

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.Login
Expand Down
Loading
Loading