Skip to content

Commit

Permalink
Merge pull request #42 from warp-ds/whats-new-android-v33
Browse files Browse the repository at this point in the history
Update whats new for android
  • Loading branch information
julbar authored Nov 7, 2024
2 parents 531bffe + 141e1af commit 2abb2df
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/api-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1766,6 +1766,12 @@ export const android = {
'true',
'Sets the textfield to a single line'
],
[
'minLines',
'Int',
'1',
'Sets the minimum amount of lines'
],
[
'maxLines',
'Int',
Expand Down
64 changes: 64 additions & 0 deletions docs/blog/posts/2024/android-0.0.33.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: 'WARP Android release v.0.0.33'
date: 2024-11-06
---

WarpCallout is here!
---

# Warp Android release 0.0.33

## 2024-11-06

### WarpCallout component

WarpCallout now available in Warp android! Can be either a popover or inline, 4 arrow directions available, closable option as well as dynamic placement given an anchor view. More info on the [tech docs site.](https://warp-ds.github.io/docs/components/callout/)

```kotlin example
val state = remember { CalloutState(false) }

WarpCallout(
text = "This is a callout",
edge = Edge.Leading,
state = state,
type = CalloutType.Popover,
size = CalloutSize.Default,
closable = false,
onDismiss = { state.isVisible = false },
) {
WarpButton (
text = "Show callout",
onClick = {
state.isVisible = !state.isVisible
}
)
}
```
```xml
<com.schibsted.nmp.warp.components.legacy.WarpCalloutView
android:id="@+id/callout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:calloutEdge="leading"
app:calloutIsClosable="false"
app:calloutIsVisible="false"
app:calloutSize="small"
app:calloutText="This is the callout text"
app:calloutType="popover"
app:calloutVerticalOffset="0"
app:calloutHorizontalOffset="0" />
```

### WarpTextField fix

Kudos to Ali Shariat for making a fix that enables the textfield component to accept minLines param. The default value of minLines remains 1.
```kotlin example
WarpTextField(
value = text,
onValueChange = { text = it },
placeholderText = "A placeholder",
label = "A label",
modifier = Modifier.fillMaxWidth(),
minLines = 3
)
```
4 changes: 3 additions & 1 deletion docs/components/textfield/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ fun WarpTextField(
keyboardOptions: KeyboardOptions = KeyboardOptions(capitalization = KeyboardCapitalization.Sentences),
keyboardActions: KeyboardActions = KeyboardActions.Default,
singleLine: Boolean = true,
minLines: Int = 1,
maxLines: Int = Int.MAX_VALUE,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }
)
Expand Down Expand Up @@ -185,7 +186,8 @@ To support layouts still written in xml the WarpTextField can be used as a custo
app:isError="false"
app:prefixText="kronor"
app:suffixText="kr"
app:maxLines="2"
app:maxLines="6"
app:minLines="2"
app:singleLine="false"
/>
```
Expand Down

0 comments on commit 2abb2df

Please sign in to comment.