protected override View GetCellCore(Xamarin.Forms.Cell item, View convertView, ViewGroup parent, Context context) { var viewModel = (FullScheduleCellViewModel)item.BindingContext; LayoutInflater layoutInflater = LayoutInflater.FromContext(context); // creates the text color to be used depending on the track of the session var textColor = ((Xamarin.Forms.Color) new TrackTextColorConverter() .Convert(viewModel.Track, typeof(Xamarin.Forms.Color), null, CultureInfo.CurrentCulture)) .ToAndroid(); var view = convertView; //if (view == null) view = layoutInflater.Inflate(Resource.Layout.FullScheduleCell, null); SetupTitle(view, viewModel, textColor, true); SetupLocation(view, viewModel, textColor, true); SetupTrack(view, viewModel, textColor, true); if (viewModel.IsOptional) { SetupSelectButton(view, viewModel, textColor); } // set the background color of the cell to the appropriate track color Color background = ((Xamarin.Forms.Color) new TrackBackgroundColorConverter() .Convert(viewModel.Track, typeof(Xamarin.Forms.Color), null, CultureInfo.CurrentCulture)).ToAndroid(); view.SetBackgroundColor(background); return(view); }
public override UIKit.UITableViewCell GetCell(Xamarin.Forms.Cell item, UIKit.UITableViewCell reusableCell, UIKit.UITableView tv) { var cell = base.GetCell(item, reusableCell, tv); if (cell != null) { cell.SelectionStyle = UIKit.UITableViewCellSelectionStyle.None; } return(cell); }
protected override View GetCellCore(Xamarin.Forms.Cell item, View convertView, ViewGroup parent, Context context) { if (!(convertView is TNativeCell nativeCell)) { nativeCell = InstanceCreator <Context, Xamarin.Forms.Cell, TNativeCell> .Create(context, item); } ClearPropertyChanged(nativeCell); nativeCell.Cell = item; SetUpPropertyChanged(nativeCell); nativeCell.UpdateCell(); return(nativeCell); }
protected override View GetCellCore(Xamarin.Forms.Cell item, View convertView, ViewGroup parent, Context context) { var cell = base.GetCellCore(item, convertView, parent, context); if (parent is Android.Widget.ListView listView) { // Disable native cell selection color style - set as *Transparent* listView.SetSelector(Android.Resource.Color.Transparent); listView.CacheColorHint = Android.Graphics.Color.Transparent; } return(cell); }
protected override View GetCellCore(Xamarin.Forms.Cell item, View convertView, ViewGroup parent, Context context) { var viewModel = (AgendaCellViewModel)item.BindingContext; LayoutInflater layoutInflater = LayoutInflater.FromContext(context); // creates the text color to be used depending on the track of the session var textColor = ((Xamarin.Forms.Color) new TrackTextColorConverter() .Convert(viewModel.Track, typeof(Xamarin.Forms.Color), null, CultureInfo.CurrentCulture)) .ToAndroid(); var view = convertView; if (view == null) { view = layoutInflater.Inflate(Resource.Layout.AgendaCell, null); } if (viewModel.IsBooked) { SetupTitle(view, viewModel, textColor, true); SetupLocation(view, viewModel, textColor, true); SetupTrack(view, viewModel, textColor, true); /**** Don't show these if user has selected a session ****/ SetupAddIcon(view, false); SetupChooseLabel(view, textColor, false); } else { SetupAddIcon(view, true); SetupChooseLabel(view, textColor, true); /**** Don't show these if the user hasn't selected a session haven't ****/ SetupTitle(view, viewModel, textColor, false); SetupLocation(view, viewModel, textColor, false); SetupTrack(view, viewModel, Color.Red, false); } SetupTime(view, viewModel, textColor); SetupAMPMLabel(view, viewModel, textColor); // set the background color of the cell to the appropriate track color Color background = ((Xamarin.Forms.Color) new TrackBackgroundColorConverter() .Convert(viewModel.Track, typeof(Xamarin.Forms.Color), null, CultureInfo.CurrentCulture)).ToAndroid(); view.SetBackgroundColor(background); return(view); }
protected override Android.Views.View GetCellCore(Xamarin.Forms.Cell item, Android.Views.View convertView, Android.Views.ViewGroup parent, Android.Content.Context context) { var cell = base.GetCellCore(item, convertView, parent, context); var listView = parent as Android.Widget.ListView; if (listView != null) { listView.SetSelector(Android.Resource.Color.Transparent); listView.CacheColorHint = Android.Graphics.Color.Transparent; } return(cell); }
protected override Android.Views.View GetCellCore(Xamarin.Forms.Cell item, Android.Views.View convertView, Android.Views.ViewGroup parent, Android.Content.Context context) { var cell = base.GetCellCore(item, convertView, parent, context) as EntryCellView; if (cell != null) { var textField = cell.EditText as TextView; GradientDrawable gd = new GradientDrawable(); gd.SetColor(0); gd.SetStroke(0, Color.White); textField.SetBackground(gd); } return(cell); }
protected override View GetCellCore(Xamarin.Forms.Cell item, View convertView, ViewGroup parent, Context context) { var x = (TaskListCell)item; var view = convertView; if (view == null) { view = (context as Activity).LayoutInflater.Inflate(Resource.Layout.TaskListCellAndroid, null); } view.FindViewById <TextView>(Resource.Id.name).Text = x.Name; view.FindViewById <TextView>(Resource.Id.incomplete_tasks).Text = x.IncompleteTasks; return(view); }
protected override View GetCellCore(Xamarin.Forms.Cell item, View convertView, ViewGroup parent, Context context) { var viewModel = (ScavengerHuntCellViewModel)item.BindingContext; LayoutInflater layoutInflater = LayoutInflater.FromContext(context); var view = convertView; if (view == null) { view = layoutInflater.Inflate(Resource.Layout.ScavengerHuntCell, null); } SetupLabel(view, viewModel, Color.Black); SetupImage(view, viewModel); return(view); }
protected override Android.Views.View GetCellCore(Xamarin.Forms.Cell item, Android.Views.View?convertView, Android.Views.ViewGroup parent, Context context) { if (convertView is not TNativeCell nativeCell) { nativeCell = InstanceCreator.Create <TNativeCell>(context, item); // nativeCell = InstanceCreator<Context, Xamarin.Forms.Cell, TnativeCell>.Create(context, item); } ClearPropertyChanged(nativeCell); nativeCell.Cell = item; SetUpPropertyChanged(nativeCell); nativeCell.UpdateCell(); return(nativeCell); }