Changeset View
Changeset View
Standalone View
Standalone View
src/android/org/kde/knotifications/NotifyByAndroid.java
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | 81 | { | |||
---|---|---|---|---|---|
127 | // we need the "BigTextStyle" expandable notifications to make everything readable | 127 | // we need the "BigTextStyle" expandable notifications to make everything readable | ||
128 | // in the single line case this behaves like the regular one, so no special-casing needed | 128 | // in the single line case this behaves like the regular one, so no special-casing needed | ||
129 | if (Build.VERSION.SDK_INT >= 24) { | 129 | if (Build.VERSION.SDK_INT >= 24) { | ||
130 | builder.setStyle(new Notification.BigTextStyle().bigText(Html.fromHtml(notification.richText, Html.FROM_HTML_MODE_COMPACT))); | 130 | builder.setStyle(new Notification.BigTextStyle().bigText(Html.fromHtml(notification.richText, Html.FROM_HTML_MODE_COMPACT))); | ||
131 | } else { | 131 | } else { | ||
132 | builder.setStyle(new Notification.BigTextStyle().bigText(Html.fromHtml(notification.richText))); | 132 | builder.setStyle(new Notification.BigTextStyle().bigText(Html.fromHtml(notification.richText))); | ||
133 | } | 133 | } | ||
134 | 134 | | |||
135 | // lock screen visibility | ||||
136 | switch (notification.visibility) { | ||||
137 | case "public": | ||||
138 | builder.setVisibility(Notification.VISIBILITY_PUBLIC); | ||||
139 | break; | ||||
140 | case "private": | ||||
141 | builder.setVisibility(Notification.VISIBILITY_PRIVATE); | ||||
142 | break; | ||||
143 | case "secret": | ||||
144 | builder.setVisibility(Notification.VISIBILITY_SECRET); | ||||
145 | break; | ||||
146 | } | ||||
147 | | ||||
148 | // grouping | ||||
135 | if (notification.group != null) { | 149 | if (notification.group != null) { | ||
136 | createGroupNotification(notification); | 150 | createGroupNotification(notification); | ||
137 | builder.setGroup(notification.group); | 151 | builder.setGroup(notification.group); | ||
138 | } | 152 | } | ||
139 | 153 | | |||
140 | // legacy priority handling for versions without NotificationChannel support | 154 | // legacy priority handling for versions without NotificationChannel support | ||
141 | if (Build.VERSION.SDK_INT < 26) { | 155 | if (Build.VERSION.SDK_INT < 26) { | ||
142 | switch (notification.urgency) { | 156 | switch (notification.urgency) { | ||
▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines |