From: fredboy Date: Wed, 15 May 2024 16:59:04 +0000 (+0700) Subject: Lower min android api X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=947f14cbeb9db09ca1ed5e80f6a66ebba193e855;p=cavedroid.git Lower min android api --- diff --git a/android/build.gradle b/android/build.gradle index bf1af00..d52b9e9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -37,10 +37,12 @@ android { } defaultConfig { applicationId "ru.deadsoftware.cavedroid" - minSdkVersion 24 + minSdkVersion 19 targetSdkVersion 34 versionCode 25 versionName "alpha0.9.2" + + multiDexEnabled true } applicationVariants.all { variant -> variant.outputs.all { diff --git a/core/build.gradle b/core/build.gradle index 7aff468..3b061a7 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -22,5 +22,5 @@ dependencies { implementation 'org.jetbrains:annotations:23.1.0' implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializationVersion" - annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion" + ksp "com.google.dagger:dagger-compiler:$daggerVersion" } \ No newline at end of file diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java b/core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java index 0dcbefc..93dc8b9 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java +++ b/core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java @@ -82,7 +82,12 @@ public class GameRenderer extends Renderer { mMobsController = mobsController; mGameWorld = gameWorld; mRenderers = new ArrayList<>(renderers); - mRenderers.sort(Comparator.comparingInt(IGameRenderer::getRenderLayer)); + kotlin.collections.CollectionsKt.sortWith(mRenderers, new Comparator() { + @Override + public int compare(IGameRenderer o1, IGameRenderer o2) { + return o1.getRenderLayer() - o2.getRenderLayer(); + } + }); mCursorMouseInputHandler = cursorMouseInputHandler; mMouseInputActionMapper = mouseInputActionMapper; mKeyboardInputActionMapper = keyboardInputActionMapper; @@ -375,7 +380,9 @@ public class GameRenderer extends Renderer { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); spriter.begin(); - mRenderers.forEach(iGameRenderer -> iGameRenderer.draw(spriter, shaper, getCameraViewport(), delta)); + for (IGameRenderer iGameRenderer : mRenderers) { + iGameRenderer.draw(spriter, shaper, getCameraViewport(), delta); + } handleMousePosition(); spriter.end(); diff --git a/core/src/ru/deadsoftware/cavedroid/game/objects/drop/DropController.java b/core/src/ru/deadsoftware/cavedroid/game/objects/drop/DropController.java index 6666fc8..0213c97 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/objects/drop/DropController.java +++ b/core/src/ru/deadsoftware/cavedroid/game/objects/drop/DropController.java @@ -25,7 +25,9 @@ public class DropController implements Serializable { } public void initDrops(GameItemsHolder gameItemsHolder) { - mDrops.forEach((drop) -> drop.initItem(gameItemsHolder)); + for (Drop drop : mDrops) { + drop.initItem(gameItemsHolder); + } } public void addDrop(float x, float y, Item item) { @@ -48,7 +50,9 @@ public class DropController implements Serializable { } public void forEach(Callback callback) { - mDrops.forEach(callback::run); + for (Drop drop : mDrops) { + callback.run(drop); + } } public Iterator getIterator() { diff --git a/core/src/ru/deadsoftware/cavedroid/misc/Assets.java b/core/src/ru/deadsoftware/cavedroid/misc/Assets.java index 71cad7a..893414b 100644 --- a/core/src/ru/deadsoftware/cavedroid/misc/Assets.java +++ b/core/src/ru/deadsoftware/cavedroid/misc/Assets.java @@ -49,7 +49,9 @@ public class Assets { public static void dispose() { minecraftFont.dispose(); - loadedTextures.forEach(Texture::dispose); + for (Texture texture : loadedTextures) { + texture.dispose(); + } loadedTextures.clear(); }