use of androidx.annotation.RequiresApi in project kdeconnect-android by KDE.
the class MouseReceiverService method startSwipe.
@RequiresApi(api = Build.VERSION_CODES.O)
private boolean startSwipe() {
assert swipeStoke == null;
Path path = new Path();
path.moveTo(getX(), getY());
swipeStoke = new GestureDescription.StrokeDescription(path, 0, 1, true);
GestureDescription.Builder builder = new GestureDescription.Builder();
builder.addStroke(swipeStoke);
((ImageView) cursorView.findViewById(R.id.mouse_cursor)).setImageResource(R.drawable.mouse_pointer_clicked);
return dispatchGesture(builder.build(), null, null);
}
use of androidx.annotation.RequiresApi in project kdeconnect-android by KDE.
the class MouseReceiverService method continueSwipe.
@RequiresApi(api = Build.VERSION_CODES.O)
private boolean continueSwipe(float fromX, float fromY) {
Path path = new Path();
path.moveTo(fromX, fromY);
path.lineTo(getX(), getY());
swipeStoke = swipeStoke.continueStroke(path, 0, 5, true);
GestureDescription.Builder builder = new GestureDescription.Builder();
builder.addStroke(swipeStoke);
return dispatchGesture(builder.build(), null, null);
}
use of androidx.annotation.RequiresApi in project kdeconnect-android by KDE.
the class MouseReceiverService method createClick.
@RequiresApi(api = Build.VERSION_CODES.N)
private static GestureDescription createClick(float x, float y, int duration) {
Path clickPath = new Path();
clickPath.moveTo(x, y);
GestureDescription.StrokeDescription clickStroke = new GestureDescription.StrokeDescription(clickPath, 0, duration);
GestureDescription.Builder clickBuilder = new GestureDescription.Builder();
clickBuilder.addStroke(clickStroke);
return clickBuilder.build();
}
use of androidx.annotation.RequiresApi in project MPAndroidChart by PhilJay.
the class ChartAnimator method xAnimator.
@RequiresApi(11)
private ObjectAnimator xAnimator(int duration, EasingFunction easing) {
ObjectAnimator animatorX = ObjectAnimator.ofFloat(this, "phaseX", 0f, 1f);
animatorX.setInterpolator(easing);
animatorX.setDuration(duration);
return animatorX;
}
use of androidx.annotation.RequiresApi in project MPAndroidChart by PhilJay.
the class ChartAnimator method animateX.
/**
* Animates values along the X axis.
*
* @param durationMillis animation duration
* @param easing EasingFunction
*/
@RequiresApi(11)
public void animateX(int durationMillis, EasingFunction easing) {
ObjectAnimator animatorX = xAnimator(durationMillis, easing);
animatorX.addUpdateListener(mListener);
animatorX.start();
}
Aggregations