mirror of
https://gitlab.com/neothefox/LayTray
synced 2026-03-23 21:54:54 +03:00
Better NotificationChannel handling
Bumped the version to 1.8
This commit is contained in:
parent
bccc0bca6c
commit
85ee301a16
@ -6,8 +6,8 @@ android {
|
|||||||
applicationId "space.neothefox.laytray"
|
applicationId "space.neothefox.laytray"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 26
|
targetSdkVersion 26
|
||||||
versionCode 8
|
versionCode 9
|
||||||
versionName "1.7"
|
versionName "1.8"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@ -54,15 +54,18 @@ implements SharedPreferences.OnSharedPreferenceChangeListener{
|
|||||||
iconManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
iconManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
|
||||||
iconChannel = new NotificationChannel(
|
iconChannel = iconManager.getNotificationChannel(channelId);
|
||||||
channelId,
|
if(iconChannel == null) {
|
||||||
"LayTray IconChannel",
|
iconChannel = new NotificationChannel(
|
||||||
NotificationManager.IMPORTANCE_DEFAULT);
|
channelId,
|
||||||
iconChannel.setShowBadge(false);
|
getString(R.string.title_icon_channel),
|
||||||
iconChannel.enableLights(false);
|
NotificationManager.IMPORTANCE_DEFAULT);
|
||||||
iconChannel.enableVibration(false);
|
iconChannel.setShowBadge(false);
|
||||||
iconChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
|
iconChannel.enableLights(false);
|
||||||
iconManager.createNotificationChannel(iconChannel);
|
iconChannel.enableVibration(false);
|
||||||
|
iconChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
|
||||||
|
iconManager.createNotificationChannel(iconChannel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -55,4 +55,5 @@
|
|||||||
<string name="title_about">Аб праграме</string>
|
<string name="title_about">Аб праграме</string>
|
||||||
<string name="close">Зачыніць</string>
|
<string name="close">Зачыніць</string>
|
||||||
<string name="unsupported_device">Тэлефон не падтрымліваецца</string>
|
<string name="unsupported_device">Тэлефон не падтрымліваецца</string>
|
||||||
|
<string name="title_icon_channel">Iконкa раскладкі</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@ -55,4 +55,5 @@
|
|||||||
<string name="title_about">О программе</string>
|
<string name="title_about">О программе</string>
|
||||||
<string name="close">Закрыть</string>
|
<string name="close">Закрыть</string>
|
||||||
<string name="unsupported_device">Телефон не поддерживается</string>
|
<string name="unsupported_device">Телефон не поддерживается</string>
|
||||||
|
<string name="title_icon_channel">Иконка раскладки</string>
|
||||||
</resources>
|
</resources>
|
||||||
@ -8,6 +8,7 @@
|
|||||||
<string name="unsupported_device">Unsupported phone</string>
|
<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="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="close">Close</string>
|
||||||
|
<string name="title_icon_channel">Layout icon</string>
|
||||||
<!-- Strings related to Settings -->
|
<!-- Strings related to Settings -->
|
||||||
|
|
||||||
<!-- Example General settings -->
|
<!-- Example General settings -->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user