Giter VIP home page Giter VIP logo

android-toast's Introduction

Android-Toast

An HTML5 replication of the Native Android Toast http://developer.android.com/guide/topics/ui/notifiers/toasts.html

Can be used for PhoneGap applications.

To use Android toast, simply include src/css/toast.css and src/js/toast.js to your project and call the android_toast javascript function (does not require jQuery or any external DOM manipulation library)

<script>
	var toast = new Android_Toast();
	toast.set_content('Please check your connection and try again.');
	toast.show();
</script>

You can also customize the position and the duration:

<script>
	var toast = new Android_Toast();
	toast.set_content('Connected to Wi-Fi network <em>Router Name</em>');
	toast.set_duration(4000);
	toast.set_position('top');
	toast.show();
</script>

JavaScript API

set_content() sets the text to be displayed. <em></em> text will be highlighted in blue.

set_duration() accepts a integer. The toast will disappear after the set duration. Defaults to 3000 (milliseconds).

set_position() Either top or bottom. Determines the position of the toast. Defaults to bottom.

show() Shows the Toast

hide() Hides and removes the Toast. It is called manually at the specified duration.

License

Check the MIT-LICENSE.txt file

Contributors

http://www.eTobb.com 's first Open Source contribution.

Developed by Jad Joubran @JoubranJad
Design replicated by Nader Dagher @naderdagher

android-toast's People

Contributors

jaunesarmiento avatar

Watchers

 avatar  avatar

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.