Search in sources :

Example 26 with PointF

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);
}
Also used : PointF(android.graphics.PointF)

Example 27 with PointF

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);
}
Also used : PointF(android.graphics.PointF)

Example 28 with PointF

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));
}
Also used : PointF(android.graphics.PointF)

Example 29 with PointF

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());
}
Also used : TextLayer(org.thoughtcrime.securesms.scribbles.viewmodel.TextLayer) PointF(android.graphics.PointF) TextEntity(org.thoughtcrime.securesms.scribbles.widget.entity.TextEntity)

Example 30 with PointF

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;
}
Also used : PointF(android.graphics.PointF) MotionEvent(android.view.MotionEvent)

Aggregations

PointF (android.graphics.PointF)342 Paint (android.graphics.Paint)67 Test (org.junit.Test)31 Matrix (android.graphics.Matrix)28 RectF (android.graphics.RectF)21 Path (android.graphics.Path)18 Point (android.graphics.Point)18 View (android.view.View)12 ValueAnimator (android.animation.ValueAnimator)11 Drawable (android.graphics.drawable.Drawable)11 MotionEvent (android.view.MotionEvent)10 LinearSmoothScroller (android.support.v7.widget.LinearSmoothScroller)9 Animator (android.animation.Animator)8 NonNull (android.support.annotation.NonNull)8 ArrayList (java.util.ArrayList)8 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)7 Rect (android.graphics.Rect)7 AnimatorUpdateListener (android.animation.ValueAnimator.AnimatorUpdateListener)6 Message (android.os.Message)6 Interpolator (android.view.animation.Interpolator)6