-
Notifications
You must be signed in to change notification settings - Fork 623
Draft: report migrate to cmp #2392
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
base: kmp-impl
Are you sure you want to change the base?
Conversation
...system/src/commonMain/kotlin/com/mifos/core/designsystem/component/MifosTextFieldDropdown.kt
Outdated
Show resolved
Hide resolved
//// PermissionBox( | ||
//// requiredPermissions = if (Build.VERSION.SDK_INT >= 33) { | ||
//// listOf(Manifest.permission.READ_MEDIA_IMAGES) | ||
//// } else { |
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.
don't comment it use expect/actual for it we need to take permission from user for accessing to their storage. for the logic of taking permission use expect/actual do the implementation only for android now.
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'm currently facing some challenges in migrating the permission logic using expect/actual. could guide me through the expected structure or share a reference implementation to help me proceed correctly.
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.
@kapmaurya i can't fully provide you the code but we can use expect/actual
for any logic: (function, composable function, variables...).
- look at below code in
kmp-project-template
how we handle thecolorScheme
cause the dynamic theme is only for android so we they made expect/acutal and different implementation for each platform.
@Composable
expect fun colorScheme(useDarkTheme: Boolean, dynamicColor: Boolean): ColorScheme
- or another good example can be
expect fun supportsDynamicTheming(): Boolean
https://github.com/openMF/kmp-project-template/blob/dev/feature/settings/src/commonMain/kotlin/org/mifos/feature/settings/Platform.kt that how i make it expect/actual and accordingly i call it at line80 of SettingsDialog.kt
to show also the option of dynamic theme for users who have an android device but not for other platforms
expect fun getPlatform(): Platform
enum class Platform {
Android,
Desktop,
IOS,
JS,
Wasm,
}
expect fun supportsDynamicTheming(): Boolean
feature/report/src/commonMain/kotlin/com/mifos/feature/report/report/ReportViewModel.kt
Outdated
Show resolved
Hide resolved
.../report/src/commonMain/kotlin/com/mifos/feature/report/reportDetail/ReportDetailViewModel.kt
Outdated
Show resolved
Hide resolved
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.
@kapmaurya don't add anything to libs.toml i think every required thing is added already,
if in any particul;ar case you are using any different librarie for kmp include it only.
Remove auto generated wild card <*>
Don't comment previews
feature/report/src/commonMain/kotlin/com/mifos/feature/report/report/ReportScreen.kt
Outdated
Show resolved
Hide resolved
...ure/report/src/commonMain/kotlin/com/mifos/feature/report/reportDetail/ReportDetailScreen.kt
Outdated
Show resolved
Hide resolved
.../report/src/commonMain/kotlin/com/mifos/feature/report/reportDetail/ReportDetailViewModel.kt
Outdated
Show resolved
Hide resolved
@kapmaurya status of this? |
# Conflicts: # cmp-navigation/src/commonMain/kotlin/cmp/navigation/di/KoinModules.kt # core/designsystem/src/commonMain/kotlin/com/mifos/core/designsystem/component/MifosTextFieldDropdown.kt # settings.gradle.kts
# Conflicts: # cmp-navigation/src/commonMain/kotlin/cmp/navigation/di/KoinModules.kt # core/designsystem/src/commonMain/kotlin/com/mifos/core/designsystem/component/MifosTextFieldDropdown.kt # settings.gradle.kts
Fixes - Jira-#Issue_Number
Didn't create a Jira ticket, click here to create new.
Please Add Screenshots If there are any UI changes.
Please make sure these boxes are checked before submitting your pull request - thanks!
Run the static analysis check
./gradlew check
orci-prepush.sh
to make sure you didn't break anythingIf you have multiple commits please combine them into one commit by squashing them.