Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinSchildhorn committed Oct 29, 2024
1 parent 8603f0e commit 2b153c4
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ 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 @@ -47,7 +47,7 @@ internal fun SettingsView(viewModel: SettingsViewModel) {
if (Constants.SisterApp.showLaunchButton) {
PlatformSwitchApp()
}
}
},
)
},
) { paddingValues ->
Expand All @@ -56,7 +56,7 @@ internal fun SettingsView(viewModel: SettingsViewModel) {
modifier = Modifier
.padding(top = paddingValues.calculateTopPadding())
.fillMaxHeight()
.verticalScroll(scrollState)
.verticalScroll(scrollState),
) {
IconTextSwitchRow(
text = "Enable feedback",
Expand All @@ -82,11 +82,7 @@ internal fun SettingsView(viewModel: SettingsViewModel) {
}

@Composable
internal fun IconTextSwitchRow(
text: String,
image: ImageVector,
checked: MutableObservableProperty<Boolean>
) {
internal fun IconTextSwitchRow(text: String, image: ImageVector, checked: MutableObservableProperty<Boolean>) {
val isChecked by checked.observeAsState()
Row(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ 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 All @@ -52,7 +53,7 @@ class ApplicationViewModel(
Tab.MyAgenda,
if (Constants.showVenueMap) Tab.Venue else null,
Tab.Sponsors,
Tab.Settings
Tab.Settings,
)
var selectedTab: Tab by published(Tab.Schedule)
val observeSelectedTab by observe(::selectedTab)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ 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 @@ -5,10 +5,6 @@ import app.cash.sqldelight.db.SqlDriver
import app.cash.sqldelight.driver.android.AndroidSqliteDriver
import co.touchlab.droidcon.db.DroidconDatabase

actual class SqlDelightDriverFactory(
private val context: Context,
) {
actual fun createDriver(): SqlDriver {
return AndroidSqliteDriver(DroidconDatabase.Schema, context, "new-droidcon2024.db")
}
actual class SqlDelightDriverFactory(private val context: Context) {
actual fun createDriver(): SqlDriver = AndroidSqliteDriver(DroidconDatabase.Schema, context, "new-droidcon2024.db")
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ 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,6 +2,7 @@ package co.touchlab.droidcon

import kotlinx.datetime.TimeZone

@Suppress("ktlint:standard:property-naming")
object Constants {
val conferenceTimeZone = TimeZone.of("Europe/London")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ 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,7 +19,8 @@ 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,7 +10,9 @@ 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,10 +14,9 @@ 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,7 +11,9 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ import app.cash.sqldelight.driver.native.NativeSqliteDriver
import co.touchlab.droidcon.db.DroidconDatabase

actual class SqlDelightDriverFactory {
actual fun createDriver(): SqlDriver {
return NativeSqliteDriver(DroidconDatabase.Schema, "droidcon2024.db")
}
actual fun createDriver(): SqlDriver = NativeSqliteDriver(DroidconDatabase.Schema, "droidcon2024.db")
}

0 comments on commit 2b153c4

Please sign in to comment.