{"id":13516750,"url":"https://github.com/keyboardsurfer/Crouton","last_synced_at":"2025-03-31T07:30:27.280Z","repository":{"id":4168770,"uuid":"5284389","full_name":"keyboardsurfer/Crouton","owner":"keyboardsurfer","description":"Context sensitive notifications for Android  ","archived":false,"fork":false,"pushed_at":"2015-09-28T15:29:58.000Z","size":3934,"stargazers_count":3003,"open_issues_count":7,"forks_count":666,"subscribers_count":173,"default_branch":"master","last_synced_at":"2025-03-23T03:08:40.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keyboardsurfer.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-03T11:04:36.000Z","updated_at":"2025-03-02T17:43:13.000Z","dependencies_parsed_at":"2022-08-29T21:00:52.254Z","dependency_job_id":null,"html_url":"https://github.com/keyboardsurfer/Crouton","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyboardsurfer%2FCrouton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyboardsurfer%2FCrouton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyboardsurfer%2FCrouton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyboardsurfer%2FCrouton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keyboardsurfer","download_url":"https://codeload.github.com/keyboardsurfer/Crouton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246273558,"owners_count":20750906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T05:01:25.485Z","updated_at":"2025-03-31T07:30:27.244Z","avatar_url":"https://github.com/keyboardsurfer.png","language":"Java","funding_links":[],"categories":["Java","Libraries","Libs","库"],"sub_categories":["GUI","\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget","[](https://github.com/JStumpp/awesome-android/blob/master/readme.md#gui)GUI"],"readme":"# Crouton\n![Crouton](https://raw.github.com/keyboardsurfer/Crouton/master/sample/src/main/res/drawable-xhdpi/ic_launcher.png \"Crouton logo\")\n\nContext sensitive notifications for Android\n\n## DEPRECATION NOTICE\n\nThis library has passed it's prime and is now considered deprecated.\n\nWith the [Android Design Support Library](http://android-developers.blogspot.co.uk/2015/05/android-design-support-library.html)\nintroducing [Snackbar](https://developer.android.com/reference/android/support/design/widget/Snackbar.html) developers get a well\ncrafted pattern to use for context aware notification of users.\n\nI won't do any active development for Crouton any more.\nBut I still do accept pull requests that fix bugs.\n\nSo long, and thanks for all the forks.\n\n## Overview\n\n**Crouton** is a class that can be used by Android developers that feel the need for an **alternative to the Context insensitive [Toast](http://developer.android.com/reference/android/widget/Toast.html)**.\n\nA Crouton will be displayed at the position the developer decides.\nStandard will be the top of an application window.\nYou can line up multiple Croutons for display, that will be shown one after another.\n\nYou can check some features in the Crouton Demo.\n\n\u003ca href=\"http://play.google.com/store/apps/details?id=de.keyboardsurfer.app.demo.crouton\"\u003e\n  \u003cimg alt=\"Crouton Demo on Google Play\"\n         src=\"http://developer.android.com/images/brand/en_generic_rgb_wo_60.png\" /\u003e\n\u003c/a\u003e\n\nIf you're already using Crouton and just want to download the latest version of the library, follow [this link](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22de.keyboardsurfer.android.widget%22).\n\n## [Releases / Changelog](https://github.com/keyboardsurfer/Crouton/releases)\n\n### Current version: 1.8.5\n\n## Usage\n\nThe API is kept as simple as the Toast API:\n\nCreate a Crouton for any CharSequence:\n\n    Crouton.makeText(Activity, CharSequence, Style).show();\n    \nCreate a Crouton with a String from your application's resources:\n\n    Crouton.makeText(Activity, int, Style).show();\n    \nFurther you can attach a Crouton to any ViewGroup like this:\n\n    Crouton.makeText(Activity, int, Style, int).show();\n\n    Crouton.makeText(Activity, int, Style, ViewGroup).show();\n    \nAlso `Crouton.show(...)` methods are available for convenient fire and forget display of Croutons. \n\nIf you would like a more graphical introduction to Crouton check out [this presentation](https://speakerdeck.com/keyboardsurfer/crouton-devfest-berlin-2012).\n\n##Important!\n\nIn your Activity.onDestroy() make sure to call\n\n    Crouton.cancelAllCroutons();\n    \nto cancel cancel all scheduled Croutons.\n\nThis is a workaround and further description is available in [issue #24](https://github.com/keyboardsurfer/Crouton/issues/24).\n\n## Basic Examples\nCurrently you can use the three different Style attributes displayed below out of the box:\n\n![Alert](https://github.com/keyboardsurfer/Crouton/raw/master/res/Alert.png \"Example of Style.ALERT\")\n\n![Confirm](https://github.com/keyboardsurfer/Crouton/raw/master/res/Confirm.png \"Example of Style.CONFIRM\")\n\n![Info](https://github.com/keyboardsurfer/Crouton/raw/master/res/Info.png \"Example of Style.INFO\")\n\n## Extension and Modification\n\nThe whole design of a Crouton is defined by  [Style](https://github.com/keyboardsurfer/Crouton/blob/master/library/src/main/java/de/keyboardsurfer/android/widget/crouton/Style.java).\n\nYou can use one of the styles Crouton ships with: **Style.ALERT**, **Style.CONFIRM** and **Style.INFO**. Or you can create your own Style.\n\nIn general you can modify\n\n- display duration\n- dimension settings\n- options for the text to display\n- custom Views\n- appearance \u0026 disappearance Animation\n- displayed Image\n\nSince [Style](https://github.com/keyboardsurfer/Crouton/blob/master/library/src/main/java/de/keyboardsurfer/android/widget/crouton/Style.java) is the general entry point for tweaking Croutons, go and see for yourself what can be done with it.\n\n## Building\n### Gradle\n\n#### From maven central\n\nAdd maven central to your `build.gradle`:\n\n```groovy\nbuildscript {\n  repositories {\n    mavenCentral()\n  }\n}\n \nrepositories {\n  mavenCentral()\n}\n```\n\nThen declare Crouton within your dependencies:\n\n```groovy\ndependencies {\n  ...\n  compile('de.keyboardsurfer.android.widget:crouton:1.8.5@aar') {\n    // exclusion is not necessary, but generally a good idea.\n    exclude group: 'com.google.android', module: 'support-v4'\n  }\n  ...\n}\n```\n\n\n### Maven\n\n#### From maven central\n\nTo use crouton within your maven build simply add\n\n```xml\n\u003cdependency\u003e\n  \u003cartifactId\u003ecrouton\u003c/artifactId\u003e\n  \u003cversion\u003e${crouton.version}\u003c/version\u003e\n  \u003cgroupId\u003ede.keyboardsurfer.android.widget\u003c/groupId\u003e\n\u003c/dependency\u003e\n```\n\nto your pom.xml\n\nIf you also want the sources or javadoc add the respective classifier  \n\n```xml\n  \u003cclassifier\u003esources\u003c/classifier\u003e\n```\n\nor\n\n```xml\n  \u003cclassifier\u003ejavadoc\u003c/classifier\u003e\n```\nto the dependency.\n\nIf you are referencing a newer version of the Android Support Library in your application, you might want to exclude Crouton's dependency like this:\n\n```xml\n\u003cdependency\u003e\n\t\u003cartifactId\u003ecrouton\u003c/artifactId\u003e\n\t\u003cversion\u003e${crouton.version}\u003c/version\u003e\n\t\u003cgroupId\u003ede.keyboardsurfer.android.widget\u003c/groupId\u003e\n\t\u003cexclusions\u003e\n\t    \u003cexclusion\u003e\n\t        \u003cgroupId\u003ecom.android.support\u003c/groupId\u003e\n\t        \u003cartifactId\u003esupport-v4\u003c/artifactId\u003e\n\t    \u003c/exclusion\u003e\n\t\u003c/exclusions\u003e\n\u003c/dependency\u003e\n```\n\n### DIY\n\nThe build requires Gradle. Operations are very simple:\n\n* install [gradle](http://www.gradle.org/)\n* `gradle assemble` builds all artifacts\n* `gradle jar` builds the jar\n\nAfter putting Crouton in a repository you can add it as dependency.\n\n```groovy\ncompile('de.keyboardsurfer.android.widget:crouton:1.8.5@aar') {\n  exclude group: 'com.google.android', module: 'support-v4'\n}\n```\n\n###Building and Signing\n\nIn order to build and sign Crouton locally you'll need to rename `gradle.properties.sample` to `gradle.properties`.\n\n## Contribution\n\n###Questions\n\nQuestions regarding Crouton can be asked on [StackOverflow, using the crouton tag](http://stackoverflow.com/questions/tagged/crouton).\n\n### Pull requests welcome\n\nFeel free to contribute to Crouton.\n\nEither you found a bug or have created a new and awesome feature, just create a pull request.\n\nIf you want to start to create a new feature or have any other questions regarding Crouton, [file an issue](https://github.com/keyboardsurfer/Crouton/issues/new).\nI'll try to answer as soon as I find the time.\n\nPlease note, if you're working on a pull request, make sure to use the [develop branch](https://github.com/keyboardsurfer/Crouton/tree/develop) as your base.\n\n### Formatting\n\nFor contributors using Eclipse there's a formatter available at the [download section](https://github.com/downloads/keyboardsurfer/Crouton/Crouton_Eclipseformatter.xml).\n\nIn order to reduce merging pains on my end, please use this formatter or format your commit in a way similar to it's example.\n\nIf you're using IDEA, the Eclipse Formatter plugin should allow you to use the formatter as well.\n\n## License\n\n* [Apache Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)\n\n## Attributions\n\nThe initial version was written by  \u003ca href=\"https://plus.google.com/u/0/117509657298845443204?rel=author\"\u003eBenjamin Weiss\u003c/a\u003e.\nThe name and the idea of [Crouton](https://github.com/keyboardsurfer/Crouton/blob/master/library/src/de/keyboardsurfer/android/widget/crouton/Crouton.java) originates in a [blog article](http://android.cyrilmottier.com/?p=773) by Cyril Mottier.\n\nThe Crouton logo has been created by [Marie Schweiz](http://marie-schweiz.de).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyboardsurfer%2FCrouton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeyboardsurfer%2FCrouton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyboardsurfer%2FCrouton/lists"}