App-Icon Create an Overlayinformation (Number)?

2019-04-10 04:46发布

How can I clone this behaviour (iOS) on an Android-App?

enter image description here

Technically its definitly possible as I have an app by my own on my Androidphone - its an Email-App with a very similiar indicator on the Icon. (shows the number of unread Emails)

2条回答
贪生不怕死
2楼-- · 2019-04-10 05:22

yes you can implement overlay like ios.. by the way it is called badge value.

here is one sample available on github

You just have to add classes in your project and call below lines

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

hope it helps.

查看更多
不美不萌又怎样
3楼-- · 2019-04-10 05:43

If you are referring to doing this on the home screen, that is an app widget.

查看更多
登录 后发表回答