CroutonContext sensitive notifications for Android
Benjamin Weisshttp://gplus.to/keyboardsurferTwitter: @keyboardsurferSenior Software Developerat ImmobilienScout24Organizer...
Agenda●   What is a Crouton?●   Problems with Toast●   What does a Crouton look like?●   Usage●   Getting started●   Sources
What is a Crouton"A crouton is a piece of sautéed or rebakedbread, often cubed and seasoned, that is usedto add texture an...
Now what has it to do with Android?A Crouton is made of bread,like a Toast.
Now what has it to do with Android?Context aware alternative toAndroids Toast
Problems with Toast● Toast is not context aware
Problems with Toast● Toast is not context aware
Problems with Toast● Toast is not context aware● Styling Toasts
Problems with Toast● Toast is not context aware● Styling Toasts
What does a Crouton look like? Any way you want
What does a Crouton look like?There are three predefined styles:Style.INFOStyle.CONFIRMStyle.ALERT
What does a Crouton look like?There are three predefined styles:Style.INFO
What does a Crouton look like?There are three predefined styles:Style.INFOStyle.CONFIRM
What does a Crouton look like?There are three predefined styles:Style.INFOStyle.CONFIRMStyle.ALERT
What does a Crouton look like?
What does a Crouton look like?Any way you wantnew Style.Builder()    .setDuration(int) //in milliseconds    .setTextColor(...
Usage within your code//Crouton with StringCrouton.    makeText(this, "Hello Crouton", Style.INFO).    show();//Crouton wi...
Usage within your code//Cancels all pending CroutonsCrouton.cancelAllCroutons();//Clear all Croutons for an ActivityCrouto...
Getting started# clones Crouton to your machinegit clone git://github.com/keyboardsurfer/Crouton.git# will install Crouton...
Getting startedhttps://github.com/keyboardsurfer/Crouton/downloadshttps://github.com/downloads/keyboardsurfer/Crouton/crou...
Demo App
https://github.com/keyboardsurfer/Crouton
Sources[1] https://en.wikipedia.org/wiki/Crouton[2] http://android.cyrilmottier.com/?p=773[3] https://github.com/keyboards...
Thank you
QuestionsBenjamin Weisshttp://gplus.to/keyboardsurferTwitter: @keyboardsurfer
Crouton
Upcoming SlideShare
Loading in …5
×

Crouton

1,012 views

Published on

Slides for the talk on Crouton at the 2012 Berlin DevFest. The whole talk also is available as a video here: http://vimeo.com/51356663

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,012
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Crouton

  1. 1. CroutonContext sensitive notifications for Android
  2. 2. Benjamin Weisshttp://gplus.to/keyboardsurferTwitter: @keyboardsurferSenior Software Developerat ImmobilienScout24Organizer: GDG Android in BerlinCo-Organizer: ●Global Android Dev Camp ●GTUG Community Weekend ●Google I/O Extended Berlin 2012 ●DevFest Berlin 2012
  3. 3. Agenda● What is a Crouton?● Problems with Toast● What does a Crouton look like?● Usage● Getting started● Sources
  4. 4. What is a Crouton"A crouton is a piece of sautéed or rebakedbread, often cubed and seasoned, that is usedto add texture and flavor to salads [...] as anaccompaniment to soups, or eaten as a snackfood.The word crouton is derived from the French[...] meaning "crust"." [1]
  5. 5. Now what has it to do with Android?A Crouton is made of bread,like a Toast.
  6. 6. Now what has it to do with Android?Context aware alternative toAndroids Toast
  7. 7. Problems with Toast● Toast is not context aware
  8. 8. Problems with Toast● Toast is not context aware
  9. 9. Problems with Toast● Toast is not context aware● Styling Toasts
  10. 10. Problems with Toast● Toast is not context aware● Styling Toasts
  11. 11. What does a Crouton look like? Any way you want
  12. 12. What does a Crouton look like?There are three predefined styles:Style.INFOStyle.CONFIRMStyle.ALERT
  13. 13. What does a Crouton look like?There are three predefined styles:Style.INFO
  14. 14. What does a Crouton look like?There are three predefined styles:Style.INFOStyle.CONFIRM
  15. 15. What does a Crouton look like?There are three predefined styles:Style.INFOStyle.CONFIRMStyle.ALERT
  16. 16. What does a Crouton look like?
  17. 17. What does a Crouton look like?Any way you wantnew Style.Builder() .setDuration(int) //in milliseconds .setTextColor(int) //resId .setBackgroundDrawable(Drawable) //background drawable .setBackgroundColor(int) //resource id .setTileEnabled(boolean) //whether the image should be tiled .setHeight(int) // WRAP_CONTENT or MATCH_PARENT .setImageResource(int) //resId .setTextShadowRadius(float) //shadow radius .setGravity(int) //one of the Gravity constants .setTextAppearance(int) //resId .setInAnimation(Animation) //in animation // more options .build(); //creates the Style
  18. 18. Usage within your code//Crouton with StringCrouton. makeText(this, "Hello Crouton", Style.INFO). show();//Crouton with text resourceCrouton. makeText(this, R.string.hello, Style.INFO). show();
  19. 19. Usage within your code//Cancels all pending CroutonsCrouton.cancelAllCroutons();//Clear all Croutons for an ActivityCrouton.clearCroutonsForActivity();
  20. 20. Getting started# clones Crouton to your machinegit clone git://github.com/keyboardsurfer/Crouton.git# will install Crouton to your local maven repositorycd library && mvn install<!--include this in your pom.xmls dependency section--><dependency> <artifactId>crouton</artifactId> <version>1.4</version> <groupId>de.keyboardsurfer.android.widget</groupId></dependency>
  21. 21. Getting startedhttps://github.com/keyboardsurfer/Crouton/downloadshttps://github.com/downloads/keyboardsurfer/Crouton/crouton-1.4.jar
  22. 22. Demo App
  23. 23. https://github.com/keyboardsurfer/Crouton
  24. 24. Sources[1] https://en.wikipedia.org/wiki/Crouton[2] http://android.cyrilmottier.com/?p=773[3] https://github.com/keyboardsurfer/Crouton[4] http://marie-schweiz.de
  25. 25. Thank you
  26. 26. QuestionsBenjamin Weisshttp://gplus.to/keyboardsurferTwitter: @keyboardsurfer

×