![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
nativescript-photoviewer
Advanced tools
Readme
A simple image-viewer/gallery component for NativeScript.
iOS | Android |
---|---|
NYTPhotoViewer | ImageGallery |
Since the plugin is based on two different libraries for two different platforms their features are also somewhat diferent:
"NYTPhotoViewer" (iOS) is a slideshow and image viewer that includes double-tap to zoom, captions, support for multiple images, interactive flick to dismiss, animated zooming presentation, and more.
"ImageGallery" (Android) is a gallery used to host an array of external images (array of urls). It supports multiple images, double-tap to zoom and a gallery view.
Run npm i nativescript-photoviewer
in your ROOT directory of your project.
Captions only available on iOS. Android only supports array of string urls as datasource.
The usage is very simple. Require "nativescript-photoviewer" module and create a instance of it. Call the showViewer(array)
function to present the photoViewer.
The showViewer(ARRAY)
function accepts a two parameters on iOS and one on Android. The first one is allways an Array. The Array can contain one, or a mixture, of the following types:
NYTPhoto
protocol (see the cocoapod documentation for more info - very similar to the above option) (iOS only)When using the second option, properties that one can use are defined below in the second example. The image
conforms to the UIImage object, while the imageURL
is a string containing the URL of the image. If imageURL
is set, then image
is ignored.
You can also customize fontFamily, fontSize and color of the caption texts (iOS). FontFamily applies to all captions, size and color are caption-specific.
Properties Android (Optional):
startIndex
(number): Optional index to start the gallery from (Fullscreen Image gallery only)showAlbum
(boolean): Set to true
if you want to show the album first, otherwise false
if you want to show fullscreen slides directly.paletteType
(string): Optional string value telling the fullscreen image gallery what type of background color palette to use (VIBRANT
, LIGHT_VIBRANT
, DARK_VIBRANT
, MUTED
, LIGHT_MUTED
, DARK_MUTED
)Properties iOS (Optional):
startIndex
: Optional index to start the gallery from (Fullscreen Image gallery only)completionCallback
Optional function to run after the gallery has finished loading images and is visiblefontFamily
(string): Font familiy to use for caption and titlestitleFontSize
(number): Font-size for titlesummaryFontSize
(number): Font-size for summary-titlecreditFontSize
(number): Font-size for creditstitleColor
(UIColor): Title colorsummaryColor
(UIColor): Summary-title colorcreditColor
(UIColor): Credits colorMethods:
showViewer(array)
: Method to call when you want to show the gallery. Mandatory param is an array of image urls or a custom image-object (iOS).// Include the module
const PhotoViewer = require("nativescript-photoviewer");
// Show gallery from event
export function openGallery(args: EventData){
let photoViewer = new PhotoViewer();
// Caption font-style settings (optional - iOS only)
photoViewer.fontFamily = "Avenir-Roman";
photoViewer.titleFontSize = 20;
photoViewer.summaryFontSize = 16;
photoViewer.creditFontSize = 14;
photoViewer.titleColor = new colorModule.Color("#fff").ios;
photoViewer.summaryColor = new colorModule.Color("#99813c").ios;
photoViewer.creditColor = new colorModule.Color("#fed700").ios;
photoViewer.completionCallback = galleryLoaded; // iOS only
photoViewer.paletteType = "LIGHT_MUTED"; // Android only
photoViewer.showAlbum = false; // Android only (true = shows album first, false = shows fullscreen gallery directly)
photoViewer.startIndex = 0; // start index for the fullscreen gallery
// Image from object (iOS only)
var testImage1 = {
imageURL: "https://somepage.com/image01.jpg",
title: "Image 1 title",
summary: "Image 1 summary",
credit: "Telerik"
};
var testImage2 = {
imageURL: "https://somepage.com/image01.jpg",
title: "Image 2 title",
summary: "Image 2 summary",
credit: "Telerik"
};
//Image from URLs (Android & iOS)
var imageFromURL1 = "https://somepage.com/image01.jpg";
var imageFromURL2 = "https://somepage.com/image02.jpg";
// Add to array and pass to showViewer
var myImages = [testImage1, testImage2, imageFromURL1, imageFromURL2];
photoViewer.showViewer(myImages);
}
function galleryShowing(){
console.log(`gallery Loaded`);
}
1.5.0
completionCallback
and show a spinner when opening the gallery.1.4.0
startIndex
1.3.0
showViewer(ARRAY, INDEX?)
function. Makes the gallery init on that image: photoViewer.showViewer(myImages,1);
I will accept pull requests that improve this and assign credit.
FAQs
A simple Photo-viewer component for NativeScript based on NYTPhotoViewer pod for iOS and ImageGalleryViewer for Android.
The npm package nativescript-photoviewer receives a total of 6 weekly downloads. As such, nativescript-photoviewer popularity was classified as not popular.
We found that nativescript-photoviewer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.