1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Add comments for NotificationCompat to support API < 16

This commit is contained in:
volzhs
2016-05-25 22:19:37 +09:00
parent ff67c256f5
commit e5d16eca46
3 changed files with 5 additions and 3 deletions

View File

@@ -49,6 +49,7 @@ public class DownloadNotification implements IDownloaderClient {
private IDownloaderClient mClientProxy;
final ICustomNotification mCustomNotification;
// NotificationCompat.Builder is used to support API < 16. This can be changed to Notification.Builder if minimum API >= 16.
private NotificationCompat.Builder mNotificationBuilder;
private NotificationCompat.Builder mCurrentNotificationBuilder;
private CharSequence mLabel;
@@ -186,7 +187,7 @@ public class DownloadNotification implements IDownloaderClient {
void setTimeRemaining(long timeRemaining);
NotificationCompat.Builder updateNotification(Context c);
NotificationCompat.Builder updateNotification(Context c);
}
/**

View File

@@ -60,7 +60,8 @@ public class V14CustomNotification implements DownloadNotification.ICustomNotifi
@Override
public NotificationCompat.Builder updateNotification(Context c) {
NotificationCompat.Builder builder = new NotificationCompat.Builder(c);
// NotificationCompat.Builder is used to support API < 16. This can be changed to Notification.Builder if minimum API >= 16.
NotificationCompat.Builder builder = new NotificationCompat.Builder(c);
builder.setContentTitle(mTitle);
if (mTotalKB > 0 && -1 != mCurrentKB) {
builder.setProgress((int) (mTotalKB >> 8), (int) (mCurrentKB >> 8), false);