Lines Matching refs:degrees

126         // Prepare mapping to snap touchable degrees to selectable degrees.
322 * Split up the 360 degrees of the circle among the 60 selectable values. Assigns a larger
325 * E.g. the output of 30 degrees should have a higher range of input associated with it than
326 * the output of 24 degrees, because 30 degrees corresponds to a visible number on the clock
331 // output will correspond to a range of 14 associated input degrees, and each non-visible
332 // output will correspond to a range of 4 associate input degrees, so visible numbers
336 // If an output of 30 degrees should correspond to a range of 14 associated degrees, then
339 // can be touching 36 degrees but have the selection snapped to 30 degrees; however, this
340 // inconsistency isn't noticeable at such fine-grained degrees, and it affords us the
356 for (int degrees = 0; degrees < 361; degrees++) {
358 mSnapPrefer30sMap[degrees] = snappedOutputDegrees;
378 * Returns mapping of any input degrees (0 to 360) to one of 60 selectable output degrees,
379 * where the degrees corresponding to visible numbers (i.e. those divisible by 30) will be
380 * weighted heavier than the degrees corresponding to non-visible numbers.
384 private int snapPrefer30s(int degrees) {
388 return mSnapPrefer30sMap[degrees];
392 * Returns mapping of any input degrees (0 to 360) to one of 12 visible output degrees (all
393 * multiples of 30), where the input will be "snapped" to the closest visible degrees.
394 * @param degrees The input degrees
398 * @return output degrees, will be a multiple of 30
400 private int snapOnly30s(int degrees, int forceHigherOrLower) {
402 int floor = (degrees / stepSize) * stepSize;
405 degrees = ceiling;
407 if (degrees == floor) {
410 degrees = floor;
412 if ((degrees - floor) < (ceiling - degrees)) {
413 degrees = floor;
415 degrees = ceiling;
418 return degrees;
423 * selector, and redraw it at that position. The input degrees will be snapped to a selectable
425 * @param degrees Degrees which should be selected.
434 private int reselectSelector(int degrees, boolean isInnerCircle,
436 if (degrees == -1) {
444 degrees = snapPrefer30s(degrees);
446 degrees = snapOnly30s(degrees, 0);
457 radialSelectorView.setSelection(degrees, isInnerCircle, forceDrawDot);
463 if (degrees == 0 && isInnerCircle) {
464 degrees = 360;
465 } else if (degrees == 360 && !isInnerCircle) {
466 degrees = 0;
468 } else if (degrees == 0) {
469 degrees = 360;
471 } else if (degrees == 360 && currentShowing == MINUTE_INDEX) {
472 degrees = 0;
475 int value = degrees / stepSize;
476 if (currentShowing == HOUR_INDEX && mIs24HourMode && !isInnerCircle && degrees != 0) {
483 * Calculate the degrees within the circle that corresponds to the specified coordinates, if
567 int degrees;
608 // Calculate the degrees that is currently being touched.
664 degrees = getDegreesFromCoords(eventX, eventY, true, isInnerCircle);
665 if (degrees != -1) {
666 value = reselectSelector(degrees, isInnerCircle[0], false, true);
702 // If we have a legal degrees selected, set the value and tell the listener.
704 degrees = getDegreesFromCoords(eventX, eventY, mDoingMove, isInnerCircle);
705 if (degrees != -1) {
706 value = reselectSelector(degrees, isInnerCircle[0], !mDoingMove, false);
803 int degrees = value * stepSize;
804 degrees = snapOnly30s(degrees, changeMultiplier);
805 value = degrees / stepSize;