11 namespace MonoDroid.Dialog
21 if (_entry != null && _entry.Text != value)
24 if (ValueChanged != null)
33 : this(caption, value, (int)
DroidResources.ElementLayout.dialog_textfieldright)
38 public EntryElement(
string caption,
string hint,
string value) : this(caption,value)
44 : base(caption, layoutId)
55 public bool Password {
get; set; }
56 public bool Numeric {
get; set; }
57 public string Hint {
get; set; }
58 public int Lines {
get; set; }
62 protected Action _entryClicked {
get;set; }
65 public override View
GetView(Context context, View convertView, ViewGroup parent)
67 Log.Debug(
"MDD",
"EntryElement: GetView: ConvertView: " + ((convertView == null) ?
"false" :
"true") +
68 " Value: " + Value +
" Hint: " + Hint +
" Password: " + (Password ?
"true" :
"false"));
72 var view = DroidResources.LoadStringEntryLayout(context, convertView, parent, LayoutId, out label, out _entry);
78 if (_entry.Tag != null)
79 _entry.RemoveTextChangedListener((
ITextWatcher)_entry.Tag);
81 _entry.Text = this.Value;
82 _entry.Hint = this.Hint;
85 _entry.InputType = (InputTypes.ClassText | InputTypes.TextVariationPassword);
86 else if (this.Numeric)
87 _entry.InputType = (InputTypes.ClassNumber | InputTypes.NumberFlagDecimal | InputTypes.NumberFlagSigned);
89 _entry.InputType = InputTypes.ClassText;
93 _entry.AddTextChangedListener(
this);
95 label.Text = (label != null) ? Caption:
string.Empty;
100 protected override void Dispose(
bool disposing)
111 return (Value != null ? Value.IndexOf(text, StringComparison.CurrentCultureIgnoreCase) != -1 :
false) || base.Matches(text);
116 this.Value = s.ToString();
121 Console.Write(
"foo");
127 Console.Write(
"foo");
136 var context = this.GetContext();
137 var entryDialog =
new AlertDialog.Builder(context)
138 .SetTitle(
"Enter Text")
140 .SetPositiveButton(
"OK", (o, e) => {
141 this.Value = _entry.Text;
EventHandler ValueChanged
EntryElement(string caption, string value)
override void Dispose(bool disposing)
EntryElement(string caption, string hint, string value)
EntryElement(string caption, string @value, int layoutId)
void BeforeTextChanged(Java.Lang.ICharSequence s, int start, int count, int after)
override string Summary()
Returns a summary of the value represented by this object, suitable for rendering as the result of a ...
override bool Matches(string text)
void AfterTextChanged(IEditable s)
void OnTextChanged(Java.Lang.ICharSequence s, int start, int before, int count)
override View GetView(Context context, View convertView, ViewGroup parent)
Overriden my most derived classes, creates a view that creates a View with the contents for display ...