TranscationResultScreen ui
This commit is contained in:
parent
5904b4f69a
commit
42bd592c3e
@ -67,6 +67,10 @@ dependencies {
|
|||||||
implementation(libs.rxandroid)
|
implementation(libs.rxandroid)
|
||||||
implementation(libs.retrofit)
|
implementation(libs.retrofit)
|
||||||
implementation(libs.converter.gson)
|
implementation(libs.converter.gson)
|
||||||
|
// Core icons (usually included with material library)
|
||||||
|
implementation( libs.androidx.compose.material.icons.core)
|
||||||
|
// Extended icons (full set of icons)
|
||||||
|
implementation(libs.androidx.compose.material.icons.extended)
|
||||||
// splash screen
|
// splash screen
|
||||||
implementation(libs.androidx.core.splashscreen)
|
implementation(libs.androidx.core.splashscreen)
|
||||||
// local libs
|
// local libs
|
||||||
|
|||||||
@ -0,0 +1,43 @@
|
|||||||
|
package com.mob.utsmyanmar.ui.components.appbar
|
||||||
|
|
||||||
|
import android.graphics.drawable.Icon
|
||||||
|
import androidx.compose.material3.*
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.graphics.vector.ImageVector
|
||||||
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
|
import com.mob.utsmyanmar.ui.theme.Primary
|
||||||
|
import com.mob.utsmyanmar.ui.theme.White
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
|
@Composable
|
||||||
|
fun AppBar(
|
||||||
|
title: String,
|
||||||
|
onIconClick: (() -> Unit)? = null,
|
||||||
|
icon: ImageVector
|
||||||
|
) {
|
||||||
|
CenterAlignedTopAppBar(
|
||||||
|
title = {
|
||||||
|
Text(
|
||||||
|
text = title,
|
||||||
|
color = White,
|
||||||
|
fontWeight = FontWeight.SemiBold
|
||||||
|
)
|
||||||
|
},
|
||||||
|
navigationIcon = {
|
||||||
|
if (onIconClick != null) {
|
||||||
|
IconButton(
|
||||||
|
onClick = onIconClick
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = icon,
|
||||||
|
"Appbar icon",
|
||||||
|
tint = White
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
colors = TopAppBarDefaults.topAppBarColors(
|
||||||
|
containerColor = Primary
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
@ -5,6 +5,8 @@ import androidx.compose.foundation.background
|
|||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.Menu
|
||||||
import androidx.compose.material3.*
|
import androidx.compose.material3.*
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.rememberCoroutineScope
|
import androidx.compose.runtime.rememberCoroutineScope
|
||||||
@ -20,6 +22,7 @@ import com.mob.utsmyanmar.ui.theme.MOBPOSTheme
|
|||||||
import com.mob.utsmyanmar.ui.theme.*
|
import com.mob.utsmyanmar.ui.theme.*
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import com.mob.utsmyanmar.R
|
import com.mob.utsmyanmar.R
|
||||||
|
import com.mob.utsmyanmar.ui.components.appbar.AppBar
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
@ -113,28 +116,14 @@ fun DashboardScreen(
|
|||||||
) {
|
) {
|
||||||
Scaffold(
|
Scaffold(
|
||||||
topBar = {
|
topBar = {
|
||||||
CenterAlignedTopAppBar(
|
AppBar(
|
||||||
title = {
|
title = "Dashboard",
|
||||||
Text(text = "Dashboard", color = White, fontWeight = FontWeight.SemiBold)
|
icon = Icons.Default.Menu,
|
||||||
},
|
onIconClick = {
|
||||||
navigationIcon = {
|
scope.launch {
|
||||||
IconButton(
|
drawerState.open()
|
||||||
onClick = {
|
|
||||||
scope.launch {
|
|
||||||
drawerState.open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
Icon(
|
|
||||||
painter = painterResource(R.drawable.ic_menu),
|
|
||||||
contentDescription = "Menu Icon",
|
|
||||||
tint = White
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
colors = TopAppBarDefaults.topAppBarColors(
|
|
||||||
containerColor = Primary
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
) { paddingValues ->
|
) { paddingValues ->
|
||||||
|
|||||||
@ -1,41 +1,185 @@
|
|||||||
package com.mob.utsmyanmar.ui.transaction_result
|
package com.mob.utsmyanmar.ui.transaction_result
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
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.fillMaxSize
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.height
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.ChevronLeft
|
||||||
import androidx.compose.material3.Button
|
import androidx.compose.material3.Button
|
||||||
|
import androidx.compose.material3.ButtonColors
|
||||||
|
import androidx.compose.material3.Card
|
||||||
|
import androidx.compose.material3.CardDefaults
|
||||||
|
import androidx.compose.material3.CenterAlignedTopAppBar
|
||||||
import androidx.compose.material3.CircularProgressIndicator
|
import androidx.compose.material3.CircularProgressIndicator
|
||||||
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
|
import androidx.compose.material3.HorizontalDivider
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.blur
|
||||||
|
import androidx.compose.ui.res.painterResource
|
||||||
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import com.mob.utsmyanmar.R
|
||||||
|
import com.mob.utsmyanmar.ui.components.appbar.AppBar
|
||||||
|
import com.mob.utsmyanmar.ui.theme.Black
|
||||||
|
import com.mob.utsmyanmar.ui.theme.Primary
|
||||||
|
import com.mob.utsmyanmar.ui.theme.White
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun TransactionResultScreen(
|
fun TransactionResultScreen(
|
||||||
state: TransactionResultState,
|
state: TransactionResultState,
|
||||||
onEvent: (TransactionResultEvent) -> Unit
|
onEvent: (TransactionResultEvent) -> Unit,
|
||||||
) {
|
) {
|
||||||
Column(
|
Scaffold(
|
||||||
modifier = Modifier.fillMaxSize(),
|
topBar = {
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
AppBar(
|
||||||
verticalArrangement = Arrangement.Center
|
title = "Transaction Results",
|
||||||
) {
|
icon = Icons.Default.ChevronLeft,
|
||||||
Text(text = state.title)
|
onIconClick = { TransactionResultEvent.BackClick }
|
||||||
|
)
|
||||||
if (state.message.isNotEmpty()) {
|
|
||||||
Text(text = state.message)
|
|
||||||
}
|
}
|
||||||
|
) { paddingValues ->
|
||||||
if (state.isLoading) {
|
Column(
|
||||||
CircularProgressIndicator()
|
modifier = Modifier
|
||||||
}
|
.padding(paddingValues)
|
||||||
|
.fillMaxSize()
|
||||||
Button(
|
.padding(16.dp),
|
||||||
onClick = {
|
verticalArrangement = Arrangement.SpaceBetween
|
||||||
onEvent(TransactionResultEvent.BackClick)
|
|
||||||
}
|
|
||||||
) {
|
) {
|
||||||
Text("Back")
|
Column() {
|
||||||
|
|
||||||
|
Card(
|
||||||
|
colors = CardDefaults.cardColors(
|
||||||
|
containerColor = White
|
||||||
|
),
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.height(200.dp),
|
||||||
|
elevation = CardDefaults.cardElevation(
|
||||||
|
defaultElevation = 6.dp
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
) {
|
||||||
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
Icon(
|
||||||
|
painter = painterResource(R.drawable.ic_success),
|
||||||
|
modifier = Modifier.size(100.dp),
|
||||||
|
tint = Primary,
|
||||||
|
contentDescription = "success icon"
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
Text(
|
||||||
|
text = "Transaction Status",
|
||||||
|
textAlign = TextAlign.Center,
|
||||||
|
color = Black
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
Text(
|
||||||
|
text = state.message,
|
||||||
|
textAlign = TextAlign.Center,
|
||||||
|
color = Black
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Spacer(Modifier.height(24.dp))
|
||||||
|
|
||||||
|
Card(
|
||||||
|
colors = CardDefaults.cardColors(
|
||||||
|
containerColor = Primary
|
||||||
|
),
|
||||||
|
modifier = Modifier.fillMaxWidth().height(200.dp),
|
||||||
|
elevation = CardDefaults.cardElevation(
|
||||||
|
defaultElevation = 6.dp
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.padding(16.dp),
|
||||||
|
) {
|
||||||
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
Text(text = "Transaction Details", color = White)
|
||||||
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
|
Row(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
horizontalArrangement = Arrangement.SpaceBetween
|
||||||
|
) {
|
||||||
|
Text(text = "Amount", color = White)
|
||||||
|
Text(text = "1,000 MMK", color = White)
|
||||||
|
}
|
||||||
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
|
Row(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
horizontalArrangement = Arrangement.SpaceBetween
|
||||||
|
) {
|
||||||
|
Text(text = "Transaction Type", color = White)
|
||||||
|
Text(text = "MPU", color = White)
|
||||||
|
}
|
||||||
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
|
HorizontalDivider(thickness = 1.dp, color = White)
|
||||||
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
|
) {
|
||||||
|
Text(text = "Transaction Amount", color = White)
|
||||||
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
|
Text(text = "500.00 MMMK", color = White)
|
||||||
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
|
Text(text = "Received", color = White)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Button(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.height(50.dp),
|
||||||
|
colors = ButtonColors(
|
||||||
|
containerColor = Primary,
|
||||||
|
contentColor = White,
|
||||||
|
disabledContainerColor = Primary,
|
||||||
|
disabledContentColor = White,
|
||||||
|
),
|
||||||
|
shape = RoundedCornerShape(12.dp),
|
||||||
|
onClick = {}
|
||||||
|
) {
|
||||||
|
Text("Transaction Completed")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Preview(showBackground = true, showSystemUi = true)
|
||||||
|
@Composable
|
||||||
|
fun TransactionResultScreenPreview() {
|
||||||
|
TransactionResultScreen(
|
||||||
|
state = TransactionResultState(
|
||||||
|
title = "Transaction Success",
|
||||||
|
message = "Transaction Approved",
|
||||||
|
isLoading = false
|
||||||
|
),
|
||||||
|
onEvent = {}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
24
app/src/main/res/drawable/ic_success.xml
Normal file
24
app/src/main/res/drawable/ic_success.xml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<!--
|
||||||
|
~ Copyright (C) 2026 The Android Open Source Project
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="800dp"
|
||||||
|
android:height="800dp"
|
||||||
|
android:viewportWidth="52"
|
||||||
|
android:viewportHeight="52">
|
||||||
|
<path
|
||||||
|
android:pathData="M26,2C12.7,2 2,12.7 2,26s10.7,24 24,24s24,-10.7 24,-24S39.3,2 26,2zM39.4,20L24.1,35.5c-0.6,0.6 -1.6,0.6 -2.2,0L13.5,27c-0.6,-0.6 -0.6,-1.6 0,-2.2l2.2,-2.2c0.6,-0.6 1.6,-0.6 2.2,0l4.4,4.5c0.4,0.4 1.1,0.4 1.5,0L35,15.5c0.6,-0.6 1.6,-0.6 2.2,0l2.2,2.2C40.1,18.3 40.1,19.3 39.4,20z"
|
||||||
|
android:fillColor="#000000"/>
|
||||||
|
</vector>
|
||||||
@ -22,6 +22,8 @@ rxjava = "3.1.12"
|
|||||||
hiltNavigationCompose = "1.2.0"
|
hiltNavigationCompose = "1.2.0"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
androidx-compose-material-icons-core = { module = "androidx.compose.material:material-icons-core" }
|
||||||
|
androidx-compose-material-icons-extended = { module = "androidx.compose.material:material-icons-extended" }
|
||||||
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||||
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "coreSplashscreen" }
|
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "coreSplashscreen" }
|
||||||
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigationCompose" }
|
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigationCompose" }
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
o/PayLib-release-1.4.64-runtime
|
||||||
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
o/sunmiui-1.1.27-runtime
|
||||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user