일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- hilt
- room
- recyclerview
- sqlite
- 코틀린
- notification
- Android
- BOJ
- CollapsingToolbarLayout
- 알림
- Behavior
- HTTP
- lifecycle
- CoordinatorLayout
- 알고리즘
- activity
- AppBarLayout
- CustomView
- Algorithm
- LiveData
- DataBinding
- ViewModel
- Navigation
- 안드로이드
- 백준
- Coroutine
- View
- kotlin
- onMeasure
- onLayout
- Today
- Total
목록notification (5)
개발일지

그룹 Android 7.0(API 24)부터는 관련된 알림을 그룹으로 표시할 수 있습니다. 예를 들어, 앱에서 수신된 이메일의 알림을 표시하려면 모든 알림을 동일한 그룹에 포함하여 함께 축소할 수 있도록 해야 합니다. Android에서 기본적으로 그룹을 지정하지 않은 경우 4개 이상의 알림을 자동으로 그룹화 합니다. Notification 만들기 Notification을 만들 때 setGroup을 통해 그룹을 정해줍니다. val notification = NotificationCompat.Builder(context, CHANNEL_ID) .setSmallIcon(R.drawable.ic_android) .setContentTitle(message.title) .setContentText(message...

확장형 알림 기존의 알림보다 훨씬 많은 알림을 제공하기 위해 확장형 알림을 사용할 수 있다. 코드 @Singleton class ExtendNotificationManager @Inject constructor( @ApplicationContext private val context: Context ) { companion object { private const val CHANNEL_ID_IMPORTANCE_HIGH = "com.taetae98.notification.EXTEND.IMPORTANCE_HIGH" private const val CHANNEL_ID_IMPORTANCE_LOW = "com.taetae98.notification.EXTEND.IMPORTANCE_LOW" private const..

Notification Action 알림을 빠르게 대응할 수 있도록 알림을 탭했을 때 작업을 추가 하거나 최대 3개의 Action을 추가할 수 있다. setContentIntent 알림을 탭 했을 때 PendingIntent를 통해 작업을 정할 수 있다. private fun createPendingIntent(message: Message): PendingIntent { return NavDeepLinkBuilder(context) .setGraph(R.navigation.navigation_main) .setDestination(R.id.actionFragment) .setArguments( Bundle().apply { putSerializable("message", message) } ) .cre..

Notification 사용자에게 알림을 보내야할 때 사용한다. 앱 또는 사용자가 닫을 때까지 알림창에 표시된다. Head Up Notification 처럼 즉각적으로 알림을 보여줄 수 있다. (Android 5.0(API 21) 이상 가능) Lock Screen에 표시할 수 있고, 보여주는 내용을 지정할 수 있다. (Android 5.0(API 21) 이상 가능) Launcher에서 지원하는 경우 알림 뱃지를 설정할 수 있다. (Android 8.0(API 26) 이상 가능) Notification 구성 Small Icon : 필수 구성요소이며 setSmallIcon을 통해 설정할 수 있다. App Name : 앱 이름, 시스템에서 제공한다. Time : 시스템에서 제공하지만 setWhen으로 설정하거..
채널 만들기 Android O 이상에서 Notification을 생성하기 위해서는 Notification Channel을 만들어야 한다. if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { val NOTIFICATION_CHANNEL_ID = "id" val NOTIFICATION_CHANNEL_NAME = "name" val NOTIFICATION_IMPORTANCE = NotificationManager.IMPORTANCE_DEFAULT val channel = NotificationChannel(NOTIFICATION_CHANNEL_ID, NOTIFICATION_CHANNEL_NAME, NOTIFICATION_IMPORTANCE) val manager = ..