bump version to 1.1.8

This commit is contained in:
Leo Lin 2016-07-18 12:46:50 +08:00
parent fbb805390c
commit df3ae12a91
5 changed files with 27 additions and 6 deletions

View File

@ -132,6 +132,10 @@ Please use version 1.1.0+
CHANGE LOG
===================================
1.1.8:<br/>
Remove SolidBadger, now solid launcher will use default badger.
1.1.7:<br/>
add huawei launcher support. <br/>
<br/>

View File

@ -13,6 +13,9 @@ android {
consumerProguardFiles 'proguard-rules.pro'
}
lintOptions {
abortOnError false
}
}

View File

@ -4,4 +4,9 @@ public class ShortcutBadgeException extends Exception {
public ShortcutBadgeException(String message) {
super(message);
}
public ShortcutBadgeException(String message, Exception e) {
super(message, e);
}
}

View File

@ -7,6 +7,7 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Build;
import android.util.Log;
import me.leolin.shortcutbadger.impl.*;
import java.lang.reflect.Constructor;
@ -41,7 +42,8 @@ public final class ShortcutBadger {
/**
* Tries to update the notification count
* @param context Caller context
*
* @param context Caller context
* @param badgeCount Desired badge count
* @return true in case of success, false otherwise
*/
@ -57,7 +59,8 @@ public final class ShortcutBadger {
/**
* Tries to update the notification count, throw a {@link ShortcutBadgeException} if it fails
* @param context Caller context
*
* @param context Caller context
* @param badgeCount Desired badge count
*/
public static void applyCountOrThrow(Context context, int badgeCount) throws ShortcutBadgeException {
@ -77,6 +80,7 @@ public final class ShortcutBadger {
/**
* Tries to remove the notification count
*
* @param context Caller context
* @return true in case of success, false otherwise
*/
@ -86,6 +90,7 @@ public final class ShortcutBadger {
/**
* Tries to remove the notification count, throw a {@link ShortcutBadgeException} if it fails
*
* @param context Caller context
*/
public static void removeCountOrThrow(Context context) throws ShortcutBadgeException {
@ -108,8 +113,12 @@ public final class ShortcutBadger {
String currentHomePackage = resolveInfo.activityInfo.packageName;
for (Class<? extends Badger> badger : BADGERS) {
Badger shortcutBadger = badger.newInstance();
if (shortcutBadger.getSupportLaunchers().contains(currentHomePackage)) {
Badger shortcutBadger = null;
try {
shortcutBadger = badger.newInstance();
} catch (Exception e) {
}
if (shortcutBadger != null && shortcutBadger.getSupportLaunchers().contains(currentHomePackage)) {
sShortcutBadger = shortcutBadger;
break;
}

View File

@ -9,7 +9,7 @@ buildscript {
POM_NAME = 'Shortcutbadger'
POM_PACKAGING = 'aar'
POM_ARTIFACT_ID = 'shortcutbadger'
VERSION_NAME = '1.1.7'
VERSION_NAME = '1.1.8'
VERSION_CODE = 1
GROUP = 'me.leolin'
}