• Stars
    star
    3,019
  • Rank 14,384 (Top 0.3 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 12 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[DEPRECATED] A simple way to "badge" any given Android view at runtime without having to cater for it in layout

Android ViewBadger

A simple way to "badge" any given Android view at runtime without having to cater for it in layout.

Demosย  ListAdapter

Note: If your aim is to replicate the iOS icon and TabBar badge UI for notifications, consider using Android UI conventions such as the number field of the Notification class rather than this method.

Usage

Simple example:

View target = findViewById(R.id.target_view);
BadgeView badge = new BadgeView(this, target);
badge.setText("1");
badge.show();

This project contains a fully working example application. Refer to the DemoActivity class for more custom badge examples, including custom backgrounds and animations. BadgeView is a subclass of TextView so you can use all of TextView's methods to style the appearance of your badge.

To use ViewBadger in your own Android project, simply copy android-viewbadger.jar (available from this repository's package downloads) into your project's /libs directory and add it to the build path.

Current Limitations

  • Badging Action Bar items is currently not supported #2
  • Badging views inside RelativeLayout with dependencies may break alignment #1

Credits

Author: Jeff Gilfelt

The code in this project is licensed under the Apache Software License 2.0.
Copyright (c) 2011 readyState Software Ltd.

More Repositories

1

SystemBarTint

[DEPRECATED] Apply background tinting to the Android system UI when using KitKat translucent modes
Java
5,367
star
2

chuck

An in-app HTTP inspector for Android OkHttp clients
Java
4,670
star
3

android-sqlite-asset-helper

An Android helper class to manage database creation and version management using an application's raw asset files
Java
2,145
star
4

android-actionbarstylegenerator

[DEPRECATED] Easily create a simple, attractive and seamless custom action bar style for your Android application
JavaScript
1,006
star
5

android-mapviewballoons

[DEPRECATED] Simple information balloon annotation for Android MapView
Java
851
star
6

android-adt-templates

A small collection of ADT templates to help quickly scaffold common Activity and UI patterns.
633
star
7

GhostLog

Android app that displays the logcat buffer in a system overlay window
Java
382
star
8

androidicons-adt-template

Android Studio / Eclipse ADT template for androidicons.com resources
190
star
9

android-simpl3r

Amazon S3 multipart file upload for Android, made simple
Java
182
star
10

android-resource-navigator

Chrome Extension providing enhanced resource navigation for GitHub hosted Android projects
JavaScript
170
star
11

NotificationLog

Use an expanded notification as a makeshift Android log output console
Java
160
star
12

android-protobuf-example

Google Protocol Buffer Example on Android
Java
91
star
13

ThisWayUp

Sample app for my Droidcon London 2013 talk - "This Way Up: Implementing Effective Navigation"
Java
84
star
14

android-jsonarrayadapter

An easy adapter to map JSON data to views defined in an XML layout
Java
66
star
15

android-countdown

A simple Android chronometer view that counts down to a given time
Java
32
star
16

SQLook

Examine an Android SQLite database using a client application of your choice
Python
22
star
17

RoughCut

Experimental port of Android's private video editor API
Java
16
star
18

android-sdk-samples-search

[DEPRECATED] Chrome extension that adds a 'sample code' link for class references at developer.android.com
JavaScript
15
star
19

android-geras

Android sensor feed for Geras IoT time series database
Java
11
star
20

Novocation

An attempt jar-ify location.
Java
6
star