android icon indicating copy to clipboard operation
android copied to clipboard

feat: allow widgets on flip phones cover screen

Open romainrbr opened this issue 2 months ago • 9 comments

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: image
  • "Standard" widgets still working: image

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:

romainrbr avatar Dec 04 '25 08:12 romainrbr

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:

Learn more about our pull request process.

home-assistant[bot] avatar Dec 04 '25 08:12 home-assistant[bot]

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

TimoPtr avatar Dec 04 '25 08:12 TimoPtr

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.

romainrbr avatar Dec 04 '25 10:12 romainrbr

@jpelgrom I don't have any objection to merge it like this to get feedback from people. Wdyt?

TimoPtr avatar Dec 04 '25 10:12 TimoPtr

I posted a comment on the other PR about what might fix it, did you try that?

jpelgrom avatar Dec 04 '25 11:12 jpelgrom

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

romainrbr avatar Dec 04 '25 12:12 romainrbr

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?

TimoPtr avatar Dec 05 '25 07:12 TimoPtr

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?

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

romainrbr avatar Dec 05 '25 15:12 romainrbr

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?

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.

TimoPtr avatar Dec 05 '25 16:12 TimoPtr