{"id":16606648,"url":"https://github.com/abdularis/circularimageview","last_synced_at":"2025-07-19T16:39:45.808Z","repository":{"id":111776994,"uuid":"126420359","full_name":"abdularis/CircularImageView","owner":"abdularis","description":"Circle image view :red_circle: and Avatar image view :smiley: for android","archived":false,"fork":false,"pushed_at":"2020-08-21T08:11:54.000Z","size":1165,"stargazers_count":90,"open_issues_count":1,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-28T14:34:19.912Z","etag":null,"topics":["android","android-imageview","android-library","circular-imageview"],"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/abdularis.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-23T02:13:42.000Z","updated_at":"2023-09-04T18:36:11.000Z","dependencies_parsed_at":"2023-03-17T11:15:15.346Z","dependency_job_id":null,"html_url":"https://github.com/abdularis/CircularImageView","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/abdularis/CircularImageView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdularis%2FCircularImageView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdularis%2FCircularImageView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdularis%2FCircularImageView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdularis%2FCircularImageView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abdularis","download_url":"https://codeload.github.com/abdularis/CircularImageView/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdularis%2FCircularImageView/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265967070,"owners_count":23857065,"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-imageview","android-library","circular-imageview"],"created_at":"2024-10-12T01:09:31.242Z","updated_at":"2025-07-19T16:39:45.787Z","avatar_url":"https://github.com/abdularis.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android Circular Image View\n[![](https://jitpack.io/v/abdularis/CircularImageView.svg)](https://jitpack.io/#abdularis/CircularImageView)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Circular%20Image%20View-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/6870)\n\nThis library provides you circle and avatar imageview for android. it automatically scale and center a bitmap based on the size of the view but does not copy the bitmap itself.\n\nRead this article:\n* [https://medium.com/@abdularis/android-custom-view-tutorial-create-circle-image-view-cacdd3e986cb](https://medium.com/@abdularis/android-custom-view-tutorial-create-circle-image-view-cacdd3e986cb)\n\n## Screenshot\n|![](demo.gif)|![](screenshots/screenshot.png)|\n|-|-|\n\n## Setup\n- **Step 1** Add repository into root build.gradle\n\n~~~gradle\nallprojects {\n    repositories {\n    ...\n    maven {\n        url 'https://jitpack.io' }\n    }\n}\n~~~\n\n- **Step 2** Add library dependency into app build.gradle\n\n\u003e See the jitpack badge above for the latest version number\n\n~~~gradle\ndependencies {\n    implementation 'com.github.abdularis:circularimageview:\u003clatest-version\u003e'\n}\n~~~\n\n## Usage\nCheck also the sample app\n\n- **Creating circle image view**\n\n![](screenshots/fig2.gif)\n\n~~~xml\n\u003ccom.github.abdularis.civ.CircleImageView\n    android:layout_width=\"100dp\"\n    android:layout_height=\"170dp\"\n    android:src=\"@drawable/figure\"\n    app:highlightColor=\"#80fb1743\"\n    app:strokeColor=\"@color/colorAccent\"\n    app:strokeWidth=\"2px\"/\u003e\n\n\u003ccom.github.abdularis.civ.CircleImageView\n    android:layout_width=\"160dp\"\n    android:layout_height=\"160dp\"\n    android:src=\"@drawable/figure2\"\n    android:onClick=\"onCircleImageClick\"\n    app:strokeColor=\"@color/colorAccent\"/\u003e\n~~~\n\n- **Creating avatar**\n\n![](screenshots/fig1.gif)\n\nYou can choose either for avatar view state, IMAGE or INITIAL to show the first letter (default is INITIAL)\n\n~~~xml\n\u003ccom.github.abdularis.civ.AvatarImageView\n    android:layout_width=\"60dp\"\n    android:layout_height=\"60dp\"\n    android:src=\"@drawable/figure\"\n    android:onClick=\"onAClick\"\n    app:strokeWidth=\"1dp\"\n    app:strokeColor=\"@android:color/white\"\n    app:avatarBackgroundColor=\"@color/colorAccent\"\n    app:text=\"A\"\n    app:textSize=\"22sp\"/\u003e\n\n\u003ccom.github.abdularis.civ.AvatarImageView\n    android:layout_width=\"60dp\"\n    android:layout_height=\"60dp\"\n    app:highlightEnable=\"false\"\n    app:strokeColor=\"#64B5F6\"\n    app:strokeWidth=\"1dp\"\n    app:avatarBackgroundColor=\"#8E24AA\"\n    app:text=\"B\"\n    app:textSize=\"22sp\"/\u003e\n\n\u003ccom.github.abdularis.civ.AvatarImageView\n    android:layout_width=\"60dp\"\n    android:layout_height=\"60dp\"\n    app:avatarBackgroundColor=\"#FDFD00\"\n    app:text=\"C\"\n    app:textSize=\"22sp\"\n    app:textColor=\"#3d3d01\"/\u003e\n\n\u003ccom.github.abdularis.civ.AvatarImageView\n    android:layout_width=\"60dp\"\n    android:layout_height=\"60dp\"\n    android:src=\"@drawable/figure2\"\n    app:strokeColor=\"#1976D2\"\n    app:strokeWidth=\"1dp\"\n    app:view_state=\"IMAGE\"\n    app:avatarBackgroundColor=\"#1976D2\"\n    app:text=\"B\"\n    app:textSize=\"22sp\"/\u003e\n~~~\n\nJava on view click listener\n\n~~~java\n// on click listener for avatar view 'A'\npublic void onAClick(View view) {\n    AvatarImageView a = (AvatarImageView) view;\n    if (a.getState() == AvatarImageView.SHOW_INITIAL) {\n        a.setState(AvatarImageView.SHOW_IMAGE);\n    } else {\n        a.setState(AvatarImageView.SHOW_INITIAL);\n    }\n}\n~~~\n\n\n## XML Attributes\n\nThese are all attributes that you can use to customize the appearance of CircleImageView and AvatarImageView\n\n~~~xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cresources\u003e\n    \u003cdeclare-styleable name=\"CircleImageView\"\u003e\n        \u003cattr name=\"strokeColor\" format=\"color\"/\u003e\n        \u003cattr name=\"strokeWidth\" format=\"dimension\"/\u003e\n        \u003cattr name=\"highlightEnable\" format=\"boolean\"/\u003e\n        \u003cattr name=\"highlightColor\" format=\"color\"/\u003e\n    \u003c/declare-styleable\u003e\n\n    \u003cdeclare-styleable name=\"AvatarImageView\"\u003e\n        \u003cattr name=\"avatarBackgroundColor\" format=\"color\"/\u003e\n        \u003cattr name=\"textSize\" format=\"dimension\"/\u003e\n        \u003cattr name=\"textColor\" format=\"color\"/\u003e\n        \u003cattr name=\"text\" format=\"string\"/\u003e\n        \u003cattr name=\"view_state\" format=\"enum\"\u003e\n            \u003cenum name=\"INITIAL\" value=\"1\"/\u003e\n            \u003cenum name=\"IMAGE\" value=\"2\"/\u003e\n        \u003c/attr\u003e\n    \u003c/declare-styleable\u003e\n\u003c/resources\u003e\n~~~\n\n## License\n~~~\nCopyright 2018 abdularis\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdularis%2Fcircularimageview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdularis%2Fcircularimageview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdularis%2Fcircularimageview/lists"}