Skip to content

Commit

Permalink
Fixes an issue where popup couldn't be dismissed on Lollipop (5.0 & 5…
Browse files Browse the repository at this point in the history
….1).
  • Loading branch information
Piotr Zawadzki authored and zawadz88 committed Dec 8, 2019
1 parent 049b64d commit 1d2c2fa
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [4.0.1]
### Fixed
- Popup couldn't be dismissed on Lollipop (issue #66)

## [4.0.0]
### Changed
- *Breaking change:* minimum SDK version raised to API 19 (Kitkat)
Expand Down Expand Up @@ -108,7 +112,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
Initial release of the library.

[Unreleased]: https://github.com/zawadz88/MaterialPopupMenu/compare/4.0.0...HEAD
[Unreleased]: https://github.com/zawadz88/MaterialPopupMenu/compare/4.0.1...HEAD
[4.0.1]: https://github.com/zawadz88/MaterialPopupMenu/compare/4.0.0...4.0.1
[4.0.0]: https://github.com/zawadz88/MaterialPopupMenu/compare/3.4.0...4.0.0
[3.4.0]: https://github.com/zawadz88/MaterialPopupMenu/compare/3.3.0...3.4.0
[3.3.0]: https://github.com/zawadz88/MaterialPopupMenu/compare/3.2.0...3.3.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This library allows to create simple popup menus programmatically with a nice [t

## Download (from JCenter)
```groovy
implementation 'com.github.zawadz88.materialpopupmenu:material-popup-menu:4.0.0'
implementation 'com.github.zawadz88.materialpopupmenu:material-popup-menu:4.0.1'
```

## Getting started
Expand Down
2 changes: 1 addition & 1 deletion material-popup-menu/material-popup-menu.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ext {
siteUrl = 'https://github.com/zawadz88/MaterialPopupMenu'
gitUrl = 'https://github.com/zawadz88/MaterialPopupMenu.git'

libraryVersion = '4.0.0'
libraryVersion = '4.0.1'

developerId = 'zawadz88'
developerName = 'Piotr Zawadzki'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,11 @@ internal class MaterialRecyclerViewPopupWindow(
dropDownList.clipToOutline = true
// Move the background from popup to RecyclerView for clipToOutline to take effect.
dropDownList.background = background
popup.setBackgroundDrawable(null)
// Remove background from popup itself to avoid overdraw.
// This causes issues on Lollipop so we do it on M+ only (see issue #66 on GitHub).
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
popup.setBackgroundDrawable(null)
}
}

popup.contentView = dropDownList
Expand Down

0 comments on commit 1d2c2fa

Please sign in to comment.