Shrink max height for "add reactoin" autocomplete

Stephen Paul Weber created

The onscreen keyboard may come up after the calculatoin or something?
Anyway it ends up being about 4x too big so this seems to fix it.

Change summary

src/main/java/eu/siacs/conversations/ui/XmppActivity.java | 8 ++++++++
1 file changed, 8 insertions(+)

Detailed changes

src/main/java/eu/siacs/conversations/ui/XmppActivity.java 🔗

@@ -418,6 +418,14 @@ public abstract class XmppActivity extends ActionBarActivity {
                     return adapter;
                 }
 
+                @Override
+                protected PopupDimensions getPopupDimensions() {
+                    final var dims = super.getPopupDimensions();
+                    final var available = new android.widget.PopupWindow().getMaxAvailableHeight(viewBinding.search);
+                    dims.maxHeight = available / 4;
+                    return dims;
+                }
+
                 @Override
                 protected void onViewHidden() {
                     if (getRecyclerView() == null) return;