{"id":19635850,"url":"https://github.com/codepath/android-crouton-sample","last_synced_at":"2025-04-28T08:31:22.571Z","repository":{"id":14709352,"uuid":"17429719","full_name":"codepath/android-crouton-sample","owner":"codepath","description":"Demonstrates how to use the crouton alert library","archived":false,"fork":false,"pushed_at":"2015-06-06T20:47:44.000Z","size":864,"stargazers_count":29,"open_issues_count":0,"forks_count":16,"subscribers_count":11,"default_branch":"master","last_synced_at":"2023-05-10T14:13:26.595Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codepath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-05T06:02:30.000Z","updated_at":"2022-08-11T01:00:05.000Z","dependencies_parsed_at":"2022-09-23T22:42:25.572Z","dependency_job_id":null,"html_url":"https://github.com/codepath/android-crouton-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepath%2Fandroid-crouton-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepath%2Fandroid-crouton-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepath%2Fandroid-crouton-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepath%2Fandroid-crouton-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codepath","download_url":"https://codeload.github.com/codepath/android-crouton-sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224102261,"owners_count":17256126,"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-11-11T12:27:15.329Z","updated_at":"2024-11-11T12:27:16.477Z","avatar_url":"https://github.com/codepath.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crouton Sample Code\n\nDisplays the use of the [Crouton](https://github.com/keyboardsurfer/Crouton) library with three use cases:\n\n * Basic preset crouton\n * Styled crouton\n * Custom view crouton\n \nDemo:\n\n\u003cimg src=\"http://i.imgur.com/4aRRnAe.gif\" width=\"350\" /\u003e\n\nScreens:\n\n\u003cimg src=\"http://i.imgur.com/QlbGZe8.png\" width=\"350\" /\u003e\u0026nbsp;\n\u003cimg src=\"http://i.imgur.com/LtPAkoX.png\" width=\"350\" /\u003e\n\nSee [this tutorial](http://www.grokkingandroid.com/useful-android-libraries-crouton/) for more details.\n\n## Quick Usage\n\nShow simple text crouton alert based on string resource:\n\n```java\nCrouton.showText(this, R.string.simple_text_message, Style.INFO);\n```\n\nShow styled text crouton alert:\n\n```java\n// Define configuration options\nConfiguration croutonConfiguration = new Configuration.Builder()\n    .setDuration(2500).build();\n// Define custom styles for crouton\nStyle style = new Style.Builder()\n    .setBackgroundColorValue(Color.parseColor(\"#daffc0\"))\n    .setGravity(Gravity.CENTER_HORIZONTAL)\n    .setConfiguration(croutonConfiguration)\n    .setHeight(150)\n    .setTextColorValue(Color.parseColor(\"#323a2c\")).build();\n// Display notice with custom style and configuration\nCrouton.showText(this, R.string.styled_text_message, style);\n```\n\nShow custom crouton alert:\n\n```java\n// Inflate any custom view\nView customView = getLayoutInflater().inflate(R.layout.custom_crouton_layout, null);\n// Display the view just by calling \"show\"\nCrouton.show(this, customView);\n```\n\nand `res/layout/custom_crouton_layout.xml` with the content for the notice:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cLinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/LinearLayout1\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"#c9dfff\"\n    android:layout_gravity=\"center\"\n    android:orientation=\"vertical\"\n    android:paddingTop=\"15dp\"  \n    android:paddingBottom=\"15dp\" \u003e\n\n    \u003cRelativeLayout\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center\" \u003e\n\n        \u003cImageView\n            android:id=\"@+id/imageView1\"\n            android:layout_width=\"50dp\"\n            android:layout_height=\"50dp\"\n            android:src=\"@drawable/ic_info\" /\u003e\n\n        \u003cTextView\n            android:id=\"@+id/textView2\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignLeft=\"@+id/textView1\"\n            android:layout_below=\"@+id/textView1\"\n            android:text=\"With More Information\" /\u003e\n\n        \u003cTextView\n            android:id=\"@+id/textView1\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentTop=\"true\"\n            android:layout_toRightOf=\"@+id/imageView1\"\n            android:layout_marginLeft=\"10dp\"\n            android:text=\"Custom Crouton\"\n            android:textAppearance=\"?android:attr/textAppearanceLarge\" /\u003e\n\n    \u003c/RelativeLayout\u003e\n\n\u003c/LinearLayout\u003e\n```\n\nThat's it!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodepath%2Fandroid-crouton-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodepath%2Fandroid-crouton-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodepath%2Fandroid-crouton-sample/lists"}