Skip to content
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
2 changes: 1 addition & 1 deletion docs/docs/recipes/BOTTOM_SHEET.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const BottomSheetExample: React.FC = () => {

const styles = StyleSheet.create({
backdrop: {
...StyleSheet.absoluteFillObject,
...StyleSheet.absoluteFill,
backgroundColor: 'rgba(0,0,0,0.5)',
},
bottomSheet: {
Expand Down
2 changes: 1 addition & 1 deletion docs/versioned_docs/version-3.0.x/recipes/BOTTOM_SHEET.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const BottomSheetExample: React.FC = () => {

const styles = StyleSheet.create({
backdrop: {
...StyleSheet.absoluteFillObject,
...StyleSheet.absoluteFill,
backgroundColor: 'rgba(0,0,0,0.5)',
},
bottomSheet: {
Expand Down
2 changes: 1 addition & 1 deletion docs/versioned_docs/version-4.0.x/recipes/BOTTOM_SHEET.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const BottomSheetExample: React.FC = () => {

const styles = StyleSheet.create({
backdrop: {
...StyleSheet.absoluteFillObject,
...StyleSheet.absoluteFill,
backgroundColor: 'rgba(0,0,0,0.5)',
},
bottomSheet: {
Expand Down
2 changes: 1 addition & 1 deletion docs/versioned_docs/version-5.0.x/recipes/BOTTOM_SHEET.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const BottomSheetExample: React.FC = () => {

const styles = StyleSheet.create({
backdrop: {
...StyleSheet.absoluteFillObject,
...StyleSheet.absoluteFill,
backgroundColor: 'rgba(0,0,0,0.5)',
},
bottomSheet: {
Expand Down
2 changes: 1 addition & 1 deletion docs/versioned_docs/version-6.0.x/recipes/BOTTOM_SHEET.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const BottomSheetExample: React.FC = () => {

const styles = StyleSheet.create({
backdrop: {
...StyleSheet.absoluteFillObject,
...StyleSheet.absoluteFill,
backgroundColor: 'rgba(0,0,0,0.5)',
},
bottomSheet: {
Expand Down
2 changes: 1 addition & 1 deletion docs/versioned_docs/version-7.0.x/recipes/BOTTOM_SHEET.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const BottomSheetExample: React.FC = () => {

const styles = StyleSheet.create({
backdrop: {
...StyleSheet.absoluteFillObject,
...StyleSheet.absoluteFill,
backgroundColor: 'rgba(0,0,0,0.5)',
},
bottomSheet: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: use-soft-input-applied-offset-changed
title: useSoftInputAppliedOffsetChanged
sidebar_label: useSoftInputAppliedOffsetChanged
keywords: [react-native-avoid-softinput, useSoftInputAppliedOffsetChanged, react hooks]
---

`useSoftInputAppliedOffsetChanged` is a shortcut for using `AvoidSoftInput.onSoftInputAppliedOffsetChange` method inside `useEffect`.

### Parameters

| Type | Required | Description |
| ---------------------------------------------------------- | -------- | --------------------------------------------------------------------------------- |
| (\{ appliedOffset \}: \{ appliedOffset: number \}) => void | yes | function called during applying padding or translation with current applied value |

### Example

```ts
import { useSoftInputAppliedOffsetChanged } from "react-native-avoid-softinput";

useSoftInputAppliedOffsetChanged(({ appliedOffset }) => {
// Do sth
});
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: use-soft-input-height-changed
title: useSoftInputHeightChanged
sidebar_label: useSoftInputHeightChanged
keywords: [react-native-avoid-softinput, useSoftInputHeightChanged, react hooks]
---

`useSoftInputHeightChanged` is a shortcut for using `AvoidSoftInput.onSoftInputHeightChange` method inside `useEffect`.

### Parameters

| Type | Required | Description |
| -------------------------------------------------------------- | -------- | --------------------------------------------------------------------------- |
| (\{ softInputHeight \}: \{ softInputHeight: number \}) => void | yes | function called with current soft input height when soft input is displayed |

### Example

```ts
import { useSoftInputHeightChanged } from "react-native-avoid-softinput";

useSoftInputHeightChanged(({ softInputHeight }) => {
// Do sth
});
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: use-soft-input-hidden
title: useSoftInputHidden
sidebar_label: useSoftInputHidden
keywords: [react-native-avoid-softinput, useSoftInputHidden, react hooks]
---

`useSoftInputHidden` is a shortcut for using `AvoidSoftInput.onSoftInputHidden` method inside `useEffect`.

### Parameters

| Type | Required | Description |
| ---------- | -------- | ----------------------------------------- |
| () => void | yes | function called when soft input is hidden |

### Example

```ts
import { useSoftInputHidden } from "react-native-avoid-softinput";

useSoftInputHidden(() => {
// Do sth
});
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: use-soft-input-shown
title: useSoftInputShown
sidebar_label: useSoftInputShown
keywords: [react-native-avoid-softinput, useSoftInputShown, react hooks]
---

`useSoftInputShown` is a shortcut for using `AvoidSoftInput.onSoftInputShown` method inside `useEffect`.

### Parameters

| Type | Required | Description |
| -------------------------------------------------------------- | -------- | --------------------------------------------------------------------------- |
| (\{ softInputHeight \}: \{ softInputHeight: number \}) => void | yes | function called with current soft input height when soft input is displayed |

### Example

```ts
import { useSoftInputShown } from "react-native-avoid-softinput";

useSoftInputShown(({ softInputHeight }) => {
// Do sth
});
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
id: use-soft-input-state
title: useSoftInputState
sidebar_label: useSoftInputState
keywords: [react-native-avoid-softinput, useSoftInputState, react hooks]
---

`useSoftInputState` returns object with properties determining whether soft input is shown and how much screen it covers.

### Return value

```
{ isSoftInputShown: boolean, softInputHeight: number }
```

### Example

```ts
import { useSoftInputState } from "react-native-avoid-softinput";

const { isSoftInputShown, softInputHeight } = useSoftInputState();
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
id: on-soft-input-applied-offset-change
title: onSoftInputAppliedOffsetChange
sidebar_label: onSoftInputAppliedOffsetChange
keywords: [react-native-avoid-softinput, onSoftInputAppliedOffsetChange, module]
---

Use `onSoftInputAppliedOffsetChange` method, to e.g. create animation based on current applied offset value.

### Parameters

| Type | Required | Description |
| ---------------------------------------------------------- | -------- | --------------------------------------------------------------------------------- |
| (\{ appliedOffset \}: \{ appliedOffset: number \}) => void | yes | function called during applying padding or translation with current applied value |

### Example

```ts
import { AvoidSoftInput } from "react-native-avoid-softinput";

const unsubscribe = AvoidSoftInput.onSoftInputAppliedOffsetChange(
({ appliedOffset }) => {
// Do sth
}
);

// Later invoke unsubscribe.remove()
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
id: on-soft-input-height-change
title: onSoftInputHeightChange
sidebar_label: onSoftInputHeightChange
keywords: [react-native-avoid-softinput, onSoftInputHeightChange, module]
---

Use `onSoftInputHeightChange` method, if you want to listen to events when soft input's height changes.

### Parameters

| Type | Required | Description |
| -------------------------------------------------------------- | -------- | --------------------------------------------------------------------------- |
| (\{ softInputHeight \}: \{ softInputHeight: number \}) => void | yes | function called with current soft input height when soft input is displayed |

### Example

```ts
import { AvoidSoftInput } from "react-native-avoid-softinput";

const unsubscribe = AvoidSoftInput.onSoftInputHeightChange(
({ softInputHeight }) => {
// Do sth
}
);

// later invoke unsubscribe.remove()
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
id: on-soft-input-hidden
title: onSoftInputHidden
sidebar_label: onSoftInputHidden
keywords: [react-native-avoid-softinput, onSoftInputHidden, module]
---

Use `onSoftInputHidden` method, if you want to listen to events when soft input is hidden.

### Parameters

| Type | Required | Description |
| ---------- | -------- | ----------------------------------------- |
| () => void | yes | function called when soft input is hidden |

### Example

```ts
import { AvoidSoftInput } from "react-native-avoid-softinput";

const unsubscribe = AvoidSoftInput.onSoftInputHidden(() => {
// Do sth
});

// later invoke unsubscribe.remove()
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
id: on-soft-input-shown
title: onSoftInputShown
sidebar_label: onSoftInputShown
keywords: [react-native-avoid-softinput, onSoftInputShown, module]
---

Use `onSoftInputShown` method, if you want to listen to events when soft input is shown.

### Parameters

| Type | Required | Description |
| -------------------------------------------------------------- | -------- | --------------------------------------------------------------------------- |
| (\{ softInputHeight \}: \{ softInputHeight: number \}) => void | yes | function called with current soft input height when soft input is displayed |

### Example

```ts
import { AvoidSoftInput } from "react-native-avoid-softinput";

const unsubscribe = AvoidSoftInput.onSoftInputShown(({ softInputHeight }) => {
// Do sth
});

// later invoke unsubscribe.remove()
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
id: set-adjust-nothing
title: setAdjustNothing
sidebar_label: setAdjustNothing
keywords: [react-native-avoid-softinput, setAdjustNothing, module]
---

Use `setAdjustNothing`, to set `android:windowSoftInputMode` attribute to `adjustNothing` value.

### Example

```ts
import { AvoidSoftInput } from "react-native-avoid-softinput";

AvoidSoftInput.setAdjustNothing();
```
16 changes: 16 additions & 0 deletions docs/versioned_docs/version-8.0.x/api/module/SET_ADJUST_PAN.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
id: set-adjust-pan
title: setAdjustPan
sidebar_label: setAdjustPan
keywords: [react-native-avoid-softinput, setAdjustPan, module]
---

Use `setAdjustPan`, to set `android:windowSoftInputMode` attribute to `adjustPan` value.

### Example

```ts
import { AvoidSoftInput } from "react-native-avoid-softinput";

AvoidSoftInput.setAdjustPan();
```
16 changes: 16 additions & 0 deletions docs/versioned_docs/version-8.0.x/api/module/SET_ADJUST_RESIZE.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
id: set-adjust-resize
title: setAdjustResize
sidebar_label: setAdjustResize
keywords: [react-native-avoid-softinput, setAdjustResize, module]
---

Use `setAdjustResize`, to set `android:windowSoftInputMode` attribute to `adjustResize` value.

### Example

```ts
import { AvoidSoftInput } from "react-native-avoid-softinput";

AvoidSoftInput.setAdjustResize();
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
id: set-adjust-unspecified
title: setAdjustUnspecified
sidebar_label: setAdjustUnspecified
keywords: [react-native-avoid-softinput, setAdjustUnspecified, module]
---

Use `setAdjustUnspecified`, to set `android:windowSoftInputMode` attribute to `adjustUnspecified` value.

### Example

```ts
import { AvoidSoftInput } from "react-native-avoid-softinput";

AvoidSoftInput.setAdjustUnspecified();
```
26 changes: 26 additions & 0 deletions docs/versioned_docs/version-8.0.x/api/module/SET_AVOID_OFFSET.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
id: set-avoid-offset
title: setAvoidOffset
sidebar_label: setAvoidOffset
keywords: [react-native-avoid-softinput, setAvoidOffset, module]
---

Use `setAvoidOffset` method, if you want to increase/decrease amount of translation/padding applied to react root view/scroll view.

### Parameters

| Type | Required | Description |
| ------ | -------- | ------------------------------------------------------ |
| number | yes | additional offset added to react root view/scroll view |

### Example

```ts
import { AvoidSoftInput } from "react-native-avoid-softinput";

AvoidSoftInput.setAvoidOffset(40); // It will result in applied value 40dp greater than standard one
```

:::info
**Value applied to that method is persisted, so if you want to use that in a single use case, remember to clear it (just pass 0 as an argument)**
:::
Loading
Loading