8
8
- Simple and eazy to use
9
9
- With many feature
10
10
- Full documentation
11
+ - Custom Layout Notification
11
12
12
13
## Screenshoot Library Sample
13
- | Simple Notification | Custom Notification | Stack Notification |
14
- | :------------------:| :---------------------:| :---------------------:|
15
- | <img width =" 200px " height =" 360px " src =" docs/image/simple_notif .gif " > | <img width =" 200px " height =" 360px " src =" docs/image/custom_notif .gif " > | <img width =" 200px " height =" 360px " src =" docs/image/stack_notif .gif " > |
14
+ | Simple Notification | Custom Notification (1) | Custom Notification (2) | Stack Notification |
15
+ | :------------------:| :-------------------------: | :------------------------- :| :---------------------:|
16
+ | <img width =" 200px " height =" 360px " src =" docs/image/ss_simple_notif .gif " > | <img width =" 200px " height =" 360px " src =" docs/image/ss_custom_layout .gif " > | <img width =" 200px " height =" 360px " src =" docs/image/ss_reply_notif.gif " > | < img width = " 200px " height = " 360px " src = " docs/image/ss_stack_notif .gif" > |
16
17
17
18
18
19
## Version Release
19
20
This Is Latest Release
20
21
21
- $version_release = 1.0.5
22
+ $version_release = 1.0.6
22
23
23
24
What's New??
24
25
25
26
* Bug Fixed *
26
27
* Enhance Performance *
27
28
* Update : build.gradle latest version *
29
+ * Update : Android Gradle Plugin 7.0.0 *
30
+ * Adding : Custom Layout Notification *
31
+ * Solving Feature Request *
32
+ * Solving Issue *
28
33
29
34
## Download this project
30
35
@@ -43,7 +48,7 @@ What's New??
43
48
44
49
dependencies {
45
50
// library frogo-notification
46
- implementation 'com.github.amirisback:frogo-notification:1.0.5 '
51
+ implementation 'com.github.amirisback:frogo-notification:1.0.6 '
47
52
}
48
53
49
54
### Step 3. Implement frogo-notification (Simple Notification)
@@ -57,7 +62,7 @@ What's New??
57
62
.setContentTitle(resources.getString(R.string.content_title)) // Initialize for Content Title
58
63
.setContentText(resources.getString(R.string.content_text)) // Initialize for Content Text
59
64
.setSubText(resources.getString(R.string.subtext)) // Initialize for Sub Text
60
- .setAutoCancel(true ) // Initialize for Auto Cancel
65
+ .setupAutoCancel( ) // Initialize for Auto Cancel
61
66
.build() // Build the Frogo Notification
62
67
.launch(NOTIFICATION_ID) // Notify the Frogo Notification
63
68
@@ -74,10 +79,46 @@ What's New??
74
79
.setContentTitle(resources.getString(R.string.content_title)) // Initialize for Content Title
75
80
.setContentText(resources.getString(R.string.content_text)) // Initialize for Content Text
76
81
.setSubText(resources.getString(R.string.subtext)) // Initialize for Sub Text
77
- .setAutoCancel(true ) // Initialize for Auto Cancel
82
+ .setupAutoCancel( ) // Initialize for Auto Cancel
78
83
.build() // Build the Frogo Notification
79
84
.launch(NOTIFICATION_ID) // Notify the Frogo Notification
80
85
86
+ ### Custom Layout (NEW FEATURE)
87
+
88
+ val collapsed = object : FrogoNotifCustomContentViewListener {
89
+ override fun setupCustomView(): Int {
90
+ return R.layout.notification_collapsed
91
+ }
92
+
93
+ override fun setupComponent(context: Context, customView: RemoteViews) {
94
+ customView.apply{
95
+ setTextViewText(R.id.text_view_collapsed_1, "Hello World!")
96
+ }
97
+ }
98
+ }
99
+
100
+ val expanded = object : FrogoNotifCustomContentViewListener {
101
+ override fun setupCustomView(): Int {
102
+ return R.layout.notification_expanded
103
+ }
104
+
105
+ override fun setupComponent(context: Context, customView: RemoteViews) {
106
+ customView.apply {
107
+ setImageViewResource(R.id.image_view_expanded, R.drawable.ic_android)
108
+ setOnClickPendingIntent(R.id.image_view_expanded, clickPendingIntent)
109
+ }
110
+ }
111
+ }
112
+
113
+ FrogoNotification.Inject(this) // Intialize for Context
114
+ .setChannelId(FrogoApp.CHANNEL_ID) // Intialize for Channel ID
115
+ .setChannelName(FrogoApp.CHANNEL_NAME) // Initialize for Channel Name
116
+ .setSmallIcon(R.drawable.ic_android) // Initialize for Small Icon
117
+ .setCustomContentView(collapsed)
118
+ .setCustomBigContentView(expanded)
119
+ .build() // Build the Frogo Notification
120
+ .launch(FrogoApp.NOTIFICATION_ID) // Notify the Frogo Notification
121
+
81
122
### With Action Replay
82
123
83
124
FrogoNotification.Inject(this)
@@ -86,8 +127,8 @@ What's New??
86
127
.setSmallIcon(R.drawable.ic_frogo_notif)
87
128
.setContentTitle(getString(R.string.notif_title))
88
129
.setContentText(getString(R.string.notif_content))
89
- .showWhen(true )
90
- .setupActionRemoteInput(object : IFNActionRemoteInput {
130
+ .setupShowWhen( )
131
+ .setupActionRemoteInput(object : FrogoNotifActionRemoteInputListener {
91
132
override fun setRemoteInputResultKey(): String {
92
133
return KEY_REPLY
93
134
}
@@ -124,7 +165,7 @@ What's New??
124
165
.setSmallIcon(R.drawable.ic_frogo_email)
125
166
.setGroup(GROUP_KEY_EMAILS)
126
167
.setContentIntent(pendingIntent)
127
- .setAutoCancel(true )
168
+ .setupAutoCancel( )
128
169
129
170
// Check if NotificationID is smaller than Max Notif
130
171
if (idNotification < MAX_NOTIFICATION) {
@@ -142,7 +183,7 @@ What's New??
142
183
.setContentTitle("$idNotification new emails")
143
184
.setContentText("[email protected] ")
144
185
.setGroupSummary()
145
- .setupInboxStyle(object : IFNInboxStyle {
186
+ .setupInboxStyle(object : FrogoNotifInboxStyleListener {
146
187
override fun addLine1(): String {
147
188
return "New Email from " + stackNotif[idNotification].sender
148
189
}
0 commit comments