Skip to content

5.0.0

Choose a tag to compare

@davidmigloz davidmigloz released this 15 Jul 20:49
· 6 commits to master since this release
6d0aff0

✨ New Features

• Introduced NumberKeyboardFormat enum to control keypad layout:

enum class NumberKeyboardFormat {
    Normal,         // Standard ascending layout (like phone dial pad)
    Inverted,       // Descending layout (like a calculator)
    Scrambled,      // Shuffled once on composition
    AlwaysScrambled // Re-shuffles every tap (chaos, but secure chaos)
}

⚠️ Breaking Changes

  • isInverted: Boolean is now deprecated
    One flag was never enough. Now you’ve got four layout options to rule them all. Replace
isInverted = true

with:

format = NumberKeyboardFormat.Inverted

🧭 Migration Guide

Before After
isInverted = false format = NumberKeyboardFormat.Normal
isInverted = true format = NumberKeyboardFormat.Inverted
  • NumberKeyboard is now a stateless composable.
    • Removed internal remember state for the input amount.
    • You must provide:
      • amount: String
      • onAmountChange: (String) -> Unit
    • Removed initialAmount attribute.
    • This enables external state management and improves integration with architectures like MVI,
      ViewModel, etc.

Before:

NumberKeyboard() // internally remembered state

After:

var amount by remember { mutableStateOf("") }

NumberKeyboard(
    amount = amount,
    onAmountChange = { amount = it }
)