Feb 28, 2016 Replies: 66 FloatLabeledEditText is an improved EditText where the hint moves to the top instead of disappearing when there is text in the field. With the floating hint you no longer need to add a label to describe the field. The implementation is based on this open source project: https://github.com/wrapp/floatlabelededittext It is implemented as a custom view. You need to add it from the designer. Note that you can change the text properties. Technically FloatLabeledEditText wraps an EditText. You can get this EditText with the EditText property. This is useful if you want to configure the internal EditText. This library is part of the ViewsEx library (v1.10+). It is supported by Android 4+ and requires B4A v5.8+. Click to expand...
FloatLabeledEditText is an improved EditText where the hint moves to the top instead of disappearing when there is text in the field. With the floating hint you no longer need to add a label to describe the field. The implementation is based on this open source project: https://github.com/wrapp/floatlabelededittext It is implemented as a custom view. You need to add it from the designer. Note that you can change the text properties. Technically FloatLabeledEditText wraps an EditText. You can get this EditText with the EditText property. This is useful if you want to configure the internal EditText. This library is part of the ViewsEx library (v1.10+). It is supported by Android 4+ and requires B4A v5.8+.
ArminKH Well-Known Member Feb 28, 2016 #2 awsome erel. since past week to now you've share some useful classes,wrapper for some views,etc and this is one of them please don't stop this way.that's it This is what we want to see in the forum THE LIVE FORUM Last edited: Feb 29, 2016
awsome erel. since past week to now you've share some useful classes,wrapper for some views,etc and this is one of them please don't stop this way.that's it This is what we want to see in the forum THE LIVE FORUM
Claudio Oliveira Active Member Licensed User Longtime User Feb 29, 2016 #4 Hi! I've changed all EditText to FloatLabeledEditText views on an activity, and noticed that the soft keyboard covers the views wich are close to the activity bottom. With normal EditText, Android system automatically pans the activity in order to show the view that has focus, which is expected. But this doesn't happen with FloatLabeledEditText. I added this line to the manifest file, and it worked. Code: SetActivityAttribute(Main, android:windowSoftInputMode, adjustPan) My App uses "Theme.AppCompat.Light". I don't know if this has something to do with this theme or what, and I don't know if that's the right thing to do in such case either, but it's working pretty fine anyway. Regards.
Hi! I've changed all EditText to FloatLabeledEditText views on an activity, and noticed that the soft keyboard covers the views wich are close to the activity bottom. With normal EditText, Android system automatically pans the activity in order to show the view that has focus, which is expected. But this doesn't happen with FloatLabeledEditText. I added this line to the manifest file, and it worked. Code: SetActivityAttribute(Main, android:windowSoftInputMode, adjustPan) My App uses "Theme.AppCompat.Light". I don't know if this has something to do with this theme or what, and I don't know if that's the right thing to do in such case either, but it's working pretty fine anyway. Regards.
J JNG Member Licensed User Mar 1, 2016 #5 hi Erel how to get FloatLabeledEditText custom type in designer I am using B4A ver 5.8+ I am missing something regards
hi Erel how to get FloatLabeledEditText custom type in designer I am using B4A ver 5.8+ I am missing something regards
Erel B4X founder Staff member Licensed User Longtime User Mar 1, 2016 #6 Claudio Oliveira said: I added this line to the manifest file, and it worked. Click to expand... This is the correct solution if you want to use pan mode. JNG said: how to get FloatLabeledEditText custom type in designer I am using B4A ver 5.8+ I am missing something Click to expand... Check ViewsEx in the libraries tab and then in the designer: Add View - CustomView - FloatLabeledEditText.
Claudio Oliveira said: I added this line to the manifest file, and it worked. Click to expand... This is the correct solution if you want to use pan mode. JNG said: how to get FloatLabeledEditText custom type in designer I am using B4A ver 5.8+ I am missing something Click to expand... Check ViewsEx in the libraries tab and then in the designer: Add View - CustomView - FloatLabeledEditText.
konradwalsh Active Member Licensed User Longtime User Mar 3, 2016 #7 Hey Should I expect this to work? txtSugar.EditText.INPUT_TYPE_DECIMAL_NUMBERS = 1
Erel B4X founder Staff member Licensed User Longtime User Mar 3, 2016 #8 No. You should expect this to work: Code: txtSugar.EditText.InputType = txtSugar.EditText.INPUT_TYPE_DECIMAL_NUMBERS
No. You should expect this to work: Code: txtSugar.EditText.InputType = txtSugar.EditText.INPUT_TYPE_DECIMAL_NUMBERS
konradwalsh Active Member Licensed User Longtime User Mar 3, 2016 #9 Always amazing support... THANKS!
Claudio Oliveira Active Member Licensed User Longtime User Mar 4, 2016 #10 No HintColor property for FloatLabeledEditText? Setting HintColor for it's embedded EditText at runtime, like this Code: fleText1.EditText.HintColor=Colors.red has no effect whatsoever. Any "hint" on this?
No HintColor property for FloatLabeledEditText? Setting HintColor for it's embedded EditText at runtime, like this Code: fleText1.EditText.HintColor=Colors.red has no effect whatsoever. Any "hint" on this?
Erel B4X founder Staff member Licensed User Longtime User Mar 4, 2016 #11 You can use this code: Code: Sub SetHintColor(fl As FloatLabeledEditText, Color As Int) Dim jo As JavaObject = fl Dim r As Reflector r.Target = jo Dim lbl As Label = r.GetField("mHintTextView") fl.EditText.HintColor = Color lbl.TextColor = Color End Sub Depends on JavaObject and Reflection libraries.
You can use this code: Code: Sub SetHintColor(fl As FloatLabeledEditText, Color As Int) Dim jo As JavaObject = fl Dim r As Reflector r.Target = jo Dim lbl As Label = r.GetField("mHintTextView") fl.EditText.HintColor = Color lbl.TextColor = Color End Sub Depends on JavaObject and Reflection libraries.
Claudio Oliveira Active Member Licensed User Longtime User Mar 4, 2016 #12 Brilliant! Thank you, Erel
Claudio Oliveira Active Member Licensed User Longtime User Mar 4, 2016 #13 "FloatLabeledEditText" is not raising the FocusChanged event. TextChanged and EnterPressed events are ok. This is an awsome and very useful view, so I believe it's worth this feedback. Regards EDIT: Sorry!!! I've just read about new version 1.11 Thanks!
"FloatLabeledEditText" is not raising the FocusChanged event. TextChanged and EnterPressed events are ok. This is an awsome and very useful view, so I believe it's worth this feedback. Regards EDIT: Sorry!!! I've just read about new version 1.11 Thanks!
asales Expert Licensed User Longtime User Mar 7, 2016 #14 Erel said: You can use this code: Code: Sub SetHintColor(fl As FloatLabeledEditText, Color As Int) Dim jo As JavaObject = fl Dim r As Reflector r.Target = jo Dim lbl As Label = r.GetField("mHintTextView") fl.EditText.HintColor = Color lbl.TextColor = Color End Sub Depends on JavaObject and Reflection libraries. Click to expand... I use this values to the text style of the FloatLabeledEditText: - TextColor = RGB(20,120,160) - TextSize = 16 but If I use this code the values returns to default. How can I fix it?
Erel said: You can use this code: Code: Sub SetHintColor(fl As FloatLabeledEditText, Color As Int) Dim jo As JavaObject = fl Dim r As Reflector r.Target = jo Dim lbl As Label = r.GetField("mHintTextView") fl.EditText.HintColor = Color lbl.TextColor = Color End Sub Depends on JavaObject and Reflection libraries. Click to expand... I use this values to the text style of the FloatLabeledEditText: - TextColor = RGB(20,120,160) - TextSize = 16 but If I use this code the values returns to default. How can I fix it?
Claudio Oliveira Active Member Licensed User Longtime User Mar 8, 2016 #15 asales said: I use this values to the text style of the FloatLabeledEditText: - TextColor = RGB(20,120,160) - TextSize = 16 but If I use this code the values returns to default. How can I fix it? Click to expand... As explained by Erel in the first post, this view wraps an EditText, so it "heirs" it's properties which, at run time, are default. The "SetHintColor" sub changes a property of the embedded EditText so, I SUPPOSE, the FloatLabeledEditText will bring back these default values. Try to change these properties at run time on the embedded editText. Supposing your variable name is txtVar, do this: Code: txtVar.EditText.Color = RGB(20,120,160) txtVar.TextSize = 16 Tested here, and worked pretty fine. Regards Last edited: Mar 8, 2016
asales said: I use this values to the text style of the FloatLabeledEditText: - TextColor = RGB(20,120,160) - TextSize = 16 but If I use this code the values returns to default. How can I fix it? Click to expand... As explained by Erel in the first post, this view wraps an EditText, so it "heirs" it's properties which, at run time, are default. The "SetHintColor" sub changes a property of the embedded EditText so, I SUPPOSE, the FloatLabeledEditText will bring back these default values. Try to change these properties at run time on the embedded editText. Supposing your variable name is txtVar, do this: Code: txtVar.EditText.Color = RGB(20,120,160) txtVar.TextSize = 16 Tested here, and worked pretty fine. Regards
so27 Active Member Licensed User Longtime User Mar 15, 2016 #16 Great! What's with the Autocompletetext? There is also a FloatLabel for?
Erel B4X founder Staff member Licensed User Longtime User Mar 15, 2016 #17 You can use SearchView which is better than the built-in AutoCompleteEditText control. You can replace the EditText in SearchView with this control.
You can use SearchView which is better than the built-in AutoCompleteEditText control. You can replace the EditText in SearchView with this control.
S shashkiranr Active Member Licensed User Longtime User Apr 17, 2016 #19 Hi All, How to set custom typeface for this edit text? Best, SK
Erel B4X founder Staff member Licensed User Longtime User Apr 18, 2016 #20 Code: FloatLabeledEditText.EditText.Typeface = ...