This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.gradle.api.file.Directory | |
import org.gradle.api.file.DirectoryProperty | |
import org.gradle.api.internal.file.copy.CopyAction | |
import org.gradle.api.internal.file.copy.CopySpecInternal | |
import org.gradle.api.internal.file.copy.DestinationRootCopySpec | |
import org.gradle.api.internal.file.copy.FileCopyAction | |
import org.gradle.api.provider.Provider | |
import org.gradle.api.tasks.AbstractCopyTask | |
import org.gradle.api.tasks.OutputDirectory | |
import org.gradle.work.DisableCachingByDefault |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Color | |
import androidx.core.app.NotificationCompat | |
import androidx.core.app.NotificationManagerCompat | |
import com.sample_app.R | |
private const val MESSAGES_CHANNEL_ID = "notification_channel_id" | |
private const val NOTIFICATION_ID = 123456 | |
fun pushMessageNotification() { | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Color | |
import androidx.core.app.NotificationCompat | |
import androidx.core.app.NotificationManagerCompat | |
import com.sample_app.R | |
private const val MESSAGES_CHANNEL_ID = "notification_channel_id" | |
private const val NOTIFICATION_ID = 123456 | |
fun pushMessageNotification() { | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Notification | |
import android.graphics.Bitmap | |
import androidx.core.app.NotificationCompat | |
private fun addNewMessageToExistingMessageNotificationStyle( | |
previousNotification: Notification, | |
userName: String, | |
userProfileBitmap: Bitmap, | |
text: String, | |
): NotificationCompat.MessagingStyle { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Notification | |
import androidx.core.app.NotificationManagerCompat | |
private const val NOTIFICATION_ID = 123456 | |
private fun getPreviousNotification(): Notification? { | |
return NotificationManagerCompat.from(context).activeNotifications | |
.find { it.id == NOTIFICATION_ID } | |
?.notification | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Notification | |
import android.graphics.Bitmap | |
import androidx.core.app.NotificationCompat | |
import androidx.core.app.NotificationManagerCompat | |
fun pushMessageNotification() { | |
... | |
val previousNotification = getPreviousNotification() | |
val chatMessageStyle = if (previousNotification != null) { | |
addNewMessageToExistingMessageNotificationStyle( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.PendingIntent | |
import android.content.Intent | |
import androidx.core.app.PendingIntentCompat | |
import com.mwm.labs.poc.audiochat.main_activity.MainActivity | |
private fun createPendingIntent(): PendingIntent? { | |
val intent = createIntent() | |
return PendingIntentCompat.getActivity( | |
/* context = */ context, | |
/* requestCode = */ 42, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.NotificationChannel | |
import android.app.NotificationManager | |
import android.os.Build | |
import androidx.core.app.NotificationManagerCompat | |
private const val MESSAGES_CHANNEL_ID = "notification_channel_id" | |
private fun createNotificationChannelIfNeeded() { | |
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Color | |
import androidx.core.app.NotificationCompat | |
import androidx.core.app.NotificationManagerCompat | |
import com.sample_app.R | |
private const val MESSAGES_CHANNEL_ID = "notification_channel_id" | |
private const val NOTIFICATION_ID = 123456 | |
fun pushMessageNotification() { | |
createNotificationChannelIfNeeded() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1.12.0 is the latest version as of the 4th of february 2024 | |
implementation("androidx.core:core:1.12.0") |
NewerOlder