diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java index ae0bdea30a..de6fc98ef9 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java @@ -9227,7 +9227,7 @@ private void preparePlayer(Uri uri, boolean playWhenReady, boolean preview, Medi } checkFullscreenButton(); - if (orientationEventListener == null) { + if (orientationEventListener == null && !Config.disableGravityDetectionInVideo) { orientationEventListener = new OrientationEventListener(ApplicationLoader.applicationContext) { @Override public void onOrientationChanged(int orientation) { diff --git a/TMessagesProj/src/main/java/xyz/nextalone/nnngram/activity/ChatSettingActivity.java b/TMessagesProj/src/main/java/xyz/nextalone/nnngram/activity/ChatSettingActivity.java index e9e423c42f..8e3a7a2537 100644 --- a/TMessagesProj/src/main/java/xyz/nextalone/nnngram/activity/ChatSettingActivity.java +++ b/TMessagesProj/src/main/java/xyz/nextalone/nnngram/activity/ChatSettingActivity.java @@ -142,6 +142,7 @@ public class ChatSettingActivity extends BaseActivity { private int disableChannelMuteButtonRow; private int disableAutoPipRow; private int sendMp4DocumentAsVideoRow; + private int disableGravityDetectionInVideoRow; private int chat2Row; private int markdownRow; @@ -466,6 +467,11 @@ protected void onItemClick(View view, int position, float x, float y) { if (view instanceof TextCheckCell) { ((TextCheckCell) view).setChecked(Config.sendMp4DocumentAsVideo); } + } else if (position == disableGravityDetectionInVideoRow) { + Config.toggleDisableGravityDetectionInVideo(); + if (view instanceof TextCheckCell) { + ((TextCheckCell) view).setChecked(Config.disableGravityDetectionInVideo); + } } } @@ -534,6 +540,7 @@ protected void updateRows() { disableChannelMuteButtonRow = addRow("disableChannelMuteButton"); disableAutoPipRow = addRow("disableAutoPip"); sendMp4DocumentAsVideoRow = addRow("sendMp4DocumentAsVideo"); + disableGravityDetectionInVideoRow = addRow("disableGravityDetectionInVideo"); chat2Row = addRow(); markdownRow = addRow(); markdownDisableRow = addRow("markdownDisabled"); @@ -712,6 +719,8 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, boole textCell.setTextAndCheck(LocaleController.getString("disableAutoPip", R.string.disableAutoPip), Config.disableAutoPip, true); } else if (position == sendMp4DocumentAsVideoRow) { textCell.setTextAndCheck(LocaleController.getString("sendMp4DocumentAsVideo", R.string.sendMp4DocumentAsVideo), Config.sendMp4DocumentAsVideo, true); + } else if (position == disableGravityDetectionInVideoRow) { + textCell.setTextAndCheck(LocaleController.getString("disableGravityDetectionInVideo", R.string.disableGravityDetectionInVideo), Config.disableGravityDetectionInVideo, true); } break; } diff --git a/TMessagesProj/src/main/java/xyz/nextalone/nnngram/utils/Defines.kt b/TMessagesProj/src/main/java/xyz/nextalone/nnngram/utils/Defines.kt index 236cfaf19e..644a09a546 100644 --- a/TMessagesProj/src/main/java/xyz/nextalone/nnngram/utils/Defines.kt +++ b/TMessagesProj/src/main/java/xyz/nextalone/nnngram/utils/Defines.kt @@ -219,6 +219,7 @@ object Defines { @BooleanConfig const val disableChannelMuteButton = "disableChannelMuteButton" @BooleanConfig const val disableAutoPip = "disableAutoPip" @BooleanConfig const val sendMp4DocumentAsVideo = "sendMp4DocumentAsVideo" + @BooleanConfig const val disableGravityDetectionInVideo = "disableGravityDetectionInVideo" // Drawer List @BooleanConfig(true) const val showNewGroup = "showNewGroup" diff --git a/TMessagesProj/src/main/res/values-zh/strings_nullgram.xml b/TMessagesProj/src/main/res/values-zh/strings_nullgram.xml index 7032cdc3b6..138cfbf368 100644 --- a/TMessagesProj/src/main/res/values-zh/strings_nullgram.xml +++ b/TMessagesProj/src/main/res/values-zh/strings_nullgram.xml @@ -374,4 +374,5 @@ 禁用频道静音按钮 禁用自动画中画 以视频格式发送 MP4 文件 + 禁用视频重力检测 diff --git a/TMessagesProj/src/main/res/values/strings_nullgram.xml b/TMessagesProj/src/main/res/values/strings_nullgram.xml index a58be46bf3..31accaf87e 100644 --- a/TMessagesProj/src/main/res/values/strings_nullgram.xml +++ b/TMessagesProj/src/main/res/values/strings_nullgram.xml @@ -379,4 +379,5 @@ Disable channel mute button Disable auto PIP Send MP4 document as video + Disable gravity detection in video