use of android.graphics.PointF in project BoomMenu by Nightonke.
the class HamButton method init.
private void init(Builder builder) {
LayoutInflater.from(context).inflate(R.layout.bmb_ham_button, this, true);
initAttrs(builder);
initShadow(builder.shadowCornerRadius);
initHamButton();
initText(button);
initSubText(button);
initImage();
centerPoint = new PointF(buttonWidth / 2.0f + shadowRadius + shadowOffsetX, buttonHeight / 2.0f + shadowRadius + shadowOffsetY);
}
use of android.graphics.PointF in project BoomMenu by Nightonke.
the class SimpleCircleButton method init.
private void init(Builder builder) {
LayoutInflater.from(context).inflate(R.layout.bmb_simple_circle_button, this, true);
initAttrs(builder);
initShadow(buttonRadius + shadowRadius);
initCircleButton();
initImage();
centerPoint = new PointF(buttonRadius + shadowRadius + shadowOffsetX, buttonRadius + shadowRadius + shadowOffsetY);
}
use of android.graphics.PointF in project WoWoViewPager by Nightonke.
the class CubicBezier method init.
/**
* init the 4 values of the cubic-bezier
* @param startX x of start
* @param startY y of start
* @param endX x of end
* @param endY y of end
*/
public void init(float startX, float startY, float endX, float endY) {
setStart(new PointF(startX, startY));
setEnd(new PointF(endX, endY));
}
use of android.graphics.PointF in project Signal-Android by WhisperSystems.
the class ScribbleActivity method addTextSticker.
protected void addTextSticker() {
TextLayer textLayer = createTextLayer();
TextEntity textEntity = new TextEntity(textLayer, scribbleView.getWidth(), scribbleView.getHeight());
scribbleView.addEntityAndPosition(textEntity);
// move text sticker up so that its not hidden under keyboard
PointF center = textEntity.absoluteCenter();
center.y = center.y * 0.5F;
textEntity.moveCenterTo(center);
// redraw
scribbleView.invalidate();
startTextEntityEditing();
changeTextEntityColor(toolbar.getToolColor());
}
use of android.graphics.PointF in project Signal-Android by WhisperSystems.
the class MoveGestureDetector method updateStateByEvent.
protected void updateStateByEvent(MotionEvent curr) {
super.updateStateByEvent(curr);
final MotionEvent prev = mPrevEvent;
// Focus intenal
mCurrFocusInternal = determineFocalPoint(curr);
mPrevFocusInternal = determineFocalPoint(prev);
// Focus external
// - Prevent skipping of focus delta when a finger is added or removed
boolean mSkipNextMoveEvent = prev.getPointerCount() != curr.getPointerCount();
mFocusDeltaExternal = mSkipNextMoveEvent ? FOCUS_DELTA_ZERO : new PointF(mCurrFocusInternal.x - mPrevFocusInternal.x, mCurrFocusInternal.y - mPrevFocusInternal.y);
// - Don't directly use mFocusInternal (or skipping will occur). Add
// unskipped delta values to mFocusExternal instead.
mFocusExternal.x += mFocusDeltaExternal.x;
mFocusExternal.y += mFocusDeltaExternal.y;
}
Aggregations