Skip to content

Commit

Permalink
chore: publish v2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Aashu-Dubey committed Jun 1, 2024
1 parent 97c4575 commit ed261ba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`

Expand Down Expand Up @@ -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)).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit ed261ba

Please sign in to comment.