Skip to content

Commit

Permalink
Prevent keyboard from getting recreated when cascade is shown
Browse files Browse the repository at this point in the history
  • Loading branch information
saket committed Jan 28, 2021
1 parent fbad8d5 commit 1fc1553
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cascade/src/main/java/me/saket/cascade/CascadePopupWindow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ open class CascadePopupWindow @JvmOverloads constructor(
private var margins = Rect()

init {
// Dismiss on outside touch.
isFocusable = true
isOutsideTouchable = true
elevation = themeAttrs.popupElevation

// Remove PopupWindow's default frame around the content.
setBackgroundDrawable(null)
isFocusable = true // For receiving hardware back clicks.
isOutsideTouchable = true // For receiving outside clicks.
inputMethodMode = INPUT_METHOD_NOT_NEEDED // Keyboard is recreated otherwise.
setBackgroundDrawable(null) // Remove PopupWindow's default frame around the content.
PopupWindowCompat.setOverlapAnchor(this, true)

elevation = themeAttrs.popupElevation
contentView = HeightAnimatableViewFlipper(context).apply {
background = themeAttrs.popupBackground
clipToOutline = true
Expand Down

0 comments on commit 1fc1553

Please sign in to comment.