Skip to content

Commit 3a37918

Browse files
Merge pull request #19 from Live2D/develop
Update to Cubism 5 SDK for Java R5
2 parents 3bafdae + 8ce6803 commit 3a37918

18 files changed

Lines changed: 441 additions & 251 deletions

CHANGELOG.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,35 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77

8+
## [5-r.5] - 2026-06-04
9+
10+
### Changed
11+
12+
* Migrate system bar hiding in `MainActivity` and `MainActivityMinimum` classes from deprecated `setSystemUiVisibility()` to `WindowInsetsControllerCompat`.
13+
* Reorganize lifecycle methods in the `LAppDelegate` and `LAppMinimumDelegate` classes to reliably reconstruct rendering resources on GL surface recreation.
14+
* Change motion calculation order in `LAppModel` and `LAppMinimumModel` classes to be performed by `CubismUpdateScheduler` class with per-feature Updaters.
15+
* Change `LAppModel` and `LAppMinimumModel` classes to configure parameter IDs and settings for target tracking via `CubismLook` class.
16+
* Change `LAppWavFileHandler` class to implement the `IParameterProvider` interface.
17+
18+
### Fixed
19+
20+
* Fix collision detection misalignment in split-screen mode.
21+
* Fix app state reset when entering split-screen mode.
22+
* Fix the model being clipped by system bars in the Minimum sample app on Android 15 or later.
23+
* Fix an issue in the Android sample where shaders were rebuilt every time the app returned to the foreground.
24+
* Unify remaining uses of `OffscreenSurface` in comments to `RenderTarget`.
25+
* Fix missing resource release in `close()` method of the `LAppView` and `LAppMinimumView` classes.
26+
* Fix incorrect debug log output when tapping the body hit area of the model.
27+
* Fix the bug where Y-axis coordinate transform methods incorrectly used X-axis methods in the `LAppView` and `LAppMinimumView` classes.
28+
* Fix an issue where `PREMULTIPLIED_ALPHA_ENABLE` flag was not applied to texture loading in the `LAppTextureManager` and `LAppMinimumTextureManager` classes.
29+
* Fix an issue where `PREMULTIPLIED_ALPHA_ENABLE` flag was not referenced for renderer premultiplied alpha setting in the `LAppMinimumModel` class.
30+
31+
832
## [5-r.5-beta.1.1] - 2026-02-19
933

1034
### Fixed
1135

12-
* Fix some problems related to rendering and clipping mask.
36+
* Fix some problems related to rendering and clipping mask.
1337
* See `CHANGELOG.md` in Framework.
1438

1539

@@ -230,6 +254,7 @@ Also adjust the return value of the getSpriteAlpha function.
230254
* New released!
231255

232256

257+
[5-r.5]: https://github.com/Live2D/CubismJavaSamples/compare/5-r.5-beta.1.1...5-r.5
233258
[5-r.5-beta.1.1]: https://github.com/Live2D/CubismJavaSamples/compare/5-r.5-beta.1...5-r.5-beta.1.1
234259
[5-r.5-beta.1]: https://github.com/Live2D/CubismJavaSamples/compare/5-r.4.1...5-r.5-beta.1
235260
[5-r.4.1]: https://github.com/Live2D/CubismJavaSamples/compare/5-r.4...5-r.4.1

Framework

Submodule Framework updated 30 files

README.ja.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ Core : [CHANGELOG.md](Core/CHANGELOG.md)
7171

7272
| 開発ツール | バージョン |
7373
|----------------|------------------|
74-
| Android Studio | Panda 1 2025.3.1 Patch 1 |
74+
| Android Studio | Panda 4 2025.3.4 Patch 1 |
7575
| Gradle | 8.11.1 |
7676
| Android Gradle Plugin | 8.9.1 |
7777
| Gradle JDK | 21.0.7 |
78-
| Android SDK | 36.0.0 |
78+
| Android SDK Platform | 36.0 |
7979

8080
## 動作確認環境
8181

@@ -85,11 +85,12 @@ Core : [CHANGELOG.md](Core/CHANGELOG.md)
8585

8686
### Android
8787

88-
| バージョン | デバイス | エミュレーター | 16KBページサイズ *1 |
89-
|-------|----------|:-------:|:-------:|
90-
| 16 | Pixel 9 | | ✔︎ |
91-
| 16 | Pixel 7a | | |
92-
| 5.0 | Pixel 7a || |
88+
| API レベル | デバイス | 16KBページサイズ *1 |
89+
|---------|----------|:-------------:|
90+
| 36 | Pixel 9 | ✔︎ |
91+
| 36 | Pixel 7a | |
92+
93+
※ エミュレーターは API 21 / 36 で動作確認済み
9394

9495
本サンプルアプリケーションは**Android API 21**以上のAndroidバージョンで動作します。
9596
*1 開発者向けオプションを使用して有効にした環境となります

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ Core : [CHANGELOG.md](Core/CHANGELOG.md)
7171

7272
| Development Tools | Version |
7373
|-------------------|--|
74-
| Android Studio | Panda 1 2025.3.1 Patch 1 |
74+
| Android Studio | Panda 4 2025.3.4 Patch 1 |
7575
| Gradle | 8.11.1 |
7676
| Android Gradle Plugin | 8.9.1 |
7777
| Gradle JDK | 21.0.7 |
78-
| Android SDK | 36.0.0 |
78+
| Android SDK Platform | 36.0 |
7979

8080
## Operation environment
8181

@@ -85,11 +85,12 @@ This sample application runs with **Java SE 7** or higher Java versions.
8585

8686
### Android
8787

88-
| Version | Device | Emulator | 16KB page sizes *1 |
89-
|---------|----------|:--------:|:--------:|
90-
| 16 | Pixel 9 | | ✔︎ |
91-
| 16 | Pixel 7a | | |
92-
| 5.0 | Pixel 7a || |
88+
| API Level | Device | 16KB page sizes *1 |
89+
|-----------|----------|:------------------:|
90+
| 36 | Pixel 9 | ✔︎ |
91+
| 36 | Pixel 7a | |
92+
93+
Note: The emulator has been tested with API 21 / 36.
9394

9495
This sample application runs with **Android API 21** or higher Android versions.
9596
*1 This environment has been enabled using developer options.

Sample/src/full/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
android:theme="@android:style/Theme.NoTitleBar">
1515
<activity
1616
android:name=".full.MainActivity"
17-
android:configChanges="orientation|screenSize"
17+
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
1818
android:screenOrientation="fullUser"
1919
android:exported="true">
2020
<intent-filter>

Sample/src/full/java/com/live2d/demo/full/LAppDelegate.java

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import android.os.Build;
1313
import com.live2d.demo.LAppDefine;
1414
import com.live2d.sdk.cubism.framework.CubismFramework;
15+
import com.live2d.sdk.cubism.framework.rendering.android.CubismShaderAndroid;
1516

1617
import static android.opengl.GLES20.*;
1718

@@ -40,27 +41,23 @@ public void deactivateApp() {
4041
}
4142

4243
public void onStart(Activity activity) {
43-
textureManager = new LAppTextureManager();
44-
view = new LAppView();
45-
4644
this.activity = activity;
47-
48-
LAppPal.updateTime();
45+
isActive = true;
4946
}
5047

5148
public void onPause() {}
5249

53-
public void onStop() {
50+
public void onStop() {}
51+
52+
public void onDestroy() {
5453
if (view != null) {
5554
view.close();
5655
}
5756
textureManager = null;
5857

5958
LAppLive2DManager.releaseInstance();
6059
CubismFramework.dispose();
61-
}
6260

63-
public void onDestroy() {
6461
releaseInstance();
6562
}
6663

@@ -73,8 +70,33 @@ public void onSurfaceCreated() {
7370
GLES20.glEnable(GLES20.GL_BLEND);
7471
GLES20.glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
7572

76-
// Initialize Cubism SDK framework
77-
CubismFramework.initialize();
73+
if (textureManager == null) {
74+
textureManager = new LAppTextureManager();
75+
} else {
76+
// 無効になっているテクスチャ情報を破棄
77+
textureManager.releaseInvalidTextures();
78+
}
79+
80+
if (view != null) {
81+
view.close();
82+
}
83+
view = new LAppView();
84+
85+
LAppPal.updateTime();
86+
87+
if (!CubismFramework.isInitialized()) {
88+
CubismFramework.initialize();
89+
}
90+
91+
// 無効になっているOpenGLリソースを破棄
92+
CubismShaderAndroid.getInstance().releaseInvalidShaderProgram();
93+
// シェーダコードを再読み込みするためにインスタンスを破棄しておく
94+
CubismShaderAndroid.deleteInstance();
95+
96+
LAppLive2DManager live2DManager = LAppLive2DManager.getInstance();
97+
for (int i = 0; i < live2DManager.getModelNum(); i++) {
98+
live2DManager.getModel(i).reloadRenderer();
99+
}
78100
}
79101

80102
public void onSurfaceChanged(int width, int height) {
@@ -89,14 +111,6 @@ public void onSurfaceChanged(int width, int height) {
89111

90112
// オフスクリーンのサイズ変更
91113
LAppLive2DManager.getInstance().setRenderTargetSize(width, height);
92-
93-
// load models
94-
LAppLive2DManager manager = LAppLive2DManager.getInstance();
95-
if (manager.getModelNum() == 0) {
96-
manager.changeScene(sceneIndex);
97-
}
98-
99-
isActive = true;
100114
}
101115

102116
public void run() {

Sample/src/full/java/com/live2d/demo/full/LAppLive2DManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public void onTap(float x, float y) {
186186
// 体をタップした場合ランダムモーションを開始する
187187
else if (model.hitTest(HitAreaName.BODY.getId(), adjustedX, adjustedY)) {
188188
if (DEBUG_LOG_ENABLE) {
189-
LAppPal.printLog("hit area: " + HitAreaName.HEAD.getId());
189+
LAppPal.printLog("hit area: " + HitAreaName.BODY.getId());
190190
}
191191

192192
model.startRandomMotion(MotionGroup.TAP_BODY.getId(), Priority.NORMAL.getPriority(), finishedMotion, beganMotion);

0 commit comments

Comments
 (0)