mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-20 13:40:46 +01:00
avoid showing the same color multiple times at the caldav event type color picker
This commit is contained in:
parent
7ed33a2157
commit
0f97ce7153
@ -182,12 +182,15 @@ class CalDAVHandler(val context: Context) {
|
|||||||
colors.put(colorKey, color)
|
colors.put(colorKey, color)
|
||||||
} while (cursor.moveToNext())
|
} while (cursor.moveToNext())
|
||||||
}
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("DEBUG", "exc $e")
|
||||||
} finally {
|
} finally {
|
||||||
cursor?.close()
|
cursor?.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
val sortedColors = ArrayList<Int>(colors.size())
|
var sortedColors = ArrayList<Int>(colors.size())
|
||||||
(0 until colors.size()).mapTo(sortedColors) { colors[it] }
|
(0 until colors.size()).mapTo(sortedColors) { colors[it] }
|
||||||
|
sortedColors = sortedColors.distinct() as ArrayList<Int>
|
||||||
|
|
||||||
return sortedColors
|
return sortedColors
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user