Skip to content

flaviusdemian/Xamarin.Crouton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

Xamarin.Crouton

This project is the Xamarin.Android implementation of https://github.com/keyboardsurfer/Crouton.

===============

Crouton

Crouton

Context sensitive notifications for Android

Overview

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

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

You can check some features in the Crouton Demo.

Crouton Demo on Google Play

If you're already using Crouton and just want to download the latest version of the library, follow this link.

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();

Further you can attach a Crouton to any ViewGroup like this:

Crouton.MakeText(Activity, int, Style, int).Show();

Crouton.makeText(Activity, int, Style, ViewGroup).Show();

Also Crouton.Show(...) methods are available for convenient fire and forget display of Croutons.

If you would like a more graphical introduction to Crouton check out this presentation.

Important!

In your Activity.OnDestroy() make sure to call

Crouton.CancelAllCroutons();

to cancel cancel all scheduled Croutons.

This is a workaround and further description is available in issue #24.

Basic Examples

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

Alert

Confirm

Info

Extension and Modification

The whole design of a Crouton is defined by Style.

You can use one of the styles Crouton ships with: Style.ALERT, Style.CONFIRM and Style.INFO. Or you can create your own Style.

In general you can modify

  • display duration
  • dimension settings
  • options for the text to display
  • custom Views
  • appearance & disappearance Animation
  • displayed Image

Since Style is the general entry point for tweaking Croutons, go and see for yourself what can be done with it.

Questions

Questions regarding Crouton can be asked on StackOverflow, using the crouton tag.

Pull requests welcome

Feel free to contribute to Crouton.

Either you found a bug or have created a new and awesome feature, just create a pull request.

If you want to start to create a new feature or have any other questions regarding Crouton, file an issue. I'll try to answer as soon as I find the time.

License

Attributions

The initial version was written by Benjamin Weiss. The name and the idea of Crouton originates in a blog article by Cyril Mottier.

The Crouton logo has been created by Marie Schweiz.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages