mirror of https://github.com/encounter/SDL.git
Android: remove trailing spaces
This commit is contained in:
parent
d86de288d4
commit
a86754167c
|
@ -500,7 +500,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
mSDLThread = new Thread(new SDLMain(), "SDLThread");
|
mSDLThread = new Thread(new SDLMain(), "SDLThread");
|
||||||
mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, true);
|
mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, true);
|
||||||
mSDLThread.start();
|
mSDLThread.start();
|
||||||
|
|
||||||
// No nativeResume(), don't signal Android_ResumeSem
|
// No nativeResume(), don't signal Android_ResumeSem
|
||||||
mSurface.handleResume();
|
mSurface.handleResume();
|
||||||
} else {
|
} else {
|
||||||
|
@ -572,7 +572,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
|
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
|
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.INVISIBLE;
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.INVISIBLE;
|
||||||
window.getDecorView().setSystemUiVisibility(flags);
|
window.getDecorView().setSystemUiVisibility(flags);
|
||||||
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||||
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
||||||
SDLActivity.mFullscreenModeActive = true;
|
SDLActivity.mFullscreenModeActive = true;
|
||||||
|
@ -597,7 +597,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
|
|
||||||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
imm.hideSoftInputFromWindow(mTextEdit.getWindowToken(), 0);
|
imm.hideSoftInputFromWindow(mTextEdit.getWindowToken(), 0);
|
||||||
|
|
||||||
mScreenKeyboardShown = false;
|
mScreenKeyboardShown = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -664,14 +664,14 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
// or 500ms have passed.
|
// or 500ms have passed.
|
||||||
|
|
||||||
boolean bShouldWait = false;
|
boolean bShouldWait = false;
|
||||||
|
|
||||||
if (data instanceof Integer) {
|
if (data instanceof Integer) {
|
||||||
// Let's figure out if we're already laid out fullscreen or not.
|
// Let's figure out if we're already laid out fullscreen or not.
|
||||||
Display display = ((WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
|
Display display = ((WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
|
||||||
android.util.DisplayMetrics realMetrics = new android.util.DisplayMetrics();
|
android.util.DisplayMetrics realMetrics = new android.util.DisplayMetrics();
|
||||||
display.getRealMetrics( realMetrics );
|
display.getRealMetrics( realMetrics );
|
||||||
|
|
||||||
boolean bFullscreenLayout = ((realMetrics.widthPixels == mSurface.getWidth()) &&
|
boolean bFullscreenLayout = ((realMetrics.widthPixels == mSurface.getWidth()) &&
|
||||||
(realMetrics.heightPixels == mSurface.getHeight()));
|
(realMetrics.heightPixels == mSurface.getHeight()));
|
||||||
|
|
||||||
if (((Integer)data).intValue() == 1) {
|
if (((Integer)data).intValue() == 1) {
|
||||||
|
@ -696,7 +696,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
// size we need, instead of grabbing a size that's still got
|
// size we need, instead of grabbing a size that's still got
|
||||||
// the navigation and/or status bars before they're hidden.
|
// the navigation and/or status bars before they're hidden.
|
||||||
//
|
//
|
||||||
// We'll wait for up to half a second, because some devices
|
// We'll wait for up to half a second, because some devices
|
||||||
// take a surprisingly long time for the surface resize, but
|
// take a surprisingly long time for the surface resize, but
|
||||||
// then we'll just give up and return.
|
// then we'll just give up and return.
|
||||||
//
|
//
|
||||||
|
@ -760,7 +760,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
/**
|
/**
|
||||||
* This method is called by SDL using JNI.
|
* This method is called by SDL using JNI.
|
||||||
* This is a static method for JNI convenience, it calls a non-static method
|
* This is a static method for JNI convenience, it calls a non-static method
|
||||||
* so that is can be overridden
|
* so that is can be overridden
|
||||||
*/
|
*/
|
||||||
public static void setOrientation(int w, int h, boolean resizable, String hint)
|
public static void setOrientation(int w, int h, boolean resizable, String hint)
|
||||||
{
|
{
|
||||||
|
@ -768,11 +768,11 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
mSingleton.setOrientationBis(w, h, resizable, hint);
|
mSingleton.setOrientationBis(w, h, resizable, hint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This can be overridden
|
* This can be overridden
|
||||||
*/
|
*/
|
||||||
public void setOrientationBis(int w, int h, boolean resizable, String hint)
|
public void setOrientationBis(int w, int h, boolean resizable, String hint)
|
||||||
{
|
{
|
||||||
int orientation = -1;
|
int orientation = -1;
|
||||||
|
|
||||||
|
@ -812,7 +812,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
/**
|
/**
|
||||||
* This method is called by SDL using JNI.
|
* This method is called by SDL using JNI.
|
||||||
*/
|
*/
|
||||||
public static boolean isScreenKeyboardShown()
|
public static boolean isScreenKeyboardShown()
|
||||||
{
|
{
|
||||||
if (mTextEdit == null) {
|
if (mTextEdit == null) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -837,7 +837,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeX mode in Samsung Experience 9.0 and earlier doesn't support relative mice properly under
|
// DeX mode in Samsung Experience 9.0 and earlier doesn't support relative mice properly under
|
||||||
// Android 7 APIs, and simply returns no data under Android 8 APIs.
|
// Android 7 APIs, and simply returns no data under Android 8 APIs.
|
||||||
//
|
//
|
||||||
// This is fixed in Samsung Experience 9.5, which corresponds to Android 8.1.0, and
|
// This is fixed in Samsung Experience 9.5, which corresponds to Android 8.1.0, and
|
||||||
|
@ -919,7 +919,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
*/
|
*/
|
||||||
public static boolean isChromebook() {
|
public static boolean isChromebook() {
|
||||||
return getContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
|
return getContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called by SDL using JNI.
|
* This method is called by SDL using JNI.
|
||||||
|
@ -965,7 +965,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* environment variables set! */
|
/* environment variables set! */
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.v("SDL", "exception " + e.toString());
|
Log.v("SDL", "exception " + e.toString());
|
||||||
}
|
}
|
||||||
|
@ -973,7 +973,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method is called by SDLControllerManager's API 26 Generic Motion Handler.
|
// This method is called by SDLControllerManager's API 26 Generic Motion Handler.
|
||||||
public static View getContentView()
|
public static View getContentView()
|
||||||
{
|
{
|
||||||
return mSingleton.mLayout;
|
return mSingleton.mLayout;
|
||||||
}
|
}
|
||||||
|
@ -1028,7 +1028,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isTextInputEvent(KeyEvent event) {
|
public static boolean isTextInputEvent(KeyEvent event) {
|
||||||
|
|
||||||
// Key pressed with Ctrl should be sent as SDL_KEYDOWN/SDL_KEYUP and not SDL_TEXTINPUT
|
// Key pressed with Ctrl should be sent as SDL_KEYDOWN/SDL_KEYUP and not SDL_TEXTINPUT
|
||||||
if (event.isCtrlPressed()) {
|
if (event.isCtrlPressed()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -1370,7 +1370,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called by SDL using JNI.
|
* This method is called by SDL using JNI.
|
||||||
|
@ -1870,7 +1870,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||||
// Since we may have an orientation set, we won't receive onConfigurationChanged events.
|
// Since we may have an orientation set, we won't receive onConfigurationChanged events.
|
||||||
// We thus should check here.
|
// We thus should check here.
|
||||||
int newOrientation = SDLActivity.SDL_ORIENTATION_UNKNOWN;
|
int newOrientation = SDLActivity.SDL_ORIENTATION_UNKNOWN;
|
||||||
|
|
||||||
float x, y;
|
float x, y;
|
||||||
switch (mDisplay.getRotation()) {
|
switch (mDisplay.getRotation()) {
|
||||||
case Surface.ROTATION_90:
|
case Surface.ROTATION_90:
|
||||||
|
@ -1904,7 +1904,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||||
y / SensorManager.GRAVITY_EARTH,
|
y / SensorManager.GRAVITY_EARTH,
|
||||||
event.values[2] / SensorManager.GRAVITY_EARTH);
|
event.values[2] / SensorManager.GRAVITY_EARTH);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1972,7 +1972,7 @@ class DummyEdit extends View implements View.OnKeyListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||||
/*
|
/*
|
||||||
* This handles the hardware keyboard input
|
* This handles the hardware keyboard input
|
||||||
*/
|
*/
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
|
@ -2092,7 +2092,7 @@ class SDLInputConnection extends BaseInputConnection {
|
||||||
while (beforeLength-- > 0) {
|
while (beforeLength-- > 0) {
|
||||||
boolean ret_key = sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL))
|
boolean ret_key = sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL))
|
||||||
&& sendKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL));
|
&& sendKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL));
|
||||||
ret = ret && ret_key;
|
ret = ret && ret_key;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -2111,7 +2111,7 @@ interface SDLClipboardHandler {
|
||||||
|
|
||||||
|
|
||||||
class SDLClipboardHandler_API11 implements
|
class SDLClipboardHandler_API11 implements
|
||||||
SDLClipboardHandler,
|
SDLClipboardHandler,
|
||||||
android.content.ClipboardManager.OnPrimaryClipChangedListener {
|
android.content.ClipboardManager.OnPrimaryClipChangedListener {
|
||||||
|
|
||||||
protected android.content.ClipboardManager mClipMgr;
|
protected android.content.ClipboardManager mClipMgr;
|
||||||
|
@ -2142,7 +2142,7 @@ class SDLClipboardHandler_API11 implements
|
||||||
mClipMgr.setText(string);
|
mClipMgr.setText(string);
|
||||||
mClipMgr.addPrimaryClipChangedListener(this);
|
mClipMgr.addPrimaryClipChangedListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPrimaryClipChanged() {
|
public void onPrimaryClipChanged() {
|
||||||
SDLActivity.onNativeClipboardChanged();
|
SDLActivity.onNativeClipboardChanged();
|
||||||
|
|
Loading…
Reference in New Issue