Skip to content

Commit

Permalink
updating classes
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinSchildhorn committed Oct 24, 2024
1 parent 8c1bfb5 commit b3c94fc
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ root = true

[*.{kt,kts}]
end_of_line = lf
class-signature = false
ij_kotlin_packages_to_use_import_on_demand = true
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
ij_kotlin_imports_layout = *
ij_kotlin_indent_before_arrow_on_new_line = false
ij_kotlin_line_break_after_multiline_when_entry = true
ij_kotlin_wrap_super_type_list = false
indent_size = 4
indent_style = space
insert_final_newline = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ import org.brightify.hyperdrive.multiplatformx.LifecycleGraph
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject

class MainActivity :
ComponentActivity(),
KoinComponent {
class MainActivity : ComponentActivity(), KoinComponent {

private val notificationSchedulingService: NotificationSchedulingService by inject()
private val syncService: SyncService by inject()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class IOSDateFormatter : DateFormatter {

private fun LocalDate.date() = NSCalendar.currentCalendar.dateFromComponents(toNSDateComponents())

private fun LocalDateTime.date() = // TODOKPG - Pretty sure this is device time zone, might be OK. Just for local formating
NSCalendar.currentCalendar.dateFromComponents(toNSDateComponents())
// TODOKPG - Pretty sure this is device time zone, might be OK. Just for local formating
private fun LocalDateTime.date() = NSCalendar.currentCalendar.dateFromComponents(toNSDateComponents())

private fun interval(from: String?, to: String?) = listOfNotNull(from, to).joinToString("")
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class ApplicationViewModel(
private val notificationService: NotificationService,
private val feedbackService: FeedbackService,
private val settingsGateway: SettingsGateway,
) : BaseViewModel(),
DeepLinkNotificationHandler {
) : BaseViewModel(), DeepLinkNotificationHandler {

val schedule by managed(scheduleFactory.create())
val agenda by managed(agendaFactory.create())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import co.touchlab.droidcon.application.repository.AboutRepository
import co.touchlab.droidcon.service.ParseUrlViewService
import org.brightify.hyperdrive.multiplatformx.BaseViewModel

class AboutViewModel(private val aboutRepository: AboutRepository, private val parseUrlViewService: ParseUrlViewService) :
BaseViewModel() {
class AboutViewModel(
private val aboutRepository: AboutRepository,
private val parseUrlViewService: ParseUrlViewService
) : BaseViewModel() {

var items: List<AboutItem> by published(emptyList())
private set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import kotlinx.coroutines.launch
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject

class NotificationRescheduler :
BroadcastReceiver(),
KoinComponent {
class NotificationRescheduler : BroadcastReceiver(), KoinComponent {
private val notificationSchedulingService by inject<NotificationSchedulingService>()

override fun onReceive(context: Context?, intent: Intent?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ package co.touchlab.droidcon.domain.entity

import co.touchlab.droidcon.composite.Url

class Sponsor(override val id: Id, val hasDetail: Boolean, val description: String?, val icon: Url, val url: Url) :
DomainEntity<Sponsor.Id>() {
class Sponsor(
override val id: Id,
val hasDetail: Boolean,
val description: String?,
val icon: Url,
val url: Url
) : DomainEntity<Sponsor.Id>() {

val name: String
get() = id.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class SqlDelightProfileRepository(
private val profileQueries: ProfileQueries,
private val speakerQueries: SessionSpeakerQueries,
private val representativeQueries: SponsorRepresentativeQueries,
) : BaseRepository<Profile.Id, Profile>(),
ProfileRepository {
) : BaseRepository<Profile.Id, Profile>(), ProfileRepository {

override suspend fun getSpeakersBySession(id: Session.Id): List<Profile> =
profileQueries.selectBySession(id.value, ::profileFactory).executeAsList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import co.touchlab.droidcon.domain.repository.RoomRepository
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow

class SqlDelightRoomRepository(private val roomQueries: RoomQueries) :
BaseRepository<Room.Id, Room>(),
RoomRepository {
class SqlDelightRoomRepository(private val roomQueries: RoomQueries) : BaseRepository<Room.Id, Room>(), RoomRepository {

override fun allSync(): List<Room> = roomQueries.selectAll(::roomFactory).executeAsList()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.first
import kotlinx.datetime.Instant

class SqlDelightSessionRepository(private val dateTimeService: DateTimeService, private val sessionQueries: SessionQueries) :
BaseRepository<Session.Id, Session>(),
SessionRepository {
class SqlDelightSessionRepository(
private val dateTimeService: DateTimeService,
private val sessionQueries: SessionQueries
) : BaseRepository<Session.Id, Session>(), SessionRepository {
override fun observe(id: Session.Id): Flow<Session> =
sessionQueries.sessionById(id.value, ::sessionFactory).asFlow().mapToOne(Dispatchers.Main)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import co.touchlab.droidcon.domain.repository.SponsorGroupRepository
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow

class SqlDelightSponsorGroupRepository(private val sponsorGroupQueries: SponsorGroupQueries) :
BaseRepository<SponsorGroup.Id, SponsorGroup>(),
SponsorGroupRepository {
class SqlDelightSponsorGroupRepository(
private val sponsorGroupQueries: SponsorGroupQueries
) : BaseRepository<SponsorGroup.Id, SponsorGroup>(), SponsorGroupRepository {

override fun allSync(): List<SponsorGroup> = sponsorGroupQueries.selectAll(::sponsorGroupFactory).executeAsList()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import co.touchlab.droidcon.domain.repository.SponsorRepository
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow

class SqlDelightSponsorRepository(private val sponsorQueries: SponsorQueries) :
BaseRepository<Sponsor.Id, Sponsor>(),
SponsorRepository {
class SqlDelightSponsorRepository(private val sponsorQueries: SponsorQueries) : BaseRepository<Sponsor.Id, Sponsor>(), SponsorRepository {

override fun observe(id: Sponsor.Id): Flow<Sponsor> =
sponsorQueries.sponsorById(id.name, id.group, ::sponsorFactory).asFlow().mapToOne(Dispatchers.Main)
Expand Down

0 comments on commit b3c94fc

Please sign in to comment.