일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Coroutine
- recyclerview
- activity
- 백준
- CustomView
- onLayout
- hilt
- Android
- Behavior
- CollapsingToolbarLayout
- ViewModel
- BOJ
- Algorithm
- 안드로이드
- 알림
- onMeasure
- CoordinatorLayout
- lifecycle
- 알고리즘
- DataBinding
- HTTP
- notification
- sqlite
- room
- View
- kotlin
- AppBarLayout
- LiveData
- Navigation
- 코틀린
- Today
- Total
목록알림 (5)
개발일지

Notification Custom 사용자가 직접 Layout을 구성하여 RemoteView를 통해 Nofitication 템플릿을 만들 수 있습니다. * 보통 축소된 Notification은 64dp, 확장된 Notification은 256dp로 제한됩니다. RemoteViews를 만들고setCustomContentView를 통해 적용할 수 있다. * 확장된 CustomContentView는 setCustomBigContentView를 통해 적용할 수 있다. private fun createCustomContentView(): RemoteViews { return RemoteViews(context.packageName, R.layout.notification_content_view).apply { s..

그룹 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...

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 = ..