Skip to content

Commit

Permalink
refactor: Moved components and utils to AppToolkit library
Browse files Browse the repository at this point in the history
- Moved various UI components (dialogs, preferences, spacers) and utility classes (ClipboardHelper, IntentsHelper, PermissionsHelper) to the AppToolkit library.
- Updated usages of these components and utils in the app to use the versions from AppToolkit.
- Updated dependencies and imports to reflect the move.
- Removed the now unused classes and resources from the app.
  • Loading branch information
Mihai-Cristian Condrea committed Jan 13, 2025
1 parent 5b628a2 commit 5f650f9
Show file tree
Hide file tree
Showing 54 changed files with 129 additions and 1,082 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- **Minor**: Updated Gradle dependencies to the latest versions for enhanced stability and speed.
- **Patch**: Fixed an issue where newly created carts wouldn’t open correctly.
- **Patch**: Updated string resources for better clarity and consistency across the app.
- **Patch**: Cleaned up unused code and optimized existing features for better performance.
- **Patch**: Cleaned up unused code and optimized existing features for better performance.
- **Patch**: Refactored some parts of the code to improve maintainability and efficiency.

# Version 1.1.3:
Expand Down
48 changes: 5 additions & 43 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {
minSdk = 23
targetSdk = 35
versionCode = 79
versionName = "1.2.0"
versionName = "1.2.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
resourceConfigurations += listOf(
"en" ,
Expand Down Expand Up @@ -94,29 +94,10 @@ android {
}

dependencies {

// AndroidX
implementation(dependencyNotation = libs.androidx.core.ktx)
implementation(dependencyNotation = libs.androidx.appcompat)
implementation(dependencyNotation = libs.androidx.core.splashscreen)
implementation(dependencyNotation = libs.androidx.multidex)
implementation(dependencyNotation = libs.androidx.work.runtime.ktx)

// Compose
implementation(dependencyNotation = platform(libs.androidx.compose.bom))
implementation(dependencyNotation = libs.androidx.activity.compose)
implementation(dependencyNotation = libs.androidx.animation.core)
implementation(dependencyNotation = libs.androidx.foundation)
implementation(dependencyNotation = libs.androidx.material.icons.extended)
implementation(dependencyNotation = libs.androidx.material3)
implementation(dependencyNotation = libs.androidx.runtime)
implementation(dependencyNotation = libs.androidx.runtime.livedata)
implementation(dependencyNotation = libs.androidx.ui)
implementation(dependencyNotation = libs.androidx.graphics.shapes)
implementation(dependencyNotation = libs.ui.tooling)
implementation(dependencyNotation = libs.datastore.preferences)
implementation(dependencyNotation = libs.androidx.datastore.preferences)
implementation(dependencyNotation = libs.androidx.navigation.compose)
// App Core
implementation(dependencyNotation = "com.github.D4rK7355608:AppToolkit:0.0.15") {
isTransitive = true
}

// Firebase
implementation(dependencyNotation = platform(libs.firebase.bom))
Expand All @@ -127,31 +108,12 @@ dependencies {
// Google
implementation(dependencyNotation = libs.play.services.ads)
implementation(dependencyNotation = libs.billing)
implementation(dependencyNotation = libs.material)
implementation(dependencyNotation = libs.review.ktx)
implementation(dependencyNotation = libs.app.update.ktx)
implementation(dependencyNotation = libs.volley)

// Images
implementation(dependencyNotation = libs.coil.compose)

// Kotlin
implementation(dependencyNotation = libs.kotlinx.coroutines.android)

// KSP
ksp(dependencyNotation = libs.androidx.room.compiler)
implementation(dependencyNotation = libs.androidx.room.ktx)
implementation(dependencyNotation = libs.androidx.room.runtime)

// Lifecycle
implementation(dependencyNotation = libs.androidx.lifecycle.runtime.ktx)
implementation(dependencyNotation = libs.androidx.lifecycle.livedata.ktx)
implementation(dependencyNotation = libs.androidx.lifecycle.process)
implementation(dependencyNotation = libs.androidx.lifecycle.viewmodel.ktx)
implementation(dependencyNotation = libs.androidx.lifecycle.viewmodel.compose)
implementation(dependencyNotation = libs.androidx.lifecycle.runtime.compose)

// About
implementation(dependencyNotation = libs.aboutlibraries)
implementation(dependencyNotation = libs.core)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package com.d4rk.cartcalculator.data.core.ads

import android.app.Activity
import android.content.Context
import com.d4rk.android.libs.apptoolkit.utils.interfaces.OnShowAdCompleteListener
import com.d4rk.cartcalculator.data.core.AppCoreManager
import com.d4rk.cartcalculator.utils.constants.ads.AdsConstants
import com.d4rk.cartcalculator.data.datastore.DataStore
import com.d4rk.cartcalculator.utils.interfaces.OnShowAdCompleteListener
import com.google.android.gms.ads.AdError
import com.google.android.gms.ads.AdRequest
import com.google.android.gms.ads.FullScreenContentCallback
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.d4rk.cartcalculator.data.model.ui.screens

import com.d4rk.cartcalculator.data.model.ui.navigation.NavigationDrawerItem
import com.d4rk.android.libs.apptoolkit.data.model.ui.navigation.NavigationDrawerItem


data class UiMainScreen(
val navigationDrawerItems : List<NavigationDrawerItem> = listOf() ,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ 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.cartcalculator.R
import com.d4rk.cartcalculator.data.database.table.ShoppingCartTable
import com.d4rk.cartcalculator.ui.components.spacers.MediumVerticalSpacer
import java.util.Date

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ 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.cartcalculator.R
import com.d4rk.cartcalculator.data.database.table.ShoppingCartItemsTable
import com.d4rk.cartcalculator.ui.components.spacers.MediumVerticalSpacer

@Composable
fun AddNewCartItemAlertDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ 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.cartcalculator.R
import com.d4rk.cartcalculator.data.database.table.ShoppingCartTable
import com.d4rk.cartcalculator.ui.components.spacers.MediumVerticalSpacer

@Composable
fun DeleteCartAlertDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ 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.cartcalculator.R
import com.d4rk.cartcalculator.data.database.table.ShoppingCartItemsTable
import com.d4rk.cartcalculator.ui.components.spacers.MediumVerticalSpacer

@Composable
fun DeleteCartItemAlertDialog(
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringArrayResource
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.cartcalculator.R
import com.d4rk.cartcalculator.data.datastore.DataStore
import com.d4rk.cartcalculator.ui.components.spacers.MediumVerticalSpacer
import kotlinx.coroutines.flow.firstOrNull

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringArrayResource
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.cartcalculator.R
import com.d4rk.cartcalculator.data.datastore.DataStore
import com.d4rk.cartcalculator.ui.components.spacers.MediumVerticalSpacer
import kotlinx.coroutines.flow.firstOrNull

@Composable
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.platform.LocalHapticFeedback
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.dp
import com.d4rk.android.libs.apptoolkit.data.model.ui.animations.button.ButtonState
import com.d4rk.cartcalculator.data.core.AppCoreManager
import com.d4rk.cartcalculator.data.datastore.DataStore
import com.d4rk.cartcalculator.data.model.ui.button.ButtonState

@Composable
fun Modifier.bounceClick(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.d4rk.android.libs.apptoolkit.data.model.ui.navigation.NavigationDrawerItem
import com.d4rk.android.libs.apptoolkit.ui.components.spacers.LargeVerticalSpacer
import com.d4rk.android.libs.apptoolkit.utils.helpers.IntentsHelper
import com.d4rk.cartcalculator.R
import com.d4rk.cartcalculator.data.model.ui.navigation.NavigationDrawerItem
import com.d4rk.cartcalculator.data.model.ui.screens.UiMainScreen
import com.d4rk.cartcalculator.ui.components.modifiers.bounceClick
import com.d4rk.cartcalculator.ui.components.modifiers.hapticDrawerSwipe
import com.d4rk.cartcalculator.ui.components.spacers.LargeVerticalSpacer
import com.d4rk.cartcalculator.ui.screens.help.HelpActivity
import com.d4rk.cartcalculator.ui.screens.main.MainScreenContent
import com.d4rk.cartcalculator.ui.screens.main.MainViewModel
import com.d4rk.cartcalculator.ui.screens.settings.SettingsActivity
import com.d4rk.cartcalculator.utils.helpers.IntentsHelper
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch

Expand Down Expand Up @@ -75,7 +75,8 @@ fun NavigationDrawer(

R.string.share -> {
IntentsHelper.shareApp(
context = context
context = context,
shareMessageFormat = R.string.summary_share_message
)
}
}
Expand Down
Loading

0 comments on commit 5f650f9

Please sign in to comment.