diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java index 02ea019fa..7e9960047 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java @@ -2489,9 +2489,11 @@ public class ChatActivityEnterView extends BlurredFrameLayout implements Notific botCommandsMenuButton.setOnClickListener(view -> { boolean open = !botCommandsMenuButton.isOpened(); botCommandsMenuButton.setOpened(open); - try { - performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); - } catch (Exception ignore) {} + if (!NekoConfig.disableVibration.Bool()) { + try { + performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); + } catch (Exception ignore) {} + } if (hasBotWebView()) { if (open) { if (emojiViewVisible || botKeyboardViewVisible) { @@ -2700,9 +2702,11 @@ public class ChatActivityEnterView extends BlurredFrameLayout implements Notific } } if (delegate.getSendAsPeers() != null) { - try { - v.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); - } catch (Exception ignored) {} + if (!NekoConfig.disableVibration.Bool()) { + try { + v.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); + } catch (Exception ignored) {} + } if (senderSelectPopupWindow != null) { senderSelectPopupWindow.setPauseNotifications(false); senderSelectPopupWindow.startDismissAnimation(); @@ -2885,9 +2889,11 @@ public class ChatActivityEnterView extends BlurredFrameLayout implements Notific public void onAnimationUpdate(DynamicAnimation animation, float value, float velocity) { if (!performedHapticFeedback && value >= endY) { performedHapticFeedback = true; - try { - avatar.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); - } catch (Exception ignored) {} + if (!NekoConfig.disableVibration.Bool()) { + try { + avatar.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); + } catch (Exception ignored) {} + } } } }) @@ -3673,9 +3679,11 @@ public class ChatActivityEnterView extends BlurredFrameLayout implements Notific sendPopupWindow.showAtLocation(view, Gravity.LEFT | Gravity.TOP, location[0] + view.getMeasuredWidth() - sendPopupLayout.getMeasuredWidth() + AndroidUtilities.dp(8), y); sendPopupWindow.dimBehind(); doneButtonContainer.invalidate(); - try { - view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); - } catch (Exception ignore) {} + if (!NekoConfig.disableVibration.Bool()) { + try { + view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); + } catch (Exception ignore) {} + } return false; }); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java index b38dc7de3..d5856c347 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java @@ -52,6 +52,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import tw.nekomimi.nekogram.NekoConfig; import xyz.nextalone.nagram.NaConfig; public class SenderSelectPopup extends ActionBarPopupWindow { @@ -243,9 +244,11 @@ public class SenderSelectPopup extends ActionBarPopupWindow { return; } if (peerObj.premium_required && !UserConfig.getInstance(UserConfig.selectedAccount).isPremium()) { - try { - view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); - } catch (Exception ignored) {} + if (!NekoConfig.disableVibration.Bool()) { + try { + view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); + } catch (Exception ignored) {} + } WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); if (bulletinContainer == null) { @@ -345,7 +348,9 @@ public class SenderSelectPopup extends ActionBarPopupWindow { bulletinContainer.animate().alpha(0).setDuration(150).setListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { - windowManager.removeViewImmediate(bulletinContainer); + if (bulletinContainer != null && bulletinContainer.isShown()) { + windowManager.removeViewImmediate(bulletinContainer); + } if (bulletinHideCallback != null) { AndroidUtilities.cancelRunOnUIThread(bulletinHideCallback);