protected override void PublishResults(ICharSequence constraint, FilterResults results) { using (var values = results.Values) _adapter._items = values.ToArray <Java.Lang.Object>() .Select(r => r.ToNetObject <Chemical>()).ToList(); _adapter.NotifyDataSetChanged(); // Don't do this and see GREF counts rising constraint.Dispose(); results.Dispose(); }
public override void RecyclerView_ItemClick(NewCardModel obj, int position) { base.RecyclerView_ItemClick(obj, position); //Footer if (obj == null) { var convertedActivity = Activity as BaseActivity; if (convertedActivity == null) { return; } var fragm = new MyOutletsRecyclerViewFragment(); fragm.OutletSelected += (outlet) => { AddOutletToCard(outlet, true); }; ((MainActivity)Activity).AddFragmentOver(fragm); return; } if (String.IsNullOrEmpty(obj.Title)) { return; } if (obj.Editable) { return; } (Activity as BaseActivity)?.HideKeyboard(); var frag = new ColorPickerAppCompatActivity(); frag.ColorPicked += (color) => { if (obj == null && String.IsNullOrEmpty(obj.Title)) { return; } obj.ColorHexString = ColorUtils.HexStringFromColor(color); if (obj.Title.Equals(NewCardShared.new_card_model_border_color, StringComparison.InvariantCulture)) { Shared.SelectedCard.UpdateStringProperty(() => Shared.SelectedCard.BorderColor, obj.ColorHexString); Shared.SelectedCard.ShowFront(); return; } if (obj.Title.Equals(NewCardShared.new_card_model_background_color, StringComparison.InvariantCulture)) { Shared.SelectedCard.UpdateStringProperty(() => Shared.SelectedCard.BackgroundColor, obj.ColorHexString); Shared.SelectedCard.ShowBack(); return; } if (obj.Title.Equals(NewCardShared.new_card_model_company_name_text_color, StringComparison.InvariantCulture)) { Shared.SelectedCard.UpdateStringProperty(() => Shared.SelectedCard.CompanyNameTextColor, obj.ColorHexString); Shared.SelectedCard.ShowBack(); return; } RecyclerViewAdapter.NotifyDataSetChanged(); }; frag.LabelTitle = obj.Title; frag.StartingColor = ColorUtils.FromHexString(obj.ColorHexString, Android.Graphics.Color.White); var convertedActiviy = (Activity as BaseActivity); convertedActiviy.AddFragmentOver(frag); }