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;
}
}
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);
}
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);
}
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();
}
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;
}
Aggregations