Coder Social home page Coder Social logo

rcluan / nativescript-material-showcaseview Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 1.92 MB

Nativescript plugin for android based on MaterialShowcaseView library https://github.com/deano2390/MaterialShowcaseView.

License: Other

CSS 0.43% TypeScript 47.12% JavaScript 52.45%

nativescript-material-showcaseview's Introduction

Nativescript MaterialShowcaseView

A Material Design themed showcaseview (coachmarks) for Nativescript.

This plugin works only on Android devices and it is based on * MaterialShowcaseView. Consider checking * nativescript-coachmarks if you are looking for an iOS version.

Getting started

To install run npm install nativescript-material-showcaseview

Usage

Import the NSMaterialShowcaseView class to your module, then create a new instance of it.

import { NSMaterialShowcaseView } from 'nativescript-material-showcaseview'

export class MyModel {
	private showcaseView: NSMaterialShowcaseView;
	constructor() { this.showcaseView = new NSMaterialShowcaseView(); }
}

IShowcaseItem and IShowcaseConfig interfaces respectively represent a showcase item and the showcase configuration.

export interface IShowcaseItem {
    target: any; // the element in your view (e.g a button)
    dismissText: string; // the text to dismiss the show case
    contentText: string; // the text explaining the element
    withRectangleShape: boolean;
}

An example of item:

let item : IShowcaseItem = {

	target: this.btn,
	dismissText: "GOT IT",
	contentText: "This is the start button",
	withRectangleShape: false
};

Currently the plugin only implements the showcase sequence available on MaterialShowcaseView. In order to create the sequence you should call this.showcaseView.createSequence(items), in which the paramenter items represents an array of IShowcaseItem.

Note: if you wish to highlight only one element in your view, then your array must have only one element.

this.showcaseView.startSequence() initiates the showcase sequence, whilst this.showcaseView.reset() resets the sequence so it can be shown again.

There is a sample app available here in case you need to see a working example.

License

MIT

nativescript-material-showcaseview's People

Contributors

rcluan avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

hubupfr

nativescript-material-showcaseview's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.