togisoft / jetpack_compose_country_code_picker Goto Github PK
View Code? Open in Web Editor NEWJetpack Compose Country Code Picker
Home Page: https://github.com/jump-sdk/jetpack_compose_country_code_picker_emoji
License: Apache License 2.0
Jetpack Compose Country Code Picker
Home Page: https://github.com/jump-sdk/jetpack_compose_country_code_picker_emoji
License: Apache License 2.0
I really liked this library but in my latest project I need to use it as text field that have single line not rounded border. I am unable to add Single line like
`
TextField(
value = password.value,
colors = TextFieldDefaults.textFieldColors(
backgroundColor = Color.White,
focusedIndicatorColor = brc_green_color,
cursorColor = brc_green_color,
disabledPlaceholderColor = brc_green_color,
unfocusedIndicatorColor = brc_green_color
),
onValueChange = {
if (passwordErrorState.value) {
passwordErrorState.value = false
}
password.value = it
},
isError = passwordErrorState.value,
modifier = Modifier.fillMaxWidth(),
label = {
Text(text = "Enter Password*")
},
trailingIcon = {
IconButton(onClick = {
passwordVisibility.value = !passwordVisibility.value
}) {
}
},
visualTransformation = if (passwordVisibility.value) PasswordVisualTransformation() else VisualTransformation.None
)
`
I want to use exactly like above text-field. can anyone help?
Is there a way to get country code?
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
java.lang.NoSuchMethodError: No direct method (ZZLandroidx/compose/ui/window/SecureFlagPolicy;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V in class Landroidx/compose/ui/window/DialogProperties; or its super classes (declaration of 'androidx.compose.ui.window.DialogProperties' appears in /data/app/com.example.bikiya-9aKEJDChoFqll2l-k0MTTg==/base.apk)
at com.togitech.ccp.component.TogiCodePicker.TogiCodeDialog-9JTe1hw(TogiCodePicker.kt:98)
there is a problem with the dialog I think
It could be useful if I can have the capability of just getting the country code and for the textfield, I can create one of my own and also handle state on my own
Have you ever heard of SOLID? This library is a joke
would you please remove the default padding from the text field or will you give the option to change the default padding?
Please add night support to TextField .
add textfieldcolor parameter to TogiCountryCodePicker
A user may enter the hint number and the validity check fails.
In the default string.xml file https://github.com/togisoft/jetpack_compose_country_code_picker/blob/master/ccp/src/main/res/values/strings.xml at line no 222 and 232, extra word like amp is there and should be removed
And I am also adding Hindi translations file link if you consider
Hindi string.xml https://gist.github.com/kalactor/aa664632fd17e039ab04ed5117f158ed
Compose 1.3 is available. So is compose.material3 1.0.
https://developer.android.com/jetpack/androidx/releases/compose
https://developer.android.com/jetpack/androidx/releases/compose-material3
Is your feature request related to a problem? Please describe.
I'm not able to change the text color. It is black by default
Describe the solution you'd like
Any type of documentation would be helpful.
Describe alternatives you've considered
an option to change the textColorDefault, textColorError, textColorSuccess
Additional context
NIL
Is your feature request related to a problem? Please describe.
The text field and dialog use hardcoded some colors, font size, font family and padding. It would be great to provide more options to be able to customize those.
Describe the solution you'd like
More options to specify styling for various pieces of the UI.
Alternatively, each composable can be broken down into smaller composables more, so that we can pick and choose which ones we can use, or supply a child composable to be used. E.g. SearchTextField is private and there is no way to customize it at all, other than to copy the code for TogiCodeDialog and make the changes.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
when i click on the flag icon in the textfield my application crashes showing the error below:
java.lang.NoSuchMethodError: No direct method (ZZLandroidx/compose/ui/window/SecureFlagPolicy;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V in class Landroidx/compose/ui/window/DialogProperties; or its super classes (declaration of 'androidx.compose.ui.window.DialogProperties' appears in /data/data/com.scud.scuddriver/code_cache/.overlay/base.apk/classes15.dex)
Process: com.biblereadingcommunity.android, PID: 8039
java.util.NoSuchElementException: Collection contains no element matching the predicate.
at com.togitech.ccp.data.utils.TogiUtilsKt.getDefaultPhoneCode(TogiUtils.kt:42)
at com.biblereadingcommunity.android.loginAndRegister.LoginBRC$onCreate$1$2$phoneCode$2.invoke(LoginBRC.kt:239)
at com.biblereadingcommunity.android.loginAndRegister.LoginBRC$onCreate$1$2$phoneCode$2.invoke(LoginBRC.kt:239)
at androidx.compose.runtime.saveable.RememberSaveableKt.rememberSaveable(RememberSaveable.kt:87)
at com.biblereadingcommunity.android.loginAndRegister.LoginBRC$onCreate$1.invoke(LoginBRC.kt:239)
at com.biblereadingcommunity.android.loginAndRegister.LoginBRC$onCreate$1.invoke(LoginBRC.kt:184)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.ui.platform.ComposeView.Content(ComposeView.android.kt:402)
at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:248)
at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:247)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.ui.platform.CompositionLocalsKt.ProvideCommonCompositionLocals(CompositionLocals.kt:177)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:123)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:122)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.ProvideAndroidCompositionLocals(AndroidCompositionLocals.android.kt:114)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:157)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:156)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:156)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:140)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:74)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3186)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3176)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:252)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3176)
at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:3112)
at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:573)
2022-11-11 11:18:06.981 8039-8039 AndroidRuntime pid-8039 E at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:811)
at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:508)
at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:140)
at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131)
at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.android.kt:998)
at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.android.kt:131)
at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.android.kt:182)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:360)
at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:202)
at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:138)
at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131)
at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:1085)
at android.view.View.dispatchAttachedToWindow(View.java:17453)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3329)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3336)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3336)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3336)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3336)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1696)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1420)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6835)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:723)
at android.view.Choreographer.doFrame(Choreographer.java:658)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6626)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
App is crashing on this line...
var phoneCode by rememberSaveable { mutableStateOf(getDefaultPhoneCode(context)) }
@togisoft Hello. I found the one more problem and I can explain what's going on in this. The app will crash at the time of selecting the country whenever Someone is using material-3 in their project. I am using material-3 and the dialog will not open instated app will throw an exception. Please check on this and help me to fix this issue. This is the one of the most Helpful library for those who are using jetpack-compose and wanted to use country picker.
Crash-Logs.
ava.lang.NoSuchMethodError: No direct method (ZZLandroidx/compose/ui/window/SecureFlagPolicy;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V in class Landroidx/compose/ui/window/DialogProperties; or its super classes (declaration of 'androidx.compose.ui.window.DialogProperties' appears in /data/app/~~W3R3pVvbD-MhAj1UnTZmXw==/com.biblereadingcommunity.android-a9Mz9NlveUtxGFYZ-_W3Ug==/base.apk!classes2.dex)
com.togitech.ccp.component.TogiCodePicker.TogiCodeDialog-9JTe1hw(TogiCodePicker.kt:98)
com.togitech.ccp.component.TogiCodePicker$TogiCodeDialog$5.invoke(:23)
com.togitech.ccp.component.TogiCodePicker$TogiCodeDialog$5.invoke(:8)
androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:145)
androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2375)
androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2643)
androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3260)
androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3238)
androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(:1)
androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3238)
androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3203)
androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:771)
androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1031)
androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:125)
androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:534)
androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:503)
androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:34)
androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
android.view.Choreographer$CallbackRecord.run(Choreographer.java:970)
android.view.Choreographer.doCallbacks(Choreographer.java:796)
android.view.Choreographer.doFrame(Choreographer.java:727)
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
android.os.Handler.handleCallback(Handler.java:938)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loop(Looper.java:223)
android.app.ActivityThread.main(ActivityThread.java:7701)
java.lang.reflect.Method.invoke(Method.java:0)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I am sure it is happening because of material-3 and I can't remove material-3 from my project.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.