{"id":13790063,"url":"https://github.com/skydoves/AndroidRibbon","last_synced_at":"2025-05-12T07:31:23.545Z","repository":{"id":44977390,"uuid":"165635435","full_name":"skydoves/AndroidRibbon","owner":"skydoves","description":":ribbon: A fancy and beautiful ribbon with shimmer effects for Android.","archived":false,"fork":false,"pushed_at":"2022-01-15T05:57:35.000Z","size":809,"stargazers_count":695,"open_issues_count":1,"forks_count":60,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-04T13:50:55.868Z","etag":null,"topics":["android","android-library","android-ui","androidribbon","recyclerview","ribbon","ribbonlayout","ribbonview","skydoves"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/skydoves.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null},"funding":{"github":"skydoves","custom":["https://www.paypal.me/skydoves","https://www.buymeacoffee.com/skydoves"]}},"created_at":"2019-01-14T09:43:20.000Z","updated_at":"2025-03-21T01:13:35.000Z","dependencies_parsed_at":"2022-07-19T03:17:07.386Z","dependency_job_id":null,"html_url":"https://github.com/skydoves/AndroidRibbon","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skydoves%2FAndroidRibbon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skydoves%2FAndroidRibbon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skydoves%2FAndroidRibbon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skydoves%2FAndroidRibbon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skydoves","download_url":"https://codeload.github.com/skydoves/AndroidRibbon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253695127,"owners_count":21948817,"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":["android","android-library","android-ui","androidribbon","recyclerview","ribbon","ribbonlayout","ribbonview","skydoves"],"created_at":"2024-08-03T22:00:36.490Z","updated_at":"2025-05-12T07:31:22.571Z","avatar_url":"https://github.com/skydoves.png","language":"Kotlin","readme":"\u003ch1 align=\"center\"\u003eAndroidRibbon\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://opensource.org/licenses/Apache-2.0\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://android-arsenal.com/api?level=16\"\u003e\u003cimg alt=\"API\" src=\"https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat\"/\u003e\u003c/a\u003e \n  \u003ca href=\"https://github.com/skydoves/AndroidRibbon/actions\"\u003e\u003cimg alt=\"Build Status\" src=\"https://github.com/skydoves/AndroidRibbon/workflows/Android%20CI/badge.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/skydoves\"\u003e\u003cimg alt=\"Profile\" src=\"https://skydoves.github.io/badges/skydoves.svg\"/\u003e\u003c/a\u003e \n  \u003ca href=\"https://skydoves.github.io/libraries/androidribbon/html/androidribbon/com.skydoves.androidribbon/index.html\"\u003e\u003cimg alt=\"Dokka\" src=\"https://skydoves.github.io/badges/dokka-androidribbon.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e  \n:ribbon: A fancy and beautiful ribbon with the shimmer effect for Android.\n\u003c/p\u003e\n\u003c/br\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24237865/51105497-7873e680-182c-11e9-954a-1bf767d15312.gif\" width=\"33%\"/\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24237865/51105671-fb953c80-182c-11e9-8288-7ce97d5474e8.gif\" width=\"33%\"/\u003e\n\u003c/p\u003e\n\n## Download\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.skydoves/androidribbon.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.github.skydoves%22%20AND%20a:%22androidribbon%22)\n\n### Gradle\nAdd the codes below to your **root** `build.gradle` file (not your module build.gradle file):\n```gradle\nallprojects {\n    repositories {\n        mavenCentral()\n    }\n}\n```\nNext, add the dependency below to your **module**'s `build.gradle` file:\n```gradle\ndependencies {  \n    implementation \"com.github.skydoves:androidribbon:1.0.4\"\n}\n```\n\n## Usage\nAdd XML namespace inside your XML layout file as in the following:\n\n```gradle\nxmlns:app=\"http://schemas.android.com/apk/res-auto\"\n```\n\n### RibbonView in layout\n\n```gradle\n\u003ccom.skydoves.androidribbon.RibbonView\n     android:layout_width=\"match_parent\"\n     android:layout_height=\"wrap_content\"\n     android:text=\"skydoves\"\n     android:textColor=\"@android:color/white\"\n     app:ribbon_rotation=\"-45\" // set rotation\n     app:ribbon_background_color=\"@color/colorPrimary\" // set background color\n     app:ribbon_ribbonRadius=\"4dp\" // set radius\n     app:ribbon_drawable=\"@drawable/ribbon03\" // set drawable, not background color\n     app:ribbon_padding_top=\"4dp\"\n     app:ribbon_padding_bottom=\"8dp\"/\u003e\n```\n\n### create using Builder\nThis is how to create `RibbonView`'s instance using `RibbonView.Builder` class.\n```java\nnew RibbonView.Builder(context)\n      .setText(\"Android-Ribbon\")\n      .setTextColor(Color.WHITE)\n      .setTextSize(13f)\n      .setRibbonRotation(-45)\n      .setRibbonBackgroundColor(ContextCompat.getColor(context, R.color.bright_lavender))\n      .setRibbonDrawable(ContextCompat.getDrawable(context, R.drawable.ribbon03))\n      .build();\n```\n\n### create using kotlin dsl\nThis is how to create `RibbonView`'s instance using kotlin dsl.\n```kotlin\nval ribbonView = ribbonView(this) {\n      setText(\"Android-Ribbon\")\n      setTextColor(Color.WHITE)\n      setTextSize(13f)\n      setTextStyle(Typeface.BOLD)\n      setRibbonRotation(-45)\n      setRibbonDrawableResource(R.drawable.ribbon02)\n    }\n```\n\n## ShimmerRibbonView\nShimmerRibbonView lets you implement shimmer animation easily.\n\n### ShimmerRibbonView in layout\n```gradle\n\u003ccom.skydoves.androidribbon.ShimmerRibbonView\n      android:layout_width=\"130dp\"\n      android:layout_height=\"wrap_content\"\n      android:alpha=\"0.8\"\n      app:shimmer_base_alpha=\"1.0\"\n      app:shimmer_highlight_alpha=\"0.5\"\n      app:shimmer_ribbon_text=\"Android-Ribbon\"\n      app:shimmer_ribbon_textColor=\"@android:color/white\"\n      app:shimmer_ribbon_textStyle=\"bold\"\n      app:shimmer_ribbon_padding_top=\"3dp\"\n      app:shimmer_ribbon_padding_bottom=\"3dp\"\n      app:shimmer_ribbon_rotation=\"-45\"\n      app:shimmer_ribbon_background_color=\"@color/colorPrimary\"/\u003e\n```\n\n### create using Builder\nThis is how to create `ShimmerRibbonView`'s instance using `ShimmerRibbonView.Builder` class.\n```java\nnew ShimmerRibbonView.Builder(context)\n      .setRibbonView(ribbonView)\n      .setShimmer(shimmer)\n      .build();\n```\n\n### create using kotlin dsl\nThis is how to create `ShimmerRibbonView`'s instance using kotlin dsl.\n```kotlin\nval shimmerRibbonView = shimmerRibbonView(context) {\n      ribbon = ribbonView(context) {\n          text = \"Android-Ribbon\"\n          textColor = Color.WHITE\n          textSize = 13f\n          textStyle = Typeface.BOLD\n          ribbonRotation = -45\n          ribbonDrawable = ContextCompat.getDrawable(context, R.drawable.ribbon02)\n      }\n      shimmer = alphaShimmer {\n          setBaseAlpha(1.0f)\n          setHighlightAlpha(0.5f)\n       }\n    }\n```\n\n## Shimmer\nThis library using [shimmer-android](https://github.com/facebook/shimmer-android) by Facebook.\u003cbr\u003e\nHere are the detail [shimmer-instruction](http://facebook.github.io/shimmer-android/) about shimmer or you can reference below examples.\n\n### create using Builder\nThis is how to create `Shimmer`'s instance using `Shimmer.Builder` class.\n```java\nnew Shimmer.AlphaHighlightBuilder()\n      .setBaseAlpha(1.0f)\n      .setHighlightAlpha(0.5f)\n      .setRepeatDelay(1000)\n      .setDuration(1000)\n      .setDirection(Shimmer.Direction.RIGHT_TO_LEFT)\n      .build();\n```\n\n### create using kotlin dsl\nThis is how to create `Shimmer`'s instance using kotlin dsl.\n```kotlin\nval shimmer_alpha = alphaShimmer {\n      setBaseAlpha(1.0f)\n      setHighlightAlpha(0.5f)\n}\nval shimmer_color = colorShimmer {\n      setBaseAlpha(1.0f)\n      setHighlightAlpha(0.5f)\n      setBaseColor(ContextCompat.getColor(context, R.color.colorPrimary))\n      setHighlightColor(ContextCompat.getColor(context, R.color.colorPrimaryDark))\n}\n```\n\n## RibbonLayout\nRibbonLayout lets RibbonViews overlap with other child views.\n\n### RibbonLayout in layout\n```gradle\n\u003ccom.skydoves.androidribbon.RibbonLayout\n      android:id=\"@+id/ribbonLayout01\"\n      android:layout_width=\"match_parent\"\n      android:layout_height=\"wrap_content\"\n      app:ribbonLayout_header_align=\"left\"\n      app:ribbonLayout_bottom_align=\"center\"\u003e\n\n     \u003cImageView\n          android:layout_width=\"match_parent\"\n          android:layout_height=\"180dp\"\n          android:src=\"@drawable/background02\"\n          android:scaleType=\"fitXY\"/\u003e\n\u003c/com.skydoves.androidribbon.RibbonLayout\u003e\n```\n\nAnd should set `ribbonHeader` or `ribbonBottom` using `RibbonView` or `ShimmerRibbonView` instance.\n```java\nribbonLayout.setRibbonHeader(ribbon_header);\nribbonLayout.setRibbonBottomAlign(Gravity.LEFT);\nribbonLayout.setRibbonBottom(ribbon_bottom);\nribbonLayout.setRibbonBottomAlign(Gravity.RIGHT);\n```\n\n## RibbonRecyclerView\nRibbonRecyclerView lets you implement RecyclerView has `RibbonView` items easily.\n\n### RibbonRecyclerView in layout\n```gradle\n\u003ccom.skydoves.androidribbon.RibbonRecyclerView\n      android:id=\"@+id/ribbonRecyclerView\"\n      android:layout_width=\"match_parent\"\n      android:layout_height=\"wrap_content\"\n      android:layout_marginTop=\"15dp\"\n      app:ribbon_recycler_space=\"3dp\"\n      app:ribbon_recycler_orientation=\"horizontal\"/\u003e\n```\n\nAdd or remove `RibbonView` items.\n```java\nrecyclerView.addRibbon(ribbonView);\nrecyclerView.addRibbon(2, ribbonView);\nrecyclerView.addRibbonList(ribbonViewList);\nrecyclerView.removeRibbon(ribbonView);\nrecyclerView.removeRibbon(2);\nrecyclerView.clear();\n```\n\n\n## RibbonView Attributes\nAttributes | Type | Default | Description\n--- | --- | --- | ---\nribbonBackgroundColor | Color | #e254ff | sets ribbon background using color.\nribbonRadius | Float | 10f | sets ribbon corner's radius. It's only active using with `ribbonBackgroundColor`.\nribbonDrawable | Drawable | null | sets ribbon background using drawable. `ribbonBackgroundColor` and `ribbonRadius` will be ignored.\nribbonRotation | Int | 0 | sets ribbon rotation. Only between 1 to 90 or -90 to -1 degree.\npaddingLeft | Float | 8f | sets left padding of the text.\npaddingTop | Float | 4f | sets top padding of the text.\npaddingRight | Float | 8f | sets right padding of the text.\npaddingBottom | Float | 4f | sets bottom padding of the text.\ntext | String | \"\" | sets text. It is same as `android:text` attribute.\ntextColor | Color | Color.WHITE | sets text color. It is same as `android:textColor` attribute.\ntextSize | Float | 12f | sets text size. It is same as `android:textSize` attribute.\ntextStyle | Int | Typeface.NORMAL | sets text style. It is same as `android:textStyle` attribute.\n\n## ShimmerRibbonView Attributes\nAttributes | Type | Default | Description\n--- | --- | --- | ---\nribbon | RibbonView | RibbonView(context) | sets `RibbonView` on the frame.\nshimmer | Shimmer | AlphaHighlightBuilder(context).build() | sets `Shimmer` on the frame.\n\n## ShimmerLayout Attributes\nAttributes | Type | Default | Description\n--- | --- | --- | ---\nribbonHeader | RibbonView | RibbonView(context) | sets header `RibbonView` on the frame.\nribbonBottom | RibbonView | RibbonView(context) | sets bottom `RibbonView` on the frame.\nribbonHeaderAlign | Gravity | Gravity.START | sets an align of the header ribbon.\nribbonBottomAlign | Gravity | Gravity.CENTER | sets an align of the bottom ribbon.\n\n## Find this library useful? :heart:\nSupport it by joining __[stargazers](https://github.com/skydoves/AndroidRibbon/stargazers)__ for this repository. :star: \u003cbr\u003e\nAnd __[follow](https://github.com/skydoves)__ me for my next creations! 🤩\n\n# License\n```xml\nCopyright 2019 skydoves\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":["https://github.com/sponsors/skydoves","https://www.paypal.me/skydoves","https://www.buymeacoffee.com/skydoves"],"categories":["Index"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskydoves%2FAndroidRibbon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskydoves%2FAndroidRibbon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskydoves%2FAndroidRibbon/lists"}