5

Is there any way to set a custom layout for an error popup window in TextView: Valid XHTML.
In textView.setError(String, Drawable) we can set an error icon only. showError() method in TextView and ErrorPopup class are private, so I can't work with them.

Any ideas? Thanks in advance! Michael

UPD:
Thanks for comments, but as I understand it, the theme trick isn't applicable here: (TextView 3384 line from android-10)

void fixDirection(boolean above) {
    mAbove = above;

    if (above) {
        mView.setBackgroundResource(com.android.internal.R.drawable.popup_inline_error_above);
    } else {
        mView.setBackgroundResource(com.android.internal.R.drawable.popup_inline_error);
    }
}    

In android-15 com.android.internal.R.styleable.Theme_errorMessageBackground theme parameter is used, but it is internal.
Therefore I don't see any way to solve this problem, except writing my own error notificator ):

Community
  • 1
  • 1
Lampapos
  • 1,063
  • 1
  • 12
  • 26
  • Maybe you can set a theme or style to it. – Marcio Covre Jun 11 '12 at 14:12
  • Maybe. In TextView.showError() com.android.internal.R.styleable.Theme_errorMessageBackground is used, but I can't find where I can change this parameter. – Lampapos Jun 11 '12 at 15:42
  • http://developer.android.com/guide/topics/ui/themes.html for more info about themes, this attribute is probably private to textview but you can try to change via theming – Marcio Covre Jun 11 '12 at 16:29
  • You may want to use a subclass of EditText that implements its own custom error message layout. See here: http://stackoverflow.com/a/15272453/1172181 – Luis Feb 16 '14 at 08:12

0 Answers0