Ejemplo n.º 1
0
 private void DefaultWindow_WheelEvent(object sender, Window.WheelEventArgs e)
 {
     if (e.Wheel.Type == Wheel.WheelType.CustomWheel)
     {
         Tizen.Log.Error("MYLOG", "wheel: " + e.Wheel.Direction);
         Tizen.Log.Error("MYLOG", "galleryType: " + galleryType);
         if (e.Wheel.Direction == 1)
         {
             if (galleryType + 1 <= 3)
             {
                 galleryType++;
                 gallery.SetLayoutManager(lm[galleryType]);
             }
             else
             {
                 gallery.Next();
             }
         }
         else if (e.Wheel.Direction == -1)
         {
             if (galleryType + 1 <= 3)
             {
                 //galleryType++;
                 //gallery.SetLayoutManager(lm[galleryType]);
             }
             else
             {
                 gallery.Prev();
             }
         }
     }
 }
Ejemplo n.º 2
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;
        }