NotificationService.java 文件源码

java
阅读 40 收藏 0 点赞 0 评论 0

项目:Klyph 作者:
private void sendNotification(final Notification notification, final boolean  sendDetails)
{
    final Builder builder = KlyphNotification.getBuilder(service.get(), true);

    builder.setContentTitle(notification.getSender_name());
    builder.setContentText(notification.getTitle_text());
    builder.setTicker(String.format("%1$s\n%2$s", notification.getSender_name(), notification.getTitle_text()));

    ImageLoader.loadImage(notification.getSender_pic(), new SimpleFakeImageLoaderListener() {

        @Override
        public void onBitmapFailed(Drawable drawable)
        {
            if (sendDetails)
                KlyphNotification.sendNotification(service.get(), builder, notification);
            else
                KlyphNotification.sendNotification(service.get(), builder);
        }

        @Override
        public void onBitmapLoaded(Bitmap bitmap, LoadedFrom arg1)
        {
            builder.setLargeIcon(bitmap);
            if (sendDetails)
                KlyphNotification.sendNotification(service.get(), builder, notification);
            else
                KlyphNotification.sendNotification(service.get(), builder);
        }
    });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号