feat: allow widgets on flip phones cover screen
Summary
This allows Home assistant widgets to be displayed on Flip Phones (at least Samsung Galaxy Flip X) Following Android's documentation on widgets: https://developer.android.com/develop/ui/views/appwidgets?hl=en
Declares whether your widget can be displayed on the home screen (home_screen), the lock screen (keyguard), or both. For Android 5.0 and higher, only home_screen is valid.
Checklist
- [ ] New or updated tests have been added to cover the changes following the testing guidelines.
- [X] The code follows the project's code style and best_practices.
- [X] The changes have been thoroughly tested, and edge cases have been considered.
- [X] Changes are backward compatible whenever feasible. Any breaking changes are documented in the changelog for users and/or in the code for developers depending on the relevance.
Screenshots
- Widgets on cover screen:
- "Standard" widgets still working:
Any other notes
Please let me know if anything is missing to get this PR merged, thanks for your work on this awesome project :heart:
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:
It's a duplicate of https://github.com/home-assistant/android/pull/5753. I'm willing to close the old one if you continue the work.
It seems the initial author had an issue https://github.com/home-assistant/android/pull/5753#issuecomment-3263534463
It's a duplicate of #5753. I'm willing to close the old one if you continue the work.
It seems the initial author had an issue #5753 (comment)
Hi @TimoPtr , thanks for the quick response.
I've indeed ran into the same issues as @soubiliz did, and I am not sure if there is a fix (tried a bunch of things, with no change).
However, I believe this is not a huge issue as we are introducing a new feature, with a slight limitation (widgets on cover screen will take full page by default, vs not being able to use them on cover screen for now) Let me know what you think.
@jpelgrom I don't have any objection to merge it like this to get feedback from people. Wdyt?
I posted a comment on the other PR about what might fix it, did you try that?
I posted a comment on the other PR about what might fix it, did you try that?
Yes, I've tried creating samsung specific xml files, with the <samsung-appwidget-provider xmlns:samsung="http://schemas.samsung.com/apk/res/samsung" display="sub_screen" /> tag, but I could never get the widgets to show as anything but 4x4
I posted a comment on the other PR about what might fix it, did you try that?
Yes, I've tried creating samsung specific xml files, with the
<samsung-appwidget-provider xmlns:samsung="http://schemas.samsung.com/apk/res/samsung" display="sub_screen" />tag, but I could never get the widgets to show as anything but 4x4
Could you try other apps to see if it's the same for all of them?
I posted a comment on the other PR about what might fix it, did you try that?
Yes, I've tried creating samsung specific xml files, with the
<samsung-appwidget-provider xmlns:samsung="http://schemas.samsung.com/apk/res/samsung" display="sub_screen" />tag, but I could never get the widgets to show as anything but 4x4Could you try other apps to see if it's the same for all of them?
The only app that provide widgets with something else than 4x4 grid seems to be Samsung's own apps. (at least out of the apps I have currently installed)
I've tried to search for opensource apps that implemented the coverscreen widgets (there's not so much), and managed to build tasks, but it has the same limitation.
I've also found a reddit thread that hints at a limitation from Samsung
I posted a comment on the other PR about what might fix it, did you try that?
Yes, I've tried creating samsung specific xml files, with the
<samsung-appwidget-provider xmlns:samsung="http://schemas.samsung.com/apk/res/samsung" display="sub_screen" />tag, but I could never get the widgets to show as anything but 4x4Could you try other apps to see if it's the same for all of them?
The only app that provide widgets with something else than 4x4 grid seems to be Samsung's own apps. (at least out of the apps I have currently installed)
I've tried to search for opensource apps that implemented the coverscreen widgets (there's not so much), and managed to build tasks, but it has the same limitation.
I've also found a reddit thread that hints at a limitation from Samsung
You can also check on Github https://github.com/search?type=code&q=keyguard%7C+language%3Axml if you find another app that might have find how to make it work.