Loading src/main/java/at/bitfire/ical4android/AndroidCalendar.kt +11 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,17 @@ abstract class AndroidCalendar<out T: AndroidEvent>( companion object { /** * Creates a local (Android calendar provider) calendar. * * @param account account which the calendar should be assigned to * @param provider client for Android calendar provider * @param info initial calendar properties ([Calendars.CALENDAR_DISPLAY_NAME] etc.) * * @return [Uri] of the created calendar * * @throws Exception if the calendar couldn't be created */ fun create(account: Account, provider: ContentProviderClient, info: ContentValues): Uri { info.put(Calendars.ACCOUNT_NAME, account.name) info.put(Calendars.ACCOUNT_TYPE, account.type) Loading src/main/java/at/bitfire/ical4android/Css3Color.kt +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ package at.bitfire.ical4android * * @property argb ARGB color value (0xAARRGGBB), alpha is 0xFF for all values */ @Suppress("EnumEntryName") @Suppress("EnumEntryName", "SpellCheckingInspection") enum class Css3Color(val argb: Int) { // values taken from https://www.w3.org/TR/2011/REC-css3-color-20110607/#svg-color aliceblue(0xfff0f8ff.toInt()), Loading src/main/java/at/bitfire/ical4android/MiscUtils.kt +6 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ object MiscUtils { /** * Ensures that a given DateProperty has a time zone with an ID that is available in Android. * * @param date DateProperty to validate. Values which are not DATE-TIME will be ignored. */ fun androidifyTimeZone(date: DateProperty?) { Loading @@ -35,6 +36,7 @@ object MiscUtils { /** * Returns the time-zone ID for a given date-time, or TIMEZONE_UTC for dates (without time). * TIMEZONE_UTC is also returned for DATE-TIMEs in UTC representation. * * @param date DateProperty (DATE or DATE-TIME) whose time-zone information is used */ fun getTzId(date: DateProperty?) = Loading @@ -45,6 +47,9 @@ object MiscUtils { /** * Generates useful toString info (fields and values) from [obj] by reflection. * * @param obj object to inspect * @return string containing properties and non-static declared fields */ fun reflectionToString(obj: Any): String { val s = LinkedList<String>() Loading @@ -61,6 +66,7 @@ object MiscUtils { /** * Removes empty [String] values from [values]. * * @param values set of values to be processed */ fun removeEmptyStrings(values: ContentValues) { Loading src/test/java/at/bitfire/ical4android/EventTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ class EventTest { @Test fun testCharsets() { var e = parseCalendar("latin1.ics", Charset.forName("ISO-8859-1"))[0] var e = parseCalendar("latin1.ics", Charsets.ISO_8859_1)[0] assertEquals("äöüß", e.summary) e = parseCalendar("utf8.ics").first() Loading src/test/java/at/bitfire/ical4android/TaskTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ class TaskTest { @Test fun testCharsets() { var t = parseCalendar("latin1.ics", Charset.forName("ISO-8859-1")) var t = parseCalendar("latin1.ics", Charsets.ISO_8859_1) assertEquals("äöüß", t.summary) t = parseCalendar("utf8.ics") Loading Loading
src/main/java/at/bitfire/ical4android/AndroidCalendar.kt +11 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,17 @@ abstract class AndroidCalendar<out T: AndroidEvent>( companion object { /** * Creates a local (Android calendar provider) calendar. * * @param account account which the calendar should be assigned to * @param provider client for Android calendar provider * @param info initial calendar properties ([Calendars.CALENDAR_DISPLAY_NAME] etc.) * * @return [Uri] of the created calendar * * @throws Exception if the calendar couldn't be created */ fun create(account: Account, provider: ContentProviderClient, info: ContentValues): Uri { info.put(Calendars.ACCOUNT_NAME, account.name) info.put(Calendars.ACCOUNT_TYPE, account.type) Loading
src/main/java/at/bitfire/ical4android/Css3Color.kt +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ package at.bitfire.ical4android * * @property argb ARGB color value (0xAARRGGBB), alpha is 0xFF for all values */ @Suppress("EnumEntryName") @Suppress("EnumEntryName", "SpellCheckingInspection") enum class Css3Color(val argb: Int) { // values taken from https://www.w3.org/TR/2011/REC-css3-color-20110607/#svg-color aliceblue(0xfff0f8ff.toInt()), Loading
src/main/java/at/bitfire/ical4android/MiscUtils.kt +6 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ object MiscUtils { /** * Ensures that a given DateProperty has a time zone with an ID that is available in Android. * * @param date DateProperty to validate. Values which are not DATE-TIME will be ignored. */ fun androidifyTimeZone(date: DateProperty?) { Loading @@ -35,6 +36,7 @@ object MiscUtils { /** * Returns the time-zone ID for a given date-time, or TIMEZONE_UTC for dates (without time). * TIMEZONE_UTC is also returned for DATE-TIMEs in UTC representation. * * @param date DateProperty (DATE or DATE-TIME) whose time-zone information is used */ fun getTzId(date: DateProperty?) = Loading @@ -45,6 +47,9 @@ object MiscUtils { /** * Generates useful toString info (fields and values) from [obj] by reflection. * * @param obj object to inspect * @return string containing properties and non-static declared fields */ fun reflectionToString(obj: Any): String { val s = LinkedList<String>() Loading @@ -61,6 +66,7 @@ object MiscUtils { /** * Removes empty [String] values from [values]. * * @param values set of values to be processed */ fun removeEmptyStrings(values: ContentValues) { Loading
src/test/java/at/bitfire/ical4android/EventTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ class EventTest { @Test fun testCharsets() { var e = parseCalendar("latin1.ics", Charset.forName("ISO-8859-1"))[0] var e = parseCalendar("latin1.ics", Charsets.ISO_8859_1)[0] assertEquals("äöüß", e.summary) e = parseCalendar("utf8.ics").first() Loading
src/test/java/at/bitfire/ical4android/TaskTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ class TaskTest { @Test fun testCharsets() { var t = parseCalendar("latin1.ics", Charset.forName("ISO-8859-1")) var t = parseCalendar("latin1.ics", Charsets.ISO_8859_1) assertEquals("äöüß", t.summary) t = parseCalendar("utf8.ics") Loading