Skip to content

Commit

Permalink
feat: Improved Ads Settings and refactored UI components
Browse files Browse the repository at this point in the history
- Updated the timestamp in `.idea/deploymentTargetSelector.xml`.
- Refactored `AdsSettingsScreen` to use `InfoMessageSection` instead of custom layouts and text.
- Removed unused imports and resources in `AdsSettingsScreen`.
- Updated the `AdsSettingsScreen` to be more concise and readable.
- Replaced `MediumVerticalSpacer` with `InfoMessageSection` in `DeleteCartItemAlertDialog`.
- Replaced `MediumVerticalSpacer` with `InfoMessageSection` in `AddNewCartAlertDialog`.
- Replaced `MediumVerticalSpacer` with `InfoMessageSection` in `DeleteCartAlertDialog`.
- Replaced `MediumVerticalSpacer` with `InfoMessageSection` in `SelectLanguageAlertDialog`.
- Updated `TopAppBarScaffoldWithBackButtonAndActions` to add more icons, improved logic, and added `AnimatedButtonDirection`.
- Refactored `TopAppBarMain` to add `AnimatedButtonDirection`.
- Replaced `MediumVerticalSpacer` with `InfoMessageSection` in `AddNewCartItemAlertDialog`.
- Refactored `Theme.kt` to use `apptoolkit` strings.
- Updated the app's version code to 83.
- Improved the logic of the cart buttons visibility and updated the imports in the `CartScreen`.
- Updated dependencies to version `0.0.63` in `build.gradle.kts`.
- Updated string values and removed unused strings.
- Improved the error messages by using the `apptoolkit` library.
- Updated `HelpScreen` to use `PaddingValues` and `safeContent`.
  • Loading branch information
Mihai-Cristian Condrea committed Feb 19, 2025
1 parent 0611c31 commit ec2ea8d
Show file tree
Hide file tree
Showing 41 changed files with 391 additions and 2,280 deletions.
2 changes: 1 addition & 1 deletion .idea/deploymentTargetSelector.xml

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

4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ android {
applicationId = "com.d4rk.cartcalculator"
minSdk = 23
targetSdk = 35
versionCode = 81
versionCode = 83
versionName = "1.2.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
@Suppress("UnstableApiUsage")
Expand Down Expand Up @@ -96,7 +96,7 @@ android {
dependencies {

// App Core
implementation(dependencyNotation = "com.github.D4rK7355608:AppToolkit:0.0.55") {
implementation(dependencyNotation = "com.github.D4rK7355608:AppToolkit:0.0.63") {
isTransitive = true
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Info
import androidx.compose.material.icons.outlined.ShoppingCartCheckout
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Icon
Expand All @@ -23,7 +22,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.unit.dp
import com.d4rk.android.libs.apptoolkit.ui.components.spacers.MediumVerticalSpacer
import com.d4rk.android.libs.apptoolkit.ui.components.layouts.sections.InfoMessageSection
import com.d4rk.cartcalculator.R
import com.d4rk.cartcalculator.data.database.table.ShoppingCartTable
import java.util.Date
Expand Down Expand Up @@ -88,9 +87,7 @@ fun AddNewCartAlertDialogContent(
}) ,
placeholder = { Text(text = stringResource(id = R.string.shopping_cart)) })
Spacer(modifier = Modifier.height(24.dp))
Icon(imageVector = Icons.Outlined.Info , contentDescription = null)
MediumVerticalSpacer()
Text(text = stringResource(id = R.string.summary_cart_dialog))
InfoMessageSection(message = stringResource(id = R.string.summary_cart_dialog))
}
newCart.value = ShoppingCartTable(name = nameText.value.ifEmpty { defaultName } , date = currentDate.time)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Info
import androidx.compose.material.icons.outlined.ShoppingBag
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Icon
Expand All @@ -27,7 +26,7 @@ import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp
import com.d4rk.android.libs.apptoolkit.ui.components.spacers.MediumVerticalSpacer
import com.d4rk.android.libs.apptoolkit.ui.components.layouts.sections.InfoMessageSection
import com.d4rk.cartcalculator.R
import com.d4rk.cartcalculator.data.database.table.ShoppingCartItemsTable

Expand Down Expand Up @@ -133,9 +132,7 @@ fun AddNewCartItemAlertDialogContent(
)

Spacer(modifier = Modifier.height(height = 24.dp))
Icon(imageVector = Icons.Outlined.Info , contentDescription = null)
MediumVerticalSpacer()
Text(text = stringResource(id = R.string.dialog_info_cart_item))
InfoMessageSection(message = stringResource(id = R.string.dialog_info_cart_item))
}

if (nameText.value.isNotBlank() && priceText.value.isNotBlank() && quantityText.value.isNotBlank()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Info
import androidx.compose.material.icons.outlined.RemoveShoppingCart
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Icon
Expand All @@ -16,7 +15,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.d4rk.android.libs.apptoolkit.ui.components.spacers.MediumVerticalSpacer
import com.d4rk.android.libs.apptoolkit.ui.components.layouts.sections.InfoMessageSection
import com.d4rk.cartcalculator.R
import com.d4rk.cartcalculator.data.database.table.ShoppingCartTable

Expand Down Expand Up @@ -61,11 +60,6 @@ fun DeleteCartAlertDialogContent(cart : ShoppingCartTable?) {
style = MaterialTheme.typography.bodyLarge
)
Spacer(modifier = Modifier.height(height = 24.dp))
Icon(imageVector = Icons.Outlined.Info , contentDescription = null)
MediumVerticalSpacer()
Text(
text = stringResource(id= R.string.delete_cart_warning , cart?.name ?: "") ,
style = MaterialTheme.typography.bodyLarge
)
InfoMessageSection(message = stringResource(id = R.string.delete_cart_warning, cart?.name ?: ""))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Info
import androidx.compose.material.icons.outlined.RemoveShoppingCart
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Icon
Expand All @@ -16,7 +15,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.d4rk.android.libs.apptoolkit.ui.components.spacers.MediumVerticalSpacer
import com.d4rk.android.libs.apptoolkit.ui.components.layouts.sections.InfoMessageSection
import com.d4rk.cartcalculator.R
import com.d4rk.cartcalculator.data.database.table.ShoppingCartItemsTable

Expand Down Expand Up @@ -64,12 +63,7 @@ fun DeleteCartItemAlertDialogContent(cartItem: ShoppingCartItemsTable) {
text = stringResource(id= R.string.delete_cart_item_message),
style = MaterialTheme.typography.bodyLarge,
)
Spacer(modifier = Modifier.height(24.dp))
Icon(imageVector = Icons.Outlined.Info, contentDescription = null)
MediumVerticalSpacer()
Text(
text = stringResource(id= R.string.delete_cart_item_warning, cartItem.name),
style = MaterialTheme.typography.bodyLarge
)
Spacer(modifier = Modifier.height(height = 24.dp))
InfoMessageSection(message = stringResource(id = R.string.delete_cart_item_warning, cartItem.name))
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.d4rk.cartcalculator.ui.components.dialogs

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.ContentPaste
Expand All @@ -21,6 +23,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.ClipboardManager
import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.d4rk.android.libs.apptoolkit.ui.components.layouts.sections.InfoMessageSection
import com.d4rk.cartcalculator.R

@Composable
fun ImportCartAlertDialog(onDismiss : () -> Unit , onImport : (String) -> Unit) {
Expand Down Expand Up @@ -58,5 +63,7 @@ fun ImportCartAlertDialogContent(cartLink : String , onCartLinkChange : (String)
Icon(modifier = Modifier.size(size = ButtonDefaults.IconSize) , imageVector = Icons.Outlined.ContentPaste , contentDescription = stringResource(id = android.R.string.paste))
}
})
Spacer(modifier = Modifier.height(height = 24.dp))
InfoMessageSection(message = stringResource(id = R.string.import_cart_instructions))
}
}
Loading

0 comments on commit ec2ea8d

Please sign in to comment.