/** * updates the view rotation depending on the given touch position, also * takes the starting angle into consideration * * @param x * @param y */ public void updateGestureRotation(float x, float y) { mChart.setRotationAngle(mChart.getAngleForPoint(x, y) - mStartAngle); }
/** * sets the starting angle of the rotation, this is only used by the touch * listener, x and y is the touch position * * @param x * @param y */ public void setGestureStartAngle(float x, float y) { mStartAngle = mChart.getAngleForPoint(x, y) - mChart.getRawRotationAngle(); }
private void sampleVelocity(float touchLocationX, float touchLocationY) { long currentTime = AnimationUtils.currentAnimationTimeMillis(); _velocitySamples.add(new AngularVelocitySample(currentTime, mChart.getAngleForPoint(touchLocationX, touchLocationY))); // Remove samples older than our sample time - 1 seconds for (int i = 0, count = _velocitySamples.size(); i < count - 2; i++) { if (currentTime - _velocitySamples.get(i).time > 1000) { _velocitySamples.remove(0); i--; count--; } else { break; } } }
@Override public Highlight getHighlight(float x, float y) { float touchDistanceToCenter = mChart.distanceToCenter(x, y); // check if a slice was touched if (touchDistanceToCenter > mChart.getRadius()) { // if no slice was touched, highlight nothing return null; } else { float angle = mChart.getAngleForPoint(x, y); if (mChart instanceof PieChart) { angle /= mChart.getAnimator().getPhaseY(); } int index = mChart.getIndexForAngle(angle); // check if the index could be found if (index < 0 || index >= mChart.getData().getMaxEntryCountSet().getEntryCount()) { return null; } else { return getClosestHighlight(index, x, y); } } }
getAngleForPoint(bottomX, bottomY));
/** * sets the starting angle of the rotation, this is only used by the touch * listener, x and y is the touch position * * @param x * @param y */ public void setGestureStartAngle(float x, float y) { mStartAngle = mChart.getAngleForPoint(x, y) - mChart.getRawRotationAngle(); }
/** * sets the starting angle of the rotation, this is only used by the touch * listener, x and y is the touch position * * @param x * @param y */ public void setGestureStartAngle(float x, float y) { mStartAngle = mChart.getAngleForPoint(x, y) - mChart.getRawRotationAngle(); }
/** * sets the starting angle of the rotation, this is only used by the touch * listener, x and y is the touch position * * @param x * @param y */ public void setGestureStartAngle(float x, float y) { mStartAngle = mChart.getAngleForPoint(x, y) - mChart.getRawRotationAngle(); }
/** * updates the view rotation depending on the given touch position, also * takes the starting angle into consideration * * @param x * @param y */ public void updateGestureRotation(float x, float y) { mChart.setRotationAngle(mChart.getAngleForPoint(x, y) - mStartAngle); }
/** * sets the starting angle of the rotation, this is only used by the touch * listener, x and y is the touch position * * @param x * @param y */ public void setGestureStartAngle(float x, float y) { mStartAngle = mChart.getAngleForPoint(x, y) - mChart.getRawRotationAngle(); }
/** * updates the view rotation depending on the given touch position, also * takes the starting angle into consideration * * @param x * @param y */ public void updateGestureRotation(float x, float y) { mChart.setRotationAngle(mChart.getAngleForPoint(x, y) - mStartAngle); }
/** * updates the view rotation depending on the given touch position, also * takes the starting angle into consideration * * @param x * @param y */ public void updateGestureRotation(float x, float y) { mChart.setRotationAngle(mChart.getAngleForPoint(x, y) - mStartAngle); }
/** * updates the view rotation depending on the given touch position, also * takes the starting angle into consideration * * @param x * @param y */ public void updateGestureRotation(float x, float y) { mChart.setRotationAngle(mChart.getAngleForPoint(x, y) - mStartAngle); }
private void sampleVelocity(float touchLocationX, float touchLocationY) { long currentTime = AnimationUtils.currentAnimationTimeMillis(); _velocitySamples.add(new AngularVelocitySample(currentTime, mChart.getAngleForPoint(touchLocationX, touchLocationY))); // Remove samples older than our sample time - 1 seconds for (int i = 0, count = _velocitySamples.size(); i < count - 2; i++) { if (currentTime - _velocitySamples.get(i).time > 1000) { _velocitySamples.remove(0); i--; count--; } else { break; } } }
private void sampleVelocity(float touchLocationX, float touchLocationY) { long currentTime = AnimationUtils.currentAnimationTimeMillis(); _velocitySamples.add(new AngularVelocitySample(currentTime, mChart.getAngleForPoint(touchLocationX, touchLocationY))); // Remove samples older than our sample time - 1 seconds for (int i = 0, count = _velocitySamples.size(); i < count - 2; i++) { if (currentTime - _velocitySamples.get(i).time > 1000) { _velocitySamples.remove(0); i--; count--; } else { break; } } }
private void sampleVelocity(float touchLocationX, float touchLocationY) { long currentTime = AnimationUtils.currentAnimationTimeMillis(); _velocitySamples.add(new AngularVelocitySample(currentTime, mChart.getAngleForPoint(touchLocationX, touchLocationY))); // Remove samples older than our sample time - 1 seconds for (int i = 0, count = _velocitySamples.size(); i < count - 2; i++) { if (currentTime - _velocitySamples.get(i).time > 1000) { _velocitySamples.remove(0); i--; count--; } else { break; } } }
private void sampleVelocity(float touchLocationX, float touchLocationY) { long currentTime = AnimationUtils.currentAnimationTimeMillis(); _velocitySamples.add(new AngularVelocitySample(currentTime, mChart.getAngleForPoint(touchLocationX, touchLocationY))); // Remove samples older than our sample time - 1 seconds for (int i = 0, count = _velocitySamples.size(); i < count - 2; i++) { if (currentTime - _velocitySamples.get(i).time > 1000) { _velocitySamples.remove(0); i--; count--; } else { break; } } }
@Override public Highlight getHighlight(float x, float y) { float touchDistanceToCenter = mChart.distanceToCenter(x, y); // check if a slice was touched if (touchDistanceToCenter > mChart.getRadius()) { // if no slice was touched, highlight nothing return null; } else { float angle = mChart.getAngleForPoint(x, y); if (mChart instanceof PieChart) { angle /= mChart.getAnimator().getPhaseY(); } int index = mChart.getIndexForAngle(angle); // check if the index could be found if (index < 0 || index >= mChart.getData().getMaxEntryCountSet().getEntryCount()) { return null; } else { return getClosestHighlight(index, x, y); } } }
@Override public Highlight getHighlight(float x, float y) { float touchDistanceToCenter = mChart.distanceToCenter(x, y); // check if a slice was touched if (touchDistanceToCenter > mChart.getRadius()) { // if no slice was touched, highlight nothing return null; } else { float angle = mChart.getAngleForPoint(x, y); if (mChart instanceof PieChart) { angle /= mChart.getAnimator().getPhaseY(); } int index = mChart.getIndexForAngle(angle); // check if the index could be found if (index < 0 || index >= mChart.getData().getMaxEntryCountSet().getEntryCount()) { return null; } else { return getClosestHighlight(index, x, y); } } }
@Override public Highlight getHighlight(float x, float y) { float touchDistanceToCenter = mChart.distanceToCenter(x, y); // check if a slice was touched if (touchDistanceToCenter > mChart.getRadius()) { // if no slice was touched, highlight nothing return null; } else { float angle = mChart.getAngleForPoint(x, y); if (mChart instanceof PieChart) { angle /= mChart.getAnimator().getPhaseY(); } int index = mChart.getIndexForAngle(angle); // check if the index could be found if (index < 0 || index >= mChart.getData().getMaxEntryCountSet().getEntryCount()) { return null; } else { return getClosestHighlight(index, x, y); } } }