mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Method to check to see if camera is available or not
This commit is contained in:
@@ -106,6 +106,12 @@ export var takePicture = function (options?): Promise<any> {
|
||||
});
|
||||
}
|
||||
|
||||
export var isAvailable = function () {
|
||||
var utils: typeof utilsModule = require("utils/utils");
|
||||
|
||||
return utils.ad.getApplicationContext().getPackageManager().hasSystemFeature(android.content.pm.PackageManager.FEATURE_CAMERA)
|
||||
}
|
||||
|
||||
var calculateInSampleSize = function (imageWidth, imageHeight, reqWidth, reqHeight) {
|
||||
var sampleSize = 1;
|
||||
if (imageWidth > reqWidth && imageHeight > reqHeight) {
|
||||
|
||||
Reference in New Issue
Block a user