public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { try { View view = inflater.Inflate(Resource.Layout.SearchUsers_Layout, container, false); ContextSearch = (SearchTabbedActivity)Activity; InitComponent(view); SetRecyclerViewAdapters(); if (!string.IsNullOrEmpty(ContextSearch.DataKey)) { ContextSearch.Search("a"); if (ContextSearch.DataKey == "Random_Groups") { if (ProgressBarLoader != null) { ProgressBarLoader.Visibility = ViewStates.Visible; } if (EmptyStateLayout != null) { EmptyStateLayout.Visibility = ViewStates.Gone; } if (MRecycler != null) { MRecycler.Visibility = ViewStates.Visible; } ContextSearch.ViewPager.SetCurrentItem(2, true); } else if (ContextSearch.DataKey == "Random_Pages") { if (ContextSearch.PagesTab.ProgressBarLoader != null) { ContextSearch.PagesTab.ProgressBarLoader.Visibility = ViewStates.Visible; } if (ContextSearch.PagesTab.EmptyStateLayout != null) { ContextSearch.PagesTab.EmptyStateLayout.Visibility = ViewStates.Gone; } if (ContextSearch.PagesTab.MRecycler != null) { ContextSearch.PagesTab.MRecycler.Visibility = ViewStates.Visible; } ContextSearch.ViewPager.SetCurrentItem(1, true); } } else { ContextSearch.Search(""); } return(view); } catch (Exception e) { Methods.DisplayReportResultTrack(e); return(null !); } }
public override void OnViewCreated(View view, Bundle savedInstanceState) { try { base.OnViewCreated(view, savedInstanceState); InitComponent(view); SetRecyclerViewAdapters(); switch (string.IsNullOrEmpty(ContextSearch.DataKey)) { case false: ContextSearch.Search("a"); switch (ContextSearch.DataKey) { case "Random_Groups": { if (ProgressBarLoader != null) { ProgressBarLoader.Visibility = ViewStates.Visible; } if (EmptyStateLayout != null) { EmptyStateLayout.Visibility = ViewStates.Gone; } if (MRecycler != null) { MRecycler.Visibility = ViewStates.Visible; } ContextSearch.ViewPager.SetCurrentItem(2, true); break; } case "Random_Pages": { if (ContextSearch.PagesTab.ProgressBarLoader != null) { ContextSearch.PagesTab.ProgressBarLoader.Visibility = ViewStates.Visible; } if (ContextSearch.PagesTab.EmptyStateLayout != null) { ContextSearch.PagesTab.EmptyStateLayout.Visibility = ViewStates.Gone; } if (ContextSearch.PagesTab.MRecycler != null) { ContextSearch.PagesTab.MRecycler.Visibility = ViewStates.Visible; } ContextSearch.ViewPager.SetCurrentItem(1, true); break; } } break; default: ContextSearch.Search(""); break; } } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); } }