android.view
Class ViewRoot.TrackballAxis
java.lang.Object
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.
|
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 |
position
float position
absPosition
float absPosition
acceleration
float acceleration
step
int step
dir
int dir
nonAccelMovement
int nonAccelMovement
ViewRoot.TrackballAxis
ViewRoot.TrackballAxis()
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.
Please submit a feedback, bug or feature