Starting to make changes. Alt+Enter not working properly on laptop though, so committing to work on a different one.

This commit is contained in:
Hyperling 2024-07-20 10:42:12 -07:00
parent f5b54f4b4a
commit dcca201a91

View File

@ -9,20 +9,30 @@ import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.material3.Button
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import com.hyperling.expensetracker.ui.theme.ExpenseTrackerTheme
import androidx.compose.ui.unit.sp
// Activity which allows data to be entered and saved to Shared Preferences.
@ -61,30 +71,60 @@ fun CreateExpense() {
editor.putString("Test", "Test")
returnToMain()
}
Column (
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
modifier = Modifier.fillMaxSize()
) {
Row (
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center
horizontalArrangement = Arrangement.Center,
) {
Text(
text = "New Expense Screen"
text = "Add New Expense",
fontSize = 32.sp,
fontWeight = FontWeight.Bold
)
}
Row (
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center,
) {
var text by remember { mutableStateOf("") }
TextField(
value = text,
onValueChange = { text = it },
label = { Text("Label") }
)
}
Row (
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center
) {
Button(onClick = { returnToMain() }) {
Text(text = "Cancel")
}
Button(onClick = { saveAndReturn() }) {
Spacer(modifier = Modifier.weight(1f))
Button(
onClick = { saveAndReturn() },
Modifier.weight(3f))
{
Text(text = "Save")
}
Spacer(modifier = Modifier.weight(1f))
Button(
onClick = { returnToMain() },
Modifier.weight(3f))
{
Text(text = "Cancel")
}
Spacer(modifier = Modifier.weight(1f))
}
}