Changed: Update gradle, android gradle plugin and dependencies

This commit is contained in:
Fredrik Fornwall
2023-10-03 00:02:12 +02:00
parent bcb61c387c
commit 53f75a8da3
24 changed files with 267 additions and 191 deletions

View File

@@ -51,7 +51,7 @@ public class MessageDialogUtils {
final DialogInterface.OnClickListener onNegativeButton,
final DialogInterface.OnDismissListener onDismiss) {
AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.Theme_AppCompat_Light_Dialog);
AlertDialog.Builder builder = new AlertDialog.Builder(context, androidx.appcompat.R.style.Theme_AppCompat_Light_Dialog);
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
View view = inflater.inflate(R.layout.dialog_show_message, null);

View File

@@ -185,12 +185,11 @@ public class ViewUtils {
public static Point getDisplaySize( @NonNull Context context, boolean activitySize) {
// android.view.WindowManager.getDefaultDisplay() and Display.getSize() are deprecated in
// API 30 and give wrong values in API 30 for activitySize=false in multi-window
androidx.window.WindowManager windowManager = new androidx.window.WindowManager(context);
androidx.window.WindowMetrics windowMetrics;
androidx.window.layout.WindowMetrics windowMetrics;
if (activitySize)
windowMetrics = windowManager.getCurrentWindowMetrics();
windowMetrics = androidx.window.layout.WindowMetricsCalculator.getOrCreate().computeCurrentWindowMetrics(context);
else
windowMetrics = windowManager.getMaximumWindowMetrics();
windowMetrics = androidx.window.layout.WindowMetricsCalculator.getOrCreate().computeMaximumWindowMetrics(context);
return new Point(windowMetrics.getBounds().width(), windowMetrics.getBounds().height());
}