El Arsenal de Android: notificaciones push / pull

Información sobre este proyecto

  • SDK para su problema de notificación para facilitar el desarrollo de aplicaciones de Android
  • La notificación de frogo está experimentando un tremendo desarrollo
  • Notificación con método singleton
  • Simple y fácil de usar
  • Con muchas funciones
  • Documentación completa
  • Notificación de diseño personalizado

Ejemplo de captura de pantalla

Notificación simple Notificación de pila
Notificación personalizada (1) Notificación personalizada (2)

Lanzamiento de la versión

Esta es la última versión

¿¿Qué hay de nuevo??

* Bug Fixed *
* Enhance Performance *
* Update : build.gradle latest version *
* Update : Android Gradle Plugin 7.0.1 *
* Adding : Custom Layout Notification *
* Solving Feature Request *
* Solving Issue *

Descarga este proyecto

Paso 1. Agregue el repositorio de JitPack a su archivo de compilación (build.gradle: Project)

Add it in your root build.gradle at the end of repositories:

 allprojects {
  repositories {
   ...
   maven { url 'https://jitpack.io' }
  }
 }

Paso 2. Agregue la dependencia (build.gradle: Module)

dependencies {
        // library frogo-notification
        implementation 'com.github.amirisback:frogo-notification:1.0.7'
}

Paso 3. Implementar la notificación de Frogo (notificación simple)

FrogoNotification.Inject(this) // Intialize for Context
    .setChannelId(CHANNEL_ID) // Intialize for Channel ID
    .setChannelName(CHANNEL_NAME) // Initialize for Channel Name
    .setContentIntent(pendingIntent) // Initialize for Content Intent
    .setSmallIcon(R.drawable.ic_frogo_notif) // Initialize for Small Icon
    .setLargeIcon(R.drawable.ic_frogo_notif) // Initialize for Large Icon
    .setContentTitle(resources.getString(R.string.content_title)) // Initialize for Content Title
    .setContentText(resources.getString(R.string.content_text)) // Initialize for Content Text
    .setSubText(resources.getString(R.string.subtext)) // Initialize for Sub Text
    .setupAutoCancel() // Initialize for Auto Cancel
    .build() // Build the Frogo Notification
    .launch(NOTIFICATION_ID) // Notify the Frogo Notification

Funcionalidad de notificación frogo

Notificación simple

FrogoNotification.Inject(this) // Intialize for Context
    .setChannelId(CHANNEL_ID) // Intialize for Channel ID
    .setChannelName(CHANNEL_NAME) // Initialize for Channel Name
    .setContentIntent(pendingIntent) // Initialize for Content Intent
    .setSmallIcon(R.drawable.ic_frogo_notif) // Initialize for Small Icon
    .setLargeIcon(R.drawable.ic_frogo_notif) // Initialize for Large Icon
    .setContentTitle(resources.getString(R.string.content_title)) // Initialize for Content Title
    .setContentText(resources.getString(R.string.content_text)) // Initialize for Content Text
    .setSubText(resources.getString(R.string.subtext)) // Initialize for Sub Text
    .setupAutoCancel() // Initialize for Auto Cancel
    .build() // Build the Frogo Notification
    .launch(NOTIFICATION_ID) // Notify the Frogo Notification

Diseño personalizado (NUEVA FUNCIÓN)

val collapsed = object : FrogoNotifCustomContentViewListener {
    override fun setupCustomView(): Int {
        return R.layout.notification_collapsed
    }

    override fun setupComponent(context: Context, customView: RemoteViews) {
        customView.apply{
            setTextViewText(R.id.text_view_collapsed_1, "Hello World!")
        }
    }
}

val expanded = object : FrogoNotifCustomContentViewListener {
    override fun setupCustomView(): Int {
        return R.layout.notification_expanded
    }

    override fun setupComponent(context: Context, customView: RemoteViews) {
        customView.apply {
            setImageViewResource(R.id.image_view_expanded, R.drawable.ic_android)
            setOnClickPendingIntent(R.id.image_view_expanded, clickPendingIntent)
        }
    }
}

FrogoNotification.Inject(this) // Intialize for Context
    .setChannelId(FrogoApp.CHANNEL_ID) // Intialize for Channel ID
    .setChannelName(FrogoApp.CHANNEL_NAME) // Initialize for Channel Name
    .setSmallIcon(R.drawable.ic_android) // Initialize for Small Icon
    .setCustomContentView(collapsed)
    .setCustomBigContentView(expanded)
    .build() // Build the Frogo Notification
    .launch(FrogoApp.NOTIFICATION_ID) // Notify the Frogo Notification

Con Action Replay

FrogoNotification.Inject(this)
    .setChannelId(CHANNEL_ID)
    .setChannelName(CHANNEL_NAME as String)
    .setSmallIcon(R.drawable.ic_frogo_notif)
    .setContentTitle(getString(R.string.notif_title))
    .setContentText(getString(R.string.notif_content))
    .setupShowWhen()
    .setupActionRemoteInput(object : FrogoNotifActionRemoteInputListener {
        override fun setRemoteInputResultKey(): String {
            return KEY_REPLY
        }

        override fun setRemoteInputLabel(): String {
            return getString(R.string.notif_action_reply)
        }

        override fun setActionIcon(): Int {
            return R.drawable.ic_frogo_send
        }

        override fun setActionTitle(): String {
            return getString(R.string.notif_action_reply)
        }

        override fun setActionIntent(): PendingIntent? {
            return getReplyPendingIntent()
        }

        override fun setAllowGeneratedReplies(): Boolean {
            return true
        }
    })
    .build()
    .launch(mNotificationId)

Con estilo Bandeja de entrada (pila)

val frogoNotification = FrogoNotification.Inject(this)
    .setChannelId(CHANNEL_ID)
    .setChannelName(CHANNEL_NAME)
    .setSmallIcon(R.drawable.ic_frogo_email)
    .setGroup(GROUP_KEY_EMAILS)
    .setContentIntent(pendingIntent)
    .setupAutoCancel()

// Check if NotificationID is smaller than Max Notif
if (idNotification < MAX_NOTIFICATION) {

    stackNotif[idNotification].message?.let {
        frogoNotification
            .setContentTitle("New Email from " + stackNotif[idNotification].sender)
            .setContentText(it)
            .setLargeIcon(R.drawable.ic_frogo_notif)
    }

} else {

    frogoNotification
        .setContentTitle("$idNotification new emails")
        .setContentText("mail@frogobox.com")
        .setGroupSummary()
        .setupInboxStyle(object : FrogoNotifInboxStyleListener {
            override fun addLine1(): String {
                return "New Email from " + stackNotif[idNotification].sender
            }

            override fun addLine2(): String {
                return "New Email from " + stackNotif[idNotification - 1].sender
            }

            override fun setBigContentTitle(): String {
                return "$idNotification new emails"
            }

            override fun setSummaryText(): String {
                return "mail@frogobox"
            }
        })

}

frogoNotification
    .build()
    .launch(idNotification)

Con el estilo de la rana

    FrogoNotification.Inject(this) // Intialize for Context
        .setSmallIcon(R.drawable.ic_frogo_notif) // Initialize for Small Icon
        .setupWithFrogoStyle()
        .build() // Build the Frogo Notification
        .launch(NOTIFICATION_ID) // Notify the Frogo Notification

Para documentación

colaborador

Muy abierto a cualquiera, escribiré su nombre debajo de esto, por favor contribuya enviándome un correo electrónico

  • Correo a faisalamircs@gmail.com
  • Asunto: Github _ [Github-Username-Account] _ [Language] _ [Repository-Name]
  • Ejemplo: Github_amirisback_kotlin_admob-helper-deployment

Nombre de la contribución

  • Muhammad Faisal Amir
  • Lista de espera
  • Lista de espera

Esperamos tu contribución

¡¡¡Precaución!!!

  • Disfruta y no olvides tu tenedor y dale una estrella
  • No olvides seguir mi cuenta de Github

.

Compruebe también

Blog para desarrolladores de Android: Lucha contra las estafas de robo de identidad: el enfoque innovador de Monzo

Publicado por Todd Burner, ingeniero de relaciones con desarrolladores Los ciberdelincuentes continúan invirtiendo en estafas …

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *