-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split app into modules #131
base: main
Are you sure you want to change the base?
Conversation
), | ||
) | ||
|
||
override suspend fun getTimestamp(type: TimestampType) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to include return type here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give an argument? Other modules use TimestampRepo
where return types are specified and don't know about TimestampRepoImpl
. Also this is allowed by ktlint.
|
||
@Singleton | ||
class TimestampRepoImpl @Inject constructor(private val dao: TimestampDao) : TimestampRepo { | ||
override suspend fun rememberTimestamp(type: TimestampType) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to include return type here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as getTimestamp
.height(44.dp) | ||
.border( | ||
1.dp, | ||
ArkColor.Border, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if this is named ArkRateColor
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see much difference, anyway we will refactor this to use colors from Theme
to support dark theme
Modules structure
Resources
All resources are located in
:core:presentation
. Keeping resources in feature modules and ensuring that they are not duplicated will be a mess. We can easily access them via type aliases.Navigation
Feature modules generate compose-destination classes. We collect them in app module and create a single graph manually.
compose-destinations
library works in destinations modeDI
We have
CoreComponent
in:core:di
that contains common dependencies withSingleton
scope. Feature modules create own components that depend onCoreComponent
with own scopes. App holdsCoreComponent
and provides it.Feature component are stored in separate object called
FeatureComponentHolder
inside the module. This is the easiest way to reuse component between compose screens in module.Notes
:core:di
and:core:db
needed to not expose:core:data
module and implementation so feature modules only know about:core:domain
and interfacesBuildConfigFields
andBuildConfigFieldsProvider
.BuildConfigFieldsProvider
created in:core:data
module and initialized in app module. So all modules can use the build config of app module.