comparison 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
comparison
equal deleted inserted replaced
2522:66c490aa719d 2523:82cdb3ad7c25
1485 } 1485 }
1486 } 1486 }
1487 return retval 1487 return retval
1488 } 1488 }
1489 1489
1490 fun calendarNew(cid: Int): CalendarView?
1491 {
1492 var calendar: CalendarView? = null
1493
1494 waitOnUiThread {
1495 calendar = CalendarView(this)
1496 }
1497
1498 return calendar
1499 }
1500
1501 fun calendarSetDate(calendar: CalendarView, date: Long)
1502 {
1503 waitOnUiThread {
1504 calendar.setDate(date, true, true)
1505 }
1506 }
1507
1508 fun calendarGetDate(calendar: CalendarView): Long
1509 {
1510 var date: Long = 0
1511
1512 waitOnUiThread {
1513 date = calendar.date
1514 }
1515 return date
1516 }
1517
1490 fun timerConnect(interval: Long, sigfunc: Long, data: Long): Timer 1518 fun timerConnect(interval: Long, sigfunc: Long, data: Long): Timer
1491 { 1519 {
1492 // creating timer task, timer 1520 // creating timer task, timer
1493 val t = Timer() 1521 val t = Timer()
1494 val tt: TimerTask = object : TimerTask() { 1522 val tt: TimerTask = object : TimerTask() {