-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added basic print-receipt functionality
- Loading branch information
1 parent
aea80b7
commit 3af4427
Showing
7 changed files
with
280 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ enum class Action { | |
ADMIN, | ||
LOGIN, | ||
LOGOUT, | ||
PRINT_RECEIPT, | ||
PURCHASE, | ||
PURCHASE_W_CASHBACK, | ||
REFUND, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
app/src/main/java/com/pax/ecr/app/ui/screen/PrintReceiptScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package com.pax.ecr.app.ui.screen | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.ButtonDefaults | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
|
||
@Composable | ||
fun PrintReceiptScreen( | ||
onPrintReceipt: () -> Unit, | ||
onContinue: () -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Column( | ||
modifier = | ||
modifier | ||
.fillMaxSize() | ||
.padding(16.dp), | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
verticalArrangement = Arrangement.Center, | ||
) { | ||
Text( | ||
text = "Transaction Complete", | ||
style = MaterialTheme.typography.titleLarge, | ||
fontSize = 24.sp, | ||
modifier = Modifier.padding(bottom = 32.dp), | ||
) | ||
|
||
Button( | ||
onClick = { onPrintReceipt() }, | ||
modifier = | ||
Modifier | ||
.fillMaxWidth() | ||
.padding(bottom = 16.dp), | ||
) { | ||
Text(text = "Print receipt") | ||
} | ||
|
||
Button( | ||
onClick = { onContinue() }, | ||
colors = | ||
ButtonDefaults.buttonColors( | ||
containerColor = Color.Black, | ||
contentColor = Color.White, | ||
), | ||
modifier = | ||
Modifier | ||
.fillMaxWidth(), | ||
) { | ||
Text(text = "Continue") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.