private int currentValue;
private int maxValue;
private int minValue;
+ private int currentIdx;
private int lastScrollPosion;
private int accessibilityHiddenStartIdx;
private bool onAnimation; //Scroller on animation check.
private void AccessibilityEnabled()
{
- if (loopEnabled) ShowItemsForAccessibility(currentValue - middleItemIdx);
+ if (loopEnabled) ShowItemsForAccessibility(currentIdx - middleItemIdx);
else
{
//Exception case handling condition state.
//If user sets 4 items it can scroll but not loop.
- if (currentValue > (middleItemIdx * 2)) ShowItemsForAccessibility(middleItemIdx + 1);
+ if (currentIdx > (middleItemIdx * 2)) ShowItemsForAccessibility(middleItemIdx + 1);
else ShowItemsForAccessibility(middleItemIdx);
}
}
itemList = new List<TextLabel>();
- minValue = maxValue = currentValue = 0;
+ minValue = maxValue = currentValue = currentIdx = 0;
displayedValues = null;
//Those many flags for min, max, value method calling sequence dependency.
needItemUpdate = true;
itemList[i].AccessibilityHidden = true;
else
{
- if (currentValue > (middleItemIdx * 2))
+ if (currentIdx > (middleItemIdx * 2))
for (int i = accessibilityHiddenStartIdx; i < (accessibilityHiddenStartIdx + (maxValue - minValue)); i++)
itemList[i].AccessibilityHidden = true;
else
itemList[i].AccessibilityHidden = false;
else
{
- if (currentValue > (middleItemIdx * 2))
+ if (currentIdx > (middleItemIdx * 2))
for (int i = accessibilityHiddenStartIdx; i < (accessibilityHiddenStartIdx + (maxValue - minValue)); i++)
itemList[i].AccessibilityHidden = false;
else
{
if (loopEnabled) {
HideItemsForAccessibility();
- ShowItemsForAccessibility(currentValue - middleItemIdx);
+ ShowItemsForAccessibility(currentIdx - middleItemIdx);
}
- if (isScreenReaderEnabled) itemList[currentValue].GrabAccessibilityHighlight();
+ if (isScreenReaderEnabled) itemList[currentIdx].GrabAccessibilityHighlight();
}
+ currentValue = displayedValuesUpdate ? Int32.Parse(itemList[currentIdx].Name) : Int32.Parse(itemList[currentIdx].Text);
ValueChangedEventArgs eventArgs =
- new ValueChangedEventArgs(displayedValuesUpdate ? Int32.Parse(itemList[currentValue].Name) : Int32.Parse(itemList[currentValue].Text));
+ new ValueChangedEventArgs(displayedValuesUpdate ? Int32.Parse(itemList[currentIdx].Name) : Int32.Parse(itemList[currentIdx].Text));
ValueChanged?.Invoke(this, eventArgs);
}
{
PageAdjust(e.Position.Y);
}
- if (currentValue != ((int)(-e.Position.Y / itemHeight) + middleItemIdx))
+ if (currentIdx != ((int)(-e.Position.Y / itemHeight) + middleItemIdx))
{
- currentValue = ((int)(-e.Position.Y / itemHeight) + middleItemIdx);
+ currentIdx = ((int)(-e.Position.Y / itemHeight) + middleItemIdx);
OnValueChanged();
}
}
else
{
- if (currentValue != ((int)(-e.Position.Y / itemHeight) + middleItemIdx))
+ if (currentIdx != ((int)(-e.Position.Y / itemHeight) + middleItemIdx))
{
- currentValue = ((int)(-e.Position.Y / itemHeight) + middleItemIdx);
+ currentIdx = ((int)(-e.Position.Y / itemHeight) + middleItemIdx);
OnValueChanged();
}
}
if (loopEnabled)
{
startY = ((dummyItemsForLoop + startItemIdx) * itemHeight) + startScrollOffset;
+ currentIdx = dummyItemsForLoop + startItemIdx + middleItemIdx;
if (isAtspiEnabled)
{
else
{
startY = ((middleItemIdx + startItemIdx) * itemHeight) + startScrollOffset;
- currentValue = currentValue - minValue + middleItemIdx;
+ currentIdx = currentValue - minValue + middleItemIdx;
if (isAtspiEnabled)
{