Skip to content

Commit

Permalink
Merge pull request #41 from dokar3/v0.4.0-rc
Browse files Browse the repository at this point in the history
V0.4.0-rc
  • Loading branch information
dokar3 authored Sep 28, 2022
2 parents 2f89001 + 4c4c0f0 commit bbeaaba
Show file tree
Hide file tree
Showing 12 changed files with 576 additions and 157 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ implementation "io.github.dokar3:chiptextfield:latest_version"

```kotlin
var value by remember { mutableStateOf("Initial text") }
val state = rememberChipTextFieldState<Chip>(
value = value,
onValueChange = { value = it },
)
val state = rememberChipTextFieldState<Chip>()
ChipTextField(
state = state,
onSubmit = { textFieldValue -> Chip(textFieldValue.text) },
value = value,
onValueChange = { value = it },
onSubmit = { text -> Chip(text) },
)
```

Expand All @@ -30,7 +29,7 @@ Simplified version if do not care about the text field value:
val state = rememberChipTextFieldState<Chip>()
ChipTextField(
state = state,
onSubmit = { textFieldValue -> Chip(textFieldValue.text) },
onSubmit = ::Chip,
)
```

Expand All @@ -42,7 +41,7 @@ ChipTextField(
val state = rememberChipTextFieldState<Chip>()
OutlinedChipTextField(
state = state,
onSubmit = { Chip(it.text) },
onSubmit = ::Chip,
)
```

Expand All @@ -53,10 +52,10 @@ OutlinedChipTextField(
```kotlin
val state = rememberChipTextFieldState<Chip>()
ChipTextField(
state = state,
onSubmit = { Chip(it.text) },
state = state,
onSubmit = ::Chip,
colors = TextFieldDefaults.textFieldColors(
backgroundColor = Color.Transparent
backgroundColor = Color.Transparent,
),
contentPadding = PaddingValues(bottom = 8.dp),
)
Expand All @@ -72,7 +71,7 @@ class CheckableChip(text: String, isChecked: Boolean = false) : Chip(text) {
}

val state = rememberChipTextFieldState(
chips = listOf(CheckableChip(""), ...),
chips = listOf(CheckableChip(""), /*...*/),
)
BasicChipTextField(
state = state,
Expand All @@ -84,7 +83,7 @@ BasicChipTextField(
)

@Composable
fun CheckIcon(chip: CheckableChip, modifier: Modifier = Modifier) { ... }
fun CheckIcon(chip: CheckableChip, modifier: Modifier = Modifier) { /*...*/ }
```

![](/images/screenshot_checkable.jpg)
Expand All @@ -102,7 +101,7 @@ ChipTextField(
)

@Composable
fun Avatar(chip: AvatarChip, modifier: Modifier = Modifier) { ... }
fun Avatar(chip: AvatarChip, modifier: Modifier = Modifier) { /*...*/ }
```

![](/images/screenshot_avatar.png)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
compose_version = '1.3.0-beta02'
compose_version = '1.3.0-beta03'
compose_compiler_version = '1.3.1'
kotlin_version = '1.7.10'
accompanist_version = '0.26.4-beta'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kotlin.code.style=official

GROUP=io.github.dokar3
POM_ARTIFACT_ID=chiptextfield
VERSION_NAME=0.4.0-beta
VERSION_NAME=0.4.0-rc

POM_NAME=ChipTextField
POM_DESCRIPTION=Editable chip layout in Jetpack Compose.
Expand Down
Loading

0 comments on commit bbeaaba

Please sign in to comment.