# UrlAnnotation

Artifact: [androidx.compose.ui:ui-text](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/text/UrlAnnotation.kt+class:androidx.compose.ui.text.UrlAnnotation) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.3.0) Deprecated in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0) Common/AllAndroid/JVM
- Cmn

  ```
  @ExperimentalTextApi
  class UrlAnnotation : AnnotatedString.Annotation
  ```

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> Use LinkAnnotatation.Url(url) instead, use this instead:
>
> ```kotlin
> LinkAnnotation.Url(url)
> ```

An annotation that contains the metadata intended for text-to-speech engine. If the text is being processed by a text-to-speech engine, the engine may use the data in this annotation in addition to or instead of its associated text.

Note: this is now deprecated. In order to display a link in the text, add a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkAnnotation` to the AnnotatedString and pass it to the Text composable function

## Summary

| ### Public constructors |
|---|---|
| `[UrlAnnotation](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/UrlAnnotation#UrlAnnotation(kotlin.String))(url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` **This function is deprecated.** Use LinkAnnotatation.Url(url) instead | Cmn |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[equals](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/UrlAnnotation#equals(kotlin.Any))(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` **This function is deprecated.** Use LinkAnnotatation.Url(url) instead | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[hashCode](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/UrlAnnotation#hashCode())()` **This function is deprecated.** Use LinkAnnotatation.Url(url) instead | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `[toString](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/UrlAnnotation#toString())()` **This function is deprecated.** Use LinkAnnotatation.Url(url) instead | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/UrlAnnotation#url()` **This property is deprecated.** Use LinkAnnotatation.Url(url) instead | Cmn |

## Public constructors

### UrlAnnotation

Cmn Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.3.0) Deprecated in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0)

```
[UrlAnnotation](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/UrlAnnotation#UrlAnnotation(kotlin.String))(url: String)
```

> [!CAUTION]
> **This function is deprecated.**   
> Use LinkAnnotatation.Url(url) instead, use this instead:
>
> ```kotlin
> LinkAnnotation.Url(url)
> ```

## Public functions

### equals

Cmn

```
open operator fun [equals](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/UrlAnnotation#equals(kotlin.Any))(other: Any?): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> Use LinkAnnotatation.Url(url) instead, use this instead:
>
> ```kotlin
> LinkAnnotation.Url(url)
> ```

### hashCode

Cmn

```
open fun [hashCode](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/UrlAnnotation#hashCode())(): Int
```

> [!CAUTION]
> **This function is deprecated.**   
> Use LinkAnnotatation.Url(url) instead, use this instead:
>
> ```kotlin
> LinkAnnotation.Url(url)
> ```

### toString

Cmn

```
open fun [toString](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/UrlAnnotation#toString())(): String
```

> [!CAUTION]
> **This function is deprecated.**   
> Use LinkAnnotatation.Url(url) instead, use this instead:
>
> ```kotlin
> LinkAnnotation.Url(url)
> ```

## Public properties

### url

Cmn Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.3.0) Deprecated in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0)

```
val url: String
```

> [!CAUTION]
> **This property is deprecated.**   
> Use LinkAnnotatation.Url(url) instead, use this instead:
>
> ```kotlin
> LinkAnnotation.Url(url)
> ```