Search in sources :

Example 91 with RequiresApi

use of androidx.annotation.RequiresApi in project EhViewer by seven332.

the class GalleryHeader method offsetVertically.

@RequiresApi(api = Build.VERSION_CODES.P)
private boolean offsetVertically(Rect rect, View view, int width) {
    int offset = 0;
    measureChild(rect, view, width, 0, 0);
    rect.offset(lastX, lastY);
    for (Rect notch : displayCutout.getBoundingRects()) {
        if (Rect.intersects(notch, rect)) {
            offset = Math.max(offset, notch.bottom - lastY);
        }
    }
    if (offset != 0) {
        rect.offset(-lastX, -lastY);
        rect.offset(0, offset);
        return true;
    } else {
        return false;
    }
}
Also used : Rect(android.graphics.Rect) RequiresApi(androidx.annotation.RequiresApi)

Example 92 with RequiresApi

use of androidx.annotation.RequiresApi in project android by nextcloud.

the class SyncFileNotEnoughSpaceDialogFragment method onCancel.

/**
 * Will access to storage manager in order to empty useless files
 */
@RequiresApi(api = Build.VERSION_CODES.N_MR1)
@Override
public void onCancel(String callerTag) {
    Intent storageIntent = new Intent(StorageManager.ACTION_MANAGE_STORAGE);
    startActivityForResult(storageIntent, REQUEST_CODE_STORAGE);
}
Also used : Intent(android.content.Intent) RequiresApi(androidx.annotation.RequiresApi)

Example 93 with RequiresApi

use of androidx.annotation.RequiresApi in project LshUtils by SenhLinsh.

the class ApkInstaller method gotoPermissionPage.

/**
 * 跳转打开安装未知来源应用权限的页面
 */
@RequiresApi(api = Build.VERSION_CODES.O)
public void gotoPermissionPage() {
    Uri uri = Uri.parse("package:" + ContextUtils.getPackageName());
    Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES, uri);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    ContextUtils.startActivity(intent);
}
Also used : Intent(android.content.Intent) Uri(android.net.Uri) RequiresApi(androidx.annotation.RequiresApi)

Example 94 with RequiresApi

use of androidx.annotation.RequiresApi in project MPAndroidChart by PhilJay.

the class ChartAnimator method animateXY.

/**
 * Animates values along both the X and Y axes.
 *
 * @param durationMillisX animation duration along the X axis
 * @param durationMillisY animation duration along the Y axis
 * @param easing EasingFunction for both axes
 */
@RequiresApi(11)
public void animateXY(int durationMillisX, int durationMillisY, EasingFunction easing) {
    ObjectAnimator xAnimator = xAnimator(durationMillisX, easing);
    ObjectAnimator yAnimator = yAnimator(durationMillisY, easing);
    if (durationMillisX > durationMillisY) {
        xAnimator.addUpdateListener(mListener);
    } else {
        yAnimator.addUpdateListener(mListener);
    }
    xAnimator.start();
    yAnimator.start();
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) RequiresApi(androidx.annotation.RequiresApi)

Example 95 with RequiresApi

use of androidx.annotation.RequiresApi in project OneSignal-Android-SDK by OneSignal.

the class NotificationChannelManager method createRestoreChannel.

@RequiresApi(api = Build.VERSION_CODES.O)
private static String createRestoreChannel(NotificationManager notificationManager) {
    NotificationChannel channel = new NotificationChannel(RESTORE_CHANNEL_ID, "Restored", NotificationManager.IMPORTANCE_LOW);
    notificationManager.createNotificationChannel(channel);
    return RESTORE_CHANNEL_ID;
}
Also used : NotificationChannel(android.app.NotificationChannel) RequiresApi(androidx.annotation.RequiresApi)

Aggregations

RequiresApi (androidx.annotation.RequiresApi)117 NotificationChannel (android.app.NotificationChannel)16 Intent (android.content.Intent)13 SuppressLint (android.annotation.SuppressLint)10 NotificationManager (android.app.NotificationManager)9 Uri (android.net.Uri)9 StatusBarNotification (android.service.notification.StatusBarNotification)9 NonNull (androidx.annotation.NonNull)9 IOException (java.io.IOException)8 Notification (android.app.Notification)6 PendingIntent (android.app.PendingIntent)6 Context (android.content.Context)6 ObjectAnimator (android.animation.ObjectAnimator)5 Bundle (android.os.Bundle)5 ByteBuffer (java.nio.ByteBuffer)5 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)5 SecretKey (javax.crypto.SecretKey)5 GestureDescription (android.accessibilityservice.GestureDescription)4 TaskStackBuilder (android.app.TaskStackBuilder)4 Bitmap (android.graphics.Bitmap)4