UIColor colorWithPercentage(nfloat percentage) { UIColor color = DefaultColor ?? UIColor.Clear; if (percentage > ShortTrigger && ModeForStateRightShort != SwipeTableCellMode.None) { color = ColorRightShort; } if (percentage > LongTrigger && ModeForStateRightLong != SwipeTableCellMode.None) { color = ColorRightLong; } if (percentage < ShortTrigger.Neg() && ModeForStateLeftShort != SwipeTableCellMode.None) { color = ColorLeftShort; } if (percentage < LongTrigger.Neg() && ModeForStateLeftLong != SwipeTableCellMode.None) { color = ColorLeftLong; } return(color); }
SwipeTableViewCellState stateWithPercentage(nfloat percentage) { SwipeTableViewCellState state = SwipeTableViewCellState.None; if (percentage >= ShortTrigger && ModeForStateRightShort != SwipeTableCellMode.None) { state = SwipeTableViewCellState.StateRightShort; } if (percentage >= LongTrigger && ModeForStateRightLong != SwipeTableCellMode.None) { state = SwipeTableViewCellState.StateRightLong; } if (percentage <= ShortTrigger.Neg() && ModeForStateLeftShort != SwipeTableCellMode.None) { state = SwipeTableViewCellState.StateLeftShort; } if (percentage <= LongTrigger.Neg() && ModeForStateLeftLong != SwipeTableCellMode.None) { state = SwipeTableViewCellState.StateLeftLong; } return(state); }
UIView viewWithPercentage(nfloat percentage) { UIView view = null; if (percentage >= 0 && ModeForStateRightShort != SwipeTableCellMode.None) { view = ViewRightShort; } if (percentage >= LongTrigger && ModeForStateRightLong != SwipeTableCellMode.None) { view = ViewRightLong; } if (percentage < 0 && ModeForStateLeftShort != SwipeTableCellMode.None) { view = ViewLeftShort; } if (percentage <= (LongTrigger.Neg()) && ModeForStateLeftLong != SwipeTableCellMode.None) { view = ViewLeftLong; } return(view); }