ttilLastDate = (TextInputLayout) view.findViewById(R.id.tilLastDate);
tilLastDate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.v("PublishTask","has click");
}
});
why the OnClickListener don't work?
Now you can simply do input. setError(..) for new error and input. setErrorEnabled(false) to remove it. Works back and forth.
You can just set the start and end padding on the inner EditText to 0dp. Here's a screenshot with Show Layout Bounds turned on so you can see that the hints go all the way to the edge of the view. Save this answer.
To change the hint color you have to use these attributes: hintTextColor and android:textColorHint . To change the bottom line color you have to use the attribute: boxStrokeColor .
I faced the same issue and my solution was to use the setOnFocusChangeListener on the EditText inside the TextInputLayout.
This is an example using ButterKnife.
The Layout:
<android.support.design.widget.TextInputLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<android.support.design.widget.TextInputEditText
android:id="@+id/edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.design.widget.TextInputLayout>
The listener:
@OnFocusChange(R.id.edit_text)
public void actionOnEditText(View view, boolean hasFocus) {
if (hasFocus)
yourClickMethod();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With