forked from leolin310148/ShortcutBadger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
72 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
build | ||
.gradle | ||
local.properties | ||
**/gradle.properties | ||
**/gradle.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
|
||
compileSdkVersion 19 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
ShortcutBadger/src/main/java/me/leolin/shortcutbadger/impl/SolidHomeBadger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package me.leolin.shortcutbadger.impl; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
|
||
import me.leolin.shortcutbadger.ShortcutBadgeException; | ||
import me.leolin.shortcutbadger.ShortcutBadger; | ||
|
||
/** | ||
* @author MajeurAndroid | ||
*/ | ||
public class SolidHomeBadger extends ShortcutBadger { | ||
|
||
private static final String INTENT_UPDATE_COUNTER = "com.majeur.launcher.intent.action.UPDATE_BADGE"; | ||
private static final String PACKAGENAME = "com.majeur.launcher.intent.extra.BADGE_PACKAGE"; | ||
private static final String COUNT = "com.majeur.launcher.intent.extra.BADGE_COUNT"; | ||
private static final String CLASS = "com.majeur.launcher.intent.extra.BADGE_CLASS"; | ||
|
||
public SolidHomeBadger(Context context) { | ||
super(context); | ||
} | ||
|
||
@Override | ||
protected void executeBadge(int badgeCount) throws ShortcutBadgeException { | ||
Intent intent = new Intent(INTENT_UPDATE_COUNTER); | ||
intent.putExtra(PACKAGENAME, getContextPackageName()); | ||
intent.putExtra(COUNT, badgeCount); | ||
intent.putExtra(CLASS, getEntryActivityName()); | ||
mContext.sendBroadcast(intent); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters