Skip to content

Commit

Permalink
Fix clipping for popups.
Browse files Browse the repository at this point in the history
This appears to be a behavior change in newer API levels. PopupWindow's
setClippingEnabled has been around since API level 3, but appears to
have been optional.

See also:
https://stackoverflow.com/questions/46564984/android-custom-keyboard-preview-view-constrained-to-parent-layout
  • Loading branch information
Klaus Weidner committed Nov 21, 2018
1 parent 0bddec9 commit e3179ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public CandidateView(Context context, AttributeSet attrs) {
mPreviewPopup.setContentView(mPreviewText);
mPreviewPopup.setBackgroundDrawable(null);
mPreviewPopup.setAnimationStyle(R.style.KeyPreviewAnimation);
mPreviewPopup.setClippingEnabled(false);
mColorNormal = res.getColor(R.color.candidate_normal);
mColorRecommended = res.getColor(R.color.candidate_recommended);
mColorOther = res.getColor(R.color.candidate_other);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ public LatinKeyboardView(Context context, AttributeSet attrs, int defStyle) {
mPreviewPopup.setBackgroundDrawable(null);
mPreviewPopup.setTouchable(false);
mPreviewPopup.setAnimationStyle(R.style.KeyPreviewAnimation);
mPreviewPopup.setClippingEnabled(false);
} else {
mShowPreview = false;
}
Expand All @@ -175,8 +176,8 @@ public LatinKeyboardView(Context context, AttributeSet attrs, int defStyle) {
mMiniKeyboardPopup.setBackgroundDrawable(null);
mMiniKeyboardPopup.setAnimationStyle(R.style.MiniKeyboardAnimation);
mMiniKeyboardVisible = false;
mMiniKeyboardPopup.setClippingEnabled(false);
}

}

public void setPhoneKeyboard(Keyboard phoneKeyboard) {
Expand Down

0 comments on commit e3179ce

Please sign in to comment.