Allow for server app to foreground itself over tools, Emulator improvements#83
Conversation
…nding of server app to matchin lightos, inject settings where possible
|
@dupontgu , this PR brought to mind something I've been wondering for a while but I'm sure you all are already thinking about internally. Remember back in the days of iPhone OS 3 and iOS 4 when Apple didn't have a framework for handling notifications other than alert-style – so waking up in the morning you'd have to mash through a bunch of subsequent alert-style notifs you received overnight, one by one, then they were dismissed forever? As the Tool Library grows, have you all put thought into how you want to handle this problem? I don't even think I'm asking for a traditional notification center (to the relief of many people here i'm sure). Maybe just a mechanism for non-alert notifs to get to you without A) totally taking you out of your context by sending an alert or B) risk getting missed entirely by only being an asterisk next to the tool (if that's the plan). Up to this point, it's been pretty easy to assume a vibration in the background means a text, while most other things would send an alert. That won't be the case moving forward! Primarily asking as I work on rewriting my Reminders tool and Nourish tool, if that helps. This seemed relevant enough to ask here, but can also open an issue or something else instead :) appreciate all you're doing!! |
|
@zacksimpson great questions We've definitely talked about the non-alert "push" notification case, and I don't think we have it fully figured out but when we last spoke we were thinking of having a very simple notification screen that kind of just indicates which tools have something unread. Or potentially having some kind of small indicator next to a tool with a pending notif right in the toolbox. We're gonna keep working on it. Open to suggestions at this point! Now that I think about it - I'm not sure we've considered giving community tools the ability to launch full-takeover alerts, but it seems like it might be a reasonable thing to do. Maybe it can be as simple as just letting tools set alarms with custom titles through LightOS. 🤔 Gonna tag @JoeHollier mostly as a reminder that we should revisit this! |
3fff385 to
2f0e88c
Compare
|
@dupontgu love these thoughts! Yeah, I didn't want to assume there was already a plan for community tools to support full-takeover alerts, but totally agree with your thought process. And if they did, it would make sense to limit their use case to avoid that above issue. Perhaps by introducing an alternative style for non-urgent notifs (like messaging tools etc), such as a temporary & dismissible banner – just to discourage everything from using a full-takeover. If you're open to suggestions for a very simple notif screen, maybe consider checking out @vandamd's implementation in Luma 2. (That 2nd notification is Reminders and the third is from Nourish – all are earlier PoCs.) I've been using for a couple months as I test my tools, and have not felt the need for anything more complex than this. Although if I envision the experience in today's LightOS, the usefulness of these notifications (and thus the tools themselves) would be significantly degraded without a place to revisit and take action on them. Just my two cents! Excited to see what you all cook up!! 🤙
|

In LightOS, alerts (alarms, incoming calls, calendar alerts, timers, etc) takeover whatever tool is currently being viewed. Since LightOS was traditionally a single app/single activity, we never really had to re-order anything. Everything was displayed within
MainActivity, andMainActivitywas effectively always foregrounded. Now, if a user's in a community tool (separate APK), and a LightOS alert pops up, it needs to yeet itself in front of the active tool. And more importantly, since LightOS acts as the lock/homescreen on LP3's, it also needs to pull itself forward when the phone is locked. This PR provides a BroadcastReceiver for the server app to listen for SCREEN_OFF events and provide an Activity to be launched/focused when this happens. We've also added a setting to suppress this behavior since it may be annoying to folks who have already modded their phones.The emulator has also been updated with a home screen that mostly matches LightOS'. The Android home button behavior is slightly different since we cannot intercept the Home key presses on the emulator image like we can on real LP3's (you can't toggle between home screen/toolbox on the emulator currently).
I'm also sneaking in a
GetUserPreferencesapi where clients can query generic settings from the server app. Right now the only field ishapticsEnabled. Feel free to make requests for more LightOS settings that you might like exposed there. Another obvious one is light/dark mode but I have a hunch there aren't too many of you actually using light mode?