Auto commit Thu Apr 9 09:01:02 PM CDT 2026

This commit is contained in:
Tretzi
2026-04-09 21:01:02 -05:00
parent 75c6df6188
commit 1a3508d527

View File

@@ -2,6 +2,7 @@ package com.mindmachine.mvp
import android.app.Activity
import android.content.pm.ActivityInfo
import android.graphics.BitmapFactory
import android.os.Bundle
import android.view.WindowManager
import androidx.activity.ComponentActivity
@@ -9,6 +10,7 @@ import androidx.activity.compose.BackHandler
import androidx.activity.compose.setContent
import androidx.activity.viewModels
import androidx.compose.foundation.background
import androidx.compose.foundation.Image
import com.mindmachine.mvp.session.DurationSliderCard
import com.mindmachine.mvp.session.SetupTimelineEditor
import androidx.compose.foundation.clickable
@@ -24,6 +26,7 @@ import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeDrawingPadding
@@ -39,6 +42,7 @@ import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.Delete
import androidx.compose.material.icons.filled.PlayArrow
import androidx.compose.material.icons.filled.Settings
import androidx.compose.ui.res.painterResource
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button
import androidx.compose.material3.Card
@@ -73,6 +77,7 @@ import androidx.compose.runtime.withFrameNanos
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalLifecycleOwner
@@ -110,6 +115,8 @@ import kotlinx.coroutines.delay
import kotlin.math.roundToInt
import java.util.Locale
import com.mindmachine.mvp.R
private const val SESSION_ENTRY_HOME = "home"
private const val SESSION_ENTRY_SETUP = "setup"
@@ -205,7 +212,19 @@ fun App(vm: MainViewModel = viewModel()) {
.fillMaxSize()
.safeDrawingPadding()
) {
TopAppBar(title = { Text("MindMachine") }, actions = {
TopAppBar(
title = {
Row(verticalAlignment = Alignment.CenterVertically) {
Icon(
painter = painterResource(id = R.mipmap.ic_launcher),
contentDescription = "MindMachine",
modifier = Modifier.size(20.dp)
)
Spacer(Modifier.width(8.dp))
Text("MindMachine")
}
},
actions = {
IconButton(
onClick = {
vm.createNewProgramDraft()
@@ -217,7 +236,8 @@ fun App(vm: MainViewModel = viewModel()) {
IconButton(onClick = { nav.navigate("settings") }) {
Icon(Icons.Filled.Settings, contentDescription = "Settings")
}
})
}
)
LazyColumn(Modifier.padding(12.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) {
item {
TextButton(onClick = { nav.navigate("holder") }) { Text("User Guidance/Disclaimer") }
@@ -811,6 +831,7 @@ fun SettingsScreen(vm: MainViewModel) {
@Composable
fun PositioningScreen() {
val context = LocalContext.current
Column(
Modifier
.fillMaxSize()
@@ -820,10 +841,36 @@ fun PositioningScreen() {
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
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("• 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("• Do not place the phone directly on your eyes or apply pressure.", color = MaterialTheme.colorScheme.onBackground)
Text("• Do not rest the phone on your eyes or put pressure on your face.", color = MaterialTheme.colorScheme.onBackground)
Text("• Ensure comfortable breathing/airflow and stop if you feel discomfort.", color = MaterialTheme.colorScheme.onBackground)
Spacer(Modifier.height(12.dp))
Text("Disclaimer", style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onBackground)
Text(
"MindMachine is provided \"as is\" for informational and experimental purposes only, without warranties of any kind. You assume all risks of use. MindMachine is not a medical device and does not provide medical advice. To the maximum extent permitted by law, the developers and distributors disclaim all liability for any claims, damages, losses, or injuries arising from or related to use of the app.",
color = MaterialTheme.colorScheme.onBackground
)
}
}