Lines Matching refs:degrees

125         // Prepare mapping to snap touchable degrees to selectable degrees.
321 * Split up the 360 degrees of the circle among the 60 selectable values. Assigns a larger
324 * E.g. the output of 30 degrees should have a higher range of input associated with it than
325 * the output of 24 degrees, because 30 degrees corresponds to a visible number on the clock
330 // output will correspond to a range of 14 associated input degrees, and each non-visible
331 // output will correspond to a range of 4 associate input degrees, so visible numbers
335 // If an output of 30 degrees should correspond to a range of 14 associated degrees, then
338 // can be touching 36 degrees but have the selection snapped to 30 degrees; however, this
339 // inconsistency isn't noticeable at such fine-grained degrees, and it affords us the
355 for (int degrees = 0; degrees < 361; degrees++) {
357 mSnapPrefer30sMap[degrees] = snappedOutputDegrees;
377 * Returns mapping of any input degrees (0 to 360) to one of 60 selectable output degrees,
378 * where the degrees corresponding to visible numbers (i.e. those divisible by 30) will be
379 * weighted heavier than the degrees corresponding to non-visible numbers.
383 private int snapPrefer30s(int degrees) {
387 return mSnapPrefer30sMap[degrees];
391 * Returns mapping of any input degrees (0 to 360) to one of 12 visible output degrees (all
392 * multiples of 30), where the input will be "snapped" to the closest visible degrees.
393 * @param degrees The input degrees
397 * @return output degrees, will be a multiple of 30
399 private static int snapOnly30s(int degrees, int forceHigherOrLower) {
401 int floor = (degrees / stepSize) * stepSize;
404 degrees = ceiling;
406 if (degrees == floor) {
409 degrees = floor;
411 if ((degrees - floor) < (ceiling - degrees)) {
412 degrees = floor;
414 degrees = ceiling;
417 return degrees;
422 * selector, and redraw it at that position. The input degrees will be snapped to a selectable
424 * @param degrees Degrees which should be selected.
433 private int reselectSelector(int degrees, boolean isInnerCircle,
435 if (degrees == -1) {
443 degrees = snapPrefer30s(degrees);
445 degrees = snapOnly30s(degrees, 0);
456 radialSelectorView.setSelection(degrees, isInnerCircle, forceDrawDot);
462 if (degrees == 0 && isInnerCircle) {
463 degrees = 360;
464 } else if (degrees == 360 && !isInnerCircle) {
465 degrees = 0;
467 } else if (degrees == 0) {
468 degrees = 360;
470 } else if (degrees == 360 && currentShowing == MINUTE_INDEX) {
471 degrees = 0;
474 int value = degrees / stepSize;
475 if (currentShowing == HOUR_INDEX && mIs24HourMode && !isInnerCircle && degrees != 0) {
482 * Calculate the degrees within the circle that corresponds to the specified coordinates, if
566 int degrees;
605 // Calculate the degrees that is currently being touched.
661 degrees = getDegreesFromCoords(eventX, eventY, true, isInnerCircle);
662 if (degrees != -1) {
663 value = reselectSelector(degrees, isInnerCircle[0], false, true);
699 // If we have a legal degrees selected, set the value and tell the listener.
701 degrees = getDegreesFromCoords(eventX, eventY, mDoingMove, isInnerCircle);
702 if (degrees != -1) {
703 value = reselectSelector(degrees, isInnerCircle[0], !mDoingMove, false);
800 int degrees = value * stepSize;
801 degrees = snapOnly30s(degrees, changeMultiplier);
802 value = degrees / stepSize;