Add KDoc to six small library API modules

Cover the remaining interfaces of libraries/troubleshoot, libraries/matrixmedia,
libraries/dateformatter, libraries/featureflag, libraries/workmanager and
libraries/mediaviewer, along with their members and parameters.

Behaviours worth recording: NotificationTroubleshootTest reports its outcome
through its state flow rather than by returning, and its quickFix throws unless
the test offers one; DateFormatter.format turns a null timestamp into an empty
string so callers need no null check; ImageLoaderHolder keeps one loader per
session because decrypting room media needs that session's client.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benoit Marty
2026-08-14 11:43:40 +02:00
parent d80aaf6be4
commit 2284cff25a
13 changed files with 118 additions and 0 deletions
@@ -8,7 +8,17 @@
package io.element.android.libraries.dateformatter.api
/**
* Formats timestamps for display, in the user's locale and time zone.
*/
interface DateFormatter {
/**
* Formats a timestamp according to [mode].
*
* @param timestamp milliseconds since the epoch; a `null` value yields an empty string, so callers need no null check of their own.
* @param mode how much of the date and time to include; see [DateFormatterMode] for examples of each.
* @param useRelative true to prefer wording relative to today, such as "Today" or "This month", where the mode allows it.
*/
fun format(
timestamp: Long?,
mode: DateFormatterMode = DateFormatterMode.Full,
@@ -21,6 +21,11 @@ import kotlin.time.Duration
* - 30 seconds → "30 seconds"
*/
interface DurationFormatter {
/**
* Formats the duration using its largest appropriate unit, rounding rather than listing several units.
*
* @param duration the duration to describe.
*/
fun format(duration: Duration): String
}