Skip to content

Commit

Permalink
running formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinSchildhorn committed Oct 24, 2024
1 parent ceb24ca commit c5592a0
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,29 @@ class NotificationLocalizedStringFactory(
) : NotificationSchedulingService.LocalizedStringFactory {

override fun reminderTitle(roomName: String?): String {
val ending = roomName?.let { NSString.stringWithFormat(bundle.localizedStringForKey("Notification.Reminder.Title.InRoom", null, null).convertParametersForPrintf(), it.cstr) } ?: ""
return NSString.stringWithFormat(bundle.localizedStringForKey("Notification.Reminder.Title.Base", null, null).convertParametersForPrintf(), ending.cstr)
val ending = roomName?.let {
NSString
.stringWithFormat(
bundle.localizedStringForKey("Notification.Reminder.Title.InRoom", null, null)
.convertParametersForPrintf(),
it.cstr
)
} ?: ""
return NSString
.stringWithFormat(
bundle.localizedStringForKey("Notification.Reminder.Title.Base", null, null)
.convertParametersForPrintf(),
ending.cstr
)
}

override fun reminderBody(sessionTitle: String): String {
return NSString.stringWithFormat(bundle.localizedStringForKey("Notification.Reminder.Body", null, null).convertParametersForPrintf(), sessionTitle.cstr)
return NSString
.stringWithFormat(
bundle.localizedStringForKey("Notification.Reminder.Body", null, null)
.convertParametersForPrintf(),
sessionTitle.cstr
)
}

override fun feedbackTitle(): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class IOSDateFormatter : DateFormatter {
private fun LocalDate.date() = NSCalendar.currentCalendar.dateFromComponents(toNSDateComponents())

private fun LocalDateTime.date() =
NSCalendar.currentCalendar.dateFromComponents(toNSDateComponents()) // TODOKPG - Pretty sure this is device time zone, might be OK. Just for local formating
// TODOKPG - Pretty sure this is device time zone, might be OK. Just for local formating
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 @@ -2,8 +2,8 @@ package co.touchlab.droidcon.ui.util

import androidx.compose.runtime.Composable
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.window.DialogProperties
import androidx.compose.ui.window.Dialog as AndroidXComposeDialog
import androidx.compose.ui.window.DialogProperties

@OptIn(ExperimentalComposeUiApi::class)
@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ internal fun SessionListView(
Modifier.tabIndicatorOffset(tabPositions[pagerState.currentPage])
)
} else {
Logger.w("SessionList TabRow requested an indicator for selectedTabIndex: ${pagerState.currentPage}, but only got ${tabPositions.count()} tabs.")
Logger.w(
"SessionList TabRow requested an indicator for selectedTabIndex: " +
"${pagerState.currentPage}, but only got ${tabPositions.count()} tabs."
)
TabRowDefaults.SecondaryIndicator()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ internal fun UIImage.toSkiaImage(): Image? {
val alphaType = when (alphaInfo) {
CGImageAlphaInfo.kCGImageAlphaPremultipliedFirst, CGImageAlphaInfo.kCGImageAlphaPremultipliedLast -> ColorAlphaType.PREMUL
CGImageAlphaInfo.kCGImageAlphaFirst, CGImageAlphaInfo.kCGImageAlphaLast -> ColorAlphaType.UNPREMUL
CGImageAlphaInfo.kCGImageAlphaNone, CGImageAlphaInfo.kCGImageAlphaNoneSkipFirst, CGImageAlphaInfo.kCGImageAlphaNoneSkipLast -> ColorAlphaType.OPAQUE
CGImageAlphaInfo.kCGImageAlphaNone, CGImageAlphaInfo.kCGImageAlphaNoneSkipFirst, CGImageAlphaInfo.kCGImageAlphaNoneSkipLast
-> ColorAlphaType.OPAQUE
else -> ColorAlphaType.UNKNOWN
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package co.touchlab.droidcon.util.formatter

import co.touchlab.droidcon.Constants.conferenceTimeZone
import co.touchlab.droidcon.domain.service.DateTimeService
import kotlinx.datetime.LocalDate
import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.atTime
import java.text.DateFormat
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import kotlinx.datetime.LocalDate
import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.atTime

class AndroidDateFormatter(private val dateTimeService: DateTimeService) : DateFormatter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ class DefaultSyncService(
while (isActive) {
val lastSessionizeSync = lastSessionizeSync
// If this is the first Sessionize sync or if the last sync occurred more than 2 hours ago.
if (lastSessionizeSync == null || lastSessionizeSync <= dateTimeService.now().minus(SESSIONIZE_SYNC_SINCE_LAST_MINUTES, DateTimeUnit.MINUTE)) {
if (
lastSessionizeSync == null ||
lastSessionizeSync <= dateTimeService.now().minus(SESSIONIZE_SYNC_SINCE_LAST_MINUTES, DateTimeUnit.MINUTE)
) {
try {
runApiDataSourcesSynchronization()
} catch (e: Exception) {
Expand Down Expand Up @@ -280,7 +283,10 @@ class DefaultSyncService(
}
}

private fun updateSponsorsFromDataSource(sponsorSessionsGroups: List<SponsorSessionsDto.SessionGroupDto>, sponsors: SponsorsDto.SponsorCollectionDto) {
private fun updateSponsorsFromDataSource(
sponsorSessionsGroups: List<SponsorSessionsDto.SessionGroupDto>,
sponsors: SponsorsDto.SponsorCollectionDto
) {
val sponsorSessions = sponsorSessionsGroups.flatMap { it.sessions }.associateBy { it.id }
val sponsorGroupsToSponsorDtos = sponsors.groups.map { group ->
val groupName = (group.name.split('/').lastOrNull() ?: group.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package co.touchlab.droidcon

import co.touchlab.droidcon.util.printThrowable
import co.touchlab.kermit.Logger
import kotlin.coroutines.CoroutineContext
import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob
import kotlin.coroutines.CoroutineContext

class MainScope(private val mainContext: CoroutineContext, private val log: Logger) : CoroutineScope {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ class BundleResourceReader(
name to null
}
}
val path = bundle.pathForResource(filename, type) ?: error("Couldn't get path of $name (parsed as: ${listOfNotNull(filename, type).joinToString(".")})")
val path = bundle
.pathForResource(filename, type) ?: error(
"Couldn't get path of $name (parsed as: ${listOfNotNull(filename, type)
.joinToString(".")})"
)

return memScoped {
val errorPtr = alloc<ObjCObjectVar<NSError?>>()
Expand Down

0 comments on commit c5592a0

Please sign in to comment.