◾HTTP://stackoverflow.com/questions/8937700/can-we-show-badge-number-on-android-app-icon-like-iphone
◾HTTP://stackoverflow.com/questions/2905542/is-there-a-way-to-add-a-badge-to-an-application-icon-in-android

 

Android ViewBadger 是一個比較簡單的方案,用來實作 badge 在 andriod 的 "view" 裡, 可惜不是在 icon. url: HTTPs://github.com/jgilfelt/android-viewbadger ======================== A simple way to "badge" any given Android view at runtime without having to cater for it in layout.
687474703a2f2f7777772e6a65666667696c66656c742e636f6d2f766965776261646765722f76622d31612e706e67687474703a2f2f7777772e6a65666667696c66656c742e636f6d2f766965776261646765722f76622d32612e706e67  
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.

 

==============================

 

Unfortunately, Android does not allow changing of the application icon because it’s sealed in the APK once the program is compiled. There is no way to programmatically change it to a ‘drawable’.

 

You may achieve your goal by using a widget instead of an icon. Widgets are highly customisable and can do what you want.

 

There’s a short discussion about the difference between iPhone icon notification and using widgets here:

 

HTTP://www.cnet.com/8301-19736_1-10278814-251.html

 

As you’ll notice, there is virtually no difference between using a widget or an icon, since they can be the same size and look the same.
創作者介紹
創作者 shadow 的頭像
shadow

資訊園

shadow 發表在 痞客邦 留言(0) 人氣()