Skip to content

Commit

Permalink
Merge pull request #2 from suyash01/theme-update
Browse files Browse the repository at this point in the history
Theme update
  • Loading branch information
suyash01 authored Aug 9, 2024
2 parents 78bf146 + b2a025e commit 2903324
Show file tree
Hide file tree
Showing 16 changed files with 733 additions and 299 deletions.
11 changes: 0 additions & 11 deletions .idea/other.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
kotlinOptions {
jvmTarget = "17"
jvmTarget = "21"
}
buildFeatures {
buildConfig = true
Expand All @@ -72,7 +72,7 @@ dependencies {
val hiltVersion = "2.51.1"
val roomVersion = "2.6.1"
val navVersion = "2.7.7"
val workVersion = "2.9.0"
val workVersion = "2.9.1"
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.4")
implementation("androidx.appcompat:appcompat:1.7.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import androidx.compose.material3.Surface
import androidx.compose.ui.Modifier
import androidx.core.app.ActivityCompat
import com.suyash.creditmanager.presentation.main.CreditManager
import com.suyash.creditmanager.ui.theme.CreditManagerTheme
import com.suyash.creditmanager.ui.theme.AppTheme
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
Expand All @@ -33,7 +33,7 @@ class MainActivity : AppCompatActivity() {
}

setContent {
CreditManagerTheme {
AppTheme(dynamicColor = false) {
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
Expand All @@ -16,6 +15,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
Expand Down Expand Up @@ -67,7 +67,9 @@ fun CreditCardsScreen(
Scaffold(
topBar = {
TopAppBar(
title = { Text(text = "Credit Cards") },
title = {
Text(text = "Credit Cards")
},
actions = {
IconButton(onClick = { isSortBottomSheetOpen = true }) {
Icon(
Expand All @@ -81,17 +83,19 @@ fun CreditCardsScreen(
floatingActionButton = {
FloatingActionButton(
modifier = Modifier.onGloballyPositioned { fabHeight = it.size.height },
onClick = { navController.navigate(Screen.AddEditCCScreen.route) }
onClick = { navController.navigate(Screen.AddEditCCScreen.route) },
containerColor = MaterialTheme.colorScheme.primary,
contentColor = MaterialTheme.colorScheme.onPrimary
) {
Icon(Icons.Filled.Add, "Add Credit Card")
}
}
) { contentPadding ->
LazyColumn(
modifier = Modifier
.padding(contentPadding),
modifier = Modifier.fillMaxWidth(),
contentPadding = PaddingValues(
bottom = fabHeightInDp + 16.dp
top = contentPadding.calculateTopPadding(),
bottom = contentPadding.calculateBottomPadding() + fabHeightInDp + 16.dp
)
) {
items(viewModel.state.value.creditCards) { creditCard ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ 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.material3.Card
import androidx.compose.material3.CardColors
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand All @@ -27,13 +29,20 @@ fun CreditCardItem(
countryCode: String,
modifier: Modifier = Modifier
) {
Column(
modifier = modifier
.padding(horizontal = 16.dp)
.padding(vertical = 8.dp)
Card(
modifier = modifier.padding(horizontal = 16.dp, vertical = 8.dp),
colors = CardColors(
containerColor = MaterialTheme.colorScheme.surfaceContainer,
contentColor = MaterialTheme.colorScheme.onSurface,
disabledContainerColor = MaterialTheme.colorScheme.surfaceContainer,
disabledContentColor = MaterialTheme.colorScheme.onSurface
)
) {
Row(
modifier = Modifier.fillMaxWidth()
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp)
.padding(vertical = 8.dp)
) {
Image(
modifier = Modifier.size(45.dp),
Expand Down Expand Up @@ -74,7 +83,7 @@ fun CreditCardItem(
style = MaterialTheme.typography.bodySmall,
)
Text(
text = creditCard.expiryDate.replaceRange(2,2, "/"),
text = creditCard.expiryDate.replaceRange(2, 2, "/"),
style = MaterialTheme.typography.bodySmall,
)
}
Expand All @@ -98,7 +107,8 @@ fun CreditCardItemPreview() {
5,
CardType.VISA,
550000,
"ICICI"),
"ICICI"
),
countryCode = "IN",
modifier = Modifier.fillMaxWidth()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
Expand All @@ -16,6 +15,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
Expand Down Expand Up @@ -81,18 +81,19 @@ fun EMIsScreen(
floatingActionButton = {
FloatingActionButton(
modifier = Modifier.onGloballyPositioned { fabHeight = it.size.height },
onClick = { navController.navigate(Screen.AddEditEMIScreen.route) }
onClick = { navController.navigate(Screen.AddEditEMIScreen.route) },
containerColor = MaterialTheme.colorScheme.primary,
contentColor = MaterialTheme.colorScheme.onPrimary
) {
Icon(Icons.Filled.Add, "Add EMI")
}
}
) {
paddingValues ->
) { contentPadding ->
LazyColumn(
modifier = Modifier
.padding(paddingValues),
modifier = Modifier.fillMaxWidth(),
contentPadding = PaddingValues(
bottom = fabHeightInDp + 16.dp
top = contentPadding.calculateTopPadding(),
bottom = contentPadding.calculateBottomPadding() + fabHeightInDp + 16.dp
)
) {
items(viewModel.state.value.emis) { emi ->
Expand All @@ -117,7 +118,7 @@ fun EMIsScreen(
)
}
}
if(openDeleteConfirmationDialog) {
if (openDeleteConfirmationDialog) {
CustomConfirmationDialog(
title = "Delete EMI?",
description = "Do you want to delete ${viewModel.state.value.selectedEMI?.name}",
Expand All @@ -129,7 +130,7 @@ fun EMIsScreen(
onDismissButton = { openDeleteConfirmationDialog = false }
)
}
if(isItemBottomSheetOpen) {
if (isItemBottomSheetOpen) {
CustomActionBottomSheet(
onDismissRequest = { isItemBottomSheetOpen = false },
actions = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Card
import androidx.compose.material3.CardColors
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand All @@ -27,13 +29,20 @@ fun EMIItem(
dateFormat: DateFormat,
modifier: Modifier
) {
Column(
modifier = modifier
.padding(horizontal = 16.dp)
.padding(vertical = 8.dp)
Card(
modifier = modifier.padding(horizontal = 16.dp, vertical = 8.dp),
colors = CardColors(
containerColor = MaterialTheme.colorScheme.surfaceContainer,
contentColor = MaterialTheme.colorScheme.onSurface,
disabledContainerColor = MaterialTheme.colorScheme.surfaceContainer,
disabledContentColor = MaterialTheme.colorScheme.onSurface
)
) {
Row(
modifier = Modifier.fillMaxWidth()
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp)
.padding(vertical = 8.dp)
) {
Column(
modifier = Modifier
Expand Down
Loading

0 comments on commit 2903324

Please sign in to comment.