Repository navigation
Conversation
Glide will be used to display animated pictures
Those layouts have been reorganized to accomodate the new space dedicated for the eventual picture
This string will be used for the new "Pick Step Image" option for "Screen" items
Images and GIFs can be picked to be displayed on the "Screen" activity
|
Thank you very much for your contribution! However, I cannot merge this pull request because of the complexity of the feature, but I'll reference it when implementing the feature. There are a lot of considerations while implementing the feature, such as separating the image from the full-screen reminder, saving the image to internal storage, showing the image at multiple locations, etc. I've also added some suggestions to the PR, although you can safely ignore them if the feature works for you. The support for images will be a part of the next release(7.5.0.) Thank you again for making me realize that the feature can be more straightforward than I expected. :D |
| context = context, | ||
| action = current.toScreenAction(), | ||
| onPickImageClick = { | ||
| registerForActivityResult( |
There was a problem hiding this comment.
Registering a launcher after onCreate will crash the app. If I remember correctly, you must create the launcher before or in onCreate.
There was a problem hiding this comment.
I indeed noticed that with "EditActivity.kt", which has this fixed. I leaved it that way here because I didn't know how to accommodate the difference between this file and the other. Beside, I still don't know when this file intervenes in the app
| // binding.image.setImageURI(Uri.parse(imagePath)) | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Glide can take care of everything for you, like this:
Glide.with(this).load(imagePath.toUri()).into(binding.image)
| kapt libs.hilt.compiler | ||
|
|
||
| implementation libs.glide | ||
| annotationProcessor libs.compiler |
There was a problem hiding this comment.
The compiler is redundant here because we only use Glide to load images.
There was a problem hiding this comment.
My bad. I admit this one was a blind copy-pasting of some tutorial
| android:layout_marginEnd="8dp" | ||
| android:layout_width="191dp" | ||
| android:layout_height="113dp" | ||
| android:layout_marginTop="16dp" |
There was a problem hiding this comment.
Designing layouts with the layout inspector makes the layout inconsistent on different devices, which is why many developers prefer XML.
There was a problem hiding this comment.
Ah, I didn't know using the layout designer was known to be a problem. Will remember this next time I work on native Android project
|
I understand. Thanks for taking the time to review it anyway, and I'm glad it still helped even a bit! |
|
Due to the sheer complexity of the feature that involves backup, sharing, and some refactoring, the image support won't be able to arrive in the next release. Although I don't have much free time, I'll try to finish it as soon as possible. |
Description
Per #30, being able to have an image displayed as a guide when using this app for exercising looked very handy
So I decided to display such picture in the only place where it seemed to make sense, "Screen" activities that is. In order to pick the still / animated picture to be displayed, a new option "Pick Step Image" option has been added for "Screen" items
"Solves" also #63, since I had to make room for the guide image, so removed the large bell animation that in my opinion served little purpose
Bugs
No bugs were found upon testing. However, I am unsure about the
onPickImageClickimplementation added in "UpdateStepDialog.kt". Maintainers might want to check additions there in particularFeature notes
Once an image has been picked, the only way to reset to default is by removing the corresponding "Screen" item. I haven't thought of a better way to handle it
General notes
I might have made a mess in "activity_screen.xml" layouts, since I have very little experience with layouting in native Android projects. Feel free to correct directly - what mattered to me was to have something that works (which apparently is the case) therefore I do not intend to edit my PR further and leave eventual corrections to maintainers. Same applies for the Kotlin code, as I'm definitely not familiar with this language either