public EmptyStateViewHolder(View itemView) : base(itemView) { try { MainView = itemView; EmptyStateIcon = (TextView)itemView.FindViewById(Resource.Id.emtyicon); TitleText = (TextView)itemView.FindViewById(Resource.Id.headText); DescriptionText = (TextView)itemView.FindViewById(Resource.Id.seconderyText); EmptyStateButton = itemView.FindViewById <Button>(Resource.Id.button); LottieAnimationView = itemView.FindViewById <LottieAnimationView>(Resource.Id.animation_view); LottieAnimationView.Visibility = ViewStates.Gone; EmptyStateIcon.Visibility = ViewStates.Visible; FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, EmptyStateIcon, IonIconsFonts.Search); EmptyStateIcon.SetTextSize(ComplexUnitType.Dip, 45f); TitleText.Text = Application.Context.GetText(Resource.String.Lbl_NoSearchResult_TitleText); DescriptionText.Text = Application.Context.GetText(Resource.String.Lbl_NoSearchResult_DescriptionText); EmptyStateButton.Text = Application.Context.GetText(Resource.String.Lbl_NoSearchResult_Button); } catch (Exception exception) { Console.WriteLine(exception); } }
protected override void InitBindings() { SetsRecyclerView.SetAdapter(new ObservableRecyclerAdapter <CrawlerSetViewModel, CrawlerSetHolder>( ViewModel.Sets, DataTemplate, LayoutInflater, Resource.Layout.item_crawler_set) { StretchContentHorizonatally = true }); ViewModel.Sets.SetUpWithEmptyState(EmptyState); SetsRecyclerView.SetLayoutManager(new LinearLayoutManager(Activity)); var touchHelper = new ItemTouchHelper(new ItemTouchHelperCallback(this)); touchHelper.AttachToRecyclerView(SetsRecyclerView); EmptyStateIcon.SetImageResource(Resource.Drawable.icon_playlist_plus_huge); EmptyStateSubtitle.Text = AppResources.EmptyState_Subtitle_CrawlerSets; AddButton.SetOnClickCommand(ViewModel.AddNewSetCommand); }
public EmptyStateViewHolder(View itemView) : base(itemView) { try { MainView = itemView; EmptyStateIcon = (ImageView)MainView.FindViewById(Resource.Id.emtyicon); TitleText = (TextView)MainView.FindViewById(Resource.Id.headText); DescriptionText = (TextView)MainView.FindViewById(Resource.Id.seconderyText); EmptyStateButton = (Button)MainView.FindViewById(Resource.Id.button); //FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, EmptyStateIcon, IonIconsFonts.AndroidCamera); EmptyStateIcon.SetImageResource(Resource.Drawable.ic_no_video_vector); TitleText.Text = Application.Context.GetText(Resource.String.Lbl_Emptyvideos); DescriptionText.Text = Application.Context.GetText(Resource.String.Lbl_No_videos_found_for_now); EmptyStateButton.Visibility = ViewStates.Gone; } catch (Exception exception) { Console.WriteLine(exception); } }
protected override void InitBindings() { EmptyStateIcon.SetImageResource(Resource.Drawable.icon_add); EmptyStateSubtitle.Text = AppResources.EmptyState_Subtitle_ConfigureCrawler; ViewModel.ExcludedKeywords.SetUpWithEmptyState(EmptyState); ExcludedKeywordsRecyclerView.SetAdapter(new RecyclerViewAdapterBuilder <string, ExcludedItemHolder>() .WithItems(ViewModel.ExcludedKeywords) .WithContentStretching() .WithResourceId(LayoutInflater, Resource.Layout.item_excluded_term) .WithDataTemplate(DataTemplate) .Build()); ExcludedKeywordsRecyclerView.SetLayoutManager(new LinearLayoutManager(Activity)); Bindings.Add( this.SetBinding(() => ViewModel.SearchQueryInput, () => SearchQueryTextBox.Text, BindingMode.TwoWay)); Bindings.Add( this.SetBinding(() => ViewModel.CostOffsetIncrease, () => OffsetIncreaseTextBox.Text, BindingMode.TwoWay)); Bindings.Add( this.SetBinding(() => ViewModel.CostPercentageIncrease, () => PercentageIncreaseTextBox.Text, BindingMode.TwoWay)); Bindings.Add(this.SetBinding(() => ViewModel.SearchQueryInputError).WhenSourceChanges(() => { SearchQueryInputLayout.ErrorEnabled = !string.IsNullOrEmpty(ViewModel.SearchQueryInputError); SearchQueryInputLayout.Error = ViewModel.SearchQueryInputError; })); AddExcludedKeywordButton.SetOnClickListener(new OnClickListener(view => { ViewModel.AddExcludedKeywordCommand.Execute(ExcludedKeywordInput.Text); })); }
protected override void InitBindings() { CrawlersRecyclerView.SetAdapter( new RecyclerViewAdapterBuilder <CrawlerDescriptorViewModel, RecyclerView.ViewHolder>() .WithItems(ViewModel.CrawlerDescriptors) .WithContentStretching() .WithMultipleViews() .WithGroup <CrawlerDescriptorViewModel <SurugayaItem>, SurugayaCrawlerHolder>(builder => { builder.WithResourceId(LayoutInflater, Resource.Layout.item_surugaya_crawler); builder.WithDataTemplate(SharedCrawlerDescriptorDataTemplate); }) .WithGroup <CrawlerDescriptorViewModel <MandarakeItem>, MandarakeCrawlerHolder>(builder => { builder.WithResourceId(LayoutInflater, Resource.Layout.item_mandarake_crawler); builder.WithDataTemplate(SharedCrawlerDescriptorDataTemplate); }) .WithGroup <CrawlerDescriptorViewModel <MercariItem>, MercariCrawlerHolder>(builder => { builder.WithResourceId(LayoutInflater, Resource.Layout.item_mandarake_crawler); builder.WithDataTemplate(SharedCrawlerDescriptorDataTemplate); }) .WithGroup <CrawlerDescriptorViewModel <YahooItem>, YahooCrawlerHolder>(builder => { builder.WithResourceId(LayoutInflater, Resource.Layout.item_mandarake_crawler); builder.WithDataTemplate(SharedCrawlerDescriptorDataTemplate); }) .WithGroup <CrawlerDescriptorViewModel <LashinbangItem>, LashinbangCrawlerHolder>(builder => { builder.WithResourceId(LayoutInflater, Resource.Layout.item_mandarake_crawler); builder.WithDataTemplate(SharedCrawlerDescriptorDataTemplate); }) .Build()); ViewModel.CrawlerDescriptors.SetUpWithEmptyState(EmptyState); AddCrawlersRecyclerView.SetAdapter( new ObservableRecyclerAdapter <CrawlerEntryViewModel, AddCrawlerHolder>( ViewModel.CrawlerEntries, AddCrawlerDataTemplate, LayoutInflater, Resource.Layout.item_add_crawler)); Bindings.Add( this.SetBinding(() => ViewModel.SetName, () => TitleTextBox.Text, BindingMode.TwoWay)); Bindings.Add(this.SetBinding(() => ViewModel.SetNameError).WhenSourceChanges(() => { TitleInputLayout.Error = ViewModel.SetNameError; })); EmptyStateIcon.SetImageResource(Resource.Drawable.icon_playlist_plus_huge); EmptyStateSubtitle.Text = AppResources.EmptyState_Subtitle_CrawlerSetDetails; CrawlersRecyclerView.SetLayoutManager(new LinearLayoutManager(Activity)); AddCrawlersRecyclerView.SetLayoutManager(new CustomFlexboxLayoutManager(Activity) { FlexDirection = FlexDirection.Row, FlexWrap = FlexWrap.Wrap }); }