davidliu

Show FlowObservable annotation in docs

... ... @@ -65,17 +65,21 @@ constructor(
@Deprecated("Use events instead.")
var listener: RoomListener? = null
@FlowObservable
@get:FlowObservable
var sid: Sid? by flowDelegate(null)
@FlowObservable
@get:FlowObservable
var name: String? by flowDelegate(null)
private set
@FlowObservable
@get:FlowObservable
var state: State by flowDelegate(State.DISCONNECTED)
private set
@FlowObservable
@get:FlowObservable
var metadata: String? by flowDelegate(null)
private set
... ... @@ -129,12 +133,14 @@ constructor(
private var mutableRemoteParticipants by flowDelegate(emptyMap<String, RemoteParticipant>())
@FlowObservable
@get:FlowObservable
val remoteParticipants: Map<String, RemoteParticipant>
get() = mutableRemoteParticipants
private var mutableActiveSpeakers by flowDelegate(emptyList<Participant>())
@FlowObservable
@get:FlowObservable
val activeSpeakers: List<Participant>
get() = mutableActiveSpeakers
... ...
... ... @@ -34,6 +34,7 @@ open class Participant(
/**
* Changes can be observed by using [io.livekit.android.util.flow]
*/
@FlowObservable
@get:FlowObservable
var participantInfo: LivekitModels.ParticipantInfo? by flowDelegate(null)
private set
... ... @@ -41,6 +42,7 @@ open class Participant(
/**
* Changes can be observed by using [io.livekit.android.util.flow]
*/
@FlowObservable
@get:FlowObservable
var identity: String? by flowDelegate(identity)
internal set
... ... @@ -48,6 +50,7 @@ open class Participant(
/**
* Changes can be observed by using [io.livekit.android.util.flow]
*/
@FlowObservable
@get:FlowObservable
var audioLevel: Float by flowDelegate(0f)
internal set
... ... @@ -55,6 +58,7 @@ open class Participant(
/**
* Changes can be observed by using [io.livekit.android.util.flow]
*/
@FlowObservable
@get:FlowObservable
var isSpeaking: Boolean by flowDelegate(false) { newValue, oldValue ->
if (newValue != oldValue) {
... ... @@ -64,13 +68,15 @@ open class Participant(
}
}
internal set
@FlowObservable
@get:FlowObservable
var name by flowDelegate<String?>(null)
/**
* Changes can be observed by using [io.livekit.android.util.flow]
*/
@FlowObservable
@get:FlowObservable
var metadata: String? by flowDelegate(null) { newMetadata, oldMetadata ->
if (newMetadata != oldMetadata) {
... ... @@ -84,6 +90,7 @@ open class Participant(
/**
* Changes can be observed by using [io.livekit.android.util.flow]
*/
@FlowObservable
@get:FlowObservable
var connectionQuality by flowDelegate(ConnectionQuality.UNKNOWN)
internal set
... ... @@ -106,6 +113,7 @@ open class Participant(
/**
* Changes can be observed by using [io.livekit.android.util.flow]
*/
@FlowObservable
@get:FlowObservable
var tracks by flowDelegate(emptyMap<String, TrackPublication>())
protected set
... ... @@ -113,6 +121,7 @@ open class Participant(
/**
* Changes can be observed by using [io.livekit.android.util.flow]
*/
@FlowObservable
@get:FlowObservable
val audioTracks by flowDelegate(
stateFlow = ::tracks.flow
... ... @@ -123,6 +132,7 @@ open class Participant(
/**
* Changes can be observed by using [io.livekit.android.util.flow]
*/
@FlowObservable
@get:FlowObservable
val videoTracks by flowDelegate(
stateFlow = ::tracks.flow
... ...
... ... @@ -12,6 +12,7 @@ open class TrackPublication(
participant: Participant
) {
@FlowObservable
@get:FlowObservable
open var track: Track? by flowDelegate(track)
internal set
... ... @@ -22,6 +23,7 @@ open class TrackPublication(
var kind: Track.Kind
private set
@FlowObservable
@get:FlowObservable
open var muted: Boolean by flowDelegate(false)
internal set
... ...
... ... @@ -65,7 +65,7 @@ val <T> KProperty0<T>.flow: StateFlow<T>
/**
* Indicates that the target property changes can be observed with [flow].
*/
@Target(AnnotationTarget.CLASS, AnnotationTarget.PROPERTY_GETTER)
@Target(AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER)
@Retention(AnnotationRetention.BINARY)
@MustBeDocumented
annotation class FlowObservable
... ...
... ... @@ -22,6 +22,7 @@ class FlowDelegateUsageDetectorTest {
import io.livekit.android.util.flow
import io.livekit.android.util.flowDelegate
class Example {
@FlowObservable
@get:FlowObservable
val value: Int by flowDelegate(0)
fun foo() {
... ... @@ -50,6 +51,7 @@ class FlowDelegateUsageDetectorTest {
import io.livekit.android.util.flow
import io.livekit.android.util.flowDelegate
class Example {
@FlowObservable
@get:FlowObservable
val value: Int by flowDelegate(0)
fun foo() {
... ... @@ -78,6 +80,7 @@ class FlowDelegateUsageDetectorTest {
import io.livekit.android.util.flow
import io.livekit.android.util.flowDelegate
class FlowContainer {
@FlowObservable
@get:FlowObservable
val value: Int by flowDelegate(0)
}
... ... @@ -109,6 +112,7 @@ class FlowDelegateUsageDetectorTest {
import io.livekit.android.util.flow
import io.livekit.android.util.flowDelegate
class FlowContainer {
@FlowObservable
@get:FlowObservable
val value: Int by flowDelegate(0)
}
... ... @@ -141,6 +145,7 @@ class FlowDelegateUsageDetectorTest {
import io.livekit.android.util.flowDelegate
class FlowContainer {
var value: Int by flowDelegate(0)
@FlowObservable
@get:FlowObservable
val otherValue: Int
get() = value
... ... @@ -205,7 +210,7 @@ fun flowAccess(): TestFile {
val <T> KProperty0<T>.flow: StateFlow<T>
get() = delegate as StateFlow<T>
@Target(AnnotationTarget.PROPERTY_GETTER)
@Target(AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER)
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
annotation class FlowObservable
... ...