protected override void OnElementChanged(ElementChangedEventArgs <CarouselPage> e)
        {
            base.OnElementChanged(e);

            _pagedCarouselPage = (CxPagedCarouselPage)Element;

            _viewPager = null;

            for (int i = 0; i < ViewGroup.ChildCount; i++)
            {
                _viewPager = ViewGroup.GetChildAt(i) as ViewPager;
                if (_viewPager != null)
                {
                    break;
                }
            }
            if (_viewPager == null)
            {
                return;
            }

            var density = Resources.DisplayMetrics.Density;

            _circlePageIndicator = new CirclePageIndicator(base.Context);
            _circlePageIndicator.SetPadding(5, 5, 5, 5);
            _circlePageIndicator.Radius = 5 * density;
            SetPageIndicatorTintColor();
            SetCurrentPageIndicatorTintColor();

            AddView(_circlePageIndicator);
            _circlePageIndicator.BringToFront();
        }
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            _pagedCarouselPage = (CxPagedCarouselPage)e.NewElement;
            _view = NativeView;

            _uiPageControl = new UIPageControl();
            SetPageIndicatorTintColor();
            SetCurrentPageIndicatorTintColor();

            _view.Add(_uiPageControl);

            _pagedCarouselPage.PropertyChanged += OnPagedCarouselPagePropertyChanged;
            _uiPageControl.ValueChanged        += OnUIPageControlValueChanged;
        }
예제 #3
0
        public static Page GetMainPage()
        {
            var page = new CxPagedCarouselPage()
            {
                Children =
                {
                    new IntroPage("intro1background.png", "Welcome",              "Djubble is the easiest and fastest way to get your friends together"),
                    new IntroPage("intro2background.png", "Create your activity", ""),
                    new IntroPage("intro3background.png", "Invite your friends",  "Doing things together is much more fun than alone"),
                    new IntroPage("intro4background.png", "Swipe to accept",      "Your friends just have to swipe to accept or decline your invitation. The answers pop up in your djubble app and fun can start."),
                    new IntroPage("intro5background.png", "Start to djubble",     "")
                },
                PagerPadding           = new Thickness(0, 0, 0, 0),
                SelectedPagerItemColor = Color.FromRgb(41, 171, 226),
                PagerItemColor         = Color.FromRgb(153, 153, 153)
            };

            return(page);
        }
예제 #4
0
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            _pagedCarouselPage = (CxPagedCarouselPage)e.NewElement;
        }
		protected override void OnElementChanged(ElementChangedEventArgs<CarouselPage> e)
		{
			base.OnElementChanged(e);

			_pagedCarouselPage = (CxPagedCarouselPage) Element;

			_viewPager = null;

			for (int i = 0; i < ViewGroup.ChildCount; i++)
			{
				_viewPager = ViewGroup.GetChildAt(i) as ViewPager;
				if (_viewPager != null)
					break;
			}
			if (_viewPager == null)
				return;

			var density = Resources.DisplayMetrics.Density;

			_circlePageIndicator = new CirclePageIndicator(base.Context);
			_circlePageIndicator.SetPadding(5, 5, 5, 5);
			_circlePageIndicator.Radius = 5*density;
			SetPageIndicatorTintColor();
			SetCurrentPageIndicatorTintColor();

			AddView(_circlePageIndicator);
			_circlePageIndicator.BringToFront();

		}