protected override void OnCreate (Bundle savedInstanceState) { base.OnCreate (savedInstanceState); SetContentView (Resource.Layout.ActivityWithTitleAndContainer); int userid = Intent.GetIntExtra ("userid", 0); View toolbarLayout = FindViewById(Resource.Id.toolbarLayout); Toolbar toolbar = (Toolbar)toolbarLayout.FindViewById(Resource.Id.toolbar); ((TextView)toolbarLayout.FindViewById(Resource.Id.toolbar_titleCenter)).Text = "Following"; SetSupportActionBar(toolbar); SupportActionBar.SetDisplayShowTitleEnabled(false); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); toolbar.NavigationClick += (sender, e) => { Finish(); }; newFragment = new ListOfFeedFragment (); newFragment.EmptyTableString = Strings.no_users_found; //newFragment.Master = this; newFragment.Target = FeedTypeEnum.FeedType.FollowingListOfFeed; newFragment.Objectid = userid; SupportFragmentManager.BeginTransaction ().Add (Resource.Id.fragment_container, newFragment).Commit (); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.HomeActivity, container, false); string tit = ""; if (Target == FeedTypeEnum.FeedType.FollowersListOfFeed) { tit = "Followers"; } else if (Target == FeedTypeEnum.FeedType.FollowingListOfFeed) { tit = "Following"; } else if (Target == FeedTypeEnum.FeedType.LikersListOfFeed) { tit = "Timers"; } View toolbarLayout = view.FindViewById(Resource.Id.toolbarLayout); ((TextView)toolbarLayout.FindViewById(Resource.Id.toolbar_titleCenter)).Text = tit; ImageView toolbarImageFarLeft = (ImageView)toolbarLayout.FindViewById(Resource.Id.toolbar_imageFarLeft); toolbarImageFarLeft.Visibility = ViewStates.Visible; Drawable backArrow = Context.Resources.GetDrawable(Resource.Drawable.abc_ic_ab_back_mtrl_am_alpha); backArrow.SetColorFilter(Resources.GetColor(Resource.Color.tenBlue), PorterDuff.Mode.SrcAtop); toolbarImageFarLeft.SetImageDrawable(backArrow); toolbarImageFarLeft.Click += (sender, e) => { FragmentManager.PopBackStack(); }; ((TextView)toolbarLayout.FindViewById(Resource.Id.toolbar_titleCenter)).Text = tit; ListOfFeedFragment fragment = new ListOfFeedFragment(); fragment.Master = this; fragment.Objectid = objectid; fragment.Target = Target; fragment.EmptyTableString = Strings.no_users_found; ChildFragmentManager.BeginTransaction().Add(Resource.Id.fragment_container, fragment).AddToBackStack(null).Commit(); return view; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.SearchActivity, container, false); View toolbarLayout = view.FindViewById(Resource.Id.toolbarLayout); ((TextView)toolbarLayout.FindViewById(Resource.Id.toolbar_titleCenter)).Text = "Search"; ImageView toolbarImageFarLeft = (ImageView)toolbarLayout.FindViewById(Resource.Id.toolbar_imageFarLeft); toolbarImageFarLeft.Visibility = ViewStates.Visible; Drawable backArrow = Context.Resources.GetDrawable(Resource.Drawable.abc_ic_ab_back_mtrl_am_alpha); backArrow.SetColorFilter(Resources.GetColor(Resource.Color.tenBlue), PorterDuff.Mode.SrcAtop); toolbarImageFarLeft.SetImageDrawable(backArrow); toolbarImageFarLeft.Click += (sender, e) => { ViewUtils.HideKeyboard(Activity, searchField); FragmentManager.PopBackStack(); }; usersButton = (Button)view.FindViewById(Resource.Id.users); usersButton.Click += delegate { usersButton.SetTypeface(null, TypefaceStyle.Bold); tagsButton.SetTypeface(null, TypefaceStyle.Normal); searchType = "user"; FragmentManager.BeginTransaction().Replace(Resource.Id.fragment_container_search, ListOfFeedFragment).Commit(); }; tagsButton = (Button)view.FindViewById(Resource.Id.tags); tagsButton.Click += delegate { tagsButton.SetTypeface(null, TypefaceStyle.Bold); usersButton.SetTypeface(null, TypefaceStyle.Normal); searchType = "post"; FragmentManager.BeginTransaction().Replace(Resource.Id.fragment_container_search, PostFeedFragment).Commit(); }; PostFeedFragment = new PostFeedFragment(); PostFeedFragment.EmptyTableString = Strings.no_active_posts; PostFeedFragment.Master = this; PostFeedFragment.Target = FeedTypeEnum.FeedType.SearchHashFeed; ListOfFeedFragment = new ListOfFeedFragment(); ListOfFeedFragment.EmptyTableString = Strings.no_users_found; ListOfFeedFragment.Master = this; ListOfFeedFragment.Target = FeedTypeEnum.FeedType.SearchListOfFeed; usersButton.CallOnClick(); searchField = (EditText)view.FindViewById(Resource.Id.searchfield); searchField.TextChanged += delegate { SearchButtonClicked(); }; string searchString = StringUtils.RemoveAllHashTags(StringUtils.TrimWhiteSpaceAndNewLine(IncommingTagForSearch)); if (!string.IsNullOrEmpty(searchString)) { tagsButton.CallOnClick(); searchField.Text = searchString; SearchButtonClicked(); } return view; }