mirror of
https://github.com/JakeWharton/mosaic.git
synced 2025-11-02 21:40:06 +08:00
Convert data class to Poko (#242)
This commit is contained in:
@ -3,6 +3,7 @@ package com.jakewharton.mosaic.text
|
|||||||
import androidx.compose.runtime.Immutable
|
import androidx.compose.runtime.Immutable
|
||||||
import androidx.compose.runtime.Stable
|
import androidx.compose.runtime.Stable
|
||||||
import com.jakewharton.mosaic.text.AnnotatedString.Builder
|
import com.jakewharton.mosaic.text.AnnotatedString.Builder
|
||||||
|
import dev.drewhamilton.poko.Poko
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The basic data structure of text with multiple styles. To construct an [AnnotatedString] you
|
* The basic data structure of text with multiple styles. To construct an [AnnotatedString] you
|
||||||
@ -79,8 +80,8 @@ public class AnnotatedString internal constructor(
|
|||||||
* @param start The start of the range where [item] takes effect. It's inclusive
|
* @param start The start of the range where [item] takes effect. It's inclusive
|
||||||
* @param end The end of the range where [item] takes effect. It's exclusive
|
* @param end The end of the range where [item] takes effect. It's exclusive
|
||||||
*/
|
*/
|
||||||
@Immutable
|
@[Immutable Poko]
|
||||||
public data class Range<T>(val item: T, val start: Int, val end: Int) {
|
public class Range<T>(public val item: T, public val start: Int, public val end: Int) {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
require(start <= end) { "Reversed range is not supported" }
|
require(start <= end) { "Reversed range is not supported" }
|
||||||
|
|||||||
Reference in New Issue
Block a user