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

Migration away from getScheme() calls #3235

Merged
merged 2 commits into from
Aug 10, 2023

Conversation

rapterjet2004
Copy link
Contributor

@rapterjet2004 rapterjet2004 commented Aug 3, 2023

fixes #3042

image

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

@rapterjet2004 rapterjet2004 self-assigned this Aug 3, 2023
@rapterjet2004 rapterjet2004 added 2. developing Work in progress technical debt Technical issue labels Aug 3, 2023
@rapterjet2004
Copy link
Contributor Author

rapterjet2004 commented Aug 4, 2023

@AndyScherzinger @AlvaroBrey
I'm not familiar with android common. Is there any reason why in ColorRole(internal val select: (Scheme) -> Int) the select function is internal? It would be helpful to use this functionality in TalkSpecificViewThemeUtils, as it enables the selection of colors without accessing the scheme directly. I wouldn't want to copy the same enum class in this project.

@AndyScherzinger
Copy link
Member

AndyScherzinger commented Aug 7, 2023

@rapterjet2004 for which theming call would you actually need it? Or why not use the scheme?

@rapterjet2004
Copy link
Contributor Author

rapterjet2004 commented Aug 7, 2023

@AndyScherzinger in com.nextcloud.talk.utils.message.MessageUtils the enrichChatReplyMessageText takes in a textColor: Int as it's parameter. The color passed is not always the same with it sometimes being R.color.nc_incoming_text_default and at other times being viewThemeUtils.getScheme(context).onSurfaceVariant.

I didn't want to hardcode any solution, so I figured that it would be best to use a ColorRole like they did in android commons.

@AndyScherzinger
Copy link
Member

Well, you could hard-code it because it is Talk specific. I guess one is incoming messages and the other is outgoing messages? So from a theming perspective one could argue that you actually want two distinct methods to reflect the theming by having "business functions", less generic, not specific and by name clear when to use which one.

@rapterjet2004 rapterjet2004 force-pushed the issue-3042-getSheme-migration branch 2 times, most recently from 4bde0a1 to 91208e2 Compare August 7, 2023 17:55
@rapterjet2004 rapterjet2004 marked this pull request as ready for review August 7, 2023 18:08
@rapterjet2004 rapterjet2004 added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 7, 2023
rapterjet2004 and others added 2 commits August 10, 2023 14:47
Signed-off-by: rapterjet2004 <[email protected]>
@AndyScherzinger AndyScherzinger merged commit 29d13f3 into master Aug 10, 2023
12 of 13 checks passed
@delete-merged-branch delete-merged-branch bot deleted the issue-3042-getSheme-migration branch August 10, 2023 12:47
@github-actions
Copy link
Contributor

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/3235-talk.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.

@AndyScherzinger AndyScherzinger added this to the 17.1.0 milestone Aug 10, 2023
@AndyScherzinger AndyScherzinger mentioned this pull request Aug 12, 2023
5 tasks
Copy link
Contributor

github-actions bot commented Apr 3, 2024

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews feedback-requested technical debt Technical issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate away from viewThemeUtils.getScheme calls
2 participants