添加复制

This commit is contained in:
xsl
2025-09-23 20:04:09 +08:00
parent 599e041732
commit 7ff02db939
2 changed files with 28 additions and 0 deletions
@@ -58,6 +58,16 @@ public class MainActivity extends GameActivity implements FaceLandmarkerHelper.L
@Override
protected void onCreate(Bundle savedInstanceState) {
if (!AssetsCopyUtil.isExternalStorageAvailable()) {
Log.w(TAG, "External storage not available, skipping assets copy");
return;
}
AssetsCopyUtil.copyAssetsToAppFiles(this, "assets");
AssetsCopyUtil.copyAssetsToAppFiles(this, "shaders");
String native_lib_name = getResources().getString(R.string.native_lib_name);
try {
System.loadLibrary(native_lib_name);
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- 底层:CameraX 预览 -->
<androidx.camera.view.PreviewView
android:id="@+id/previewView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- 上层:GameActivity 的容器 -->
<FrameLayout
android:id="@+id/gameActivityContainer"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>