Code Monkey home page Code Monkey logo

crouton's Introduction

Crouton

Context sensitive notifications for Android

Objective of this fork

To extend customizability of Crouton while retaining the simplicity of its API.

Overview

Crouton, is a class that can be used by Android developers that feel the need for an alternative to the Context insensitive Toast.

The name and the idea of Crouton originates in a blog article by Cyril Mottier.

A Crouton will be displayed at the top of an application window. You can line up multiple Croutons for display, that will be shown one after another.

The current implementation requires the Holo theme to be present on the device.

Usage

The API is kept as simple as the Toast API:

Create a Crouton for any CharSequence:

Crouton.makeText(Activity, CharSequence, Style).show();

Create a Crouton with a String from your application's resources:

Crouton.makeText(Activity, int, Style).show();

You can also cancel scheduled Croutons by calling:

Crouton.cancelAllCroutons();

Examples

Currently you can use the three different Style attributes displayed below:

Alert

Confirm

Info

Extension and Modification

The whole design of a Crouton is defined by Style. You can easily create your own Styles by calling one of the constructors of the Style class or use one of the already provided styles: Style.ALERT, Style.CONFIRM and Style.INFO.

If you want to modify the general appearance you might want to have a look at the ViewHolder.

Building

The build requires Maven. Operations are very simple:

  • mvn clean package will build jar library;
  • mvn clean install will put Crouton in your local Maven repository.

After putting Crouton in the repository you can add it as a dependency.

<dependency>
  <artifactId>crouton</artifactId>
  <version>1.1</version>
  <groupId>de.neofonie.mobile</groupId>
</dependency>

License

####The initial version was written by Benjamin Weiss at Neofonie Mobile GmbH.

crouton's People

Contributors

keyboardsurfer avatar arturdryomov avatar robgthai avatar

Stargazers

Dimitar Manolov avatar

Watchers

 avatar James Cloos 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.