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

Commit

Permalink
Align time picker circle centered horizontally (#3605)
Browse files Browse the repository at this point in the history
  • Loading branch information
p42rthicle authored Oct 12, 2024
1 parent 3479e35 commit 49c67a8
Showing 1 changed file with 11 additions and 7 deletions.
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

0 comments on commit 49c67a8

Please sign in to comment.