Esempio n. 1
0
		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			View view = inflater.Inflate(Resource.Layout.PopularActivity, container, false);


			Scope = "Local";
			Type = "Timed";

			TopTimedGlobalPostFeedFragment = new PostFeedFragment();
			TopTimedGlobalPostFeedFragment.EmptyTableString = Strings.no_active_posts;
			TopTimedGlobalPostFeedFragment.Master = this;
			TopTimedGlobalPostFeedFragment.Target = FeedTypeEnum.FeedType.PopularGlobalTimedFeed;
			TopTimedGlobalPostFeedFragment.NewPageContainerID = Resource.Id.fragment_container_page;

			TopTimedLocalFeedFragment = new PostFeedFragment();
			TopTimedLocalFeedFragment.EmptyTableString = Strings.no_active_posts;
			TopTimedLocalFeedFragment.Master = this;
			TopTimedLocalFeedFragment.Target = FeedTypeEnum.FeedType.PopularLocalTimedFeed;
			TopTimedLocalFeedFragment.NewPageContainerID = Resource.Id.fragment_container_page;

			TopTimersGlobalUserFeedFragment = new UserFeedFragment();
			TopTimersGlobalUserFeedFragment.EmptyTableString = Strings.no_users_found;
			TopTimersGlobalUserFeedFragment.Master = this;
			TopTimersGlobalUserFeedFragment.Target = FeedTypeEnum.FeedType.PopularGlobalTimersFeed;

			TopTimersLocalUserFeedFragment = new UserFeedFragment();
			TopTimersLocalUserFeedFragment.EmptyTableString = Strings.no_users_found;
			TopTimersLocalUserFeedFragment.Master = this;
			TopTimersLocalUserFeedFragment.Target = FeedTypeEnum.FeedType.PopularLocalTimersFeed;

			View toolbarLayout = view.FindViewById(Resource.Id.toolbarLayout);
			((TextView)toolbarLayout.FindViewById(Resource.Id.toolbar_titleCenter)).Text = "Popular";


			timersButton = (Button)view.FindViewById(Resource.Id.timers);
			timersButton.Click += delegate
			{
				timedButton.SetBackgroundResource(Resource.Drawable.LeftSegmentedControl);
				timedButton.SetTextColor(Android.Graphics.Color.ParseColor("#338a9e"));
				timersButton.SetBackgroundResource(Resource.Drawable.RightSegmentedControlSelected);
				timersButton.SetTextColor(Android.Graphics.Color.White);
				Type = "Timers";
				ShowCorrectPage();
			};

			timedButton = (Button)view.FindViewById(Resource.Id.timed);
			timedButton.Click += delegate
			{
				timedButton.SetBackgroundResource(Resource.Drawable.LeftSegmentedControlSelected);
				timedButton.SetTextColor(Android.Graphics.Color.White);
				timersButton.SetBackgroundResource(Resource.Drawable.RightSegmentedControl);
				timersButton.SetTextColor(Android.Graphics.Color.ParseColor("#338a9e"));
				Type = "Timed";
				ShowCorrectPage();
			};


			localButton = (ImageButton)view.FindViewById(Resource.Id.local);
			localButton.Click += delegate
			{
				localButton.SetImageResource(Resource.Drawable.localselected);
				globalButton.SetImageResource(Resource.Drawable.global);
				Scope = "Local";
				ShowCorrectPage();
			};

			globalButton = (ImageButton)view.FindViewById(Resource.Id.global);
			globalButton.Click += delegate
			{
				localButton.SetImageResource(Resource.Drawable.local);
				globalButton.SetImageResource(Resource.Drawable.globalselected);
				Scope = "Global";
				ShowCorrectPage();
			};

			timedButton.CallOnClick();
			localButton.CallOnClick();

			return view;

		}
		public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Bundle savedInstanceState)
		{
			View view = inflater.Inflate(Resource.Layout.ProfileHeader, container, false);

			PostCountLabel = view.FindViewById<TextView>(Resource.Id.postscount);
			BioTextView = view.FindViewById<BioTextView>(Resource.Id.bio);
			TopTimeLabel = view.FindViewById<TextView>(Resource.Id.toptimecount);
			UserImage = view.FindViewById<WebImage>(Resource.Id.userimage);

			FollowButton = view.FindViewById<FollowButton>(Resource.Id.action);
			FollowButton.BindDataToView(User, async () =>
			{
				await FetchHeaderData();
			});

			FollowersCountButton = view.FindViewById<TextView>(Resource.Id.followerscount);
			FollowersCountButton.Click += (sender, e) =>
			{
				TenServiceHelper.GoToListOf(Master.Master.FragmentManager, Resource.Id.fragment_container_page, User.idUser, FeedTypeEnum.FeedType.FollowersListOfFeed);
			};
			FollowersLabelButton = view.FindViewById<TextView>(Resource.Id.followerslabel);
			FollowersLabelButton.Click += (sender, e) =>
			{
				TenServiceHelper.GoToListOf(Master.Master.FragmentManager, Resource.Id.fragment_container_page, User.idUser, FeedTypeEnum.FeedType.FollowersListOfFeed);
			};

			FollowingCountButton = view.FindViewById<TextView>(Resource.Id.followingcount);
			FollowingCountButton.Click += (sender, e) =>
			{
				TenServiceHelper.GoToListOf(Master.Master.FragmentManager, Resource.Id.fragment_container_page, User.idUser, FeedTypeEnum.FeedType.FollowingListOfFeed);
			};
			FollowingLabelButton = view.FindViewById<TextView>(Resource.Id.followinglabel);
			FollowingLabelButton.Click += (sender, e) =>
			{
				TenServiceHelper.GoToListOf(Master.Master.FragmentManager, Resource.Id.fragment_container_page, User.idUser, FeedTypeEnum.FeedType.FollowingListOfFeed);
			};

			EditButton = view.FindViewById<Button>(Resource.Id.edit);
			if (User == null || User.IsMe())
			{
				FollowButton.Visibility = ViewStates.Invisible;
				EditButton.Visibility = ViewStates.Visible;
				EditButton.Click += (sender, e) =>
				{
					Master.Master.FragmentManager.BeginTransaction().Add(Resource.Id.fragment_container_page, new EditProfileFragment()).AddToBackStack(null).Commit();
				};
			}
			else {
				EditButton.Visibility = ViewStates.Invisible;
				FollowButton.Visibility = ViewStates.Visible;
			}


			ProfileTopTimersFragment = new UserFeedFragment();
			ProfileTopTimersFragment.Master = Master;
			ProfileTopTimersFragment.Target = FeedTypeEnum.FeedType.MyProfileFeed;
			ProfileTopTimersFragment.EmptyTableString = Strings.no_users_found;
			ProfileTopTimersFragment.User = User;
			if (User.IsMe())
			{
				ProfileTopTimersFragment.Target = FeedTypeEnum.FeedType.MyProfileFeed;
			}
			else {
				ProfileTopTimersFragment.Target = FeedTypeEnum.FeedType.GuestProfileFeed;
			}

			FragmentManager.BeginTransaction().Add(Resource.Id.fragment_container, ProfileTopTimersFragment).Commit();

			return view;
		}