Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix notchHeight(). Previous cast never succeeds #270

Merged
merged 2 commits into from
Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change Log
All notable changes to this project will be documented in this file.

## 7.2.2 - 09/08/2021
* bugfix notchHeight() cast

## 7.2.1 - 27/07/2021
* Fixed alert may has extra bottom margin when displayed with Gravity.BOTTOM

Expand Down
2 changes: 1 addition & 1 deletion alerter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ apply from: rootProject.file('quality.gradle')

final String GROUP_ID = "com.tapadoo.android"

final String VERSION = "7.2.1"
final String VERSION = "7.2.2"

final String DESCRIPTION = "An Android Alerting Library"
final String GITHUB_URL = "https://github.com/Tapadoo/Alerter"
Expand Down
2 changes: 1 addition & 1 deletion alerter/src/main/java/com/tapadoo/alerter/utils/ExAlert.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.tapadoo.alerter.R
fun Alert.getDimenPixelSize(@DimenRes id: Int) = resources.getDimensionPixelSize(id)

@RequiresApi(Build.VERSION_CODES.P)
fun Alert.notchHeight() = (context as? Activity)?.window?.decorView?.rootWindowInsets?.displayCutout?.safeInsetTop
fun Alert.notchHeight() = rootWindowInsets?.displayCutout?.safeInsetTop
?: 0

fun Context.getRippleDrawable(): Drawable? {
Expand Down