Fixed
Status Update
Comments
al...@android.com <al...@android.com>
[Deleted User] <[Deleted User]> #2
Well the work around for this is something like:
<android.support.design.widget.TextInputLayout
android:id="@+id/setup_camera_access_login_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:errorEnabled="true"
android:hint="@string/setup_camera_access_login_label"
android:layout_marginBottom="@dimen/space_small"
>
<EditText
style="@style/EditText"
android:hint="@string/setup_camera_access_login_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</android.support.design.widget.TextInputLayout>
As setting the hint to something via attribute stops "setFloatingText" being called.
<android.support.design.widget.TextInputLayout
android:id="@+id/setup_camera_access_login_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:errorEnabled="true"
android:hint="@string/setup_camera_access_login_label"
android:layout_marginBottom="@dimen/space_small"
>
<EditText
style="@style/EditText"
android:hint="@string/setup_camera_access_login_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</android.support.design.widget.TextInputLayout>
As setting the hint to something via attribute stops "setFloatingText" being called.
ma...@gmail.com <ma...@gmail.com> #3
I agree with Gabriel on that. Adding method setHintEnabled(boolean) to TextInputLayout would be a great addition to current API. In my case I need to only show error text and use default EditText hint (not the TextInputLayout floating label).
Moreover, reserving space for both error and hint labels is not a great idea - those should be shown ONLY when needed (use View.GONE instead of View.INVISIBLE).
Moreover, reserving space for both error and hint labels is not a great idea - those should be shown ONLY when needed (use View.GONE instead of View.INVISIBLE).
ch...@google.com <ch...@google.com> #4
#3: No, forms are supposed to be visually stable. You don't want everything moving just because an error has happened somewher.
ma...@gmail.com <ma...@gmail.com> #5
@Chris Banes
Don't misunderstand me. It's ok to reserve space if someone is constantly using error, counter or hint label.
But if I do explicit call to setErrorEnabled(false) or setCounterEnabled(false) I'm 100% sure I don't need that particular feature in place where I call this method and I don't want to waste precious layout space.
Don't misunderstand me. It's ok to reserve space if someone is constantly using error, counter or hint label.
But if I do explicit call to setErrorEnabled(false) or setCounterEnabled(false) I'm 100% sure I don't need that particular feature in place where I call this method and I don't want to waste precious layout space.
ar...@gmail.com <ar...@gmail.com> #6
has there is some workaround for it?
ch...@google.com <ch...@google.com>
ch...@google.com <ch...@google.com> #7
Released in v23.2.0.
Description
1) that also removes the hint on the EditText
2) it doesn't remove the margin on top
It would be nice to have an API that behaves like setErrorEnabled() and the corresponding view attribute.
The goal is to have a TextInputLayout that behaves like this: