/** * Calculate the degrees within the circle that corresponds to the specified coordinates, if * the coordinates are within the range that will trigger a selection. * @param pointX The x coordinate. * @param pointY The y coordinate. * @param forceLegal Force the selection to be legal, regardless of how far the coordinates are * from the actual numbers. * @param isInnerCircle If the selection may be in the inner circle, pass in a size-1 boolean * array here, inside which the value will be true if the selection is in the inner circle, * and false if in the outer circle. * @return Degrees from 0 to 360, if the selection was within the legal range. -1 if not. */ private int getDegreesFromCoords(float pointX, float pointY, boolean forceLegal, final Boolean[] isInnerCircle) { int currentItem = getCurrentItemShowing(); if (currentItem == HOUR_INDEX) { return mHourRadialSelectorView.getDegreesFromCoords( pointX, pointY, forceLegal, isInnerCircle); } else if (currentItem == MINUTE_INDEX) { return mMinuteRadialSelectorView.getDegreesFromCoords( pointX, pointY, forceLegal, isInnerCircle); } else { return -1; } }
/** * Calculate the degrees within the circle that corresponds to the specified coordinates, if * the coordinates are within the range that will trigger a selection. * @param pointX The x coordinate. * @param pointY The y coordinate. * @param forceLegal Force the selection to be legal, regardless of how far the coordinates are * from the actual numbers. * @param isInnerCircle If the selection may be in the inner circle, pass in a size-1 boolean * array here, inside which the value will be true if the selection is in the inner circle, * and false if in the outer circle. * @return Degrees from 0 to 360, if the selection was within the legal range. -1 if not. */ private int getDegreesFromCoords(float pointX, float pointY, boolean forceLegal, final Boolean[] isInnerCircle) { int currentItem = getCurrentItemShowing(); if (currentItem == HOUR_INDEX) { return mHourRadialSelectorView.getDegreesFromCoords( pointX, pointY, forceLegal, isInnerCircle); } else if (currentItem == MINUTE_INDEX) { return mMinuteRadialSelectorView.getDegreesFromCoords( pointX, pointY, forceLegal, isInnerCircle); } else { return -1; } }