-
8000 -
Notifications
You must be signed in to change notification settings - Fork 2.6k
Feature: Add option to attach image from Camera #9074
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
Conversation
- Fixes Option to attach from camera #7373
0be0ddf
to
007eb4c
Compare
Quick drive by comment - I believe we shouldn't be adding the strings to the translations, this is taken care of by weblate. I'll let @rafaeltonholo take a closer look at the rest. |
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.
Hi @shamim-emon,
Thank you for your contribution! I have left a few comments, some of which require further discussion.
Additionally, I kindly ask you to revert all values-{lang}.xml
files introduced in this pull request and retain only the values.xml
file. Whenever a new string is added to the application, we should first include only the new strings using American English in values.xml
. After this is merged, all other language translations should be added through our Weblate project.
For more information, please refer to Translations > Adding a string.
Thanks!
legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java
Outdated
Show resolved
Hide resolved
legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java
Outdated
Show resolved
Hide resolved
legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java
Outdated
Show resolved
Hide resolved
legacy/ui/legacy/src/main/java/com/fsck/k9/activity/CaptureImageFileProvider.kt
Outdated
Show resolved
Hide resolved
8e06bc4
to
f220bc1
Compare
@kewisch Removed added strings to the translations. |
cbb46ab
to
3da906d
Compare
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.
Hi @shamim-emon,
Thank you for addressing the other comments! I appreciate your suggestion to move the logic to a dedicated class. However, I have some concerns about creating the module :feature:camera
.
According to the Project Structure, a Feature Module should be an independent unit that encapsulates distinct user-facing features. In this context, a camera feature module should offer significant user-facing capabilities, such as camera filters, video clipping, or post-image processing. I don't see these requirements as applicable to our app.
The current code seems to align better with the description of the core module, which mentions "essential utilities and base classes used across the entire project."
Additionally, I would advise against creating a new module for this, as it likely will consist of only a few files.
I suggest placing them in the :core:android:common
module, where I believe they would be a better fit.
I would suggest the following structure, inside the :core:android:common
module:
net.thunderbird.core.android.common.camera.CameraCaptureHandler
(public api)net.thunderbird.core.android.common.camera.provider.CaptureImageFileProvider
(internal to the module)net.thunderbird.core.android.common.camera.io.CaptureImageFileWriter
(internal to the module)
Additionally, you will also need to create a CameraKoinModule.kt
, adding the CameraCaptureHandler
to the Koin dependency graph. Something like:
// net.thunderbird.core.android.common.camera.CameraKoinModule.kt
internal val cameraModule = module {
single { CaptureImageFileWriter(context = get()) }
single<CameraCaptureHandler> {
DefaultCameraCaptureHandler(
captureImageFileWriter = get(),
)
}
}
// and expose it to the other modules via `app.k9mail.core.android.common.CoreCommonAndroidModule.kt`
val coreCommonAndroidModule: Module = module {
includes(coreCommonModule)
includes(contactModule)
// new Koin module
includes(cameraModule)
}
Let me know your thoughts on this.
feature/camera/src/main/kotlin/net/thunderbird/feature/camera/CameraCaptureHandler.kt
Outdated
Show resolved
Hide resolved
feature/camera/src/main/kotlin/net/thunderbird/feature/camera/CameraCaptureHandler.kt
Outdated
Show resolved
Hide resolved
3da906d
to
df3d1fc
Compare
@rafaeltonholo Done |
7db5764
to
81a6ae6
Compare
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.
LGTM! Thank you for your contribution to the project!