rememberRemotePageIndicatorState

Functions summary

RemotePageIndicatorState
@Composable
@RemoteComposable
rememberRemotePageIndicatorState(
    pageCount: @IntRange(from = 0) Int,
    selectedPage: RemoteInt,
    pageOffset: RemoteFloat
)

Creates and remembers a RemotePageIndicatorState.

Functions

rememberRemotePageIndicatorState

@Composable
@RemoteComposable
fun rememberRemotePageIndicatorState(
    pageCount: @IntRange(from = 0) Int,
    selectedPage: RemoteInt = 0.ri,
    pageOffset: RemoteFloat = 0f.rf
): RemotePageIndicatorState

Creates and remembers a RemotePageIndicatorState.

Example of remembering state for a RemoteHorizontalPageIndicator:

import androidx.compose.remote.creation.compose.state.ri
import androidx.wear.compose.remote.material3.RemoteHorizontalPageIndicator
import androidx.wear.compose.remote.material3.rememberRemotePageIndicatorState

val state = rememberRemotePageIndicatorState(selectedPage = 1.ri, pageCount = 3)
RemoteHorizontalPageIndicator(state = state, modifier = modifier)
Parameters
pageCount: @IntRange(from = 0) Int

Total number of pages (must be non-negative).

selectedPage: RemoteInt = 0.ri

The currently selected page index.

pageOffset: RemoteFloat = 0f.rf

The current offset from the start of the selected page, as a ratio of the page width.