Skip to content

Commit 73d6f30

Browse files
committed
Update CHANGELOG.md
1 parent 1a8fed8 commit 73d6f30

File tree

2 files changed

+87
-84
lines changed

2 files changed

+87
-84
lines changed

CHANGELOG.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Change Log
22

3+
## Version 5.0.2 *(16/07/2025)*
4+
5+
- Fixed `rawAmount` having 0 in front.
6+
7+
### ⚠️ Breaking Changes
8+
9+
- Removed `onAmountChange: (String) -> Unit` and merge with `NumberKeyboardListener` implementation.
10+
11+
**🧭 Migration Guide**
12+
13+
```kotlin
14+
var amountWithCurrency by remember { mutableStateOf("$currencySymbol 0") }
15+
var amount by remember { mutableStateOf("") }
16+
17+
NumberKeyboard(
18+
amount = amount,
19+
listener = object : NumberKeyboardListener {
20+
override fun onUpdated(data: NumberKeyboardData) {
21+
amountWithCurrency = data.currency
22+
amount = data.rawAmount
23+
}
24+
}
25+
)
26+
```
27+
328
## Version 5.0.1 *(15/07/2025)*
429

530
- Fix Android target configuration (#46)
@@ -8,6 +33,67 @@
833

934
- Migrate to Kotlin Multiplatform (#45)
1035

36+
### ✨ New Features
37+
38+
• Introduced NumberKeyboardFormat enum to control keypad layout:
39+
40+
```kotlin
41+
enum class NumberKeyboardFormat {
42+
Normal, // Standard ascending layout (like phone dial pad)
43+
Inverted, // Descending layout (like a calculator)
44+
Scrambled, // Shuffled once on composition
45+
AlwaysScrambled // Re-shuffles every tap (chaos, but secure chaos)
46+
}
47+
```
48+
49+
### ⚠️ Breaking Changes
50+
51+
- `isInverted: Boolean` is now deprecated
52+
One flag was never enough. Now you’ve got four layout options to rule them all. Replace
53+
54+
```kotlin
55+
isInverted = true
56+
```
57+
58+
with:
59+
60+
```kotlin
61+
format = NumberKeyboardFormat.Inverted
62+
```
63+
64+
**🧭 Migration Guide**
65+
66+
| Before | After |
67+
|--------------------|----------------------------------------|
68+
| isInverted = false | format = NumberKeyboardFormat.Normal |
69+
| isInverted = true | format = NumberKeyboardFormat.Inverted |
70+
71+
- `NumberKeyboard` is now a **stateless composable**.
72+
- Removed internal `remember` state for the input amount.
73+
- You **must** provide:
74+
- `amount: String`
75+
- `onAmountChange: (String) -> Unit`
76+
- Removed `initialAmount` attribute.
77+
- This enables external state management and improves integration with architectures like MVI,
78+
ViewModel, etc.
79+
80+
**Before:**
81+
82+
```kotlin
83+
NumberKeyboard() // internally remembered state
84+
```
85+
86+
**After:**
87+
88+
```kotlin
89+
var amount by remember { mutableStateOf("") }
90+
91+
NumberKeyboard(
92+
amount = amount,
93+
onAmountChange = { amount = it }
94+
)
95+
```
96+
1197
## Version 4.0.8 *(16/06/2025)*
1298

1399
- Update dependencies and target SDK 36

README.md

Lines changed: 1 addition & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -38,93 +38,10 @@ dependencies {
3838

3939
[CHANGELOG](https://github.com/davidmigloz/number-keyboard/blob/master/CHANGELOG.md)
4040

41-
## [5.0.2]
4241

43-
- Fixed `rawAmount` having 0 in front.
42+
#### [5.0.0] - Kotlin Multiplatform Version
4443

45-
### ⚠️ Breaking Changes
4644

47-
- Removed `onAmountChange: (String) -> Unit` and merge with `NumberKeyboardListener` implementation.
48-
49-
**🧭 Migration Guide**
50-
51-
```kotlin
52-
var amountWithCurrency by remember { mutableStateOf("$currencySymbol 0") }
53-
var amount by remember { mutableStateOf("") }
54-
55-
NumberKeyboard(
56-
amount = amount,
57-
listener = object : NumberKeyboardListener {
58-
override fun onUpdated(data: NumberKeyboardData) {
59-
amountWithCurrency = data.currency
60-
amount = data.rawAmount
61-
}
62-
}
63-
)
64-
```
65-
66-
## [5.0.0] - Kotlin Multiplatform Version
67-
68-
### ✨ New Features
69-
70-
• Introduced NumberKeyboardFormat enum to control keypad layout:
71-
72-
```kotlin
73-
enum class NumberKeyboardFormat {
74-
Normal, // Standard ascending layout (like phone dial pad)
75-
Inverted, // Descending layout (like a calculator)
76-
Scrambled, // Shuffled once on composition
77-
AlwaysScrambled // Re-shuffles every tap (chaos, but secure chaos)
78-
}
79-
```
80-
81-
### ⚠️ Breaking Changes
82-
83-
- `isInverted: Boolean` is now deprecated
84-
One flag was never enough. Now you’ve got four layout options to rule them all. Replace
85-
86-
```kotlin
87-
isInverted = true
88-
```
89-
90-
with:
91-
92-
```kotlin
93-
format = NumberKeyboardFormat.Inverted
94-
```
95-
96-
**🧭 Migration Guide**
97-
98-
| Before | After |
99-
|--------------------|----------------------------------------|
100-
| isInverted = false | format = NumberKeyboardFormat.Normal |
101-
| isInverted = true | format = NumberKeyboardFormat.Inverted |
102-
103-
- `NumberKeyboard` is now a **stateless composable**.
104-
- Removed internal `remember` state for the input amount.
105-
- You **must** provide:
106-
- `amount: String`
107-
- `onAmountChange: (String) -> Unit`
108-
- Removed `initialAmount` attribute.
109-
- This enables external state management and improves integration with architectures like MVI,
110-
ViewModel, etc.
111-
112-
**Before:**
113-
114-
```kotlin
115-
NumberKeyboard() // internally remembered state
116-
```
117-
118-
**After:**
119-
120-
```kotlin
121-
var amount by remember { mutableStateOf("") }
122-
123-
NumberKeyboard(
124-
amount = amount,
125-
onAmountChange = { amount = it }
126-
)
127-
```
12845

12946
## [4.0.0] - Jetpack Compose Version
13047

0 commit comments

Comments
 (0)