All Projects → kirich1409 → Android Notification Dsl

kirich1409 / Android Notification Dsl

Programming Languages

kotlin
9241 projects
dsl
153 projects

Projects that are alternatives of or similar to Android Notification Dsl

Node Gcm
A NodeJS wrapper library port to send data to Android devices via Google Cloud Messaging
Stars: ✭ 1,286 (+1058.56%)
Mutual labels:  notifications
Notifit
Simple colorful animated notifications with JQuery. It never has been easier to create a notification.
Stars: ✭ 101 (-9.01%)
Mutual labels:  notifications
Notifications
Notifications API Standard
Stars: ✭ 105 (-5.41%)
Mutual labels:  notifications
Pushkit silentpushnotification
PushKit_SilentPushNotification to receive VOIP call while iOS app is in background or terminated state
Stars: ✭ 93 (-16.22%)
Mutual labels:  notifications
Pushy
A Java library for sending APNs (iOS/macOS/Safari) push notifications
Stars: ✭ 1,353 (+1118.92%)
Mutual labels:  notifications
Connectivity
🌐 Makes Internet connectivity detection more robust by detecting Wi-Fi networks without Internet access.
Stars: ✭ 1,476 (+1229.73%)
Mutual labels:  notifications
React Native Onesignal
React Native Library for OneSignal Push Notifications Service
Stars: ✭ 1,270 (+1044.14%)
Mutual labels:  notifications
Flutter local notifications
A Flutter plugin for displaying local notifications on Android, iOS, macOS and Linux
Stars: ✭ 1,724 (+1453.15%)
Mutual labels:  notifications
Ravenx
Notification dispatch library for Elixir applications
Stars: ✭ 100 (-9.91%)
Mutual labels:  notifications
Applozic Ios Sdk
iOS Real Time Chat & Messaging SDK
Stars: ✭ 104 (-6.31%)
Mutual labels:  notifications
Mini Toastr
Small non-blocking notification library. No dependencies
Stars: ✭ 94 (-15.32%)
Mutual labels:  notifications
Xnotify
read notifications from stdin and pop them up on the screen
Stars: ✭ 97 (-12.61%)
Mutual labels:  notifications
Django Notifs
Modular Notifications (InApp, Email, SMS, CustomBackend etc) for Django
Stars: ✭ 105 (-5.41%)
Mutual labels:  notifications
Pwa Weather
Minimal Weather PWA: Offline, Push Notification and Web Payments
Stars: ✭ 89 (-19.82%)
Mutual labels:  notifications
Panels
Panels is a framework to easily add sliding panels to your application
Stars: ✭ 1,457 (+1212.61%)
Mutual labels:  notifications
Codehub Push
Push notification server built in Node.js for the iOS application CodeHub
Stars: ✭ 86 (-22.52%)
Mutual labels:  notifications
Telegram Bot Github
Allows to you receive GitHub notifications right in the Telegram
Stars: ✭ 103 (-7.21%)
Mutual labels:  notifications
Flare
Flare is a service that notify changes of HTTP endpoints
Stars: ✭ 110 (-0.9%)
Mutual labels:  notifications
Net Core Push Notifications
Lightweight .NET Core Push Notifications for Android and iOS
Stars: ✭ 105 (-5.41%)
Mutual labels:  notifications
Onepush
消息推送用OnePush,就够了!
Stars: ✭ 1,401 (+1162.16%)
Mutual labels:  notifications

Android Notification DSL (In Development)

Kotlin DSL for creating Android Notification using NotificationCompat.

// Core functionality
implementation 'com.kirich1409.android-notification-dsl:core:0.1.0'

// Extentions to simoplify work
implementation 'com.kirich1409.android-notification-dsl:extensions:0.1.0'

// Media Notification DSL
implementation 'com.kirich1409.android-notification-dsl:media:0.1.0'

Sample

Simple Notification

AndroidX.Core variant in Java:

NotificationCompat.Builder(this, CHANNEL_ID)
    .setSmallIcon(R.drawable.notification_icon)
    .setContentTitle(textTitle)
    .setContentText(textContent)
    .setPriority(NotificationCompat.PRIORITY_DEFAULT)

Android Notification DSL variant:

notification(context, CHANNEL_ID, smallIcon = R.drawable.notification_icon) {
    contentTitle(textTitle)
    contentText(textContent)
    priority(NotificationCompat.PRIORITY_DEFAULT)
}

Grouped Notification

Create grouped notifications

notificationsGroup(context, groupKey = GROUP_KEY, channelId = CHANNEL) {
    summary(SUMMARY_NOTIFICATION_ID, smallIcon = R.drawable.ic_android_white_24dp) {
        contentTitle(R.string.notification_summary_title)
        contentText(R.string.notification_summary_text)
    }

    notifications {
        notification(NOTIFICATION_1_ID, smallIcon = R.drawable.ic_android_white_24dp) {
            contentTitle(R.string.notification_1_title)
        }

        notification(NOTIFICATION_2_ID, smallIcon = R.drawable.ic_android_white_24dp) {
            contentTitle(R.string.notification_2_title)
        }
    }
}

Notification Channels DSL

Creating Android Notification Channels and Groups

createChannelsAndGroups(context) {
    channel(CHANNEL_1_ID, CHANNEL_1_NAME)

    group(CHANNEL_GROUP_1_ID, CHANNEL_GROUP_1_NAME) {
        // Empty group
    }

    group(CHANNEL_GROUP_2_ID, CHANNEL_GROUP_2_NAME) {
        channel(CHANNEL_2_ID, CHANNEL_2_NAME)
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].