-
Notifications
You must be signed in to change notification settings - Fork 148
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
Support for dynamic app shortcuts #3
Comments
It's true that the library currently uses dynamic shortcuts for the purpose of static shortcuts. Although there is more about dynamic shortcuts than just runtime enabling/disabling, I agree that this feature could be supported. I think of something like this for the example of displaying the next episode to watch as a dynamic shortcut: public class TvSeriesActivity extends Activity {
@DynamicInfo(shortcutId = "next_episode")
Shortcut nextEpisodeShortcut; // dynamic parts of the shortcut
public void onCreate(Bundle b) {
// load data about next episode
// ...
nextEpisodeShortcut.icon(episode.cover());
nextEpisodeShortcut.longLabel(episode.title());
Shortbread.create(this);
}
@Shortcut(id = "next_episode", shortLabel = "Next episode") // static parts of the shortcut
public void showNextEpisode() {
// show next episode...
}
} |
Another idea: We still define the shortcut statically via the method annotation but add a public class TvSeriesActivity extends Activity {
public void onCreate(Bundle b) {
// load data about next episode
// ...
// dynamic parts of the shortcut
Shortbread.getShortcut("next_episode")
.setIcon(episode.cover())
.setLongLabel(episode.title())
.setVisible(true);
}
@Shortcut(id = "next_episode", shortLabel = "Next episode", visible = false) // static parts of the shortcut
public void showNextEpisode() {
// show next episode...
}
} |
Is there any plans on adding this? |
visible attribute option is better |
Is this |
Not at the moment but I still think it's useful, so I will eventually add it if not somebody else implements it. |
The library is based on the creation of dynamic app shortcuts but itself does not provide this functionality. The annotated shortcuts are always displayed.
Any ideas how the implement that feature?
The text was updated successfully, but these errors were encountered: