diff android/DWindows.kt @ 2523:82cdb3ad7c25

Android: Implement the calendar widget using CalendarView. For some reason it is not actually displaying the correct date.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 09 May 2021 21:17:32 +0000
parents 66c490aa719d
children d5c3c573c74e
line wrap: on
line diff
--- a/android/DWindows.kt	Sun May 09 19:27:23 2021 +0000
+++ b/android/DWindows.kt	Sun May 09 21:17:32 2021 +0000
@@ -1487,6 +1487,34 @@
         return retval
     }
 
+    fun calendarNew(cid: Int): CalendarView?
+    {
+        var calendar: CalendarView? = null
+
+        waitOnUiThread {
+            calendar = CalendarView(this)
+        }
+
+        return calendar
+    }
+
+    fun calendarSetDate(calendar: CalendarView, date: Long)
+    {
+        waitOnUiThread {
+            calendar.setDate(date, true, true)
+        }
+    }
+
+    fun calendarGetDate(calendar: CalendarView): Long
+    {
+        var date: Long = 0
+
+        waitOnUiThread {
+            date = calendar.date
+        }
+        return date
+    }
+
     fun timerConnect(interval: Long, sigfunc: Long, data: Long): Timer
     {
         // creating timer task, timer