mirror of https://github.com/NekoX-Dev/NekoX.git
Feature: disable all notification bubbles
This commit is contained in:
parent
cf712d9641
commit
632b36170c
|
@ -2963,14 +2963,16 @@ public class NotificationsController extends BaseController {
|
|||
} else {
|
||||
icon = IconCompat.createWithResource(ApplicationLoader.applicationContext, R.drawable.book_group);
|
||||
}
|
||||
NotificationCompat.BubbleMetadata.Builder bubbleBuilder =
|
||||
new NotificationCompat.BubbleMetadata.Builder(
|
||||
PendingIntent.getActivity(ApplicationLoader.applicationContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT),
|
||||
icon);
|
||||
bubbleBuilder.setSuppressNotification(openedDialogId == did);
|
||||
bubbleBuilder.setAutoExpandBubble(false);
|
||||
bubbleBuilder.setDesiredHeight(AndroidUtilities.dp(640));
|
||||
builder.setBubbleMetadata(bubbleBuilder.build());
|
||||
if (!NekoConfig.disableNotificationBubbles.Bool()) {
|
||||
NotificationCompat.BubbleMetadata.Builder bubbleBuilder =
|
||||
new NotificationCompat.BubbleMetadata.Builder(
|
||||
PendingIntent.getActivity(ApplicationLoader.applicationContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT),
|
||||
icon);
|
||||
bubbleBuilder.setSuppressNotification(openedDialogId == did);
|
||||
bubbleBuilder.setAutoExpandBubble(false);
|
||||
bubbleBuilder.setDesiredHeight(AndroidUtilities.dp(640));
|
||||
builder.setBubbleMetadata(bubbleBuilder.build());
|
||||
}
|
||||
return id;
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
|
|
|
@ -119,6 +119,8 @@ public class NekoConfig {
|
|||
public static ConfigItem translateToLang = addConfig("TransToLang", configTypeString, ""); // "" -> translate to current language (MessageTrans.kt & Translator.kt)
|
||||
public static ConfigItem translateInputLang = addConfig("TransInputToLang", configTypeString, "en");
|
||||
|
||||
public static ConfigItem disableNotificationBubbles = addConfig("disableNotificationBubbles", configTypeBool, false);
|
||||
|
||||
public static ConfigItem ccToLang = addConfig("opencc_to_lang", configTypeString, "");
|
||||
public static ConfigItem ccInputLang = addConfig("opencc_input_to_lang", configTypeString, "");
|
||||
|
||||
|
|
|
@ -108,6 +108,10 @@ public class NekoGeneralSettingsActivity extends BaseFragment {
|
|||
}, LocaleController.getString("UsernameEmpty", R.string.UsernameEmpty)));
|
||||
private final AbstractConfigCell divider2 = cellGroup.appendCell(new ConfigCellDivider());
|
||||
|
||||
private final AbstractConfigCell header_notification = cellGroup.appendCell(new ConfigCellHeader(LocaleController.getString("NekoGeneralNotification")));
|
||||
private final AbstractConfigCell disableNotificationBubblesRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableNotificationBubbles));
|
||||
private final AbstractConfigCell divider_notification = cellGroup.appendCell(new ConfigCellDivider());
|
||||
|
||||
private final AbstractConfigCell header3 = cellGroup.appendCell(new ConfigCellHeader(LocaleController.getString("OpenKayChain")));
|
||||
private final AbstractConfigCell pgpAppRow = cellGroup.appendCell(new ConfigCellCustom(CellGroup.ITEM_TYPE_TEXT_SETTINGS_CELL, true));
|
||||
private final AbstractConfigCell keyRow = cellGroup.appendCell(new ConfigCellTextDetail(NekoConfig.openPGPKeyId, (view, position) -> {
|
||||
|
|
|
@ -133,5 +133,7 @@
|
|||
<string name="SaveToDownloadCount_few">Saving %1$d files to downloads</string>
|
||||
<string name="SaveToDownloadCount_many">Saving %1$d files to downloads</string>
|
||||
<string name="SaveToDownloadCount_other">Saving %1$d files to downloads</string>
|
||||
<string name="NekoGeneralNotification">Notification</string>
|
||||
<string name="disableNotificationBubbles">Disable Bubbles in notification</string>
|
||||
|
||||
</resources>
|
Loading…
Reference in New Issue