Skip to content

Commit

Permalink
Add deposit & withdraw screen
Browse files Browse the repository at this point in the history
Not complete yet

Signed-off-by: starry-shivam <krshivam24@proton.me>
  • Loading branch information
starry-shivam committed Feb 19, 2024
1 parent 1fa8b3b commit 268eea5
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
package com.starry.greenstash.ui.screens.input.composables

import androidx.compose.foundation.layout.Arrangement
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.material.Scaffold
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.Card
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.surfaceColorAtElevation
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.airbnb.lottie.compose.LottieAnimation
import com.airbnb.lottie.compose.LottieCompositionResult
import com.airbnb.lottie.compose.LottieCompositionSpec
import com.airbnb.lottie.compose.animateLottieCompositionAsState
import com.airbnb.lottie.compose.rememberLottieComposition
import com.starry.greenstash.R
import com.starry.greenstash.ui.theme.greenstashFont

@ExperimentalMaterial3Api
@Composable
fun DWScreen() {
Scaffold(topBar = {

TopAppBar(modifier = Modifier.fillMaxWidth(), title = {
Text(
text = "Deposit",
maxLines = 1,
overflow = TextOverflow.Ellipsis,
fontFamily = greenstashFont
)
}, navigationIcon = {
IconButton(onClick = { }) {
Icon(
imageVector = Icons.Filled.ArrowBack, contentDescription = null
)
}
}, colors = TopAppBarDefaults.centerAlignedTopAppBarColors(
containerColor = MaterialTheme.colorScheme.surfaceColorAtElevation(4.dp)
)
)

}) { paddingValues ->
Column(
modifier = Modifier
.fillMaxSize()
.padding(paddingValues),
horizontalAlignment = Alignment.CenterHorizontally,
) {
val compositionResult: LottieCompositionResult = rememberLottieComposition(
spec = LottieCompositionSpec.RawRes(R.raw.no_transactions_lottie)
)
val progressAnimation by animateLottieCompositionAsState(
compositionResult.value, isPlaying = true, iterations = 1, speed = 1f
)

LottieAnimation(
composition = compositionResult.value,
progress = progressAnimation,
modifier = Modifier.size(320.dp),
enableMergePaths = true
)

Card(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp, vertical = 8.dp)
) {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
horizontalArrangement = Arrangement.Center
) {
Row {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_dw_date),
contentDescription = null,
modifier = Modifier.size(24.dp)
)
Text(
text = "12/12/2021",
fontFamily = greenstashFont,
fontWeight = FontWeight.Medium,
modifier = Modifier.padding(start = 8.dp, top = 2.dp)
)
}

Spacer(modifier = Modifier.width(24.dp))

Row {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_dw_time),
contentDescription = null,
modifier = Modifier.size(24.dp)
)
Text(
text = "12:00 PM",
fontFamily = greenstashFont,
fontWeight = FontWeight.Medium,
modifier = Modifier.padding(start = 8.dp, top = 2.dp)
)
}


}
}


}
}
}

@ExperimentalMaterial3Api
@Preview
@Composable
private fun PV() {
DWScreen()
}
7 changes: 7 additions & 0 deletions app/src/main/res/drawable/ic_dw_date.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<vector android:height="24dp" android:viewportHeight="24"
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#00000000"
android:pathData="M3,9H21M9,15L11,17L15,13M7,3V5M17,3V5M6.2,21H17.8C18.92,21 19.48,21 19.908,20.782C20.284,20.59 20.59,20.284 20.782,19.908C21,19.48 21,18.92 21,17.8V8.2C21,7.08 21,6.52 20.782,6.092C20.59,5.716 20.284,5.41 19.908,5.218C19.48,5 18.92,5 17.8,5H6.2C5.08,5 4.52,5 4.092,5.218C3.716,5.41 3.41,5.716 3.218,6.092C3,6.52 3,7.08 3,8.2V17.8C3,18.92 3,19.48 3.218,19.908C3.41,20.284 3.716,20.59 4.092,20.782C4.52,21 5.08,21 6.2,21Z"
android:strokeColor="#000000" android:strokeLineCap="round"
android:strokeLineJoin="round" android:strokeWidth="2"/>
</vector>
7 changes: 7 additions & 0 deletions app/src/main/res/drawable/ic_dw_time.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<vector android:height="24dp" android:viewportHeight="24"
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#00000000"
android:pathData="M3,5.5L5,3.5M21,5.5L19,3.5M9,12.5L11,14.5L15,10.5M20,12.5C20,16.918 16.418,20.5 12,20.5C7.582,20.5 4,16.918 4,12.5C4,8.082 7.582,4.5 12,4.5C16.418,4.5 20,8.082 20,12.5Z"
android:strokeColor="#000000" android:strokeLineCap="round"
android:strokeLineJoin="round" android:strokeWidth="2"/>
</vector>

0 comments on commit 268eea5

Please sign in to comment.