Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[Unreleased]
[0.2] - 2024-12-01
๐ Major Updates
This release focuses on fixing critical bugs, improving compatibility with the latest Android ecosystem, and enhancing code quality.
โจ Added
- Comprehensive ProGuard/R8 Rules: Added consumer-rules.pro to ensure library works correctly in release builds with minification enabled (#16)
- Input Validation: Added validation to all public APIs with clear error messages for invalid parameters
- KDoc Documentation: Added comprehensive API documentation with usage examples for all public composables
- Error Handling: Improved error handling in CCPUtils and CCPValidator with graceful fallbacks
- SecurityException handling when READ_PHONE_STATE permission is missing
- Fallback to device locale when TelephonyManager fails
- Validation for invalid ISO codes in getEmojiFlag()
- Backward Compatible String Support: Restored ability to pass direct strings to PickerCustomization alongside string resources
- Optional Context Parameter: Made Context parameter optional in searchCountry() and findCountry() methods
- Phone Number Search: Enhanced search functionality to find countries from phone numbers (e.g., โ+12125551234โ finds USA)
- 19 Language Localization: Added translations for country names in 19 languages
๐ Fixed
- Issue #1: Fixed NoSuchMethodError with rememberModalBottomSheetState in multi-module architectures
- Issue #2: Fixed critical VisualTransformation crashes:
- ArrayIndexOutOfBoundsException when clearing text
- IllegalStateException with invalid offset mappings
- Crashes when typing long phone numbers
- Issue #3: Fixed BottomSheet API compatibility with Compose BOM 2024.08.00+
โฌ๏ธ Updated
- Kotlin: 1.9.0 โ 2.1.0 (major version update)
- Compose BOM: 2024.05.00 โ 2024.12.01 (latest stable)
- Core KTX: 1.13.1 โ 1.15.0
- Lifecycle Runtime: 2.7.0 โ 2.8.7
- Activity Compose: 1.9.0 โ 1.9.3
- JUnit: 1.1.5 โ 1.2.1
- Espresso: 3.5.1 โ 3.6.1
- Compile SDK: 34 โ 35
- Target SDK: 34 โ 35
๐ง Changed
- Compose Compiler Plugin: Migrated from composeOptions.kotlinCompilerExtensionVersion to new Kotlin Compose Compiler plugin (required for Kotlin 2.0+)
- BottomSheet API: Updated rememberModalBottomSheetState() usage for compatibility with latest Material 3
- Offset Mapping: Completely rewrote VisualTransformation offset mapping logic for better stability
๐๏ธ Removed
- Unused Log import from CCPTransformer
- Redundant getSelectedCountries() function that just returned input
- Deprecated composeOptions block (no longer needed with Kotlin 2.0+)
๐งน Code Quality
- Added input validation with meaningful error messages
- Improved null safety throughout the codebase
- Better error handling with specific exception catches
- Cleaned up unused code and imports
- Enhanced documentation with KDoc comments
๐ Documentation
- Added comprehensive KDoc to all public APIs
- Created CHANGELOG.md following Keep a Changelog format
- Improved inline code comments
- Added usage examples in documentation
โ ๏ธ Breaking Changes
None - This release maintains backward compatibility. All API changes are additive or internal improvements.
๐ Migration Guide
If upgrading from 0.1.x:
- Update Kotlin version to 2.0+ in your project
- Add Compose Compiler plugin if not already present:
plugins {
id("org.jetbrains.kotlin.plugin.compose") version "2.1.0"
}
- Use Compose BOM 2024.08.00 or later for best compatibility
- No code changes needed - Your existing implementation will work as-is
๐ฆ Minimum Requirements
- Minimum SDK: 24 (unchanged)
- Target SDK: 35 (updated from 34)
- Kotlin: 2.0+ (updated from 1.9.0)
- Compose BOM: 2024.08.00+ (updated from 2024.05.00)
๐ Acknowledgments
- Thanks to @Sparks1998 for the comprehensive localization PR
- Thanks to all users who reported issues and provided feedback
How to Update
Update your dependency in build.gradle.kts:
dependencies {
implementation("com.github.ahmmedrejowan:CountryCodePickerCompose:0.2")
}