public void BindDataToView(NewCardModel model) { Reset(); TextField.Text = model.Title; TextField.AttributedPlaceholder = new NSAttributedString(model.Placeholder, TextField.Font, UIColor.White); TextField.RemoveTarget(null, null, UIControlEvent.EditingChanged); TextField.EditingChanged += (sender, e) => { if (model.Placeholder.Equals(NewCardShared.new_card_model_title_placeholder, StringComparison.InvariantCultureIgnoreCase)) { model.SelectedCard.UpdateStringProperty(() => model.SelectedCard.Title, TextField.Text.Trim()); model.SelectedCard.ShowFront(); } else if (model.Placeholder.Equals(NewCardShared.new_card_model_display_name_placeholder, StringComparison.InvariantCultureIgnoreCase)) { model.SelectedCard.UpdateStringProperty(() => model.SelectedCard.UserDisplayName, TextField.Text.Trim()); model.SelectedCard.ShowFront(); } else if (model.Placeholder.Equals(NewCardShared.new_card_model_company_name, StringComparison.InvariantCultureIgnoreCase)) { model.SelectedCard.UpdateStringProperty(() => model.SelectedCard.CompanyName, TextField.Text.Trim()); model.SelectedCard.ShowBack(); } NSNotificationCenter.DefaultCenter.PostNotificationName(Strings.InternalNotifications.notification_table_row_editing_changed, null); }; TextField.RemoveTarget(null, null, UIControlEvent.EditingDidEndOnExit); TextField.EditingDidEndOnExit += (sender, e) => { TextField.ResignFirstResponder(); }; }
public void BindDataToView(Context context, int position, NewCardModel model) { if (model == null) { return; } if (model.Outlet == null) { return; } MyPosition = position; LeftImageView.SetImage(model.Outlet.RemoteURL, -1, -1, null, WebImageView.DefaultCircleTransformation); RightTextView.Text = model.Outlet.Name; ItemView.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 200); if (ItemView.HasOnClickListeners) { return; } ItemView.Click += (sender, e) => { var intent = new Intent(SettingsShared.ItemClickedBroadcastReceiverKey); intent.PutExtra(SettingsShared.ItemClickedBroadcastReceiverKeyPosition, position); context.SendBroadcast(intent); }; ItemView.SetOnCreateContextMenuListener(this); }
public void BindDataToView(NewCardModel model) { Reset(); LeftLabel.Text = model.Outlet.Name; LeftImageView.SetImage(model.Outlet.RemoteURL, null, null, null); }
public void BindDataToView(NewCardModel model) { Reset(); Label.Text = model.Title; RightView.BackgroundColor = ColorUtils.FromHexString(model.ColorHexString, (model.IsTitle) ? UIColor.Clear : UIColor.White); RightViewSuperview.BackgroundColor = model.IsTitle ? UIColor.Clear : UIColor.White; }
public void BindDataToView(Context context, int position, NewCardModel model) { if (model == null) { return; } LeftEditText.TextChanged -= LeftEditText_TextChanged; LeftEditText.Click -= LeftEditText_Click; LeftEditText.Text = model.Title; LeftEditText.Hint = model.Placeholder; LeftEditText.Clickable = model.Editable; LeftEditText.Focusable = model.Editable; LeftEditText.Tag = position; if (!model.Editable) { LeftEditText.Click += LeftEditText_Click; } RightTextView.SetBackgroundColor(ColorUtils.FromHexString(model.ColorHexString, Color.Transparent)); RightTextView.Visibility = String.IsNullOrEmpty(model.ColorHexString) ? ViewStates.Gone : ViewStates.Visible; RightTextViewSuperView.Visibility = String.IsNullOrEmpty(model.ColorHexString) ? ViewStates.Gone : ViewStates.Visible; ItemView.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 200); if (!ItemView.HasOnClickListeners) { ItemView.Click += (sender, e) => { var intent = new Intent(SettingsShared.ItemClickedBroadcastReceiverKey); intent.PutExtra(SettingsShared.ItemClickedBroadcastReceiverKeyPosition, position); context.SendBroadcast(intent); }; } LeftEditText.TextChanged += LeftEditText_TextChanged; }
public void init(int[] numbers) { daubed[Mathf.FloorToInt(_CARD_SIZE * _CARD_SIZE * 0.5f)] = 1; for (int i = 0; i < _CARD_SIZE * _CARD_SIZE; ++i) { //skip free cell if (i == Mathf.FloorToInt(_CARD_SIZE * _CARD_SIZE * 0.5f)) { continue; } GameObject spawnedCell = Instantiate(cardCell) as GameObject; spawnedCell.transform.parent = transform; spawnedCell.transform.localPosition = new Vector3(-1.1f + (i % _CARD_SIZE) * _CELL_SIZE, 0.9f - (i / _CARD_SIZE) * _CELL_SIZE, 0f); //set the number/index for the cell CardCellController cellController = spawnedCell.gameObject.GetComponent <CardCellController>(); cellController.number = numbers[i]; cellController.index = i; cellController.card = gameObject; spawnedCells.Add(spawnedCell); } cardModel = new NewCardModel(); cardModel.clearNumbers(); }