Build 1.0_r1(from source)

android.view
Class ViewRoot.TrackballAxis

java.lang.Object
  extended by android.view.ViewRoot.TrackballAxis
Enclosing class:
ViewRoot

static final class ViewRoot.TrackballAxis
extends Object

Maintains state information for a single trackball axis, generating discrete (DPAD) movements based on raw trackball motion.


Field Summary
(package private)  float absPosition
           
(package private)  float acceleration
           
(package private)  int dir
           
(package private)  int nonAccelMovement
           
(package private)  float position
           
(package private)  int step
           
 
Constructor Summary
ViewRoot.TrackballAxis()
           
 
Method Summary
(package private)  float collect(float off, String axis)
          Add trackball movement into the state.
(package private)  int generate(float precision)
          Generate the number of discrete movement events appropriate for the currently collected trackball movement.
(package private)  void reset(int _step)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

position

float position

absPosition

float absPosition

acceleration

float acceleration

step

int step

dir

int dir

nonAccelMovement

int nonAccelMovement
Constructor Detail

ViewRoot.TrackballAxis

ViewRoot.TrackballAxis()
Method Detail

reset

void reset(int _step)

collect

float collect(float off,
              String axis)
Add trackball movement into the state. If the direction of movement has been reversed, the state is reset before adding the movement (so that you don't have to compensate for any previously collected movement before see the result of the movement in the new direction).

Returns:
Returns the absolute value of the amount of movement collected so far.

generate

int generate(float precision)
Generate the number of discrete movement events appropriate for the currently collected trackball movement.

Parameters:
precision - The minimum movement required to generate the first discrete movement.
Returns:
Returns the number of discrete movements, either positive or negative, or 0 if there is not enough trackball movement yet for a discrete movement.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature