diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index 1951fb6cb..d8489861e 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -1904,10 +1904,14 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
activity.xmppConnectionService.updateConversation(conversation);
}
updateChatMsgHint();
- new Handler().post(() -> {
- int size = messageList.size();
- this.binding.messagesView.setSelection(size - 1);
- });
+ SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(activity);
+ final boolean prefScrollToBottom = p.getBoolean("scroll_to_bottom", activity.getResources().getBoolean(R.bool.scroll_to_bottom));
+ if (prefScrollToBottom || scrolledToBottom()) {
+ new Handler().post(() -> {
+ int size = messageList.size();
+ this.binding.messagesView.setSelection(size - 1);
+ });
+ }
}
public void setFocusOnInputField() {
diff --git a/src/main/res/values/defaults.xml b/src/main/res/values/defaults.xml
index bb0096a39..7da1047f3 100644
--- a/src/main/res/values/defaults.xml
+++ b/src/main/res/values/defaults.xml
@@ -41,4 +41,5 @@
false
false
true
+ true
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index e6f1ce20d..575957a3f 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -709,4 +709,6 @@
Certificate Verification
Once
The QR code scanner needs access to the camera
+ Scroll to bottom
+ Scroll down after sending a message
diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml
index 012d8b370..7b27804d3 100644
--- a/src/main/res/xml/preferences.xml
+++ b/src/main/res/xml/preferences.xml
@@ -257,6 +257,11 @@
android:key="display_enter_key"
android:summary="@string/pref_display_enter_key_summary"
android:title="@string/pref_display_enter_key"/>
+