public override View GetView(Context context, View convertView, ViewGroup parent)
{
Log.Debug("MDD", "EntryElement: GetView: ConvertView: " + ((convertView == null) ? "false" : "true") +
" Value: " + Value + " Hint: " + Hint + " Password: " + (Password ? "true" : "false"));
TextView label;
var view = DroidResources.LoadStringEntryLayout(context, convertView, parent, LayoutId, out label, out _entry);
if (view != null)
{
// Warning! Crazy ass hack ahead!
// since we can't know when out convertedView was was swapped from inside us, we store the
// old textwatcher in the tag element so it can be removed!!!! (barf, rech, yucky!)
if (_entry.Tag != null)
_entry.RemoveTextChangedListener((ITextWatcher)_entry.Tag);
_entry.Text = this.Value;
_entry.Hint = this.Hint;
if (this.Password)
_entry.InputType = (InputTypes.ClassText | InputTypes.TextVariationPassword);
else if (this.Numeric)
_entry.InputType = (InputTypes.ClassNumber | InputTypes.NumberFlagDecimal | InputTypes.NumberFlagSigned);
else
_entry.InputType = InputTypes.ClassText;
// continuation of crazy ass hack, stash away the listener value so we can look it up later
_entry.Tag = this;
_entry.AddTextChangedListener(this);
label.Text = (label != null) ? Caption: string.Empty;
}
return view;
}