Skip to content

Facebook Shimmer effect for your NativeScript app - iOS and Android.

Notifications You must be signed in to change notification settings

NathanWalker/nativescript-shimmer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NativeScript Shimmer

Facebook shimmer effect for your NativeScript app.

Uses the following native plugins:

Demo

Demo

Usage

  • main-page.xml:
<Page xmlns="http://schemas.nativescript.org/tns.xsd" 
  xmlns:sh="nativescript-shimmer" 
  loaded="pageLoaded">
  <StackLayout>
    <sh:Shimmer id="shimmer">
      <Label text="Shimmer" />     
    </sh:Shimmer>
    <Button text="Toggle" tap="{{toggleShimmer}}" />
  </StackLayout>
</Page>
  • main-page.ts:
import {EventData, Observable} from "data/observable";
import {Page} from "ui/page";

// Event handler for Page "loaded" event attached in main-page.xml
export function pageLoaded(args: observable.EventData) {
    // Get the event sender
    let page = <Page>args.object;
    page.bindingContext = new ShimmerDemo(page);
}

class ShimmerDemo extends Observable {
  private _enableTxt: string;
  private _shimmer: any;

  constructor(page: Page) {
    super();
    this._shimmer = page.getViewById('shimmer');
  }

  public toggleShimmer() {
    this._shimmer.enabled = !this._shimmer.enabled;
  }
}

LICENSE

BSD

About

Facebook Shimmer effect for your NativeScript app - iOS and Android.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •