diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 0fda1cc5..a3eb1296 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -24,10 +24,9 @@ android:hardwareAccelerated="true"> + android:windowSoftInputMode="adjustResize"> - + @@ -76,5 +75,6 @@ + diff --git a/assets/next_weap.png b/assets/next_weap.png index 14aa5e0f..099c9b69 100644 Binary files a/assets/next_weap.png and b/assets/next_weap.png differ diff --git a/assets/prev_weap.png b/assets/prev_weap.png index 099c9b69..14aa5e0f 100644 Binary files a/assets/prev_weap.png and b/assets/prev_weap.png differ diff --git a/src/org/libsdl/app/SDLActivity.java b/src/org/libsdl/app/SDLActivity.java index 39cd90ce..6021e80d 100644 --- a/src/org/libsdl/app/SDLActivity.java +++ b/src/org/libsdl/app/SDLActivity.java @@ -32,6 +32,7 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.Message; +import android.os.Vibrator; import android.util.Log; import android.util.SparseArray; import android.view.Display; @@ -77,6 +78,8 @@ public class SDLActivity extends Activity { // If we want to separate mouse and touch events. // This is only toggled in native code when a hint is set! public static boolean mSeparateMouseAndTouch; + + private static Vibrator mVibrator; // Main components protected static SDLActivity mSingleton; @@ -136,6 +139,7 @@ public class SDLActivity extends Activity { // The static nature of the singleton and Android quirkyness force us to initialize everything here // Otherwise, when exiting the app and returning to it, these variables *keep* their pre exit values mSingleton = null; + mVibrator = null; mSurface = null; mTextEdit = null; mLayout = null; @@ -174,7 +178,7 @@ public class SDLActivity extends Activity { // So we can call stuff from static callbacks mSingleton = this; mPref = this.getSharedPreferences("engine", 0); - mUseControls = mPref.getBoolean("controls", false); + mUseControls = mPref.getBoolean("controls", true); mUseVolume = mPref.getBoolean("usevolume", false); // Load shared libraries String errorMsgBrokenLib = ""; @@ -261,6 +265,8 @@ public class SDLActivity extends Activity { return; } + mVibrator.cancel(); + SDLActivity.handlePause(); } @@ -308,6 +314,8 @@ public class SDLActivity extends Activity { protected void onDestroy() { Log.v("SDL", "onDestroy()"); + mVibrator.cancel(); + if (SDLActivity.mBrokenLibraries) { super.onDestroy(); // Reset everything in case the user re opens the app @@ -499,7 +507,16 @@ public class SDLActivity extends Activity { public static void flipBuffers() { SDLActivity.nativeFlipBuffers(); } - + + /** + * This method is called by Xash3D engine using JNI + */ + public void vibrate( short time ) { + mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); + + mVibrator.vibrate( time ); + } + /** * This method is called by SDL using JNI. */