public void SetLayoutManager(WearableGalleryLayoutManager manager, ViewHolder selectVh = null) { if (layoutManager == manager) { return; } if (selectVh != null) { currentIndex = selectVh.BindingIndex; } layoutManager = manager; layoutManager.animator.animationFinished += FinishAnimation; extraItemIdx = currentIndex / layoutManager.GetItemCountByLine(); layoutManager.OrderByIndex(this); }
public WearableGallery() { extraItemIdx = EXTRA_ITEM_COUNT; PivotPoint = Tizen.NUI.PivotPoint.Center; PositionUsesPivotPoint = true; containerView = new View() { WidthSpecification = LayoutParamPolicies.WrapContent, HeightSpecification = 360, BackgroundColor = new Color(1, 0, 0, 0.3f), }; this.Add(containerView); panDetector = new PanGestureDetector(); panDetector.Attach(this); panDetector.Detected += PanDetector_Detected; layoutManager = new DefaultLayoutManager(); viewHolderList = new List <ViewHolder>(); }