mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-03 10:01:08 -04:00
Update Android SDLActivity
This commit is contained in:
@@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
private static final String TAG = "SDL";
|
||||
private static final int SDL_MAJOR_VERSION = 3;
|
||||
private static final int SDL_MINOR_VERSION = 4;
|
||||
private static final int SDL_MICRO_VERSION = 4;
|
||||
private static final int SDL_MICRO_VERSION = 8;
|
||||
/*
|
||||
// Display InputType.SOURCE/CLASS of events and devices
|
||||
//
|
||||
@@ -570,7 +570,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
public static int getNaturalOrientation() {
|
||||
int result = SDL_ORIENTATION_UNKNOWN;
|
||||
|
||||
Activity activity = (Activity)getContext();
|
||||
Activity activity = getContext();
|
||||
if (activity != null) {
|
||||
Configuration config = activity.getResources().getConfiguration();
|
||||
Display display = activity.getWindowManager().getDefaultDisplay();
|
||||
@@ -590,7 +590,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
public static int getCurrentRotation() {
|
||||
int result = 0;
|
||||
|
||||
Activity activity = (Activity)getContext();
|
||||
Activity activity = getContext();
|
||||
if (activity != null) {
|
||||
Display display = activity.getWindowManager().getDefaultDisplay();
|
||||
switch (display.getRotation()) {
|
||||
@@ -1292,7 +1292,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
public static double getDiagonal()
|
||||
{
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
Activity activity = (Activity)getContext();
|
||||
Activity activity = getContext();
|
||||
if (activity == null) {
|
||||
return 0.0;
|
||||
}
|
||||
@@ -1940,7 +1940,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
return;
|
||||
}
|
||||
|
||||
Activity activity = (Activity)getContext();
|
||||
Activity activity = getContext();
|
||||
if (activity.checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) {
|
||||
activity.requestPermissions(new String[]{permission}, requestCode);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user