Search in sources :

Example 6 with RequiresApi

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);
}
Also used : Path(android.graphics.Path) GestureDescription(android.accessibilityservice.GestureDescription) ImageView(android.widget.ImageView) RequiresApi(androidx.annotation.RequiresApi)

Example 7 with RequiresApi

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);
}
Also used : Path(android.graphics.Path) GestureDescription(android.accessibilityservice.GestureDescription) RequiresApi(androidx.annotation.RequiresApi)

Example 8 with RequiresApi

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();
}
Also used : Path(android.graphics.Path) GestureDescription(android.accessibilityservice.GestureDescription) RequiresApi(androidx.annotation.RequiresApi)

Example 9 with RequiresApi

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;
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) RequiresApi(androidx.annotation.RequiresApi)

Example 10 with RequiresApi

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();
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) RequiresApi(androidx.annotation.RequiresApi)

Aggregations

RequiresApi (androidx.annotation.RequiresApi)188 NotificationChannel (android.app.NotificationChannel)28 Intent (android.content.Intent)19 NonNull (androidx.annotation.NonNull)17 NotificationManager (android.app.NotificationManager)16 IOException (java.io.IOException)15 SuppressLint (android.annotation.SuppressLint)14 Uri (android.net.Uri)14 Cipher (javax.crypto.Cipher)12 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)11 Context (android.content.Context)10 StatusBarNotification (android.service.notification.StatusBarNotification)10 Rect (android.graphics.Rect)8 ArrayList (java.util.ArrayList)8 SecretKey (javax.crypto.SecretKey)8 Notification (android.app.Notification)7 ByteBuffer (java.nio.ByteBuffer)7 PendingIntent (android.app.PendingIntent)6 Build (android.os.Build)6 InvalidKeyException (java.security.InvalidKeyException)6