Skip to content

aaaliua/ShortcutBadger

 
 

Repository files navigation

ShortcutBadger:

The ShortcutBadger makes your Android App showing the count of unread messages as a badge on your App shortcut!

Currently support launchers:

Android native Launcher(Not support Android L)
ScreenShot

Sony Home Launcher
ScreenShot

Samsung Touchwiz
ScreenShot

LG Launcher
ScreenShot

HTC Launcher
ScreenShot

Nova launcher with TeslaUnread,Apex launcher,Adw Launcher provided by notz

HOW TO USE


1. Download the ShortcutBadger-aar.zip and put it into your project.
2. Add the repositories path in your build.gradle.

    repositories {
        jcenter()
        maven {
            url 'file://'+project.rootDir+"/ShortcutBadger-aar"
        }
    }


3. Add dependencies for Shortcutbadger

    dependencies {
        compile 'me.leolin:ShortcutBadger:1.0.1@aar'
    }


4. Add the codes below:

    int badgeCount = 1;
    try {
        ShortcutBadger.setBadge(getApplicationContext(), badgeCount);
    } catch (ShortcutBadgeException e) {
        //handle the Exception
    }


5. If you want to remove the badge, just set the badgeCount as 0.



LICENSE


    Copyright 2014 Leo Lin
    
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    
        http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

About

ShortcutBadger

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%