v3.1.0: updated AGP, compile/target Android SDK, and gradle
This commit is contained in:
@@ -29,8 +29,12 @@ import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.window.OnBackInvokedCallback;
|
||||
import android.window.OnBackInvokedDispatcher;
|
||||
|
||||
import com.badlogic.gdx.Files;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.Input;
|
||||
import com.badlogic.gdx.backends.android.AndroidApplication;
|
||||
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
|
||||
import com.badlogic.gdx.backends.android.AndroidAudio;
|
||||
@@ -44,6 +48,7 @@ import com.shatteredpixel.shatteredpixeldungeon.services.news.NewsImpl;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.services.updates.UpdateImpl;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.services.updates.Updates;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Button;
|
||||
import com.watabou.input.KeyEvent;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.utils.FileUtils;
|
||||
|
||||
@@ -85,6 +90,7 @@ public class AndroidLauncher extends AndroidApplication {
|
||||
Game.versionCode = 0;
|
||||
}
|
||||
|
||||
Gdx.app = this;
|
||||
if (UpdateImpl.supportsUpdates()) {
|
||||
Updates.service = UpdateImpl.getUpdateService();
|
||||
}
|
||||
@@ -103,7 +109,19 @@ public class AndroidLauncher extends AndroidApplication {
|
||||
} else {
|
||||
instance = this;
|
||||
}
|
||||
|
||||
|
||||
//Shattered still overrides the back gesture behaviour, but we need to do it in a new way
|
||||
// (API added in Android 13, functionality enforced in Android 16)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
getOnBackInvokedDispatcher().registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_DEFAULT, new OnBackInvokedCallback() {
|
||||
@Override
|
||||
public void onBackInvoked() {
|
||||
KeyEvent.addKeyEvent(new KeyEvent(Input.Keys.BACK, true));
|
||||
KeyEvent.addKeyEvent(new KeyEvent(Input.Keys.BACK, false));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//set desired orientation (if it exists) before initializing the app.
|
||||
if (SPDSettings.landscape() != null) {
|
||||
instance.setRequestedOrientation( SPDSettings.landscape() ?
|
||||
|
||||
Reference in New Issue
Block a user