Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
UIScrollViewDelegateSwiper.prototype.scrollViewDidScroll = function (sv) {
var owner = this._owner.get();
if (!owner) {
return;
}
if (owner) {
var scrollableWidth = Math.max(0, sv.contentSize.width - sv.bounds.size.width);
this._slidesCount = Math.round(scrollableWidth/platformModule.screen.mainScreen.widthDIPs) + 1;
owner.notify({
object: owner,
eventName: "scroll",
scrollX: owner.horizontalOffset,
scrollY: owner.verticalOffset,
slidesCount: this._slidesCount
});
}
};
// 滚动视图减速完成,滚动将停止时,调用该方法。一次有效滑动,只执行一次。
NativescriptDeviceService.prototype.onUpdateFrameState = function () {
var viewport = this.frameState.viewport;
var contentView = frames.topmost().currentPage.content;
var contentSize = contentView.getActualSize();
viewport.x = 0;
viewport.y = 0;
viewport.width = contentSize.width;
viewport.height = contentSize.height;
var subviews = this.frameState.subviews;
var device = vuforia.api.getDevice();
var renderingPrimitives = device.getRenderingPrimitives();
var renderingViews = renderingPrimitives.getRenderingViews();
var numViews = renderingViews.getNumViews();
var contentScaleFactor = vuforia.videoView.ios ? vuforia.videoView.ios.contentScaleFactor : platform.screen.mainScreen.scale;
subviews.length = numViews;
subviews.length = numViews;
for (var i = 0; i < numViews; i++) {
var view = renderingViews.getView(i);
// TODO: support PostProcess rendering subview
if (view === vuforia.View.PostProcess) {
subviews.length--;
continue;
}
var subview = subviews[i] = subviews[i] || {};
// Set subview type
switch (view) {
case vuforia.View.LeftEye:
subview.type = Argon.SubviewType.LEFTEYE;
break;
case vuforia.View.RightEye:
function resolveFilePath(path, ext) {
if (!fileNameResolver) {
fileNameResolver = new fileResolverModule.FileNameResolver({
width: platform.screen.mainScreen.widthDIPs,
height: platform.screen.mainScreen.heightDIPs,
os: platform.device.os,
deviceType: platform.device.deviceType
});
}
return fileNameResolver.resolveFileName(path, ext);
}
function pageFromBuilder(moduleNamePath, moduleExports) {
var calculateInSampleSize = function (imageWidth, imageHeight, reqWidth, reqHeight) {
let sampleSize = 1;
let displayWidth = platform.screen.mainScreen.widthDIPs;
let displayHeigth = platform.screen.mainScreen.heightDIPs;
reqWidth = (reqWidth > 0 && reqWidth < displayWidth) ? reqWidth : displayWidth;
reqHeight = (reqHeight > 0 && reqHeight < displayHeigth) ? reqHeight : displayHeigth;
if (imageWidth > reqWidth && imageHeight > reqHeight) {
let halfWidth = imageWidth / 2;
let halfHeight = imageHeight / 2;
while ((halfWidth / sampleSize) > reqWidth && (halfHeight / sampleSize) > reqHeight) {
sampleSize *= 2;
}
}
return sampleSize;
}
var calculateInSampleSize = function (imageWidth, imageHeight, reqWidth, reqHeight) {
var sampleSize = 1;
var displayWidth = platform.screen.mainScreen.widthDIPs;
var displayHeigth = platform.screen.mainScreen.heightDIPs;
reqWidth = (reqWidth > 0 && reqWidth < displayWidth) ? reqWidth : displayWidth;
reqHeight = (reqHeight > 0 && reqHeight < displayHeigth) ? reqHeight : displayHeigth;
if (imageWidth > reqWidth && imageHeight > reqHeight) {
var halfWidth = imageWidth / 2;
var halfHeight = imageHeight / 2;
while ((halfWidth / sampleSize) > reqWidth && (halfHeight / sampleSize) > reqHeight) {
sampleSize *= 2;
}
}
return sampleSize;
};
var createDateTimeStamp = function () {
public static getScreenHeight(): IScreenHeight {
let height1 = Platform.screen.mainScreen.heightDIPs;
let height2 = Platform.screen.mainScreen.widthDIPs;
return {
portrait: height1,
landscape: height2
};
}
public static getMinimumHeights(): IMinimumHeights {
let height1 = Platform.screen.mainScreen.heightDIPs;
let height2 = Platform.screen.mainScreen.widthDIPs;
//if the first hieght is lager than the second hiehgt it's the portrait views min hieght.
if (height1 > height2) {
return {
portrait: height1,
landscape: height2
};
} else {
return {
portrait: height2,
landscape: height1
};
}
}
function resolveFileName(path, ext) {
if (!appEventAttached) {
var app = require("application");
app.on(app.orientationChangedEvent, function (data) {
resolverInstance = undefined;
});
appEventAttached = true;
}
if (!resolverInstance) {
resolverInstance = new FileNameResolver({
width: platform.screen.mainScreen.widthDIPs,
height: platform.screen.mainScreen.heightDIPs,
os: platform.device.os,
deviceType: platform.device.deviceType
});
}
return resolverInstance.resolveFileName(path, ext);
}
exports.resolveFileName = resolveFileName;
var calculateInSampleSize = function (imageWidth, imageHeight, reqWidth, reqHeight) {
let sampleSize = 1;
let displayWidth = platform.screen.mainScreen.widthDIPs;
let displayHeigth = platform.screen.mainScreen.heightDIPs;
reqWidth = (reqWidth > 0 && reqWidth < displayWidth) ? reqWidth : displayWidth;
reqHeight = (reqHeight > 0 && reqHeight < displayHeigth) ? reqHeight : displayHeigth;
if (imageWidth > reqWidth && imageHeight > reqHeight) {
let halfWidth = imageWidth / 2;
let halfHeight = imageHeight / 2;
while ((halfWidth / sampleSize) > reqWidth && (halfHeight / sampleSize) > reqHeight) {
sampleSize *= 2;
}
}
return sampleSize;
}
var calculateInSampleSize = function (imageWidth, imageHeight, reqWidth, reqHeight) {
var sampleSize = 1;
var displayWidth = platform.screen.mainScreen.widthDIPs;
var displayHeigth = platform.screen.mainScreen.heightDIPs;
reqWidth = (reqWidth > 0 && reqWidth < displayWidth) ? reqWidth : displayWidth;
reqHeight = (reqHeight > 0 && reqHeight < displayHeigth) ? reqHeight : displayHeigth;
if (imageWidth > reqWidth && imageHeight > reqHeight) {
var halfWidth = imageWidth / 2;
var halfHeight = imageHeight / 2;
while ((halfWidth / sampleSize) > reqWidth && (halfHeight / sampleSize) > reqHeight) {
sampleSize *= 2;
}
}
return sampleSize;
};
//# sourceMappingURL=image-asset.js.map