示例#1
0
        public override void Bind(ListItem item)
        {
            Name.Text = item.Name;
            Image.SetImageResource(item.ImageId);
            Action.Checked = item.State;

            Action.SetOnClickListener(this);
            ItemView.SetOnClickListener(this);

            _item = item;
        }
示例#2
0
 public void InitDropDown(ListItem l)
 {
     int j = 0;
     Initials = new List<TextView> ();
     foreach (BonLijst.Participant dude in l.Deelnemers) {
         string[] subnames = dude.name.Split (' ');
         string initials;
         if (subnames.Length == 1) {
             if (subnames [0].Length == 1) {
                 initials = subnames [0] [0].ToString () + ".";
             } else {
                 initials = subnames [0] [0].ToString () + subnames [0] [1].ToString () + ".";
             }
         } else {
             initials = subnames [0] [0].ToString () + "." + subnames [1] [0].ToString () + ".";
         }
         TextView initialTextView = new TextView (Application.Context);
         initialTextView.Text = initials;
         initialTextView.SetTextColor (Android.Graphics.Color.Black);
         initialTextView.TextSize = 30;
         initialTextView.SetPadding(16, 16, 16, 16);
         //initialTextView.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams);
         initialTextView.SetOnClickListener(this);
         Initials.Add (initialTextView);
         DropDown.AddView(initialTextView);
         j++;
     }
 }
示例#3
0
 public override void Bind(ListItem item)
 {
     if (DropDown.ChildCount == 0) {
         InitDropDown (item);
     }
     for (int i = 0; i < item.Deelnames.Count; i++) {
         View v = DropDown.GetChildAt(i);
         if (item.Deelnames[i]) {
             v.SetBackgroundColor(Android.Graphics.Color.Cyan);
         } else {
             v.SetBackgroundColor (Android.Graphics.Color.Transparent);
         }
     }
     Product.Text = item.Name;
     EditProduct.Text = item.Name;
     Price.Text = item.Value.ToString ("F2");
     EditPrice.Text = item.Value.ToString ("F2");
     DropDownButton.SetOnClickListener(this);
     Product.SetOnClickListener(this);
     EditButton.SetOnClickListener (this);
     BackButton.SetOnClickListener (this);
     RemoveButton.SetOnClickListener (this);
     EditProduct.KeyPress += (object sender, View.KeyEventArgs e) => {
         e.Handled = false;
         if (e.Event.Action == KeyEventActions.Down && (e.KeyCode == Keycode.Enter || e.KeyCode == Keycode.Back)) {
             item.Name = EditProduct.Text;
             e.Handled = true;
         }
     };
     EditPrice.KeyPress += (object sender, View.KeyEventArgs e) => {
         e.Handled = false;
         if (e.Event.Action == KeyEventActions.Down && (e.KeyCode == Keycode.Enter || e.KeyCode == Keycode.Back)) {
             double result;
             double.TryParse(EditPrice.Text, out result);
             if (result != 0) {
                 item.Value = result;
             }
             e.Handled = true;
         }
     };
 }
示例#4
0
        public override void Bind(ListItem item)
        {
            Name.Text = item.Name;
            Value.Text = item.Value.ToString("N");
            StatusColor.SetImageResource(item.ImageId);

            ItemView.SetOnClickListener(this);
            ItemView.SetOnLongClickListener(this);
        }
示例#5
0
 public override void Bind(ListItem item)
 {
     Name.Text = item.Name;
     Value.Text = item.Value.ToString("N");
 }
示例#6
0
        public override void Bind(ListItem item)
        {
            ItemView.SetOnClickListener(this);
            ItemView.SetOnLongClickListener(this);

            Amount.Text = item.Value.ToString("N");
            Payer.Text = item.Name;
            Reason.Text = item.Description;
            Date.Text = item.StringValue;
            StatusColor.SetImageResource(item.ImageId);
        }
示例#7
0
        public override void Bind(ListItem item)
        {
            Action.SetOnClickListener(this);

            Name.Text = item.Name;
            Image.SetImageResource(item.ImageId);
            Action.SetImageResource (Resource.Drawable.ic_close_black_24dp);
        }
示例#8
0
 public abstract void Bind(ListItem item);
示例#9
0
        public override void Bind(ListItem item)
        {
            Name.Text = item.Name;
            Image.SetImageResource(item.ImageId);

            ItemView.SetOnClickListener(this);
            ItemView.SetOnLongClickListener(this);
        }
示例#10
0
 public override void Bind(ListItem item)
 {
     Item = item;
     Debt.Text = item.StringValue;
     Deelnemer.Text = item.Name;
 }
示例#11
0
 public override void Bind(ListItem item)
 {
     Item = item;
     Prijs.Text = item.StringValue.Replace('.', ',');
     Product.Text = item.Name;
     Check.Checked = item.State;
 }
示例#12
0
        private void DeleteContact(ListItem item)
        {
            DatabaseInterface.RemoveFromContacts(p.Id, item.Name, p.Password);

            Toast.MakeText(this.Activity, "Removed " + item.Name, ToastLength.Short).Show();

            SwipeRefreshLayout.Refreshing = true;
            this.Refresh();
        }
示例#13
0
        private void AddContact(ListItem item)
        {
            DatabaseInterface.AddToContacts(_persoon.Id, item.Name, _persoon.Password);

                Toast.MakeText(this, "Added " + item.Name, ToastLength.Short).Show();
        }