Skip to content

Commit

Permalink
AndroidX compatibility #209
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Jul 4, 2019
1 parent 562c965 commit fd7484f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/barcodescanner.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ declare let com, android, global: any;

const AppPackageName = useAndroidX() ? global.androidx.core.app : android.support.v4.app;
const ContentPackageName = useAndroidX() ? global.androidx.core.content : android.support.v4.content;
const LocalBroadcastManagerPackageName = useAndroidX() ? global.androidx.localbroadcastmanager.content : android.support.v4.content;

let _onScanReceivedCallback = undefined;
let _onContinuousScanResult = undefined;
Expand Down Expand Up @@ -163,7 +164,7 @@ export class BarcodeScanner {

// required for the 'stop' function
if (!this.broadcastManager) {
this.broadcastManager = ContentPackageName.LocalBroadcastManager.getInstance(utils.ad.getApplicationContext());
this.broadcastManager = LocalBroadcastManagerPackageName.LocalBroadcastManager.getInstance(utils.ad.getApplicationContext());
}

const isContinuous = typeof arg.continuousScanCallback === "function";
Expand Down

0 comments on commit fd7484f

Please sign in to comment.