diff --git a/hellocardboard-android/build.gradle b/hellocardboard-android/build.gradle index bc268776..afc87147 100644 --- a/hellocardboard-android/build.gradle +++ b/hellocardboard-android/build.gradle @@ -18,7 +18,7 @@ android { minSdkVersion = 26 targetSdkVersion = 35 versionCode 1 - versionName "1.32.0" + versionName "1.33.0" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' ndk { abiFilters 'armeabi-v7a', 'arm64-v8a' diff --git a/hellocardboard-android/src/main/res/layout/activity_vr.xml b/hellocardboard-android/src/main/res/layout/activity_vr.xml index acad7e90..314233ad 100644 --- a/hellocardboard-android/src/main/res/layout/activity_vr.xml +++ b/hellocardboard-android/src/main/res/layout/activity_vr.xml @@ -16,6 +16,8 @@ android:id="@+id/ui_back_button_holder" android:layout_alignParentStart="true" android:layout_alignParentTop="true" + android:layout_marginStart="18dp" + android:layout_marginTop="18dp" android:layout_width="84dp" android:layout_height="84dp"> CFBundlePackageType APPL CFBundleShortVersionString - 1.32.0 + 1.33.0 CFBundleVersion - 1.32.0 + 1.33.0 LSRequiresIPhoneOS NSCameraUsageDescription diff --git a/sdk/qrcode/android/java/com/google/cardboard/sdk/QrCodeCaptureActivity.java b/sdk/qrcode/android/java/com/google/cardboard/sdk/QrCodeCaptureActivity.java index 5b8aaff2..732d0048 100755 --- a/sdk/qrcode/android/java/com/google/cardboard/sdk/QrCodeCaptureActivity.java +++ b/sdk/qrcode/android/java/com/google/cardboard/sdk/QrCodeCaptureActivity.java @@ -34,7 +34,9 @@ import androidx.core.app.ActivityCompat; import androidx.core.graphics.Insets; import androidx.core.view.ViewCompat; +import androidx.core.view.WindowCompat; import androidx.core.view.WindowInsetsCompat; +import androidx.core.view.WindowInsetsControllerCompat; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GoogleApiAvailability; import com.google.android.gms.vision.MultiProcessor; @@ -77,20 +79,13 @@ public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.qr_code_capture); - // Adds margins to the container to account for edge to edge: - // https://developer.android.com/develop/ui/views/layout/edge-to-edge - View container = findViewById(R.id.container); - ViewCompat.setOnApplyWindowInsetsListener( - container, - (v, windowInsets) -> { - Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()); - ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams) v.getLayoutParams(); - mlp.leftMargin = insets.left; - mlp.bottomMargin = insets.bottom; - mlp.rightMargin = insets.right; - v.setLayoutParams(mlp); - return WindowInsetsCompat.CONSUMED; - }); + // Hide system bars + WindowCompat.setDecorFitsSystemWindows(getWindow(), false); + WindowInsetsControllerCompat windowInsetsController = + new WindowInsetsControllerCompat(getWindow(), getWindow().getDecorView()); + windowInsetsController.hide(WindowInsetsCompat.Type.systemBars()); + windowInsetsController.setSystemBarsBehavior( + WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE); cameraSourcePreview = findViewById(R.id.preview); }