internal void PrevPage(bool isEndEffect = true, AnimationManager.PageAnimationType type = AnimationManager.PageAnimationType.Slide) { if (animationManager.IsAnimating) { return; } animationManager.IsAnimating = true; if (currentPage > 0) { //For editing mode rotaryLayerView.CheckEditBG(currentPage - 1, lastPage); rotaryLayerView.AnimateBG(false); PlayPageAnimation(rotaryLayerView.RotaryItemList, currentPage - 1, true, type); currentPage--; pagination.SetCurrentPage(currentPage); } else { if (isEndEffect) { animationManager.AnimateEndEffect(rotaryLayerView.GetContainer()); } } }
internal void PrevPage(bool isEndEffect = true, AnimationManager.PageAnimationType type = AnimationManager.PageAnimationType.Slide) { if (animationManager.IsAnimating) { return; } animationManager.IsAnimating = true; if (currentPage > 0) { //For editing mode rotaryLayerView.CheckEditBG(currentPage - 1, lastPage); rotaryLayerView.AnimateBG(false); PlayPageAnimation(rotaryLayerView.RotaryItemList, currentPage - 1, true, type); currentPage--; pagination.SetCurrentPage(currentPage); } else { if (isEditMode) { animationManager.IsAnimating = false; return; } if (isEndEffect) { animationManager.AnimateEndEffect(rotaryLayerView.GetContainer()); return; } } int selIdx = currentPage * ApplicationConstants.MAX_ITEM_COUNT + currentSelectIdx; RotarySelectorItem item = rotaryLayerView.RotaryItemList[selIdx]; rotaryLayerView.SetItem(item); if (!isEditMode) { rotaryLayerView.SetText(item.MainText, item.SubText); rotaryLayerView.SetIndicatorPosition(); } else { if (rotaryTouchController.SelectedItem != null) { if ((rotaryLayerView.GetMovingIcon() != null) && (rotaryLayerView.GetMovingIconRes() == rotaryTouchController.SelectedItem.ResourceUrl)) { rotaryLayerView.RemoveMovingIcon(); } else { rotaryLayerView.AddMovingIcon(rotaryTouchController.SelectedItem); rotaryLayerView.SetLeft(); } } } }
internal void NextPage(bool isEndEffect = true, AnimationManager.PageAnimationType type = AnimationManager.PageAnimationType.Slide) { if (animationManager.IsAnimating) { return; } animationManager.IsAnimating = true; if (currentPage + 1 < lastPage) { //For editing mode rotaryLayerView.CheckEditBG(currentPage + 1, lastPage); rotaryLayerView.AnimateBG(true); PlayPageAnimation(rotaryLayerView.RotaryItemList, currentPage + 1, false, type); currentPage++; pagination.SetCurrentPage(currentPage); int mod = rotaryLayerView.RotaryItemList.Count % ApplicationConstants.MAX_ITEM_COUNT; if (currentSelectIdx + 1 > mod && currentPage + 1 == lastPage) { int lastIdx = currentPage * ApplicationConstants.MAX_ITEM_COUNT + mod; SelectItem(rotaryLayerView.RotaryItemList[lastIdx - 1], false); return; } } else { if (isEditMode) { animationManager.IsAnimating = false; return; } if (isEndEffect) { animationManager.AnimateEndEffect(rotaryLayerView.GetContainer()); return; } } int selIdx = currentPage * ApplicationConstants.MAX_ITEM_COUNT + currentSelectIdx; RotarySelectorItem item = rotaryLayerView.RotaryItemList[selIdx]; rotaryLayerView.SetItem(item); rotaryLayerView.SetText(item.MainText, item.SubText); return; }
private void PlayPageAnimation(List <RotarySelectorItem> itemList, int vIdx, bool cw, AnimationManager.PageAnimationType type = AnimationManager.PageAnimationType.Slide) { animationManager.InitShowHideAnimation(); int sIdx = GetViewIndex(currentPage) * ApplicationConstants.MAX_ITEM_COUNT; int eIdx = GetViewIndex(vIdx) * ApplicationConstants.MAX_ITEM_COUNT; int setIdx = vIdx * ApplicationConstants.MAX_ITEM_COUNT; int totalItemCount = rotaryLayerView.GetTotalItemCount(); int mod = rotaryLayerView.RotaryItemList.Count % ApplicationConstants.MAX_ITEM_COUNT; int lastIdx = ApplicationConstants.MAX_ITEM_COUNT + mod; for (int i = sIdx, j = eIdx, s = 0; i < sIdx + ApplicationConstants.MAX_ITEM_COUNT; i++, j++, s++) { //if Not set the item if (wrapperList[i].RotaryItem != null) { if (currentPage + 1 == lastPage && (s < mod || mod == 0) || currentPage + 1 != lastPage) { animationManager.AnimateHidePage(wrapperList[i], cw, type); } } if (setIdx < totalItemCount) { wrapperList[j].RotaryItem = itemList[setIdx++]; wrapperList[j].RotaryItem.Show(); animationManager.AnimateShowPage(wrapperList[j], cw, type); } } animationManager.AnimatePageLayerContents(rotaryLayerView, !cw); animationManager.PlayCoreAnimation(); }
private void PlayPageAnimation(List <RotarySelectorItem> itemList, int vIdx, bool cw, AnimationManager.PageAnimationType type = AnimationManager.PageAnimationType.Slide) { animationManager.InitShowHideAnimation(); int sIdx = GetViewIndex(currentPage) * ApplicationConstants.MAX_ITEM_COUNT; int eIdx = GetViewIndex(vIdx) * ApplicationConstants.MAX_ITEM_COUNT; int setIdx = vIdx * ApplicationConstants.MAX_ITEM_COUNT; int totalItemCount = rotaryLayerView.GetTotalItemCount(); for (int i = sIdx, j = eIdx; i < sIdx + ApplicationConstants.MAX_ITEM_COUNT; i++, j++) { animationManager.AnimateHidePage(wrapperList[i], cw, type); //wrapperList[i].PlayPageHideAnimation(hideAnimation, cw); if (setIdx < totalItemCount) { wrapperList[j].RotaryItem = itemList[setIdx++]; wrapperList[j].RotaryItem.Show(); animationManager.AnimateShowPage(wrapperList[j], cw, type); //wrapperList[j].PlayPageShowAnimation(showAnimation, cw); } } animationManager.AnimatePageLayerContents(rotaryLayerView, !cw); animationManager.PlayCoreAnimation(); }