{"id":13643720,"url":"https://github.com/halysongoncalves/Pugnotification","last_synced_at":"2025-04-21T02:31:20.597Z","repository":{"id":21512931,"uuid":"24832018","full_name":"halysongoncalves/Pugnotification","owner":"halysongoncalves","description":"A powerful library for creating notifications in android platform.","archived":false,"fork":false,"pushed_at":"2024-06-08T02:51:31.000Z","size":3474,"stargazers_count":862,"open_issues_count":37,"forks_count":135,"subscribers_count":51,"default_branch":"master","last_synced_at":"2024-08-03T11:02:37.704Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://halysongoncalves.github.io/Pugnotification","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/halysongoncalves.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-10-06T02:33:31.000Z","updated_at":"2024-04-20T16:55:40.000Z","dependencies_parsed_at":"2024-08-02T01:17:23.571Z","dependency_job_id":"9e2cc75c-5d6b-48df-a215-a199d6cf9527","html_url":"https://github.com/halysongoncalves/Pugnotification","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halysongoncalves%2FPugnotification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halysongoncalves%2FPugnotification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halysongoncalves%2FPugnotification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halysongoncalves%2FPugnotification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halysongoncalves","download_url":"https://codeload.github.com/halysongoncalves/Pugnotification/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223846412,"owners_count":17213187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:01:51.733Z","updated_at":"2024-11-09T15:31:45.495Z","avatar_url":"https://github.com/halysongoncalves.png","language":"Java","funding_links":[],"categories":["通知","Java"],"sub_categories":[],"readme":"[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-PugNotification-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/1688)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.halysongoncalves/pugnotification/badge.svg)](http://search.maven.org/#artifactdetails|com.github.halysongoncalves|pugnotification|1.8.1|)\n[![Build Status](https://api.travis-ci.org/halysongoncalves/Pugnotification.svg)](https://travis-ci.org/halysongoncalves/pugnotification)\n[![Coverage Status](https://coveralls.io/repos/halysongoncalves/pugnotification/badge.svg)](https://coveralls.io/r/halysongoncalves/pugnotification)\n[![Join the chat at https://gitter.im/halysongoncalves/pugnotification](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/halysongoncalves/pugnotification?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n![soon](https://raw.githubusercontent.com/halysongoncalves/pugnotification/develop/art/soon.png)\n\n# Download\n\nDownload [the latest AAR][1] or grab via Maven:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.halysongoncalves\u003c/groupId\u003e\n  \u003cartifactId\u003epugnotification\u003c/artifactId\u003e\n  \u003cversion\u003e1.8.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\nor Gradle:\n```groovy\ncompile 'com.github.halysongoncalves:pugnotification:1.8.1'\n```\n\n# Introduction\n\n![Screenshots](https://raw.githubusercontent.com/halysongoncalves/pugnotification/master/art/screenshot.png)\n\nYou're probably tired of writing code to display notifications in your applications, the library abstracts all the notifications construction process for you in a single line of code. Magic? Lie? I summarize in: productivity.\nTo further improve productivity, pugnotification from release 1.2.0 now has support Android Wear.\n\n```java\nPugNotification.with(context)\n    .load()\n    .identifier(identifier)\n    .title(title)\n    .message(message)\n    .bigTextStyle(bigtext)\n    .smallIcon(smallIcon)\n    .largeIcon(largeIcon)\n    .flags(Notification.DEFAULT_ALL)\n    .button(icon, title, pendingIntent)\n    .click(cctivity, bundle)\n    .dismiss(activity, bundle)\n    .color(color)\n    .ticker(ticker)\n    .when(when)\n    .vibrate(vibrate)\n    .lights(color, ledOnMs, ledOfMs)\n    .sound(sound) \n    .autoCancel(autoCancel)\n    .simple()\n    .build();\n```\n\nMany common pitfalls in building cases are handled automatically by PugNotification:\n\nCustom Notifications depend on RemoteViews and Android has RemoteView support for Api's below Jelly Bean.\nNotifications without no messages and title does not make sense there.\nIn addition to these treatments, there are other held by Picasso Library Square:\n\nHandling ImageView recycling and download cancelation in an adapter.\nComplex image transformations with minimal memory use.\nAutomatic memory and disk caching.\n\n\n# Simple Notification\n\nSimple notification with just text and message.\n\n```java\nPugNotification.with(context)\n    .load()\n    .title(title)\n    .message(message)\n    .bigTextStyle(bigtext)\n    .smallIcon(R.drawable.pugnotification_ic_launcher)\n    .largeIcon(R.drawable.pugnotification_ic_launcher)\n    .flags(Notification.DEFAULT_ALL)\n    .simple()\n    .build();\n```\n\n# Progress Notification\n\nSimple notification with progress.\n\n```java\nPugNotification.with(context)\n    .load()\n    .identifier(identifier)\n    .smallIcon(R.drawable.pugnotification_ic_launcher)\n    .progress()\n    .value(progress,max, indeterminate)\n    .build();\n```\n\n```java\nPugNotification.with(context)\n    .load()\n    .identifier(identifier)\n    .smallIcon(R.drawable.pugnotification_ic_launcher)\n    .progress()\n    .update(identifier,progress,max, indeterminate)\n    .build();\n```\n\n# Custom Notification\n\nWe have changed the way the library handles the download images for custom notifications. Previously disrespectfully because of the Picasso library. But many users were asking for the option of being able to choose how to download the image.\nSo we serve the requests and modify the library to allow the download of image management as an example:\n\n```java\nPugNotification.with(context)\n    .load()\n    .title(title)\n    .message(message)\n    .bigTextStyle(bigtext)\n    .smallIcon(R.drawable.pugnotification_ic_launcher)\n    .largeIcon(R.drawable.pugnotification_ic_launcher)\n    .flags(Notification.DEFAULT_ALL)\n    .color(android.R.color.background_dark)\n    .custom()\n    .background(url)\n    .setImageLoader(Callback)\n    .setPlaceholder(R.drawable.pugnotification_ic_placeholder)\n    .build();  \n```\n\n\n# Wear Notification\n\nPugNotification from release 1.2.0 started to support all types of notifications to Android Wear. We try to anticipate us to make life easier for developers to develop applications for wearable.\n\n```java\nPugNotification.with(mContext).load()\n    .smallIcon(R.drawable.pugnotification_ic_launcher)\n    .autoCancel(true)\n    .largeIcon(R.drawable.pugnotification_ic_launcher)\n    .title(title)\n    .message(message)\n    .bigTextStyle(bigtext)\n    .flags(Notification.DEFAULT_ALL)\n    .wear()\n    .background(Bitmap)\n    .setRemoteInput(icon, title, pendingIntent, remoteInput)\n    .setPages(List\u003cNotification\u003e listNotification)\n    .setHideIcon(Boolean)\n    .build();\n```\n# What's New\n*1.8.1\n\nFix Message Spanned length check\n\n*1.8.0\n\nAdding method for cancellation in tag-based notifications. And added validation to ensure that the color assigned in the method is @ColorRes.\n\n*1.7.0\n\nAdded a new type of notification, progress. Now you can assign the basic features of a notification, while also adding a progressbar in the notification.\n\nIt was also added new method: ongoing (). With it possible to make false removing the notification.\n\n*1.6.0\n\nFixed bug that did not allow the award of a sound and made some organizations and otimizaçnoes the code.\n\nNow it is necessary to set one of the flag's: Notification.DEFAULT_ALL, Notification.DEFAULT_SOUND, Notification.DEFAULT_VIBRATE or Notification.DEFAULT_LIGHTS\n\n*1.5.0\n\nMethod has been added that allows informing the existing configuration of the default notice.\nBy default it is already configured with Notification.DEFAULT_ALL if you want to change just inform the new configuration in the defaults method (int defaults).\n\n*1.4.0\n\nNow just the client implement the ImageLoader interface and implement a way to manage the download of the image. Below we use the Picasso:\n\n```java\n    @Override\n    public void load(String uri, final OnImageLoadingCompleted onCompleted) {\n        viewTarget = getViewTarget(onCompleted);\n        Picasso.with(this).load(uri).into(viewTarget);\n    }\n    \n    private static Target getViewTarget(final OnImageLoadingCompleted onCompleted) {\n        return new Target() {\n            @Override\n            public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {\n                onCompleted.imageLoadingCompleted(bitmap);\n            }\n\n            @Override\n            public void onBitmapFailed(Drawable errorDrawable) {\n            }\n\n            @Override\n            public void onPrepareLoad(Drawable placeHolderDrawable) {\n            }\n        };\n    }\n```\nPugNotification supports placeholders if download the image in the background is not successful. The library already have a default placeholder size 622x384.\n\n\n# ProGuard\n\nIf you use the Picasso to manage the download of the image, add the line below to your proguard file:\n\n```\n-dontwarn com.squareup.okhttp.**\n```\n\n# Contributing\n\nIf you would like to contribute code you can do so through GitHub by forking the repository and sending a pull request.\n\nWhen submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. Please also make sure your code compiles by running gradlew clean and gradlew assemble.\n\n\n# License\n\n    Copyright 2013 Halyson L. Gonçalves, Inc.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n[1]: http://repo1.maven.org/maven2/com/github/halysongoncalves/pugnotification/1.8.1/pugnotification-1.8.1.aar\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalysongoncalves%2FPugnotification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalysongoncalves%2FPugnotification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalysongoncalves%2FPugnotification/lists"}