public override void DragPage(WearableGallery gallery, int distance)
        {
            List <WearableGallery.ViewHolder> viewHolderList = gallery.GetChild();

            foreach (WearableGallery.ViewHolder vh in viewHolderList)
            {
                vh.GetView().PositionX += distance;
            }
        }
Esempio n. 2
0
        public override void OrderByIndex(WearableGallery gallery)
        {
            List <WearableGallery.ViewHolder> viewHolderList = gallery.GetChild();
            int currentPage = gallery.GetCurrentPage();
            int count       = viewHolderList.Count;

            ClearAnimation();
            for (int i = 0; i < count; i++)
            {
                View view = viewHolderList[i].GetView();
                Animate(view, new Position((i * view.SizeWidth) - (view.SizeWidth * currentPage), 0));
            }
            PlayAnimation();
        }
        public override void CancelPage(WearableGallery gallery)
        {
            List <WearableGallery.ViewHolder> viewHolderList = gallery.GetChild();
            int currentPage = gallery.GetCurrentPage();
            int idx         = 0;

            ClearAnimation();
            foreach (WearableGallery.ViewHolder vh in viewHolderList)
            {
                Position position = CreatePosition(idx);
                position.X -= pageSnap * (currentPage);
                Animate(vh.GetView(), position, scale);
                idx++;
            }
            PlayAnimation();
        }
Esempio n. 4
0
        public override void CancelPage(WearableGallery gallery)
        {
            ClearAnimation();
            List <WearableGallery.ViewHolder> viewHolderList = gallery.GetChild();
            int currentPage = gallery.GetCurrentPage();
            int idx         = 0;

            foreach (WearableGallery.ViewHolder vh in viewHolderList)
            {
                View view = vh.GetView();
                Animate(view, new Position((idx * view.SizeWidth) - (view.SizeWidth * (currentPage)), 0));
                idx++;
            }

            PlayAnimation();
        }
        public override void OrderByIndex(WearableGallery gallery)
        {
            List <WearableGallery.ViewHolder> viewHolderList = gallery.GetChild();
            int currentPage = gallery.GetCurrentPage();
            int idx         = 0;

            size     = (int)(viewHolderList[0].GetView().Size.Width *scale) + 5;
            pageSnap = size * 2;
            ClearAnimation();
            foreach (WearableGallery.ViewHolder vh in viewHolderList)
            {
                Position position = CreatePosition(idx);
                position.X -= pageSnap * (currentPage);
                Animate(vh.GetView(), position, scale);
                idx++;
            }
            PlayAnimation();
        }
Esempio n. 6
0
        void Initialize()
        {
            defaultWindow = GetDefaultWindow();
            defaultWindow.BackgroundColor = Color.White;
            defaultWindow.KeyEvent       += OnKeyEvent;

            View bgView = new View()
            {
                Size            = new Size(360, 360),
                BackgroundColor = Color.Black,
                CornerRadius    = 180,

                ParentOrigin           = ParentOrigin.Center,
                PivotPoint             = PivotPoint.Center,
                PositionUsesPivotPoint = true
            };

            gallery = new WearableGallery()
            {
                Size                   = new Size(360, 360),
                ParentOrigin           = ParentOrigin.Center,
                PivotPoint             = PivotPoint.Center,
                PositionUsesPivotPoint = true
            };
            gallery.SetAdapter(new UserGalleryAdapter());
            gallery.SetLayoutManager(new DefaultLayoutManager());
            gallery.ChildTouchEvent += ChildItem_TouchEvent;

            bgView.Add(gallery);
            defaultWindow.Add(bgView);

            lm.Add(new DefaultLayoutManager());
            lm.Add(new ScaleDownLayoutManager());
            lm.Add(new GridLayoutManager());
            lm.Add(new CircularLayoutManager());

            defaultWindow.WheelEvent += DefaultWindow_WheelEvent;
        }
 public abstract void DragPage(WearableGallery gallery, int distance);
 public abstract void CancelPage(WearableGallery gallery);
 //Order by index. if want using Animation, call Animate function.
 public abstract void OrderByIndex(WearableGallery gallery);