File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
codeview/src/main/java/com/amrdeveloper/codeview Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -648,9 +648,6 @@ public void showDropDown() {
648648 final int [] screenPoint = new int [2 ];
649649 getLocationOnScreen (screenPoint );
650650
651- final Rect displayFrame = new Rect ();
652- getWindowVisibleDisplayFrame (displayFrame );
653-
654651 final Layout layout = getLayout ();
655652 final int position = getSelectionStart ();
656653 final int line = layout .getLineForOffset (position );
@@ -667,8 +664,17 @@ public void showDropDown() {
667664 dropDownHeight = modifiedDropDownHeight ;
668665 }
669666
667+ final Rect displayFrame = new Rect ();
668+ getWindowVisibleDisplayFrame (displayFrame );
669+ int displayFrameHeight = displayFrame .height ();
670+
671+ int verticalOffset = lineButton + dropDownHeight ;
672+ if (verticalOffset > displayFrameHeight ) {
673+ verticalOffset = displayFrameHeight - autoCompleteItemHeightInDp ;
674+ }
675+
670676 setDropDownHeight (dropDownHeight );
671- setDropDownVerticalOffset (lineButton + dropDownHeight );
677+ setDropDownVerticalOffset (verticalOffset );
672678 setDropDownHorizontalOffset ((int ) layout .getPrimaryHorizontal (position ));
673679
674680 super .showDropDown ();
You can’t perform that action at this time.
0 commit comments