diff --git a/HijriDatePickerLib/build.gradle.kts b/HijriDatePickerLib/build.gradle.kts index 5c6507a..63857e8 100644 --- a/HijriDatePickerLib/build.gradle.kts +++ b/HijriDatePickerLib/build.gradle.kts @@ -9,7 +9,7 @@ android { compileSdk = 34 defaultConfig { - minSdk = 28 + minSdk = 26 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -44,7 +44,7 @@ android { dependencies { implementation(libs.androidx.core.ktx) - implementation(libs.androidx.lifecycle.runtime.ktx) + // implementation(libs.androidx.lifecycle.runtime.ktx) implementation(platform(libs.androidx.compose.bom)) implementation(libs.androidx.ui) implementation(libs.androidx.ui.graphics) @@ -54,7 +54,7 @@ dependencies { debugImplementation(libs.androidx.ui.test.manifest) implementation( libs.material3) implementation (libs.material) - implementation (libs.androidx.lifecycle.runtime.ktx.v231) + // implementation (libs.androidx.lifecycle.runtime.ktx.v231) implementation (libs.androidx.foundation) implementation (libs.android.joda) } diff --git a/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/FooterSection.kt b/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/FooterSection.kt index 3096c0f..1e47d95 100644 --- a/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/FooterSection.kt +++ b/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/FooterSection.kt @@ -10,6 +10,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @@ -38,3 +39,13 @@ fun FooterSection(nextMonthName: String, onConfirm: () -> Unit, onCancel: () -> } } } + +@Preview(showBackground = true) +@Composable +fun PreviewFooterSection() { + FooterSection( + nextMonthName = "Safar", + onConfirm = { /* Handle confirm action in preview */ }, + onCancel = { /* Handle cancel action in preview */ } + ) +} \ No newline at end of file diff --git a/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/HeaderSection.kt b/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/HeaderSection.kt index 1d87707..12984dc 100644 --- a/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/HeaderSection.kt +++ b/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/HeaderSection.kt @@ -15,6 +15,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @@ -44,3 +45,19 @@ fun HeaderSection(calendar: Calendar, onYearClick: () -> Unit) { ) } } + +@Preview(showBackground = true) +@Composable +fun PreviewHeaderSection() { + // Creating an instance of IslamicCalendar for preview purposes + val calendar = IslamicCalendar().apply { + set(Calendar.YEAR, 1445) + set(Calendar.MONTH, 1) // Safar + set(Calendar.DAY_OF_MONTH, 5) + } + + // Preview the HeaderSection with a mock IslamicCalendar and a simple onYearClick action + HeaderSection(calendar = calendar, onYearClick = { + // Handle year click in preview + }) +} \ No newline at end of file diff --git a/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/HijriDatePickerButton.kt b/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/HijriDatePickerButton.kt index b49bcb2..5f1fa83 100644 --- a/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/HijriDatePickerButton.kt +++ b/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/HijriDatePickerButton.kt @@ -15,6 +15,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @@ -75,7 +76,7 @@ fun HijriDatePickerButton( preselectedMonth.value = month preselectedDay.value = day }, - onConfirm = { + onConfirm = { year, month, day -> showDialog = false // Close the dialog when Confirm is clicked }, onDismissRequest = { @@ -85,4 +86,11 @@ fun HijriDatePickerButton( "umalqura" // "umalqura", "civil", or "islamic" ) } +} + +@Preview(showBackground = true) +@Composable +fun PreviewHijriDatePickerButton() { + // Preview the HijriDatePickerButton with "umalqura" as calendar type + HijriDatePickerButton(calendarType = "umalqura") } \ No newline at end of file diff --git a/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/HijriDatePickerDialogWithThreeSections.kt b/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/HijriDatePickerDialogWithThreeSections.kt index 4b5278b..0c051b7 100644 --- a/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/HijriDatePickerDialogWithThreeSections.kt +++ b/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/HijriDatePickerDialogWithThreeSections.kt @@ -18,6 +18,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Dialog @@ -26,8 +27,8 @@ fun HijriDatePickerDialogWithThreeSections( initialYear: Int, initialMonth: Int, initialDay: Int, - onDateSelected: (Int, Int, Int) -> Unit, - onConfirm: () -> Unit, + onDateSelected: (Int, Int, Int) -> Unit, // Call this when date is selected + onConfirm: (Int, Int, Int) -> Unit, // Pass the selected year, month, day onDismissRequest: () -> Unit, initialShowYearSelection: Boolean = true, // Always show year selection when opening the dialog calendarType: String @@ -38,25 +39,30 @@ fun HijriDatePickerDialogWithThreeSections( var showYearSelection by remember { mutableStateOf(initialShowYearSelection) } // Ensure selected day is valid for the selected month - val daysInMonth = getHijriDaysInMonth(selectedYear, selectedMonth,calendarType) + val daysInMonth = getHijriDaysInMonth(selectedYear, selectedMonth, calendarType) if (selectedDay > daysInMonth) { selectedDay = daysInMonth } Dialog(onDismissRequest = onDismissRequest) { Surface( - modifier = Modifier.fillMaxWidth().heightIn(min = 400.dp, max = 500.dp).padding(16.dp), + modifier = Modifier + .fillMaxWidth() + .heightIn(min = 400.dp, max = 500.dp) + .padding(16.dp), shape = MaterialTheme.shapes.medium ) { Column( - modifier = Modifier.fillMaxWidth().background(Color.White) + modifier = Modifier + .fillMaxWidth() + .background(Color.White) ) { // Header section with the selected date val calendar = getIslamicCalendar(calendarType) - // Set the specific year, month, and day on the calendar instance calendar.set(Calendar.YEAR, selectedYear) calendar.set(Calendar.MONTH, selectedMonth) calendar.set(Calendar.DAY_OF_MONTH, selectedDay) + // Pass the callback to trigger year selection HeaderSection(calendar = calendar) { showYearSelection = true // Toggle to show year selection when the year is clicked @@ -77,7 +83,9 @@ fun HijriDatePickerDialogWithThreeSections( } else { // Month Grid with Days Section Box( - modifier = Modifier.weight(1f).fillMaxWidth() + modifier = Modifier + .weight(1f) + .fillMaxWidth() ) { MonthGridWithDays( selectedYear = selectedYear, @@ -85,7 +93,7 @@ fun HijriDatePickerDialogWithThreeSections( selectedYear = year selectedMonth = month selectedDay = day - onDateSelected(year, month, day) + onDateSelected(year, month, day) // Update selected date }, preselectedMonth = selectedMonth, // Pass the preselected month preselectedDay = selectedDay, // Pass the preselected day @@ -99,11 +107,36 @@ fun HijriDatePickerDialogWithThreeSections( // Footer with Confirm and Cancel buttons FooterSection( nextMonthName = getHijriMonthName(selectedMonth), - onConfirm = onConfirm, - onCancel = onDismissRequest + onConfirm = { + onConfirm(selectedYear, selectedMonth, selectedDay) // Pass the selected date when confirmed + }, + onCancel = onDismissRequest // Handle dismissal when cancel is clicked ) } } } } + +@Preview(showBackground = true) +@Composable +fun PreviewHijriDatePickerDialogWithThreeSections() { + HijriDatePickerDialogWithThreeSections( + initialYear = 1445, // Initial Hijri year + initialMonth = 1, // Safar (month index starts at 0) + initialDay = 5, // 5th day of Safar + onDateSelected = { year, month, day -> + // Simulate the date selection in the preview (just log or print) + println("Date Selected in Preview: $day-${getHijriMonthName(month)}-$year") + }, + onConfirm = { year, month, day -> + // Simulate confirmation action in the preview + println("Date Confirmed in Preview: $day-${getHijriMonthName(month)}-$year") + }, + onDismissRequest = { + // Simulate dismiss action in the preview + println("Dialog Dismissed in Preview") + }, + calendarType = "umalqura" // Simulate the "umalqura" calendar type for preview + ) +} diff --git a/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/MonthGridWithDays.kt b/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/MonthGridWithDays.kt index 1e6ccc1..ba6f449 100644 --- a/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/MonthGridWithDays.kt +++ b/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/MonthGridWithDays.kt @@ -20,6 +20,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @@ -79,4 +80,18 @@ fun MonthGridWithDays( } } } +} + +@Preview(showBackground = true) +@Composable +fun PreviewMonthGridWithDays() { + MonthGridWithDays( + selectedYear = 1445, // Example year + onDaySelected = { year, month, day -> + // Handle day selection (preview action) + }, + preselectedMonth = 1, // Safar (0-indexed month) + preselectedDay = 5, // Preselected day + calendarType = "umalqura" // Calendar type for preview + ) } \ No newline at end of file diff --git a/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/YearSelectionScreen.kt b/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/YearSelectionScreen.kt index 8ee5a0b..c47c12a 100644 --- a/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/YearSelectionScreen.kt +++ b/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/YearSelectionScreen.kt @@ -14,6 +14,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @@ -57,4 +58,16 @@ fun YearSelectionScreen( ) } } +} + +@Preview(showBackground = true) +@Composable +fun PreviewYearSelectionScreen() { + YearSelectionScreen( + selectedYear = 1445, // Preselected year + onYearSelected = { year -> + // Handle year selection (preview action) + }, + currentYear = 1445 // Scroll to this year by default + ) } \ No newline at end of file diff --git a/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/showHijriDatePicker.kt b/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/showHijriDatePicker.kt index b0b01f9..24ccf66 100644 --- a/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/showHijriDatePicker.kt +++ b/HijriDatePickerLib/src/main/java/com/sdody/hijridatepickerlib/showHijriDatePicker.kt @@ -5,6 +5,7 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.tooling.preview.Preview // Example of how you can trigger the date picker from anywhere /* showHijriDatePicker( @@ -36,37 +37,51 @@ fun showHijriDatePicker( onDismissRequest: () -> Unit, calendarType: String ) { - // State for preselected date - val preselectedYear = remember { mutableStateOf(initialYear) } - val preselectedMonth = remember { mutableStateOf(initialMonth) } - val preselectedDay = remember { mutableStateOf(initialDay) } - - // Dialog visibility is controlled outside (no button, it will be triggered by external events) + // The showDialog state is controlled outside, as this Composable doesn't have buttons. var showDialog by remember { mutableStateOf(true) } if (showDialog) { HijriDatePickerDialogWithThreeSections( - initialYear = preselectedYear.value, - initialMonth = preselectedMonth.value, - initialDay = preselectedDay.value, + initialYear = initialYear, // Preselected year from the lifted state + initialMonth = initialMonth, // Preselected month from the lifted state + initialDay = initialDay, // Preselected day from the lifted state onDateSelected = { year, month, day -> - // Update the preselected date for the next opening - preselectedYear.value = year - preselectedMonth.value = month - preselectedDay.value = day - onDateSelected(year, month, day) // Call the provided callback + // Update the selected date in the parent + onDateSelected(year, month, day) }, - onConfirm = { - showDialog = false // Close the dialog when Confirm is clicked + onConfirm = { year, month, day -> + showDialog = false // Close the dialog when Confirm is clicked // Pass the selected date to the confirm callback - onConfirm(preselectedYear.value, preselectedMonth.value, preselectedDay.value) + onConfirm(year, month, day) }, onDismissRequest = { - showDialog = false // Close the dialog when dismissed - onDismissRequest() // Call the dismiss callback + showDialog = false // Close the dialog when dismissed + onDismissRequest() // Call the dismiss callback }, initialShowYearSelection = true, // Always show year selection first - calendarType = calendarType // "umalqura", "civil", or "islamic" + calendarType = calendarType // Calendar type ("umalqura", "civil", or "islamic") ) } } + + +@Preview(showBackground = true) +@Composable +fun PreviewHijriDatePicker() { + // Preview the Hijri Date Picker with some predefined values + showHijriDatePicker( + initialYear = 1445, // Initial year in Hijri calendar + initialMonth = 1, // Safar (0-indexed month) + initialDay = 1, // 1st day of Safar + onDateSelected = { year, month, day -> + // Handle date selection (preview action) + }, + onConfirm = { year, month, day -> + // Handle confirmation (preview action) + }, + onDismissRequest = { + // Handle dismissal (preview action) + }, + calendarType = "umalqura" // Calendar type for preview + ) +} \ No newline at end of file diff --git a/README.md b/README.md index c8e07d3..42018b9 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,111 @@ +Here’s the updated README with the additional section mentioning the `getIslamicCalendar` function and how to get the current date based on the calendar type: +--- # HijriDatePickerPlus -**HijriDatePickerPlus** is an advanced Android date picker built using Jetpack Compose, designed for selecting dates in the Hijri (Islamic) calendar. The picker now uses the widely supported `IslamicCalendar` class, which offers flexibility and broader compatibility across regions, although it is not specific to Saudi Arabia like Umm Al-Qura. +**HijriDatePickerPlus** is an advanced Android date picker built using Jetpack Compose, designed for selecting dates in the Hijri (Islamic) calendar. The picker now uses the widely supported `IslamicCalendar` class, offering flexibility and compatibility across various regions, with support for the "umalqura", "civil", or "islamic" calendar types. ## Features -- Full support for the **Islamic Calendar** system -- Custom date picker interface using Jetpack Compose -- Year selection with smooth scrolling and customizable font sizes -- Day picker automatically adjusts for the correct number of days in each Hijri month -- Ensures the app doesn't crash when selecting an invalid date in a Hijri month -- Lightweight and responsive UI for a smooth user experience +- Full support for **Islamic Calendar** systems, including **Umm Al-Qura**, **Islamic Civil**, and **General Islamic**. +- Custom date picker interface using Jetpack Compose. +- Year selection with smooth scrolling and customizable font sizes. +- Day picker automatically adjusts for the correct number of days in each Hijri month. +- Ensures the app doesn't crash when selecting an invalid date in a Hijri month. +- Lightweight and responsive UI for a smooth user experience. ## Why Use IslamicCalendar? -Unlike the Umm Al-Qura calendar, which is specific to Saudi Arabia and has known issues in some cases, **IslamicCalendar** provides broader support for the global Muslim community. It offers better flexibility and accuracy for most use cases and regions, making it a more reliable option for international users who may not need Umm Al-Qura specificity. +While the **Umm Al-Qura** calendar is specific to Saudi Arabia and suitable for regional use, the **IslamicCalendar** provides broader support globally. It offers flexibility for international users with support for various calendar types, including **Islamic Civil** and **General Islamic** calendars. ## How to Use 1. Clone the repository: `git clone https://github.com/YourUsername/HijriDatePickerPlus.git` -2. Open the project in Android Studio -3. Build and run the project on an Android device or emulator -4. Incorporate the Hijri date picker into your project by copying the necessary components from the codebase +2. Open the project in Android Studio. +3. Build and run the project on an Android device or emulator. +4. Incorporate the Hijri date picker into your project by copying the necessary components from the codebase. + +## How to Use the Library + +To use **HijriDatePickerPlus** in your Android project, follow these steps: + +### 1. Add the Dependency + +First, add the dependency to your project's `build.gradle` file. Make sure your project is set up to use JitPack by adding the JitPack repository in your `settings.gradle` or `build.gradle` (for Gradle version catalog users, include this in your version catalog file): + +```groovy +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + maven { url = uri("https://jitpack.io") } + } +} +``` + +Then, add the following to your app-level `build.gradle` file under `dependencies`: + +```groovy +dependencies { + implementation 'com.github.mohamedma872:HijriDatePickerPlus:Tag' +} +``` + +Replace `Tag` with the latest version, which you can find [here](https://jitpack.io/#mohamedma872/HijriDatePickerPlus). + +### 2. Initialize and Display the Hijri Date Picker + +To use the date picker, simply call the **HijriDatePickerPlus** component in your Composable function. Here's an example of how to integrate it into your app: + +```kotlin +@Composable +fun ShowHijriDatePicker() { + // Example of how to trigger the date picker using different calendar types + showHijriDatePicker( + initialYear = 1446, // Pass the initial year, e.g., current Hijri year + initialMonth = 1, // Initial month + initialDay = 10, // Initial day + onDateSelected = { year, month, day -> + // Handle date selected (year, month, day) + println("Selected Date: $day-${getHijriMonthName(month)}-$year") + }, + onConfirm = { year, month, day -> + // Handle the final confirmed date + println("Confirmed Date: $day-${getHijriMonthName(month)}-$year") + }, + onDismissRequest = { + // Handle the dismiss action + println("Date Picker Dismissed") + }, + calendarType = "umalqura" // Use "umalqura", "civil", or "islamic" + ) +} +``` + +### 3. Customize the Picker + +You can modify the picker to suit your design needs by adjusting properties such as: + +- **Year/Month/Day Display**: Modify the visual appearance by changing the text size, colors, and layout in the `HeaderSection`, `YearSelectionScreen`, and `FooterSection` components. +- **Hijri Calendar**: The library uses the `IslamicCalendar` class for date calculations. You can directly interact with this class for customization or region-specific adjustments. + +### Getting the Current Date Using the Desired Calendar Type + +You can easily get the current date based on the **Umm Al-Qura**, **Islamic Civil**, or **General Islamic** calendar using the following function: + +For example, to get the current date for the selected calendar type: + +```kotlin +// Get the current Hijri date using the desired calendar type +val currentHijriCalendar = getIslamicCalendar("umalqura") +val currentHijriYear = currentHijriCalendar.get(Calendar.YEAR) +val currentHijriMonth = currentHijriCalendar.get(Calendar.MONTH) +val currentHijriDay = currentHijriCalendar.get(Calendar.DAY_OF_MONTH) + +println("Current Hijri Date: $currentHijriDay-${getHijriMonthName(currentHijriMonth)}-$currentHijriYear") +``` @@ -104,7 +187,7 @@ You can modify the picker to suit your design needs by adjusting properties such ## Fixes and Solutions -HijriDatePickerPlus implements a critical fix for date validation in the Hijri calendar, ensuring that selecting a day beyond the valid number of days in a month (e.g., selecting the 30th day in a month with only 29 days) doesn't cause the app to crash. The picker automatically adjusts the selected day to the correct number of days in each month. +**HijriDatePickerPlus** implements a critical fix for date validation in the Hijri calendar, ensuring that selecting a day beyond the valid number of days in a month (e.g., selecting the 30th day in a month with only 29 days) doesn't cause the app to crash. The picker automatically adjusts the selected day to the correct number of days in each month. ## Installation @@ -142,3 +225,6 @@ For any questions or support regarding this project, you can contact the project [![](https://jitpack.io/v/mohamedma872/HijriDatePickerPlus.svg)](https://jitpack.io/#mohamedma872/HijriDatePickerPlus) +--- + +This updated README includes the mention of the `getIslamicCalendar` function and an example of how to use it to get the current Hijri date. Let me know if you need any further adjustments! diff --git a/app/build.gradle.kts b/app/build.gradle.kts index edd5438..e66132b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -52,7 +52,6 @@ android { dependencies { implementation(libs.androidx.core.ktx) - implementation(libs.androidx.lifecycle.runtime.ktx) implementation(libs.androidx.activity.compose) implementation(platform(libs.androidx.compose.bom)) implementation(libs.androidx.ui) @@ -67,6 +66,7 @@ dependencies { debugImplementation(libs.androidx.ui.tooling) debugImplementation(libs.androidx.ui.test.manifest) implementation(project(":HijriDatePickerLib")) + //implementation ("com.github.mohamedma872:HijriDatePickerPlus:Development-SNAPSHOT") } \ No newline at end of file diff --git a/app/src/main/java/com/sdody/HijriDatePickerPlusApplication/MainActivity.kt b/app/src/main/java/com/sdody/HijriDatePickerPlusApplication/MainActivity.kt index 5c698a2..20d9323 100644 --- a/app/src/main/java/com/sdody/HijriDatePickerPlusApplication/MainActivity.kt +++ b/app/src/main/java/com/sdody/HijriDatePickerPlusApplication/MainActivity.kt @@ -21,18 +21,27 @@ class MainActivity : ComponentActivity() { setContent { // Use "umalqura", "civil", or "islamic" // HijriDatePickerButton(calendarType = "umalqura") + var lastSelectedYear = 1445 + var lastSelectedMonth = 1 + var lastSelectedDay = 1 // Example of how you can trigger the date picker from anywhere showHijriDatePicker( - initialYear = 1445, - initialMonth = 1, - initialDay = 1, + initialYear = lastSelectedYear, + initialMonth = lastSelectedMonth, + initialDay = lastSelectedDay, onDateSelected = { year, month, day -> // Handle date selection changes + lastSelectedYear = year + lastSelectedMonth = month + lastSelectedDay = day println("Selected date: $year-$month-$day") }, onConfirm = { year, month, day -> // Handle the final confirmed date here + lastSelectedYear = year + lastSelectedMonth = month + lastSelectedDay = day println("Confirmed date: $year-$month-$day") }, onDismissRequest = { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ec7ae7e..80a4a25 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -26,7 +26,6 @@ androidx-lifecycle-runtime-ktx-v231 = { module = "androidx.lifecycle:lifecycle-r junit = { group = "junit", name = "junit", version.ref = "junit" } androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } -androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" } androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" } androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" } androidx-ui = { group = "androidx.compose.ui", name = "ui" }