private void TagsButton_Click(object sender, EventArgs e) { var dialog = new AlertDialog.Builder(_context, _context.GetThemedResourceId(Resource.Attribute.Dialog_Theme)).Create(); var dialogView = _context.LayoutInflater.Inflate(Resource.Layout.View_List, null); var recycler = dialogView.FindViewById <RecyclerView>(Resource.Id.List_RecyclerView); dialog.SetView(dialogView); var tags = _presenter.GetMediaTags().OrderBy(x => x.Name).Select(x => new CheckBoxItemRecyclerAdapter.CheckBoxItem { Title = x.Name, Description = x.Description, IsChecked = _selectedTags?.Any(y => y == x.Name) == true }).ToList(); var adapter = new CheckBoxItemRecyclerAdapter(_context, tags) { ToggleDescription = true }; recycler.SetAdapter(adapter); dialog.Show(); dialog.DismissEvent += (disSender, disArgs) => { _selectedTags = adapter.Items.Where(x => x.IsChecked).Select(x => x.Title).ToList(); SetupTagsButton(_tagsButton); }; }
private void StreamingOnButton_Click(object sender, EventArgs e) { var dialog = new AlertDialog.Builder(_context, _context.GetThemedResourceId(Resource.Attribute.Dialog_Theme)).Create(); var dialogView = _context.LayoutInflater.Inflate(Resource.Layout.View_List, null); var recycler = dialogView.FindViewById <RecyclerView>(Resource.Id.List_RecyclerView); dialog.SetView(dialogView); var licensees = AniListEnum.GetEnumValues <MediaLicensee>().Select(x => new CheckBoxItemRecyclerAdapter.CheckBoxItem { Title = x.DisplayValue, IsChecked = _selectedStreamingOn?.Any(y => y == x.DisplayValue) == true }).ToList(); var adapter = new CheckBoxItemRecyclerAdapter(_context, licensees); recycler.SetAdapter(adapter); dialog.Show(); dialog.DismissEvent += (disSender, disArgs) => { _selectedStreamingOn = adapter.Items.Where(x => x.IsChecked).Select(x => x.Title).ToList(); SetupStreamingOnButton(_streamingOnButton); }; }
private void GenresButton_Click(object sender, EventArgs e) { var dialog = new AlertDialog.Builder(_context, _context.GetThemedResourceId(Resource.Attribute.Dialog_Theme)).Create(); var dialogView = _context.LayoutInflater.Inflate(Resource.Layout.View_List, null); var recycler = dialogView.FindViewById <RecyclerView>(Resource.Id.List_RecyclerView); dialog.SetView(dialogView); var genres = _genres.OrderBy(x => x).Select(x => new CheckBoxItemRecyclerAdapter.CheckBoxItem { Title = x, IsChecked = _selectedGenres?.Any(y => y == x) == true }).ToList(); var adapter = new CheckBoxItemRecyclerAdapter(_context, genres); recycler.SetAdapter(adapter); dialog.Show(); dialog.DismissEvent += (disSender, disArgs) => { _selectedGenres = adapter.Items.Where(x => x.IsChecked).Select(x => x.Title).ToList(); SetupGenresButton(_genresButton); }; }