jgilfelt/android-viewbadger
关于
[DEPRECATED] 一种在运行时为任意 Android 视图添加“徽标”的简单方式,无需在布局中为其做额外处理
其他项目实测星标增长
- 24小时
- 0
- 7天
- -1
- 15天
- -3
- 1个月
- -6
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Android ViewBadger
A simple way to "badge" any given Android view at runtime without having to cater for it in layout.

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.
探索相关项目
加载中…