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 a083acb commit ced0ff6
Show file tree
Hide file tree
Showing 29 changed files with 84 additions and 80 deletions.
2 changes: 1 addition & 1 deletion shared-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ android {
listOf(
"src/androidMain/resources",
"src/commonMain/resources",
)
),
)
main.manifest.srcFile("src/androidMain/AndroidManifest.xml")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ internal actual fun PlatformSwitchApp() {
context.startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("market://details?id=${Constants.SisterApp.androidPackageName}")
)
Uri.parse("market://details?id=${Constants.SisterApp.androidPackageName}"),
),
)
}
}
},
) {
Text("Open ${Constants.SisterApp.name}")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ actual val montserratFontFamily: FontFamily = FontFamily(
montserratRegularFont,
montserratMediumFont,
montserratSemiBoldFont,
montserratBoldFont
montserratBoldFont,
)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package co.touchlab.droidcon.ui.util

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

@OptIn(ExperimentalComposeUiApi::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ internal actual fun __LocalImage(imageResourceName: String, modifier: Modifier,
modifier = modifier,
painter = painterResource(id = imageRes),
contentDescription = contentDescription,
contentScale = ContentScale.FillWidth
contentScale = ContentScale.FillWidth,
)
} else {
Row(
modifier = modifier.background(MaterialTheme.colorScheme.primary, RoundedCornerShape(Dimensions.Padding.half)),
verticalAlignment = Alignment.CenterVertically
verticalAlignment = Alignment.CenterVertically,
) {
Spacer(modifier = Modifier.weight(1f))
Icon(
imageVector = Icons.Default.Warning,
contentDescription = contentDescription,
modifier = Modifier.padding(Dimensions.Padding.half),
tint = Color.White
tint = Color.White,
)
Text("Image not supported", modifier = Modifier.padding(Dimensions.Padding.default), color = Color.White)
Spacer(modifier = Modifier.weight(1f))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ internal fun BottomNavigationView(viewModel: ApplicationViewModel, modifier: Mod
colors = NavigationBarItemDefaults.colors(
indicatorColor = MaterialTheme.colorScheme.primary,
selectedIconColor = MaterialTheme.colorScheme.onPrimary,
selectedTextColor = MaterialTheme.colorScheme.primary
)
selectedTextColor = MaterialTheme.colorScheme.primary,
),
)
}
}
}
},
) { paddingValues ->
Box(modifier = Modifier.padding(bottom = paddingValues.calculateBottomPadding())) {
when (selectedTab) {
Expand All @@ -66,11 +66,13 @@ internal fun BottomNavigationView(viewModel: ApplicationViewModel, modifier: Mod
title = "Droidcon NYC 2024",
emptyText = "Sessions could not be loaded.",
)

ApplicationViewModel.Tab.MyAgenda -> SessionListView(
viewModel = viewModel.agenda,
title = "Agenda",
emptyText = "Add sessions to your agenda from session detail in schedule.",
)

ApplicationViewModel.Tab.Venue -> VenueView()
ApplicationViewModel.Tab.Sponsors -> SponsorsView(viewModel.sponsors)
ApplicationViewModel.Tab.Settings -> SettingsView(viewModel.settings)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import co.touchlab.droidcon.viewmodel.FeedbackDialogViewModel
internal fun FeedbackDialog(feedback: FeedbackDialogViewModel) {
Dialog(dismiss = feedback::skipTapped) {
Card(
modifier = Modifier.padding(Dimensions.Padding.double)
modifier = Modifier.padding(Dimensions.Padding.double),
) {
Column(
modifier = Modifier
Expand Down Expand Up @@ -86,7 +86,7 @@ internal fun FeedbackDialog(feedback: FeedbackDialogViewModel) {
placeholder = {
Text(
text = "(Optional) Suggest improvement",
style = MaterialTheme.typography.bodyLarge
style = MaterialTheme.typography.bodyLarge,
)
},
textStyle = MaterialTheme.typography.bodyLarge,
Expand All @@ -113,7 +113,7 @@ internal fun FeedbackDialog(feedback: FeedbackDialogViewModel) {
TextButton(onClick = feedback::closeAndDisableTapped) {
Text(
text = "CLOSE AND DISABLE FEEDBACK",
color = MaterialTheme.colorScheme.primary
color = MaterialTheme.colorScheme.primary,
)
}
TextButton(onClick = feedback::skipTapped) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ internal fun SessionBlockView(sessionsBlock: SessionBlockViewModel) {
modifier = Modifier.padding(Dimensions.Padding.half),
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.onSurface,
style = MaterialTheme.typography.titleMedium
style = MaterialTheme.typography.titleMedium,
)
session.room?.let { roomName ->
Text(
Expand All @@ -85,7 +85,7 @@ internal fun SessionBlockView(sessionsBlock: SessionBlockViewModel) {
end = Dimensions.Padding.half,
bottom = Dimensions.Padding.half,
),
style = MaterialTheme.typography.titleSmall
style = MaterialTheme.typography.titleSmall,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,23 @@ internal fun SessionListView(
NavigationLink(viewModel.observePresentedSessionDetail) {
SessionDetailView(viewModel = it)
}
}
},
) {
val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior(rememberTopAppBarState())
Scaffold(
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
topBar = {
CenterAlignedTopAppBar(
title = { Text(title) },
scrollBehavior = scrollBehavior
scrollBehavior = scrollBehavior,
)
},
) { paddingValues ->
var size by remember { mutableStateOf(IntSize(0, 0)) }
Column(
modifier = Modifier
.onSizeChanged { size = it }
.padding(top = paddingValues.calculateTopPadding())
.padding(top = paddingValues.calculateTopPadding()),
) {
val days by viewModel.observeDays.observeAsState()
if (days?.isEmpty() != false) {
Expand All @@ -109,16 +109,16 @@ internal fun SessionListView(
indicator = { tabPositions ->
if (tabPositions.indices.contains(pagerState.currentPage)) {
TabIndicator(
Modifier.tabIndicatorOffset(tabPositions[pagerState.currentPage])
Modifier.tabIndicatorOffset(tabPositions[pagerState.currentPage]),
)
} else {
Logger.w(
"SessionList TabRow requested an indicator for selectedTabIndex: " +
"${pagerState.currentPage}, but only got ${tabPositions.count()} tabs."
"${pagerState.currentPage}, but only got ${tabPositions.count()} tabs.",
)
TabRowDefaults.SecondaryIndicator()
}
}
},
) {
days?.forEachIndexed { index, daySchedule ->
Tab(
Expand All @@ -130,7 +130,7 @@ internal fun SessionListView(
pagerState.animateScrollToPage(index)
}
},
unselectedContentColor = MaterialTheme.colorScheme.onSurfaceVariant
unselectedContentColor = MaterialTheme.colorScheme.onSurfaceVariant,
) {
Text(
text = daySchedule.day,
Expand Down Expand Up @@ -160,7 +160,7 @@ internal fun SessionListView(
) {
day.scrollState = SessionDayViewModel.ScrollState(
scrollState.firstVisibleItemIndex,
scrollState.firstVisibleItemScrollOffset
scrollState.firstVisibleItemScrollOffset,
)
}

Expand Down Expand Up @@ -196,7 +196,7 @@ private fun TabIndicator(modifier: Modifier = Modifier) {
.padding(horizontal = 64.dp)
.height(2.dp)
.clip(RoundedCornerShape(topStart = 12.dp, topEnd = 12.dp))
.background(MaterialTheme.colorScheme.primary)
.background(MaterialTheme.colorScheme.primary),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ internal fun SpeakerDetailView(viewModel: SpeakerDetailViewModel) {
)
}
},
scrollBehavior = scrollBehavior
scrollBehavior = scrollBehavior,
)
},
) { paddingValues ->
Expand Down Expand Up @@ -104,7 +104,7 @@ private fun HeaderView(name: String, tagLine: String, imageUrl: Url?) {
.width(100.dp)
.padding(Dimensions.Padding.default)
.clip(CircleShape)
.aspectRatio(1f)
.aspectRatio(1f),
)
}

Expand Down Expand Up @@ -140,7 +140,7 @@ private fun SocialView(url: WebLink, iconName: String) {
contentDescription = null,
modifier = Modifier
.padding(Dimensions.Padding.default)
.size(28.dp)
.size(28.dp),
)
WebLinkText(
text = url.link,
Expand Down Expand Up @@ -180,7 +180,7 @@ private fun SocialView(url: WebLink, icon: ImageVector) {
private fun BioView(bio: String, webLinks: List<WebLink>) {
Row(
modifier = Modifier.fillMaxWidth().padding(vertical = Dimensions.Padding.half),
verticalAlignment = Alignment.Top
verticalAlignment = Alignment.Top,
) {
Icon(
imageVector = Icons.Default.Description,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ internal fun SettingsView(viewModel: SettingsViewModel) {
scrollBehavior = scrollBehavior,
actions = {
PlatformSwitchApp()
}
},
)
},
) { paddingValues ->
Expand All @@ -53,7 +53,7 @@ internal fun SettingsView(viewModel: SettingsViewModel) {
modifier = Modifier
.padding(top = paddingValues.calculateTopPadding())
.fillMaxHeight()
.verticalScroll(scrollState)
.verticalScroll(scrollState),
) {
IconTextSwitchRow(
text = "Enable feedback",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ internal fun SponsorDetailView(viewModel: SponsorDetailViewModel) {
NavigationLink(viewModel.observePresentedSpeakerDetail) {
SpeakerDetailView(viewModel = it)
}
}
},
) {
Scaffold(
topBar = {
Expand All @@ -67,9 +67,9 @@ internal fun SponsorDetailView(viewModel: SponsorDetailViewModel) {
contentDescription = "Back",
)
}
}
},
)
}
},
) { paddingValues ->
val scrollState = rememberScrollState()
Column(
Expand All @@ -80,7 +80,7 @@ internal fun SponsorDetailView(viewModel: SponsorDetailViewModel) {
HeaderView(
name = viewModel.name,
groupTitle = viewModel.groupName,
imageUrl = viewModel.imageUrl
imageUrl = viewModel.imageUrl,
)

viewModel.abstract?.let {
Expand Down Expand Up @@ -195,7 +195,7 @@ private fun RepresentativeInfoView(profile: SpeakerListItemViewModel) {
.padding(
start = Dimensions.Padding.default,
end = Dimensions.Padding.default,
top = Dimensions.Padding.half
top = Dimensions.Padding.half,
)
.clip(CircleShape)
.aspectRatio(1f)
Expand All @@ -211,7 +211,7 @@ private fun RepresentativeInfoView(profile: SpeakerListItemViewModel) {
.padding(
start = Dimensions.Padding.default,
end = Dimensions.Padding.default,
top = Dimensions.Padding.half
top = Dimensions.Padding.half,
)
.clip(CircleShape)
.aspectRatio(1f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ internal fun SponsorsView(viewModel: SponsorListViewModel) {
NavigationLink(viewModel.observePresentedSponsorDetail) {
SponsorDetailView(viewModel = it)
}
}
},
) {
val scrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(rememberTopAppBarState())
Scaffold(
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
topBar = {
TopAppBar(
title = { Text("Sponsors") },
scrollBehavior = scrollBehavior
scrollBehavior = scrollBehavior,
)
},
) { paddingValues ->
Expand Down Expand Up @@ -99,8 +99,8 @@ private fun SponsorGroupView(sponsorGroup: SponsorGroupViewModel) {
Card(
modifier = Modifier.padding(
vertical = Dimensions.Padding.quarter,
horizontal = Dimensions.Padding.half
)
horizontal = Dimensions.Padding.half,
),
) {
Column(modifier = Modifier.fillMaxWidth()) {
Text(
Expand Down
Loading

0 comments on commit ced0ff6

Please sign in to comment.