Skip to content
This repository has been archived by the owner on Jan 21, 2025. It is now read-only.

Commit

Permalink
Merge pull request #220 from warp-ds/spinner-component-android
Browse files Browse the repository at this point in the history
Android WarpSpinner
  • Loading branch information
julbar authored Aug 27, 2024
2 parents 1c38a43 + ebf755b commit 3538ebd
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 5 deletions.
17 changes: 17 additions & 0 deletions docs/api-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -2258,6 +2258,23 @@ export const android = {
],
],
},
Spinner: {
props: [
[
'modifier',
'Modifier',
'Modifier',
'Sets the modifier for the spinner',
],
[
'size',
'WarpSpinnerSize.Small <br />WarpSpinnerSize.Default <br />WarpSpinnerSize.Large',
'WarpSpinnerSize.Default',
'Size of the spinner'
],

]
},
};

export const iOS = {
Expand Down
42 changes: 42 additions & 0 deletions docs/components/spinner/android.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
### Syntax

```kotlin
@Composable
fun WarpSpinner(
modifier: Modifier = Modifier,
size: WarpSpinnerSize = WarpSpinnerSize.Default,
)
```


### Visual options
There are three supported sizes for the Spinner.
```kotlin
WarpSpinnerSize.Small
WarpSpinnerSize.Default
WarpSpinnerSize.Large
```

The default size is WarpSpinnerSize.Default

```kotlin
WarpSpinner(size = WarpSpinnerSize.Small)
WarpSpinner()
WarpSpinner(size = WarpSpinnerSize.Large)
```

### Legacy support
Supported in xml layouts

```xml
<com.schibsted.nmp.warp.components.legacy.WarpSpinnerView
android:id="@+id/spinner_large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/space2"
app:spinnerSize="large"/>
```

### Parameters

<api-table type=android component="Spinner" />
18 changes: 13 additions & 5 deletions docs/components/spinner/index.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<script setup>
import iOS from './ios.md';
import Android from './android.md';
</script>

# Spinner

A spinner is an animated spinning icon that informs users about the loading of content.
Use a Spinner when confirming a change has been made or a task is being processed.


::: warning iOS only
For the web implementation of a "spinner", see [CSS - Animation - Spinner](/css/animation#spinner).
:::

<components-status ios='released' />
<components-status ios='released' android='released' />

## Example

Expand All @@ -22,6 +23,13 @@ For the web implementation of a "spinner", see [CSS - Animation - Spinner](/css/

<component-questions />

## iOS implementation
## Frameworks

<iOS />
<tabs-content>
<template #android>
<android />
</template>
<template #iOS>
<iOS />
</template>
</tabs-content>

0 comments on commit 3538ebd

Please sign in to comment.