New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CurrencyEditText setSelection problem #53
Comments
The cursor should automatically force itself to the rightmost position by
default, so you shouldn't have to call set selection. What behavior are you
seeing?
…On Wed, Apr 17, 2019, 11:24 AM Yunus Emre Uluçay ***@***.***> wrote:
Hi, I am trying to place the cursor rightmost position at the first focus.
I get the content length correctly and call setSelection method. But
doesn't work for me.
binding.cet.setSelection(binding.cet.getText().length()); // I call it on
focus
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#53>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AE_54XXsOTX0SJ7liZJ-ODy6WxZvR9Frks5vhzzKgaJpZM4c1VOr>
.
|
First of all, thank you for your fast response. I aligned the text to the right position. And when I touch the input, the cursor is placed onto the 0 position (leftmost) and value changes different. Let me explain;
|
Can you include the code you're using to set up the view? Something seems
like it's not being initialized correctly. That's not how the view should
be working
…On Wed, Apr 17, 2019, 11:39 AM Yunus Emre Uluçay ***@***.***> wrote:
First of all, thank you for your fast response. I aligned the text to the
right position. And when I touch the input, the cursor is placed onto the 0
position (leftmost) and value changes different. Let me explain;
I will text 1,2,3. and it is expected to be $1.23 but,
- $|0.00 (content aligned to right) I touched and cursor on the 0
position
- $|10.00 here, cursor goes rightmost automatically $10.00|
- $100.02|
- $1000.23 final result.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#53 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE_54VUYZt9DvlI6DSfEWTE2YLAfjTu-ks5vh0BNgaJpZM4c1VOr>
.
|
I think, it works very well except one thing. The content text of the input is aligned left by default. So, when you touch (focus) to the input, the cursor takes place at the rightmost position by default. And after all changes, the input re-place the cursor to the end everytime. But only exception is, when you set gravity=end, it aligns the content text to the end of the input. And, when you touch (focus) the input, it places the cursor the the head. <com.blackcat.currencyedittext.CurrencyEditText |
Aha! So yes, that's a bug then. No eta if/when I'll be able to get to it.
I'm able to help support the library via email but it's been admittedly too
long since I've had time to work on the code itself.
If you can come up with a solution that doesn't change the behavior when
gravity is not involved, please feel free to submit a PR.
…On Wed, Apr 17, 2019, 11:50 AM Yunus Emre Uluçay ***@***.***> wrote:
I think, it works very well except one thing. The content text of the
input is aligned left by default. So, when you touch (focus) to the input,
the cursor takes place at the rightmost position by default. And after all
changes, the input re-place the cursor to the end everytime. But only
exception is, when you set gravity=end, it aligns the content text to the
end of the input. And, when you touch (focus) the input, it places the
cursor the the head.
I mean, you should align the cursor to the rightmost when the first focus.
<com.blackcat.currencyedittext.CurrencyEditText
android:id="@+id/ceCharge"
***@***.***/EditTextStyle"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="end" !!!! *HERE aligns content text to the end (this is
what I need)*
android:inputType="numberDecimal"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:textSize="20sp" />
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#53 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE_54a5SCVIPAXYLbI2s9Z_fqEQ0dypOks5vh0LVgaJpZM4c1VOr>
.
|
Hi, I am trying to place the cursor rightmost position at the first focus. I get the content length correctly and call setSelection method. But doesn't work for me.
binding.cet.setSelection(binding.cet.getText().length()); // I call it on focus
The text was updated successfully, but these errors were encountered: