Merge pull request #16 from evgeniysharafan/master
Fix for showing badges on Samsung. Fix for compilation error.
This commit is contained in:
commit
3cd3e82ea1
|
|
@ -30,11 +30,11 @@ public class SamsungHomeBadger extends ShortcutBadger {
|
|||
if (cursor != null) {
|
||||
while (cursor.moveToNext()) {
|
||||
int id = cursor.getInt(0);
|
||||
ContentValues contentValues = getContentValues(badgeCount);
|
||||
ContentValues contentValues = getContentValues(badgeCount, false);
|
||||
contentResolver.update(mUri, contentValues, "_id=?", new String[]{String.valueOf(id)});
|
||||
}
|
||||
} else {
|
||||
ContentValues contentValues = getContentValues(badgeCount);
|
||||
ContentValues contentValues = getContentValues(badgeCount, true);
|
||||
contentResolver.insert(mUri, contentValues);
|
||||
}
|
||||
} finally {
|
||||
|
|
@ -42,11 +42,15 @@ public class SamsungHomeBadger extends ShortcutBadger {
|
|||
}
|
||||
}
|
||||
|
||||
private ContentValues getContentValues(int badgeCount) {
|
||||
private ContentValues getContentValues(int badgeCount, boolean isInsert) {
|
||||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put("package", getContextPackageName());
|
||||
contentValues.put("class", getEntryActivityName());
|
||||
if (isInsert) {
|
||||
contentValues.put("package", getContextPackageName());
|
||||
contentValues.put("class", getEntryActivityName());
|
||||
}
|
||||
|
||||
contentValues.put("badgecount", badgeCount);
|
||||
|
||||
return contentValues;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,13 +16,12 @@ public class SolidHomeBadger extends ShortcutBadger {
|
|||
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 ApexHomeBadger(Context context) {
|
||||
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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue