Skip to content

Commit e415fae

Browse files
chore: add info for scanOrientation on apps targeting Android 16 in tablets (#102)
1 parent e4c8417 commit e415fae

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

plugin/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ Note: iOS supports all formats except `MAXICODE` and `UPC_EAN_EXTENSION` - using
4545
Interface defining the contract for a plugin capable of scanning barcodes.
4646
Requires implementation of the scanBarcode method, which initiates a barcode scan with given options.
4747

48+
Starting in Android targetSdk 36, the scanOrientation parameter has no effect for large screens (e.g. tablets) on Android 16 and higher.
49+
You may opt-out of this behavior in your app by adding `<property android:name="android.window.PROPERTY_COMPAT_ALLOW_RESTRICTED_RESIZABILITY" android:value="true" />` to your `AndroidManifest.xml` inside `<application>` or `<activity>`.
50+
Keep in mind though that this opt-out is temporary and will no longer work for Android 17. Android discourages setting specific orientations for large screens.
51+
Regular Android phones are unaffected by this change.
52+
For more information check the Android docs at https://developer.android.com/about/versions/16/behavior-changes-16#adaptive-layouts
53+
4854
### scanBarcode(...)
4955

5056
```typescript

plugin/src/definitions.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ export type CapacitorBarcodeScannerOptions = {
7777
/**
7878
* Interface defining the contract for a plugin capable of scanning barcodes.
7979
* Requires implementation of the scanBarcode method, which initiates a barcode scan with given options.
80+
*
81+
* Starting in Android targetSdk 36, the scanOrientation parameter has no effect for large screens (e.g. tablets) on Android 16 and higher.
82+
* You may opt-out of this behavior in your app by adding `<property android:name="android.window.PROPERTY_COMPAT_ALLOW_RESTRICTED_RESIZABILITY" android:value="true" />` to your `AndroidManifest.xml` inside `<application>` or `<activity>`.
83+
* Keep in mind though that this opt-out is temporary and will no longer work for Android 17. Android discourages setting specific orientations for large screens.
84+
* Regular Android phones are unaffected by this change.
85+
* For more information check the Android docs at https://developer.android.com/about/versions/16/behavior-changes-16#adaptive-layouts
86+
*
8087
*/
8188
export interface CapacitorBarcodeScannerPlugin {
8289
scanBarcode(options: CapacitorBarcodeScannerOptions): Promise<CapacitorBarcodeScannerScanResult>;

0 commit comments

Comments
 (0)