Skip to content
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(feature:about): Migrate about module to CMP #2761

Open
wants to merge 5 commits into
base: kmp-impl
Choose a base branch
from

Conversation

HekmatullahAmin
Copy link
Contributor

@HekmatullahAmin HekmatullahAmin commented Feb 6, 2025

Fixes - Jira-#126

Didn't create a Jira ticket, click here to create new.

Please Add Screenshots If there are any UI changes.

Before After
AboutScreen.mp4

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the static analysis check ./gradlew check or ci-prepush.sh to make sure you didn't break anything

  • If you have multiple commits please combine them into one commit by squashing them.

Copy link
Collaborator

@niyajali niyajali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HekmatullahAmin And there are a lot of compose library available to show open source library usages like google OSS use those instead, we no need to use WebView anymore

@niyajali
Copy link
Collaborator

niyajali commented Feb 7, 2025

@HekmatullahAmin
Copy link
Contributor Author

Hi @niyajali ,

I’ve implemented the changes as you suggested. Regarding the openUrl() function, it’s actually an expect function that provides platform-specific implementations to navigate to the given URL.

About the library you mentioned, I brought it up during the stand-up, and Mr. @therajanmaurya advised against adding any external libraries for now. As for the openUrl implementation, I’ve commented it out because it uses Intent, which requires a Context. For a small app I worked on previously, I passed an Application instance, and it worked. However, for mifos-mobile, I can’t pass the AndroidApp instance to the openUrl function.

Another potential approach could be adding a custom Application for the about module and updating its manifest, but I don’t think that would be the best solution either.

Let me know your thoughts!

@therajanmaurya
Copy link
Member

I want to keep the ticket scope as less as possible and we will implement the intent library in different ticket

@HekmatullahAmin HekmatullahAmin force-pushed the MM-126 branch 2 times, most recently from fdbbc8e to 7739aa6 Compare February 10, 2025 17:11
- Implemented `openUrl` function for every platform.
- Used `Intent` for Android to handle URL opening.
- Added platform-specific implementations for Native, Desktop, and wasmJs.
@HekmatullahAmin
Copy link
Contributor Author

@niyajali If you're happy with this PR, please approve it so it can be merged.

Copy link
Collaborator

@niyajali niyajali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, here's the few things we have to maintain all over the project, make sure you've followed the same..

@HekmatullahAmin @Nagarjuna0033 @revanthkumarJ

  1. LazyColumn State:

    • Always pass the LazyColumn state as a function parameter wherever it is used.
  2. Keys for LazyColumn Items:

    • Ensure that every item in a LazyColumn has a unique key provided.
  3. Consistent Padding/Spacing:

    • Use 16.dp for padding and spacing consistently across the project where applicable.
  4. Named Arguments:

    • Always use named arguments when calling functions/class to improve readability and maintainability.
  5. State Hoisting:

    • Maintain and hoist state from the top-level composable to ensure better state management.

And use the above mentioned library for licence, I’ll discuss with the @therajanmaurya and explain the situation. No need to worry about this; I’ll handle it. Once the changes are implemented, let me know, and we’ll proceed with merging this PR.


import android.app.Application

class AndroidApp : Application() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we're creating another application for one feature, we can't do that..

@HekmatullahAmin
Copy link
Contributor Author

Hi @niyajali ,

Thanks for reviewing my PR! I’ve made sure to apply the necessary changes based on the project guidelines you shared. Specifically:

I really appreciate you sharing these best practices.

Regarding the License, this is not in the scope of my PR. As seen in the aboutUsNavGraph, the navigateToOssLicense function is simply assigned and will be handled elsewhere. So, this part doesn't require changes from my side. But I will work on another PR and will implement the library you suggested me.

As for why I created another application, that was just for testing purposes. In my PR, I had commented them out, and now, I have deleted them entirely.

Screenshot 2025-02-11 at 20 48 20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants