public override void CancelPage(CircularRecycler gallery) { storedPositionX = 0; List <CircularRecycler.ViewHolder> viewHolderList = gallery.GetChild(); //currentPage == extraIdx int toIndex = gallery.GetCurrentPage(); int count = viewHolderList.Count; ClearAnimation(); for (int i = 0; i < count; i++) { View view = viewHolderList[i].GetView(); Path path = new Path(); float startIdx = i - toIndex; Position position = GetRotaryPosition(startIdx); for (int j = 0; j <= 10; j++) { path.AddPoint(position); } path.GenerateControlPoints(0); Animate(view, position); AnimateRotate(view, GetRotation(startIdx)); } PlayAnimation(); }
public override void OrderByIndexAnimate(CircularRecycler gallery, bool cw = true) { List <CircularRecycler.ViewHolder> viewHolderList = gallery.GetChild(); //currentPage == extraIdx int toIndex = gallery.GetCurrentPage(); int fromIndex = (!cw) ? toIndex + 1 : toIndex - 1; int count = viewHolderList.Count; float val = (!cw) ? 1.0f : -1.0f; float span = (Math.Abs(storedPositionX + toIndex - fromIndex) / 10.0f) * val; ClearAnimation(); for (int i = 0; i < count; i++) { View view = viewHolderList[i].GetView(); Path path = new Path(); float startIdx = storedPositionX + i - fromIndex; for (int j = 0; j <= 10; j++) { Position position = GetRotaryPosition(startIdx); path.AddPoint(position); startIdx += span; } //SetAngle(view, i - toIndex); path.GenerateControlPoints(0); AnimatePath(view, path); Radian radi = new Radian(new Degree(30 * (i - toIndex))); AnimateRotate(view, GetRotation(i - toIndex)); } PlayAnimation(); storedPositionX = 0; }
public override void DragPage(CircularRecycler gallery, int distance) { List <CircularRecycler.ViewHolder> viewHolderList = gallery.GetChild(); int count = viewHolderList.Count; int toIndex = gallery.GetCurrentPage(); storedPositionX += ((float)distance / RESPONSIVIENESS); for (int i = 0; i < count; i++) { View view = viewHolderList[i].GetView(); view.Position = GetRotaryPosition(i - toIndex + storedPositionX); view.Orientation = GetRotation(i - toIndex + storedPositionX); } }
public override void OrderByIndex(CircularRecycler gallery) { List <CircularRecycler.ViewHolder> viewHolderList = gallery.GetChild(); //currentPage == extraIdx int currentIndex = gallery.GetCurrentPage(); int count = viewHolderList.Count; for (int i = 0; i < count; i++) { View view = viewHolderList[i].GetView(); view.Position = GetRotaryPosition(i - currentIndex); view.Orientation = GetRotation(i - currentIndex); } }
public abstract void DragPage(CircularRecycler gallery, int distance);
public abstract void CancelPage(CircularRecycler gallery);
public abstract void OrderByIndexAnimate(CircularRecycler gallery, bool cw = true);
//Order by index. if want using Animation, call Animate function. public abstract void OrderByIndex(CircularRecycler gallery);