|
|
@ -61,23 +61,20 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void addShortCut(ShortCut... shortCuts) { |
|
|
|
public void addShortCut(ShortCut shortCut) { |
|
|
|
|
|
|
|
|
|
|
|
if (shortCuts == null) { |
|
|
|
addSnapChatNotification(shortCut); |
|
|
|
return; |
|
|
|
super.addShortCut(shortCut); |
|
|
|
} |
|
|
|
|
|
|
|
for (ShortCut shortCut : shortCuts) { |
|
|
|
|
|
|
|
if (shortCut instanceof SnapChatUpdateAction) { |
|
|
|
|
|
|
|
SnapChatUpdateAction action = (SnapChatUpdateAction) shortCut; |
|
|
|
|
|
|
|
if (!action.hasRead()) { |
|
|
|
|
|
|
|
String calcKey = calcKey(); |
|
|
|
|
|
|
|
SnapChatConfig.getInstance().resetRead(calcKey); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
super.addShortCut(shortCuts); |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void insertShortCut(int index, ShortCut shortCut) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addSnapChatNotification(shortCut); |
|
|
|
|
|
|
|
super.insertShortCut(index, shortCut); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public SnapChatKey key() { |
|
|
|
public SnapChatKey key() { |
|
|
|
|
|
|
|
|
|
|
@ -90,6 +87,22 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { |
|
|
|
return new SnapChatMenuListener(); |
|
|
|
return new SnapChatMenuListener(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 添加提醒 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param shortCut 快捷方式 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private void addSnapChatNotification(ShortCut shortCut) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (shortCut instanceof SnapChatUpdateAction) { |
|
|
|
|
|
|
|
SnapChatUpdateAction action = (SnapChatUpdateAction) shortCut; |
|
|
|
|
|
|
|
if (!action.hasRead()) { |
|
|
|
|
|
|
|
String calcKey = calcKey(); |
|
|
|
|
|
|
|
SnapChatConfig.getInstance().resetRead(calcKey); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String calcKey() { |
|
|
|
private String calcKey() { |
|
|
|
|
|
|
|
|
|
|
|
return key().calc(); |
|
|
|
return key().calc(); |
|
|
|