Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Align time picker circle to centered horizontally #3605

Merged
merged 1 commit into from
Oct 12, 2024
Merged
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
@@ -1,5 +1,6 @@
package com.ivy.ui.time.impl

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.DatePicker
Expand All @@ -18,6 +19,7 @@ import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.ivy.base.time.TimeConverter
Expand Down Expand Up @@ -109,14 +111,16 @@ class AndroidDateTimePicker @Inject constructor(
containerColor = MaterialTheme.colorScheme.surfaceVariant,
)
) {
TimePicker(
modifier = Modifier.padding(16.dp),
state = pickerState,
colors = TimePickerDefaults.colors(
selectorColor = MaterialTheme.colorScheme.primary,
timeSelectorSelectedContainerColor = MaterialTheme.colorScheme.primary
Box(modifier = Modifier.align(Alignment.CenterHorizontally)) {
TimePicker(
modifier = Modifier.padding(16.dp),
state = pickerState,
colors = TimePickerDefaults.colors(
selectorColor = MaterialTheme.colorScheme.primary,
timeSelectorSelectedContainerColor = MaterialTheme.colorScheme.primary
)
)
)
}
}
}

Expand Down