B4A Library [Lib] Masked EditText

This EditText fixes a few issues with the standard EditText and adds new features:
- Filter: you can transform any input before the text is changed;
- Mask: you can define an input mask;
- Read-only: you can protect your EditText against changes;
- Floating hint: the hint moves above the EditText when the user starts typing;
- Error popup: you can display a message in a popup to warn the user:

met.png


v1.1:
- It is now a custom view supported by the designer
- I fixed a bug when Format was set after WithSuggestions

v1.2:
- I moved the CompactText function from the example to the library;
- I fixed a bug with SelectionStart;
- I fixed a bug when InputType is set to NONE.

v1.3:
- WithSuggestions works now as expected on Samsung devices.
- Suggestions are automatically disabled in password mode.

v1.4:
- I added the EnableFloatingHint function;
- I added the custom view properties for the designer.

v1.41:
- I improved the animation of the floating hint;
- I fixed an issue with the hint color.

v1.42:
- I fixed a bug with the floating hint when the EditText is moved.

v1.5:
- I rewrote the code of floating hints to make it more robust and fix a few issues;
- I added the SetFromHTML function.

v1.51:
- A few properties set in the designer were not taken into account.

v1.52:
- There was an issue with the background drawable as it was set by default by the designer to a white colored drawable. The support of this property in the designer was removed to keep the original default background.

This library does not work with Android versions < 2.
 

Attachments

  • MaskedEditText v1.52.zip
    24.9 KB · Views: 1,808
  • Java source - MaskedEditText.zip
    9.2 KB · Views: 429
  • MaskedEditText v1.53.zip
    25.2 KB · Views: 750
Last edited:

Guenter Becker

Active Member
Licensed User
thank you will mention it in the future.
 

RVP

Active Member
Licensed User
I have run into an issue with this library. I have an app I wrote for a client a couple of years ago, recently they installed it on a phone with a lower resolution that what they had been using and discovered a display issue with some fields. One was using Another Date Picker it was resolved here (https://www.b4x.com/android/forum/threads/problem-with-anotherdatepicker.112921/#post-704920 ) In Post #14.

The second was Masked Edit Text Fields.

In this case I seem to have tracked the issue down to the field ignoring the Padding parameter. I have attached a sample program that shows the issue. My test phone has a resolution of 2160x1080, if you try it on another phone you may have to adjust the box size to see the issue appear.

It consists of an Edit Field, and a Masked Edit Field. Both have the Padding set to the same value, however the display of the text in the field is different. What I noticed, is that if on the Edit Field I blank out the padding values, it then displays the same as the MET field. So it appears the MET is ignoring this setting and just using some default.,

MET.png
 

Attachments

  • MET.zip
    9.6 KB · Views: 72

Informatix

Expert
Licensed User
I have run into an issue with this library. I have an app I wrote for a client a couple of years ago, recently they installed it on a phone with a lower resolution that what they had been using and discovered a display issue with some fields. One was using Another Date Picker it was resolved here (https://www.b4x.com/android/forum/threads/problem-with-anotherdatepicker.112921/#post-704920 ) In Post #14.

The second was Masked Edit Text Fields.

In this case I seem to have tracked the issue down to the field ignoring the Padding parameter. I have attached a sample program that shows the issue. My test phone has a resolution of 2160x1080, if you try it on another phone you may have to adjust the box size to see the issue appear.

It consists of an Edit Field, and a Masked Edit Field. Both have the Padding set to the same value, however the display of the text in the field is different. What I noticed, is that if on the Edit Field I blank out the padding values, it then displays the same as the MET field. So it appears the MET is ignoring this setting and just using some default.,

View attachment 87621
I just released a new version (1.53) to fix this issue. The padding set with the designer was not took into account.
Thanks for the report and for the sample program.
 
Top