mirror of
https://gitlab.com/neothefox/LayTray
synced 2026-06-13 22:40:48 +03:00
Better NotificationChannel handling
Bumped the version to 1.8
This commit is contained in:
@@ -54,15 +54,18 @@ implements SharedPreferences.OnSharedPreferenceChangeListener{
|
||||
iconManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
|
||||
iconChannel = new NotificationChannel(
|
||||
channelId,
|
||||
"LayTray IconChannel",
|
||||
NotificationManager.IMPORTANCE_DEFAULT);
|
||||
iconChannel.setShowBadge(false);
|
||||
iconChannel.enableLights(false);
|
||||
iconChannel.enableVibration(false);
|
||||
iconChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
|
||||
iconManager.createNotificationChannel(iconChannel);
|
||||
iconChannel = iconManager.getNotificationChannel(channelId);
|
||||
if(iconChannel == null) {
|
||||
iconChannel = new NotificationChannel(
|
||||
channelId,
|
||||
getString(R.string.title_icon_channel),
|
||||
NotificationManager.IMPORTANCE_DEFAULT);
|
||||
iconChannel.setShowBadge(false);
|
||||
iconChannel.enableLights(false);
|
||||
iconChannel.enableVibration(false);
|
||||
iconChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
|
||||
iconManager.createNotificationChannel(iconChannel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,4 +55,5 @@
|
||||
<string name="title_about">Аб праграме</string>
|
||||
<string name="close">Зачыніць</string>
|
||||
<string name="unsupported_device">Тэлефон не падтрымліваецца</string>
|
||||
<string name="title_icon_channel">Iконкa раскладкі</string>
|
||||
</resources>
|
||||
|
||||
@@ -55,4 +55,5 @@
|
||||
<string name="title_about">О программе</string>
|
||||
<string name="close">Закрыть</string>
|
||||
<string name="unsupported_device">Телефон не поддерживается</string>
|
||||
<string name="title_icon_channel">Иконка раскладки</string>
|
||||
</resources>
|
||||
@@ -8,6 +8,7 @@
|
||||
<string name="unsupported_device">Unsupported phone</string>
|
||||
<string name="unsupported_device_description" translatable="false">This phone is missing the BlackBerry Keyboard. LayTray will not work without it.</string>
|
||||
<string name="close">Close</string>
|
||||
<string name="title_icon_channel">Layout icon</string>
|
||||
<!-- Strings related to Settings -->
|
||||
|
||||
<!-- Example General settings -->
|
||||
|
||||
Reference in New Issue
Block a user