Coder Social home page Coder Social logo

joelkanyi / kompose-country-code-picker Goto Github PK

View Code? Open in Web Editor NEW
119.0 4.0 13.0 2.82 MB

Kompose Country Code Picker is a Jetpack Compose library based on Material 3 (M3) that provides a country code picker for Android apps.

Home Page: https://joelkanyi.github.io/kompose-country-code-picker/

License: Apache License 2.0

Kotlin 100.00%
android jetpack-compose material3 country-code-picker

kompose-country-code-picker's Introduction

Maven central Build status

Kompose Country Code Picker

Kompose Country Code Picker is a Jetpack Compose library based on Material 3 (M3) that provides a country code picker for Android apps.

See the project's website for documentation.

Preview

Picker Dialog Picker Only

License

Copyright 2023 Joel Kanyi

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

kompose-country-code-picker's People

Contributors

joelkanyi avatar lepresk avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

kompose-country-code-picker's Issues

Gradle Task Failure

Hi Joel,

I am now trying to use GitHub Actions to automate app upload to Google Play Store.

However, I am getting the below error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mapReleaseSourceSetPaths'.
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
   > Could not find com.github.JoelKanyi:KomposeCountryCodePicker:1.0.3.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/github/JoelKanyi/KomposeCountryCodePicker/1.0.3/KomposeCountryCodePicker-1.0.3.pom
       - https://repo.maven.apache.org/maven2/com/github/JoelKanyi/KomposeCountryCodePicker/1.0.3/KomposeCountryCodePicker-1.0.3.pom
       - https://jitpack.io/com/github/JoelKanyi/KomposeCountryCodePicker/1.0.3/KomposeCountryCodePicker-1.0.3.pom
     Required by:
         project :app
         project :app > project :feature:validator

My app is a multi-modular app.

I have set this repositories.

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }

    
}

And jitpack

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven {
           setUrl("https://jitpack.io")
        }
    }
}

What could I be missing

Set background color for CountrySelectionDialog

Hey, I plan to use the library in my project and I'd like to be able to set the background color for CountrySelectionDialog.

A proposal I have is to add a countrySelectionDialogModifier as a parameter to KomposeCountryCodePicker.

Let me know.

Thanks!

KomposeCountryCodePicker usage with a Material TextField

I want to design my own TextField ( see below mock-up) and then Incorpolate KomposeCountryCodePicker

When I purely use the picker I am able to call all functions and all Texts below are being populated realtime out of box. However, when I use my own TextField and call the same functions the functions are not updating the texts.

image

Is there any way out to update the texts on typing when integrating with a custom TextField

image

Build failed on jitpack

Hello, Thank you for the great library.

I think you need to fix your keys?

Currently experiencing an issue trying to build app with no gradle cache brings up:

   > Could not resolve com.github.JoelKanyi:KomposeCountryCodePicker:1.2.2.
     Required by:
         project :app > project :oparetaDesignLanguage
      > Could not resolve com.github.JoelKanyi:KomposeCountryCodePicker:1.2.2.
         > Could not get resource 'https://jitpack.io/com/github/JoelKanyi/KomposeCountryCodePicker/1.2.2/KomposeCountryCodePicker-1.2.2.pom'.
            > Could not GET 'https://jitpack.io/com/github/JoelKanyi/KomposeCountryCodePicker/1.2.2/KomposeCountryCodePicker-1.2.2.pom'.
               > Read timed out

Checking out: https://jitpack.io/com/github/JoelKanyi/KomposeCountryCodePicker/1.2.2/build.log

Build starting...
Start: Mon Jun 10 08:27:11 UTC 2024 bb7ac5d2fc23
Git:
1.2.2-0-g396af91
commit 396af91cd3922065641e8cefd28b8ddccb657b48
Merge: 47e4aad 720d9d5
Author: Joel Kanyi 
Date:   Sat Jun 8 21:00:32 2024 +0300

    Merge pull request #58 from joelkanyi/fix-preview

Init SDKMan
Running before_install command:
sdk install java 17.0.11-oracle;sdk use java 17.0.11-oracle;./scripts/prepareJitpackEnvironment.sh
�[1;33mWe periodically need to update the local cache. Please run:�[0m

  $ sdk update

�[1;36mBroadcasts discontinued. Please follow @sdkman_ on Twitter for announcements.�[0m

Downloading: java 17.0.11-oracle

In progress...


                                                                           0.0%
###                                                                        4.6%
#######                                                                   10.8%
############                                                              17.0%
################                                                          23.0%
####################                                                      29.1%
#########################                                                 35.2%
#############################                                             41.3%
#################################                                         47.1%
#####################################                                     52.7%
#########################################                                 57.9%
#############################################                             62.7%
################################################                          67.0%
##################################################                        70.5%
####################################################                      73.3%
######################################################                    75.5%
#######################################################                   77.5%
##########################################################                81.1%
#############################################################             85.4%
################################################################          90.0%
####################################################################      94.7%
#######################################################################   99.2%
######################################################################## 100.0%

Repackaging Java 17.0.11-oracle...

Done repackaging...

�[1;32mInstalling: java 17.0.11-oracle�[0m
�[1;32mDone installing!�[0m


�[1;32mSetting java 17.0.11-oracle as default.�[0m
�[1;33mWe periodically need to update the local cache. Please run:�[0m

  $ sdk update


�[1;32mUsing java version 17.0.11-oracle in this shell.�[0m
/script/buildit.sh: line 60: ./scripts/prepareJitpackEnvironment.sh: No such file or directory
Found gradle
Gradle build script
Found gradle version: 8.8.
Using gradle wrapper
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Downloading https://services.gradle.org/distributions/gradle-8.8-bin.zip
.10%.20%.30%.40%.50%.60%.70%.80%.90%.100%

------------------------------------------------------------
Gradle 8.8
------------------------------------------------------------

Build time:   2024-05-31 21:46:56 UTC
Revision:     4bd1b3d3fc3f31db5a26eecb416a165b8cc36082

Kotlin:       1.9.22
Groovy:       3.0.21
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          17.0.11 (Oracle Corporation 17.0.11+7-LTS-207)
OS:           Linux 4.10.0-28-generic amd64

0m4.188s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
java version "17.0.11" 2024-04-16 LTS
Java(TM) SE Runtime Environment (build 17.0.11+7-LTS-207)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.11+7-LTS-207, mixed mode, sharing)
Getting tasks: ./gradlew tasks --all
Tasks: publishToMavenLocal,
Running: ./gradlew clean -Pgroup=com.github.JoelKanyi -Pversion=1.2.2 -xtest -xlint assemble publishToMavenLocal
Type-safe project accessors is an incubating feature.
Checking the license for package Android SDK Build-Tools 34 in /opt/android-sdk-linux/licenses
License for package Android SDK Build-Tools 34 accepted.
Preparing "Install Android SDK Build-Tools 34 v.34.0.0".
"Install Android SDK Build-Tools 34 v.34.0.0" ready.
Installing Android SDK Build-Tools 34 in /opt/android-sdk-linux/build-tools/34.0.0
"Install Android SDK Build-Tools 34 v.34.0.0" complete.
"Install Android SDK Build-Tools 34 v.34.0.0" finished.
Checking the license for package Android SDK Platform 34 in /opt/android-sdk-linux/licenses
License for package Android SDK Platform 34 accepted.
Preparing "Install Android SDK Platform 34 (revision 3)".
"Install Android SDK Platform 34 (revision 3)" ready.
Installing Android SDK Platform 34 in /opt/android-sdk-linux/platforms/android-34
"Install Android SDK Platform 34 (revision 3)" complete.
"Install Android SDK Platform 34 (revision 3)" finished.
> Task :clean
> Task :app:clean
> Task :komposecountrycodepicker:clean
> Task :assemble UP-TO-DATE
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :app:checkKotlinGradlePluginConfigurationErrors
> Task :komposecountrycodepicker:preBuild UP-TO-DATE
> Task :komposecountrycodepicker:preDebugBuild UP-TO-DATE
> Task :komposecountrycodepicker:writeDebugAarMetadata
> Task :app:generateDebugResValues
> Task :komposecountrycodepicker:generateDebugResValues
> Task :app:checkDebugAarMetadata
> Task :komposecountrycodepicker:generateDebugResources
> Task :komposecountrycodepicker:packageDebugResources
> Task :app:mapDebugSourceSetPaths
> Task :app:generateDebugResources
> Task :app:packageDebugResources
> Task :app:mergeDebugResources
> Task :app:createDebugCompatibleScreenManifests
> Task :app:extractDeepLinksDebug
> Task :komposecountrycodepicker:extractDeepLinksDebug
> Task :app:parseDebugLocalResources
> Task :komposecountrycodepicker:processDebugManifest
> Task :komposecountrycodepicker:compileDebugLibraryResources
> Task :app:processDebugMainManifest
> Task :app:processDebugManifest
> Task :app:processDebugManifestForPackage
> Task :komposecountrycodepicker:checkKotlinGradlePluginConfigurationErrors
> Task :komposecountrycodepicker:javaPreCompileDebug
> Task :app:javaPreCompileDebug
> Task :app:mergeDebugShaders
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :komposecountrycodepicker:parseDebugLocalResources
> Task :komposecountrycodepicker:mergeDebugShaders
> Task :komposecountrycodepicker:compileDebugShaders NO-SOURCE
> Task :komposecountrycodepicker:generateDebugAssets UP-TO-DATE
> Task :komposecountrycodepicker:packageDebugAssets
> Task :komposecountrycodepicker:generateDebugRFile
> Task :app:mergeDebugAssets
> Task :app:processDebugResources
> Task :app:compressDebugAssets
> Task :app:checkDebugDuplicateClasses
> Task :app:desugarDebugFileDependencies
> Task :app:mergeDebugStartupProfile
> Task :komposecountrycodepicker:compileDebugKotlin
w: file:///home/jitpack/build/komposecountrycodepicker/src/main/java/com/joelkanyi/jcomposecountrycodepicker/component/KomposeCountryCodePicker.kt:228:46 Unchecked cast: Any to List<String>

> Task :app:mergeExtDexDebug
> Task :komposecountrycodepicker:compileDebugJavaWithJavac NO-SOURCE
> Task :komposecountrycodepicker:processDebugJavaRes
> Task :komposecountrycodepicker:bundleLibCompileToJarDebug
> Task :app:mergeDebugJniLibFolders
> Task :komposecountrycodepicker:bundleLibRuntimeToJarDebug
> Task :komposecountrycodepicker:mergeDebugJniLibFolders
> Task :komposecountrycodepicker:mergeDebugNativeLibs NO-SOURCE
> Task :komposecountrycodepicker:copyDebugJniLibsProjectOnly
> Task :app:validateSigningDebug
> Task :app:mergeLibDexDebug
> Task :app:mergeDebugNativeLibs NO-SOURCE
> Task :app:stripDebugDebugSymbols NO-SOURCE
> Task :app:writeDebugAppMetadata
> Task :app:writeDebugSigningConfigVersions
> Task :app:buildKotlinToolingMetadata
> Task :app:preReleaseBuild UP-TO-DATE
> Task :komposecountrycodepicker:preReleaseBuild UP-TO-DATE
> Task :komposecountrycodepicker:writeReleaseAarMetadata
> Task :app:generateReleaseResValues
> Task :komposecountrycodepicker:generateReleaseResValues
> Task :app:checkReleaseAarMetadata
> Task :komposecountrycodepicker:generateReleaseResources
> Task :komposecountrycodepicker:packageReleaseResources
> Task :app:mapReleaseSourceSetPaths
> Task :app:generateReleaseResources
> Task :app:packageReleaseResources
> Task :app:createReleaseCompatibleScreenManifests
> Task :app:extractDeepLinksRelease
> Task :komposecountrycodepicker:extractDeepLinksRelease
> Task :app:parseReleaseLocalResources
> Task :komposecountrycodepicker:processReleaseManifest
> Task :app:javaPreCompileRelease
> Task :komposecountrycodepicker:javaPreCompileRelease
> Task :app:processReleaseMainManifest
> Task :komposecountrycodepicker:parseReleaseLocalResources
> Task :app:processReleaseManifest
> Task :app:extractProguardFiles
> Task :komposecountrycodepicker:generateReleaseRFile
> Task :komposecountrycodepicker:extractProguardFiles
> Task :app:mergeReleaseResources
> Task :komposecountrycodepicker:prepareLintJarForPublish
> Task :komposecountrycodepicker:mergeReleaseJniLibFolders
> Task :komposecountrycodepicker:mergeReleaseNativeLibs NO-SOURCE
> Task :komposecountrycodepicker:stripReleaseDebugSymbols NO-SOURCE
> Task :komposecountrycodepicker:extractDeepLinksForAarRelease
> Task :komposecountrycodepicker:copyReleaseJniLibsProjectAndLocalJars
> Task :komposecountrycodepicker:mergeReleaseShaders
> Task :komposecountrycodepicker:compileReleaseShaders NO-SOURCE
> Task :app:processReleaseManifestForPackage
> Task :komposecountrycodepicker:generateReleaseAssets UP-TO-DATE
> Task :komposecountrycodepicker:packageReleaseAssets
> Task :komposecountrycodepicker:prepareReleaseArtProfile
> Task :komposecountrycodepicker:writeReleaseLintModelMetadata
> Task :app:mergeReleaseJniLibFolders
> Task :komposecountrycodepicker:copyReleaseJniLibsProjectOnly
> Task :komposecountrycodepicker:compileReleaseLibraryResources
> Task :app:checkReleaseDuplicateClasses

> Task :app:compileDebugKotlin
w: file:///home/jitpack/build/app/src/main/java/com/joelkanyi/jcomposecountrycodepicker/MainActivity.kt:61:42 'rememberSystemUiController(Window? = ...): SystemUiController' is deprecated. 
accompanist/systemuicontroller is deprecated and the API is no longer maintained. 
We recommend going edge to edge using EdgeToEdge.enableEdgeToEdge in androidx.activity. 
For more information please visit https://google.github.io/accompanist/systemuicontroller


> Task :app:compileDebugJavaWithJavac NO-SOURCE
> Task :app:processDebugJavaRes
> Task :app:processReleaseResources
> Task :app:dexBuilderDebug
> Task :app:mergeReleaseNativeLibs NO-SOURCE
> Task :app:stripReleaseDebugSymbols NO-SOURCE
> Task :app:extractReleaseNativeSymbolTables NO-SOURCE
> Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE
> Task :app:mergeProjectDexDebug
> Task :app:desugarReleaseFileDependencies
> Task :app:mergeReleaseStartupProfile
> Task :app:mergeDebugJavaResource

> Task :komposecountrycodepicker:compileReleaseKotlin
w: file:///home/jitpack/build/komposecountrycodepicker/src/main/java/com/joelkanyi/jcomposecountrycodepicker/component/KomposeCountryCodePicker.kt:228:46 Unchecked cast: Any to List<String>

> Task :komposecountrycodepicker:compileReleaseJavaWithJavac NO-SOURCE
> Task :komposecountrycodepicker:bundleLibCompileToJarRelease
> Task :komposecountrycodepicker:bundleLibRuntimeToJarRelease
> Task :komposecountrycodepicker:processReleaseJavaRes
> Task :komposecountrycodepicker:createFullJarRelease

> Task :komposecountrycodepicker:generateReleaseLintModel
Generating lint files for backported methods only (compile API B)

> Task :app:compileReleaseKotlin
w: file:///home/jitpack/build/app/src/main/java/com/joelkanyi/jcomposecountrycodepicker/MainActivity.kt:61:42 'rememberSystemUiController(Window? = ...): SystemUiController' is deprecated. 
accompanist/systemuicontroller is deprecated and the API is no longer maintained. 
We recommend going edge to edge using EdgeToEdge.enableEdgeToEdge in androidx.activity. 
For more information please visit https://google.github.io/accompanist/systemuicontroller


> Task :app:mergeExtDexRelease
> Task :komposecountrycodepicker:extractReleaseAnnotations
> Task :app:compileReleaseJavaWithJavac NO-SOURCE
> Task :app:generateReleaseLintVitalReportModel
> Task :komposecountrycodepicker:mergeReleaseGeneratedProguardFiles
> Task :komposecountrycodepicker:mergeReleaseConsumerProguardFiles
> Task :komposecountrycodepicker:mergeReleaseJavaResource
> Task :komposecountrycodepicker:syncReleaseLibJars
> Task :komposecountrycodepicker:bundleReleaseLocalLintAar
> Task :app:packageDebug
> Task :app:createDebugApkListingFileRedirect
> Task :app:assembleDebug
> Task :komposecountrycodepicker:generateReleaseLintVitalModel
> Task :app:dexBuilderRelease
> Task :app:mergeReleaseArtProfile
> Task :app:mergeReleaseShaders
> Task :app:compileReleaseShaders NO-SOURCE
> Task :app:generateReleaseAssets UP-TO-DATE
> Task :app:mergeReleaseGlobalSynthetics
> Task :app:mergeReleaseAssets
> Task :app:compressReleaseAssets
> Task :app:extractReleaseVersionControlInfo
> Task :app:processReleaseJavaRes
> Task :app:collectReleaseDependencies
> Task :app:optimizeReleaseResources
> Task :app:sdkReleaseDependencyData
> Task :app:writeReleaseAppMetadata
> Task :app:writeReleaseSigningConfigVersions
> Task :komposecountrycodepicker:stripDebugDebugSymbols NO-SOURCE
> Task :komposecountrycodepicker:copyDebugJniLibsProjectAndLocalJars
> Task :komposecountrycodepicker:extractDebugAnnotations
> Task :komposecountrycodepicker:extractDeepLinksForAarDebug
> Task :komposecountrycodepicker:mergeDebugGeneratedProguardFiles
> Task :komposecountrycodepicker:mergeDebugConsumerProguardFiles
> Task :komposecountrycodepicker:prepareDebugArtProfile
> Task :komposecountrycodepicker:mergeDebugJavaResource
> Task :komposecountrycodepicker:bundleReleaseAar
> Task :komposecountrycodepicker:syncDebugLibJars
> Task :komposecountrycodepicker:bundleDebugAar
> Task :komposecountrycodepicker:assembleDebug
> Task :komposecountrycodepicker:mapReleaseSourceSetPaths
> Task :app:mergeReleaseJavaResource
> Task :komposecountrycodepicker:mergeReleaseResources
> Task :komposecountrycodepicker:verifyReleaseResources
> Task :app:mergeDexRelease
> Task :komposecountrycodepicker:assembleRelease
> Task :komposecountrycodepicker:sourceReleaseJar
> Task :komposecountrycodepicker:generatePomFileForMavenPublication
> Task :app:compileReleaseArtProfile
> Task :komposecountrycodepicker:lintVitalAnalyzeRelease
> Task :app:packageRelease
> Task :app:createReleaseApkListingFileRedirect

> Task :komposecountrycodepicker:javaDocReleaseGeneration
Initializing plugins
Dokka is performing: documentation for :komposecountrycodepicker
Validity check
Creating documentation models

> Task :app:lintVitalAnalyzeRelease
> Task :app:lintVitalReportRelease
> Task :app:lintVitalRelease
> Task :app:assembleRelease
> Task :app:assemble

> Task :komposecountrycodepicker:javaDocReleaseGeneration
Transforming documentation model before merging
Merging documentation models
Transforming documentation model after merging
Creating pages
Transforming pages
Rendering


> Task :komposecountrycodepicker:javaDocReleaseJar
> Task :komposecountrycodepicker:generateMetadataFileForMavenPublication
> Task :komposecountrycodepicker:signMavenPublication FAILED
153 actionable tasks: 153 executed
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':komposecountrycodepicker:signMavenPublication'.
> Cannot perform signing task ':komposecountrycodepicker:signMavenPublication' because it has no configured signatory

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 1m 44s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Archive: io.github.joelkanyi:komposecountrycodepicker:1.2.2
Publication: io.github.joelkanyi:komposecountrycodepicker:1.2.2
Build tool exit code: 0
Looking for artifacts...
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Looking for pom.xml in build directory and ~/.m2
[Fatal Error] lint-resources.xml:1:1: Content is not allowed in prolog.
[Fatal Error] lint-resources.xml:1:1: Content is not allowed in prolog.
Found artifact: io.github.joelkanyi:komposecountrycodepicker:1.2.2
Found artifact: io.github.joelkanyi:komposecountrycodepicker:1.2.2
2024-06-10T08:30:39.696586686Z
Exit code: 0

⚠️ ERROR: No build artifacts found
Expected artifacts in: $HOME/.m2/repository/io/github/joelkanyi/komposecountrycodepicker/1.2.2

IllegalStateException with OffsetMapping.transformedToOriginal in KomposeCountryCodePicker

I encountered an issue while using the KomposeCountryCodePicker in my application. When I try to input a more than 8-digit into the field, the application throws an IllegalStateException with the following message:

This error seems to occur due to an invalid mapping being returned by the OffsetMapping.transformedToOriginal method. It appears that the method is trying to map the offset 0 from the transformed text to -1 in the original text, which is not a valid offset.

Steps to reproduce:

  1. Open the application.
  2. Navigate to the screen with the KomposeCountryCodePicker.
  3. Try to input a 10-digit phone number into the field.

Expected behavior:
The application should allow the user to input a 10-digit phone number without any issues.

Actual behavior:
The application throws an IllegalStateException when the user tries to input a 10-digit phone number.

I am using the following environment:

  • macOS
  • Android Studio Jellyfish | 2023.3.1 Patch 1
  • Kotlin
  • KomposeCountryCodePicker v1.2.4
  • Compose UI v1.6.8

I would appreciate any help in resolving this issue. Thank you.

Airplane mode issue

Description:
When airplane mode is enabled on the device, the app crashes because it is unable to get the country code from the SIM card. The KomposeCountryCodePicker component does not have a default country code set, so it throws a NoSuchElementException when it tries to get the country code from the empty SIM card data.

Steps to reproduce:
Enable airplane mode on the device.
Open the app and navigate to the screen where the KomposeCountryCodePicker component is used.

Expected behavior:
The app should not crash when airplane mode is enabled. The KomposeCountryCodePicker component should either set a default country code or handle the case where there is no SIM card data available.

Actual behavior:
The app crashes with a NoSuchElementException.

Device info:
Google Pixel 2XL api level 30

Exception code:

             java.util.NoSuchElementException: Collection contains no element matching the predicate.
             	at com.joelkanyi.jcomposecountrycodepicker.component.KomposeCountryCodePickerKt$KomposeCountryCodePicker$2.invoke(KomposeCountryCodePicker.kt:297)
             	at com.joelkanyi.jcomposecountrycodepicker.component.KomposeCountryCodePickerKt$KomposeCountryCodePicker$2.invoke(KomposeCountryCodePicker.kt:98)
             	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:108)
             	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
             	at androidx.compose.material3.SurfaceKt$Surface$1.invoke(Surface.kt:132)
             	at androidx.compose.material3.SurfaceKt$Surface$1.invoke(Surface.kt:114)
             	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:108)
             	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
             	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
             	at androidx.compose.material3.SurfaceKt.Surface-T9BRK9s(Surface.kt:111)

Format phone number

How I can get Formatted phone number to show it in my app the format it change by country

Set phone number

if I get number when user signup the user go to settings screen to edit phone number i show set the number in KomposeCountryCodePicker how can i change country code and show number next to country code ?

i cant save the country code in my app because the user number come form backend like this +905555555555 user can signup from web or ios, before use compose UI in xml i used library do it now i cant find library in compose UI your library is the best but need some fixes .

also can u add textStyle to use our text style in the TextField

Thank you

set/change default country code

Is your feature request related to a problem? Please describe.
as Indian i want to set default country code +91 but there is no option available for this

Describe the solution you'd like
i want to pass parameter as default country

automated dependency updates dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/build.yml
  • actions/checkout v4
  • gradle/wrapper-validation-action v3
  • actions/setup-java v4
  • actions/checkout v4
  • gradle/wrapper-validation-action v3
  • actions/setup-java v4
  • actions/checkout v4
  • gradle/wrapper-validation-action v3
  • actions/setup-java v4
  • actions/checkout v4
  • gradle/wrapper-validation-action v3
  • actions/setup-java v4
.github/workflows/publish-docs.yml
  • actions/checkout v4
  • actions/setup-java v4
  • actions/setup-python v5
  • actions/configure-pages v5
  • gradle/actions v4
  • actions/upload-pages-artifact v3
  • actions/deploy-pages v4
.github/workflows/publish.yml
  • actions/checkout v4
  • actions/setup-java v4
  • gradle/gradle-build-action v3
gradle
gradle.properties
settings.gradle.kts
build.gradle.kts
  • io.nlopez.compose.rules:ktlint 0.4.10
app/build.gradle.kts
gradle/libs.versions.toml
  • com.google.accompanist:accompanist-systemuicontroller 0.34.0
  • androidx.activity:activity-compose 1.9.1
  • com.googlecode.libphonenumber:libphonenumber 8.13.44
  • androidx.compose.material3:material3 1.2.1
  • androidx.core:core-ktx 1.13.1
  • junit:junit 4.13.2
  • androidx.compose.ui:ui 1.6.8
  • androidx.compose.ui:ui-test-junit4 1.6.8
  • androidx.compose.ui:ui-tooling 1.6.8
  • androidx.compose.ui:ui-tooling-preview 1.6.8
  • androidx.test.ext:junit 1.2.1
  • com.google.truth:truth 1.4.3
  • com.android.application 8.5.2
  • com.android.library 8.5.2
  • org.jetbrains.kotlin.android 1.9.24
  • com.diffplug.spotless 6.25.0
  • org.jetbrains.kotlinx.binary-compatibility-validator 0.16.3
  • org.jetbrains.dokka 1.9.20
  • com.vanniktech.maven.publish 0.29.0
  • com.gradleup.nmcp 0.0.9
komposecountrycodepicker/gradle.properties
komposecountrycodepicker/build.gradle.kts
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.10

  • Check this box to trigger a request for Renovate to run again on this repository

LocalSoftwareKeyboardController Crash

I am using Material 3 Version 1.2.0-alpha07 and Compose UI Version 1.5.1 and I am getting this log crash while trying out KomposeCountryCodePicker.

java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/compose/ui/platform/LocalSoftwareKeyboardController;
at com.joelkanyi.jcomposecountrycodepicker.component.KomposeCountryCodePickerKt.KomposeCountryCodePicker(KomposeCountryCodePicker.kt:74)

Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.compose.ui.platform.LocalSoftwareKeyboardController" on path: DexPathList[[dex file

There is a similar issue that I saw on this unrelated bug report.

When I downgraded MD to 1.1.1 the code did not crash but crucial material three colors could not be resolved e.g. MaterialTheme.colorScheme.surfaceContainerLowest.

I also tried using Integration with TextField but the code still crashed.

Any leads on how to avert this crash will greatly be appreciated.

TODOs

/**

  • TODO: Fix the search functionality.
  • TODO: Fix phone number validation for some countries like UK.
    */

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.