-
Notifications
You must be signed in to change notification settings - Fork 604
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
Feat: Migrate :core:designsystem to KMP #2290
base: kmp-impl
Are you sure you want to change the base?
Conversation
@@ -23,6 +21,7 @@ import androidx.compose.ui.geometry.Offset | |||
import androidx.compose.ui.graphics.Color | |||
import androidx.compose.ui.graphics.drawscope.Stroke | |||
import androidx.compose.ui.input.pointer.pointerInteropFilter |
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 couldn't resolve the pointerInteropFilter and android.view.MotionEvent issue.
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 worry, we'll fix it later for now just move this file to androidMain source-set
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.
MifosDrawingCanvas.kt moved to androidMain source-set
import com.mifos.core.designsystem.theme.DarkGray | ||
import org.jetbrains.compose.resources.stringResource | ||
import androidclient.core.designsystem.generated.resources.Res | ||
import androidclient.core.designsystem.generated.resources.core_designsystem_ic_error_black_24dp |
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 am not satisfied with this resolution of adding the string resources, it temporary resolves the issue, however, I don't think it is an optimized approach.
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.
You could change the package name in build.gradle.kts
file and you've to run the command again to generate resources and update all usages with new package name..
./gradlew :core:designsystem:generateResourceAccessorsForCommonMain
designsystem/build.gradle.kts
compose.resources {
publicResClass = true
generateResClass = always
packageOfResClass = "core.designsystem.generated.resources"
}
and after running the above command all generated resources can be accesbile using core.designsystem.generated.resources.core_designsystem_ic_error_black_24dp
etc..
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 will do as suggested.
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.
This is done.
*/ | ||
package com.mifos.core.designsystem.theme | ||
|
||
import androidclient.core.designsystem.generated.resources.Res |
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.
Here I tried using android_client instead of androidclient, however, the generated resources in build folder has package named androidclient and not android_client
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.
Resolved in previous comment.
@@ -23,6 +21,7 @@ import androidx.compose.ui.geometry.Offset | |||
import androidx.compose.ui.graphics.Color | |||
import androidx.compose.ui.graphics.drawscope.Stroke | |||
import androidx.compose.ui.input.pointer.pointerInteropFilter |
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 worry, we'll fix it later for now just move this file to androidMain source-set
@@ -80,7 +75,7 @@ fun MifosOutlinedTextField( | |||
Icon( | |||
imageVector = icon, | |||
contentDescription = null, | |||
tint = if (isSystemInDarkTheme()) White else DarkGray, | |||
tint = if (isSystemInDarkTheme()) onPrimaryLight else secondaryLight, |
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.
Remove this line, no need to add any direct color for different modes, it will automatically applied based on theme mode.
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.
Line removed.
@@ -90,7 +85,7 @@ fun MifosOutlinedTextField( | |||
maxLines = maxLines, | |||
singleLine = singleLine, | |||
colors = OutlinedTextFieldDefaults.colors( | |||
focusedBorderColor = if (isSystemInDarkTheme()) BluePrimaryDark else BluePrimary, | |||
focusedBorderColor = if (isSystemInDarkTheme()) primaryDark else primaryLight, |
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.
remove this too, and recheck every composable if we are applying color directly instead of material theme remove that, no need to configure such thing
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.
Removed the mentioned line, I will check the other composables.
Text( | ||
text = "Invalid OTP", | ||
style = MaterialTheme.typography.bodyMedium, | ||
color = Color.Red, |
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.
Remove this too
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.
Removed the line. Just to let you know that this was taken from kmp-template, this has also been used in mifos-mobile :core:designsystem
.wrapContentHeight(align = Alignment.CenterVertically), | ||
text = char, | ||
style = MaterialTheme.typography.headlineSmall, | ||
color = if (isFocused) { |
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.
use Material Color like for focused use secondary and if not focused use teritory/surface color etc
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.
Used Material Color as you suggested.
@@ -74,7 +70,7 @@ fun MifosCircularProgress( | |||
.height(60.dp) | |||
.padding(8.dp), | |||
strokeWidth = 4.dp, | |||
color = DarkGray, | |||
color = secondaryLight, |
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.
remove this too
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.
Removed the line.
@biplab1 I'm commenting on one thread since you had to change all composable, and I've commented on a few components above
|
@niyajali I am working to implement all your suggestions. |
I couldn't find the component related to 4th point. Rest of the points I think I have implemented. |
Fixes - Jira-#I334
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.