Fix crash: remove positioning guide image loading

This commit is contained in:
Tretzi
2026-04-09 21:17:10 -05:00
parent 74e0953eab
commit 8dd6b9b720

View File

@@ -2,7 +2,6 @@ package com.mindmachine.mvp
import android.app.Activity import android.app.Activity
import android.content.pm.ActivityInfo import android.content.pm.ActivityInfo
import android.graphics.BitmapFactory
import android.os.Bundle import android.os.Bundle
import android.view.WindowManager import android.view.WindowManager
import androidx.activity.ComponentActivity import androidx.activity.ComponentActivity
@@ -10,7 +9,6 @@ import androidx.activity.compose.BackHandler
import androidx.activity.compose.setContent import androidx.activity.compose.setContent
import androidx.activity.viewModels import androidx.activity.viewModels
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.Image
import com.mindmachine.mvp.session.DurationSliderCard import com.mindmachine.mvp.session.DurationSliderCard
import com.mindmachine.mvp.session.SetupTimelineEditor import com.mindmachine.mvp.session.SetupTimelineEditor
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
@@ -77,7 +75,6 @@ import androidx.compose.runtime.withFrameNanos
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalLifecycleOwner import androidx.compose.ui.platform.LocalLifecycleOwner
@@ -831,7 +828,6 @@ fun SettingsScreen(vm: MainViewModel) {
@Composable @Composable
fun PositioningScreen() { fun PositioningScreen() {
val context = LocalContext.current
Column( Column(
Modifier Modifier
.fillMaxSize() .fillMaxSize()
@@ -842,24 +838,6 @@ fun PositioningScreen() {
) { ) {
Text("Positioning Guidance", style = MaterialTheme.typography.headlineSmall, color = MaterialTheme.colorScheme.onBackground) Text("Positioning Guidance", style = MaterialTheme.typography.headlineSmall, color = MaterialTheme.colorScheme.onBackground)
// Guide image (from assets)
val guideBitmap = remember {
runCatching {
context.assets.open("positioning_guide.png").use { input ->
android.graphics.BitmapFactory.decodeStream(input)
}
}.getOrNull()
}
if (guideBitmap != null) {
Image(
bitmap = guideBitmap.asImageBitmap(),
contentDescription = "Positioning guide",
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 8.dp)
)
}
Text("• Lie on your back in a safe, comfortable place.", color = MaterialTheme.colorScheme.onBackground) Text("• Lie on your back in a safe, comfortable place.", color = MaterialTheme.colorScheme.onBackground)
Text("• Rest the phone across the upper nose/forehead area so it stays stable.", color = MaterialTheme.colorScheme.onBackground) Text("• Rest the phone across the upper nose/forehead area so it stays stable.", color = MaterialTheme.colorScheme.onBackground)
Text("• Keep your eyes closed during immersive visual sessions.", color = MaterialTheme.colorScheme.onBackground) Text("• Keep your eyes closed during immersive visual sessions.", color = MaterialTheme.colorScheme.onBackground)