New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

nativescript-shatterview

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nativescript-shatterview

Break your views into pieces

latest
Source
npmnpm
Version
0.1.5
Version published
Maintainers
1
Created
Source

Nativescript Shattervew

Make sure to hold down on the view item to see the effect... the cracks start then when they hit the edges it breaks

** ANDROID ONLY (sorry iOS) **

Works awesome on device, geny throws lots of cancel events for some reason

Usage

var shatterview = require("nativescript-shatterview");

exports.pageLoaded = function (args) {
    page = args.object;
    page.bindingContext = viewModel;
    
    var options = {
                complexity: 12,
                breakDuration: 700,
                fallDuration: 2000,
                circleRiftsRadius: 50
            };
    
    var image = page.getViewById("image");
    shatterview.allowShatter(image, options);
    
    var button = page.getViewById("button");
    shatterview.allowShatter(button, options);
    
    var label = page.getViewById("label");
    shatterview.allowShatter(label, options);
    
        
    shatterview.allowShatter(page, options);
}

Methods

  • allowShatter(view);
  • allowShatter(view, options);

Events

    // Args returns the view being maniupulated
    shatterview.on("start", function (args) {
        console.log("Break started");
    });
  • start
  • cancel
  • cancelEnd
  • restart
  • falling
  • fallingEnd

So you don't handle a tap event to shatter, you make something shatterable and the click\tap is done automatically by the plugin.

BrokenView Plugin lovingly created by zhanyongsheng

Keywords

NativeScript

FAQs

Package last updated on 06 Jun 2016

Did you know?

Socket

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.

Install

Related posts