the-blue-alliance / the-blue-alliance-android

An Android app for accessing information about the FIRST Robotics Competition.
MIT License
76 stars 34 forks source link

Add Dynamic App Shortcuts #836

Open dracco1993 opened 7 years ago

dracco1993 commented 7 years ago

As a user, I want dynamic app shortcuts, so that I can quickly get to the pages I want to see.

My initial thought would be to have the shortcuts be for teams/events in myTBA. I did some research already into this, and the only real issue I see is that you're only allowed to register 5 shortcuts, so we'd need some way to determine which we're going to show, if there's more than 5.

dracco1993 commented 7 years ago

After more research, this would require "Android 7.1 (API level 25) or higher". As I've not done Android development before, I'm not sure how hard incrementing this is, or what implications it includes.

phil-lopreiato commented 7 years ago

We're actually still targeting 23, since there are few things with multiwindow that break and I haven't had time to debug them. See: https://github.com/the-blue-alliance/the-blue-alliance-android/issues/663

1fish2 commented 7 years ago

Quicker access to the info you want to see would be really great, e.g. to quickly determine, "How are my teams are doing?" and "When to tune in to which field?"

But I think a dashboard page would be a better approach than app shortcuts. A dashboard would be visible, more flexible, and faster than exiting the app and using an app shortcut. It'd show the key info for all your teams on one screen rather than having to exit the app to use another shortcut.

(Is there usage data on app shortcuts? They're hidden and new so I suspect people rarely use them.)

Listing the dashboard screen in the navigation drawer would make it only 2 taps away from any app screen.

@nwalters512 suggested an in-app dashboard in a previous issue.

dracco1993 commented 7 years ago

@1fish2 I mean, why not both? I think that each provide a valid solution to different use cases.

One of the things that's nice with shortcuts is that you can break them out as a separate icon on your launcher. This means that if you're on your homescreen already, you're only 1 tap away from a favorite team, as opposed to the normal 4 (TBA app > burger menu > myTBA > XXXX team)

1fish2 commented 7 years ago

Good point. There's no reason not to do both once the app targets Android v25. A dashboard would be my favorite way to get quick-info while an app shortcut is a simpler solution for the simpler case.

1fish2 commented 7 years ago

I decided to try implementing (static) shortcuts in a small app. See this CL.

Lesson 1: It's better if app shortcuts are idempotent, e.g. open the screen for your favorite team. The app shortcuts in this CL are not, e.g. restart a timer. A configuration change like enter/exit multi-window mode recreates the Activity with the same Intent, and we don't want that to restart the timer. My workaround was to modify the Intent's action, yuk! I think that hack is why it once got a null action, but I haven't figured out how to reproduce it. I just made the code handle it.

Lesson 2: It's smart to use vector drawables for the shortcut icons, typically a small 1-color icon on a light gray circle. Creating them took me hours even starting with standard Material icons. That one lacks the background circle. I tried to edit an icon with an outline circle into one with a background circle but it crashed some SVG editors.

dracco1993 commented 5 years ago

This should now be unblocked, as of #880