Lock activity to portrait; drop all camera-image rotation tracking

Stop trying to rotate the camera image based on device orientation.
The activity is now locked to portrait (screenOrientation="portrait"),
so the GL surface stays portrait-sized regardless of how the device
is held, and the camera passthrough goes back to the simple
texCoordsBack 90° rotation that was working before any of the
v1.1.6–1.1.13 attempts at landscape support.

Net effect: the camera image stays in the device's portrait frame
and visually follows the phone as it tilts (since there is no
inverse rotation cancelling it). The UI is also locked to the
portrait layout for now — a follow-up will add Modifier.graphicsLayer
rotations to the icon overlays so they stay readable when the phone
is held sideways. screenOrientation switched from fullSensor to
portrait; the rest of the file changes are reverts of the orientation
plumbing introduced in v1.1.6 and its follow-ups.

Bump to 1.1.14.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2026-05-11 16:44:23 +02:00
commit e4892c4b12
4 changed files with 24 additions and 78 deletions

View file

@ -1,13 +1,9 @@
package no.naiv.tiltshift.ui
import android.content.Context
import android.content.Intent
import android.graphics.SurfaceTexture
import android.hardware.display.DisplayManager
import android.opengl.GLSurfaceView
import android.util.Log
import android.view.Display
import android.view.Surface
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
@ -168,23 +164,6 @@ fun CameraScreen(
}
}
// Forward the activity's actual rotation (Display.rotation) to the
// renderer so the camera image stays world-aligned as the activity rotates
// with the device. Don't drive this from OrientationEventListener — its
// 45° threshold fires *before* the activity has rotated, briefly leaving
// the texcoord set out of sync with the GL surface orientation.
// LocalConfiguration triggers a recomposition on configuration change,
// which is when Display.rotation can have changed.
val configuration = androidx.compose.ui.platform.LocalConfiguration.current
val displayRotation = remember(configuration) {
val displayManager = context.getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
displayManager.getDisplay(Display.DEFAULT_DISPLAY)?.rotation ?: Surface.ROTATION_0
}
LaunchedEffect(displayRotation, renderer) {
renderer?.setDisplayRotation(displayRotation)
glSurfaceView?.requestRender()
}
// Start camera when surface texture is available
LaunchedEffect(surfaceTexture) {
surfaceTexture?.let {