From ed261ba37f928c9753a7791e731cdbc410e2b0b9 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Sun, 2 Jun 2024 01:48:27 +0530 Subject: [PATCH] chore: publish v2.1.2 --- CHANGELOG.md | 10 ++++++++-- .../capacitor/statusbar/safearea/SafeAreaPlugin.java | 6 +++--- package.json | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e25ba00..59289e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,16 @@ # Changelog +## [v2.1.2](https://github.com/Aashu-Dubey/capacitor-statusbar-safe-area/compare/v2.1.1...v2.1.2) - (2 June 2024) + +✨ Improvements + +- Add support for insets on Android 9 and below. By [@Menardi](https://github.com/Menardi) in [#12](https://github.com/Aashu-Dubey/capacitor-statusbar-safe-area/pull/12) ([Complete changelog](https://github.com/Aashu-Dubey/capacitor-statusbar-safe-area/pull/12/files)). + ## [v2.1.1](https://github.com/Aashu-Dubey/capacitor-statusbar-safe-area/compare/v2.1.0...v2.1.1) - (18 Jun 2023) ## Breaking Change -- Make `safe-area` custom element opt-in to register only if needed and to also to prevent breaking evaluating `SafeAreaController` in SSR environments. by @jjang16 in [#9](https://github.com/Aashu-Dubey/capacitor-statusbar-safe-area/pull/9) +- Make `safe-area` custom element opt-in to register only if needed and to also to prevent breaking evaluating `SafeAreaController` in SSR environments. by [@jjang16](https://github.com/jjang16) in [#9](https://github.com/Aashu-Dubey/capacitor-statusbar-safe-area/pull/9) If earlier you were using the `safe-area` tag by simple (Empty) import, you now have to import and call function `registerSafeAreaElement` @@ -60,7 +66,7 @@ more details about it's usage can be found in the [readme](https://github.com/Aa ✨ Improvements -- Upgraded plugin to Capacitor v4 ([#3](https://github.com/Aashu-Dubey/capacitor-statusbar-safe-area/pull/3))(by @Hrdtr) ([Complete changelog](https://github.com/Aashu-Dubey/capacitor-statusbar-safe-area/compare/v1.0.1...1d85f2b)). +- Upgraded plugin to Capacitor v4 ([#3](https://github.com/Aashu-Dubey/capacitor-statusbar-safe-area/pull/3))(by [@Hrdtr](https://github.com/Hrdtr)) ([Complete changelog](https://github.com/Aashu-Dubey/capacitor-statusbar-safe-area/compare/v1.0.1...1d85f2b)). - Added [example](https://github.com/Aashu-Dubey/capacitor-statusbar-safe-area/tree/main/example) project 📱 ([1d85f2b](https://github.com/Aashu-Dubey/capacitor-statusbar-safe-area/commit/1d85f2be317e8f3e23861f7644bdc3fa32a82f7a)). diff --git a/android/src/main/java/dev/ashu/capacitor/statusbar/safearea/SafeAreaPlugin.java b/android/src/main/java/dev/ashu/capacitor/statusbar/safearea/SafeAreaPlugin.java index 0514d49..250fd60 100644 --- a/android/src/main/java/dev/ashu/capacitor/statusbar/safearea/SafeAreaPlugin.java +++ b/android/src/main/java/dev/ashu/capacitor/statusbar/safearea/SafeAreaPlugin.java @@ -5,9 +5,7 @@ import android.os.Build; import android.view.DisplayCutout; import android.view.WindowInsets; - import androidx.core.view.WindowInsetsCompat; - import com.getcapacitor.JSObject; import com.getcapacitor.Plugin; import com.getcapacitor.PluginCall; @@ -45,7 +43,9 @@ public void getSafeAreaInsets(PluginCall call) { float density = res.getDisplayMetrics().density; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { - Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.displayCutout() | WindowInsets.Type.navigationBars()); + Insets insets = windowInsets.getInsets( + WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.displayCutout() | WindowInsets.Type.navigationBars() + ); leftInset = insets.left / density; rightInset = insets.right / density; topInset = insets.top / density; diff --git a/package.json b/package.json index e325487..b8a5d3c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aashu-dubey/capacitor-statusbar-safe-area", - "version": "2.1.1", + "version": "2.1.2", "description": "Get Status bar height and Safe area insets on Android & iOS.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js",