mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-04 16:16:33 +02:00
Push shortcuts
This commit is contained in:
@@ -57,6 +57,9 @@ import java.util.Set;
|
||||
|
||||
import javax.mail.internet.InternetAddress;
|
||||
|
||||
// https://developer.android.com/guide/topics/ui/shortcuts/creating-shortcuts
|
||||
// https://developer.android.com/guide/topics/ui/shortcuts/managing-shortcuts
|
||||
|
||||
class Shortcuts {
|
||||
private static final int MAX_SHORTCUTS = 4;
|
||||
|
||||
@@ -150,9 +153,9 @@ class Shortcuts {
|
||||
if (remove.size() > 0)
|
||||
ShortcutManagerCompat.removeDynamicShortcuts(context, remove);
|
||||
|
||||
if (add.size() > 0) {
|
||||
boolean ok = ShortcutManagerCompat.addDynamicShortcuts(context, add);
|
||||
Log.i("Shortcuts=" + add.size() + " updated=" + ok);
|
||||
for (ShortcutInfoCompat shortcut : add) {
|
||||
Log.i("Push shortcut id=" + shortcut.getId());
|
||||
ShortcutManagerCompat.pushDynamicShortcut(context, shortcut);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user