{"id":28755832,"url":"https://github.com/furkanakdemir/surroundcardview","last_synced_at":"2025-06-17T03:02:10.108Z","repository":{"id":49753217,"uuid":"324160305","full_name":"furkanakdemir/surroundcardview","owner":"furkanakdemir","description":"A material card view with an animated stroke for Android API 23+","archived":false,"fork":false,"pushed_at":"2021-10-23T19:42:08.000Z","size":2354,"stargazers_count":102,"open_issues_count":4,"forks_count":16,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-18T02:50:02.450Z","etag":null,"topics":["android","animation","cardview","custom-view","kotlin","material"],"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/furkanakdemir.png","metadata":{"files":{"readme":"README.md","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":"2020-12-24T13:17:49.000Z","updated_at":"2025-04-03T22:32:23.000Z","dependencies_parsed_at":"2022-08-26T10:50:19.200Z","dependency_job_id":null,"html_url":"https://github.com/furkanakdemir/surroundcardview","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/furkanakdemir/surroundcardview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanakdemir%2Fsurroundcardview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanakdemir%2Fsurroundcardview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanakdemir%2Fsurroundcardview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanakdemir%2Fsurroundcardview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/furkanakdemir","download_url":"https://codeload.github.com/furkanakdemir/surroundcardview/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanakdemir%2Fsurroundcardview/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260281521,"owners_count":22985623,"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","animation","cardview","custom-view","kotlin","material"],"created_at":"2025-06-17T03:01:00.072Z","updated_at":"2025-06-17T03:02:10.088Z","avatar_url":"https://github.com/furkanakdemir.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Maven Central](https://img.shields.io/maven-central/v/com.furkanakdemir/surroundcardview?color=brightgreen)\n![GitHub](https://img.shields.io/github/license/furkanakdemir/surroundcardview?color=brightgreen)\n[![API](https://img.shields.io/badge/API-23%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=23)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-SurroundCardView-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/8211)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"256\" height=\"256\" src=\"art/logo.svg\"\u003e\n\u003c/p\u003e\n\n## SurroundCardView\n\nSurroundCardView is a special form of `MaterialCardView` that has animated stroke.\n\n## Preview\n\n\u003cimg width=\"512\" src=\"art/default.gif\"\u003e\n\n## Setup\n\n#### Gradle\n\nAdd `mavenCentral` to your build.gradle in the root project.\n\n```gradle\nallprojects {\n    repositories {\n        mavenCentral()\n    }\n}\n```\n\nAdd the library to the `dependencies` section\n\n```gradle\ndependencies {\n    implementation \"com.furkanakdemir:surroundcardview:1.0.6\"\n}\n```\n\n## Usage\n\nThe example of `SurroundCardView` is the following:\n\n```xml\n\u003ccom.furkanakdemir.surroundcardview.SurroundCardView\n    android:id=\"@+id/sampleSurroundCardView\"\n    android:layout_width=\"200dp\"\n    android:layout_height=\"200dp\"\n    app:cardCornerRadius=\"12dp\"\n    app:scv_duration=\"1000\"\n    app:scv_startPoint=\"bottom_start\"\n    app:scv_color=\"#03A9F4\"\n    app:scv_surrounded=\"true\"\n    app:scv_width=\"12dp\" /\u003e\n```\n\n#### Attributes\n\n| Attribute      |    Type    |  Default  | Description                                                       |\n| :------------- | :--------: | :-------: | :---------------------------------------------------------------- |\n| scv_duration   |  Integer   |    600    | the duration of a surround or a release animation in milliseconds |\n| scv_width      | Dimension  |   4 dp    | the width of surrounding stroke                                   |\n| scv_color      |   Color    |  #03A9F4  | the color of surrounding stroke                                   |\n| scv_startPoint | StartPoint | top_start | the starting point of the animation                               |\n| scv_surrounded |  Boolean   |   false   | the initial visibility of the stroke                              |\n\n#### API\n\n##### Surround\n\n```kotlin\nsampleSurroundCardView.surround()\n```\n\n##### Release\n\n```kotlin\nsampleSurroundCardView.release()\n```\n\n##### Switch\n\n```kotlin\nsampleSurroundCardView.switch()\n```\n\n#### Listener\n\nYou can set a listener to detect the ending of a surround or a release animation.\n\n```kotlin\nsampleSurroundCardView.surroundListener = object : SurroundListener {\n    override fun onSurround() {\n        // TODO\n    }\n}\n\nsampleSurroundCardView.releaseListener = object : ReleaseListener {\n    override fun onRelease() {\n        // TODO\n    }\n}\n```\n\n#### Customization\n\nYou can customize `SurroundCardView` by changing the duration, stroke width, color, starting point, and initial state.\n\n##### Duration\n\n\u003cimg width=\"512\" src=\"art/duration.gif\"\u003e\n\nYou can change the duration of a surround animation. This will affect both surround and release animations.\n\n```kotlin\nsampleSurroundCardView.setDuration(2000)\n```\n\n##### Stroke Width\n\n\u003cimg width=\"512\" src=\"art/stroke_width.gif\"\u003e\n\nYou can change the width of a surrounding stroke by setting it as `DimenRes`.\n\n```kotlin\nsampleSurroundCardView.setSurroundStrokeWidth(R.dimen.stroke_width_custom))\n```\n\n##### Color\n\n\u003cimg width=\"512\" src=\"art/color.gif\"\u003e\n\nYou can change the color of a surrounding stroke by setting it as `ColorRes`.\n\n```kotlin\nsampleSurroundCardView.setSurroundStrokeColor(R.color.customColor)\n```\n\n##### Initial State\n\n\u003cimg width=\"512\"  src=\"art/initial_state.gif\"\u003e\n\n```kotlin\nsampleSurroundCardView.setSurrounded(true)\n```\n\n##### Starting Point\n\n|           Top Start           |           Top End           |           Bottom Start           |           Bottom End           |\n| :---------------------------: | :-------------------------: | :------------------------------: | :----------------------------: |\n| \u003cimg src=\"art/top_start.gif\"\u003e | \u003cimg src=\"art/top_end.gif\"\u003e | \u003cimg src=\"art/bottom_start.gif\"\u003e | \u003cimg src=\"art/bottom_end.gif\"\u003e |\n\n```kotlin\nval startPoint = TOP_START | TOP_END | BOTTOM_START | BOTTOM_END\nsampleSurroundCardView.setStartPoint(startPoint)\n```\n\n## Upcoming\n\n- Support shape-theming\n- Change state even when the animation is running\n\n## Contribution\n\nIf you've found an error in the library or sample, please file an issue.\n\nPatches are encouraged, and may be submitted by forking this project and submitting a pull request.\n\nIf you contributed to `surroundcardview` but your name is not in the list, please feel free to add yourself!\n\n- [Furkan Akdemir](https://github.com/furkanakdemir) - Maintainer\n\n## License\n\n    Copyright 2020 Furkan Akdemir\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurkanakdemir%2Fsurroundcardview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffurkanakdemir%2Fsurroundcardview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurkanakdemir%2Fsurroundcardview/lists"}