This commit is contained in:
Niels Andriesse
2020-01-13 16:47:50 +11:00
parent df61e9565c
commit 52dc8d6b63
8 changed files with 36 additions and 21 deletions

View File

@@ -421,7 +421,12 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
View rootView = findViewById(R.id.rootView);
rootView.getViewTreeObserver().addOnGlobalLayoutListener(() -> {
int height = rootView.getRootView().getHeight() - rootView.getHeight();
expandedKeyboardHeight = Math.max(expandedKeyboardHeight, height);
int thresholdInDP = 120;
float scale = getResources().getDisplayMetrics().density;
int thresholdInPX = (int)(thresholdInDP * scale);
if (expandedKeyboardHeight == 0 || height > thresholdInPX) {
expandedKeyboardHeight = height;
}
collapsedKeyboardHeight = Math.min(collapsedKeyboardHeight, height);
keyboardHeight = Math.max(expandedKeyboardHeight - collapsedKeyboardHeight, keyboardHeight);
});
@@ -1175,6 +1180,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
if (attachmentTypeSelector == null) {
attachmentTypeSelector = new AttachmentTypeSelector(this, getSupportLoaderManager(), new AttachmentTypeListener(), keyboardHeight);
}
attachmentTypeSelector.keyboardHeight = keyboardHeight;
attachmentTypeSelector.show(this, attachButton);
} else {
handleManualMmsRequired();