public ExploreEventCategories()
		{
			InitializeComponent();
			List<EventCategoryListItem> CategoryItems = new List<EventCategoryListItem>();
			for (int i = 0; i < partyBanners.Count; i++)
			{
				CategoryItems.Add(new EventCategoryListItem() {ImageSource = partyBanners[i], Category = (EventCategory.Category) i });
			}

			categoryList.ItemsSource = CategoryItems;
			categoryList.ItemSelected += OnListItemSelected;

			EventListView eventListView = new EventListView(0);

			eventList.Children.Add(eventListView);

			searchBar.TextChanged += async (sender, e) =>
			{
				if (string.IsNullOrWhiteSpace(searchBar.Text))
				{
					categoryList.IsVisible = true;
					categoryList.ItemsSource = CategoryItems;
					await Task.Delay(10);
					DependencyService.Get<ForceCloseKeyboard>().CloseKeyboard();
				}
				else {
					categoryList.IsVisible = false;
					eventListView.UpdateList(true, searchBar.Text);
				}
			};
			categoryList.Focused += async (sender, e) =>
			{
				await Task.Delay(10);
				DependencyService.Get<ForceCloseKeyboard>().CloseKeyboard();
			};
		}
Exemplo n.º 2
0
		public async void startCoreView()
		{
			notifications = new YourNotifications();
			homeView = new InspectController(App.userProfile);

			profileConversatios = new YourConversations(ConversationModelType.Profile, App.StoredUserFacebookId, 1);
			otherConversatios = new YourConversations(ConversationModelType.Profile, App.StoredUserFacebookId, 2);
			createEvent = new CreateEvent(new Event(), true);
			createGroup = new CreateGroup(new Group(), true);
			//createOrganization = new CreateOrganization(new Organization(), true);

			exploreEventCategories = new ExploreEventCategories();
			exploreEvents = new EventListView(0);
			joinedEvents = new EventListView(2);
			endedEvents = new EventListView(10);
			trackedEvents = new EventListView(3);
			friendsEvents = new EventListView(1);

			createView = new CarouselList(
				new List<VisualElement>() { createEvent, createGroup },
				new List<string>() { "Event", "Group" },
				CarouselList.ViewType.Create
			);

			conversatios = new CarouselList(
				new List<VisualElement>() { profileConversatios, otherConversatios },
				new List<string>() { "Yours", "Others" },
				CarouselList.ViewType.Conversations
			);

			searchEventView = new CarouselList(
				new List<VisualElement>() { exploreEventCategories, exploreEvents, friendsEvents, trackedEvents },
				new List<string>() { "Explore", "Explore", "Friends", "Followed" },
				CarouselList.ViewType.SearchEvents
			);

			joinedEventView = new CarouselList(
				new List<VisualElement>() { joinedEvents, endedEvents},
				new List<string>() { "Joined", "Old"},
				CarouselList.ViewType.JoinedEvents
			);

			myProfile = new CarouselList(
				new List<VisualElement>() { homeView, notifications },
				new List<string>() { "Me", "Notifications" },
				CarouselList.ViewType.Home
			);


			setContentView(2);
			await _dataManager.update();
			loading.IsVisible = false;

			if(token.Length > 15) displayAlertMessage("token", token, "ok");
		}