From f23aa2da656324ae26a1e3ee1554cf19e4471270 Mon Sep 17 00:00:00 2001 From: Vitor Morato Almeida Date: Thu, 5 Aug 2021 14:04:44 -0300 Subject: [PATCH 1/2] bugfix notchHeight(). Previous cast never succeeds --- alerter/src/main/java/com/tapadoo/alerter/utils/ExAlert.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alerter/src/main/java/com/tapadoo/alerter/utils/ExAlert.kt b/alerter/src/main/java/com/tapadoo/alerter/utils/ExAlert.kt index 5ffdca6..5b4711f 100644 --- a/alerter/src/main/java/com/tapadoo/alerter/utils/ExAlert.kt +++ b/alerter/src/main/java/com/tapadoo/alerter/utils/ExAlert.kt @@ -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? { From 697c46e63991ed395953da792623e71cfa30c884 Mon Sep 17 00:00:00 2001 From: Vitor Morato Almeida Date: Mon, 9 Aug 2021 15:36:29 -0300 Subject: [PATCH 2/2] bump version --- CHANGELOG.md | 3 +++ alerter/build.gradle | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b546e40..079b639 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/alerter/build.gradle b/alerter/build.gradle index 4523834..63a927b 100644 --- a/alerter/build.gradle +++ b/alerter/build.gradle @@ -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"