Commit d36b93cc authored by Ricki Hirner's avatar Ricki Hirner

Some documentation

parent 7c49ba21
......@@ -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)
......
......@@ -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()),
......
......@@ -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?) {
......@@ -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?) =
......@@ -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>()
......@@ -61,6 +66,7 @@ object MiscUtils {
/**
* Removes empty [String] values from [values].
*
* @param values set of values to be processed
*/
fun removeEmptyStrings(values: ContentValues) {
......
......@@ -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()
......
......@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment