Minimalistic-Apps / price-converter

Minimalistic price converter that allows you to convert prices of fiat shitcoins easily. It uses Bitcoin as the base currency.
MIT License
17 stars 2 forks source link

Enable editation of the input #34

Closed hank-milliken closed 2 years ago

hank-milliken commented 2 years ago
hafizsaadiftikhar commented 2 years ago

There is an issue in this because when we select the input field. Its focuses on that field. Whole text selection works when the input field is focused in. And the callback of "onFoucsChanged" trigger only when focusing out if already focused in. more than one-time focus doesn't trigger the "onFocusChanged". There is only one possibility at this time either the selectable feature or the edit feature.

I tried another way but it's another issue may occur. You can test with this apk. If you agree with this, I'll add this in this way. Sometimes, the issue occurs, and sometimes not. Please download the apk using this link

https://drive.google.com/file/d/17ys5oVgSJjEj3lzf1LDP6Nd9-QFzJkFy/view?usp=sharing

hank-milliken commented 2 years ago

Hi, I have check the original app and it works there. Can you please use implementation from there?

hank-milliken commented 2 years ago

If I see it correctly it is achvied by setting .setSelectAllOnFocus(true); on the EditText

hafizsaadiftikhar commented 2 years ago

There is no EditText in Jetpack Compose. Please don't consider simple kotlin with xml. I tried the same behavior in Jetpack Compose but the problem is the same that I mentioned earlier

hank-milliken commented 2 years ago

Hmm Understood. I have played around with the code. Can you please share the code what you have done for the provided APK?

hank-milliken commented 2 years ago

I have played a little bit with the code I this is working for me

https://github.com/Minimalistic-Apps/price-converter/pull/42/commits/7735cbdcbcb6531bf521ac2d7bea4d3c674f3d92 (Second commit in the https://github.com/Minimalistic-Apps/price-converter/pull/42 PR)

I have commented out the BTC formatting logic, to make it easier to demonstrate the functionality.

hank-milliken commented 2 years ago

An after I have implemented it I have found this solution that seems to work even better https://stackoverflow.com/a/72504219

hank-milliken commented 2 years ago

I have tested it here, and it seems it works: https://github.com/Minimalistic-Apps/price-converter/pull/42/commits/01ae2e5bb23872f9c4a0cd5211716273adddf21e

hafizsaadiftikhar commented 2 years ago

How do you want to receive the code for this apk, Please let me know?

And please join Jira. It would be easy for us to communicate there on each ticket

Because I wanna do a discussion on other points too.

hank-milliken commented 2 years ago

@hafizsaadiftikhar yes I am in jira, I have mentioned you in the relevant issue