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

Add support for Android Widgets #163

Open
mvysny opened this issue Sep 30, 2021 · 2 comments
Open

Add support for Android Widgets #163

mvysny opened this issue Sep 30, 2021 · 2 comments
Assignees

Comments

@mvysny
Copy link
Owner

mvysny commented Sep 30, 2021

Is it possible for you to add a Widget so that we can drop the slideshow onto the home screen?

I have a wall mounted tablet that has my home controls, and other indicators. It'd be great to have a widget that can display photos. I'm currently using the Animated Photo Widget + - but that only does local, on device photos.

I've purchased PhotoCloud - but would happily pay to unlock a widget feature.

@mvysny mvysny self-assigned this Sep 30, 2021
@mvysny
Copy link
Owner Author

mvysny commented Sep 30, 2021

The Android Widget API is described at https://developer.android.com/guide/topics/appwidgets/overview

Random thoughts below:

  • The updatePeriodMillis is a bit problematic since the app will need to update the widgets based on the "new_image_available" event, but that can be solved via forced updates: https://stackoverflow.com/questions/3455123/programmatically-update-widget-from-activity-service-receiver . I can simply set updatePeriodMillis to zero.
  • No gestures, therefore no photo pinch-to-zoom, no swipe back for history, but you can still touch the widget to pause the slideshow and reveal EXIF data.
  • Android layouts enforced. That's a pity since android layouts are defined in XML and they simply suck. But I can always start with something simple, like a basic ImageView
  • Remote Android layouts enforced, which further limits what we can draw. Can't even use ImageSwitcher. Definitely use ImageView
  • The memory considerations? The slideshow uses a considerable amount of memory, causing the widget to use lots of memory too. Let's experiment on this: maybe Android will kill the app frequently in order to conserve memory, especially on lower-end phones? This needs to be explained to the user.

Notes to myself:

  • Start by copying out DaydreamService but much simplified - no clock, no EXIF, just an ImageView and a TextView in case of errors.
  • If there is a widget on screen, don't allow starting a new slideshow, to conserve memory.
  • Only allow 1 widget max.

@AXEBro
Copy link

AXEBro commented Sep 30, 2021

This is excellent, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants