{"id":13848096,"url":"https://github.com/Pedroafa/avatar-android","last_synced_at":"2025-07-12T11:33:24.308Z","repository":{"id":14178301,"uuid":"16884480","full_name":"Pedroafa/avatar-android","owner":"Pedroafa","description":"Rounded and Squared Avatar for Android Applications","archived":false,"fork":false,"pushed_at":"2016-07-04T21:15:22.000Z","size":945,"stargazers_count":194,"open_issues_count":1,"forks_count":36,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-08-05T19:35:23.593Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/Pedroafa.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":"2014-02-16T12:38:11.000Z","updated_at":"2022-11-28T16:17:31.000Z","dependencies_parsed_at":"2022-07-10T00:16:37.571Z","dependency_job_id":null,"html_url":"https://github.com/Pedroafa/avatar-android","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pedroafa%2Favatar-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pedroafa%2Favatar-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pedroafa%2Favatar-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pedroafa%2Favatar-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pedroafa","download_url":"https://codeload.github.com/Pedroafa/avatar-android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225820303,"owners_count":17529138,"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-04T19:00:41.316Z","updated_at":"2024-11-21T23:30:57.499Z","avatar_url":"https://github.com/Pedroafa.png","language":"Java","readme":"Avatars for Android [![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.sectorsieteg/avatars/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.sectorsieteg/avatars)\n==============\n\nThis project provides a easy way to build avatar compositions for Android applications, as you can see in the screenshot.\n\n![Screenshot](https://github.com/Pedroafa/avatar-android/blob/master/screenshot.png?raw=true)\n\n## Usage\n\nDeclare it into your pom.xml\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003enet.sectorsieteg\u003c/groupId\u003e\n    \u003cartifactId\u003eavatars\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0\u003c/version\u003e\n    \u003ctype\u003eaar\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\nOr into your build.gradle\n\n```groovy\ndependencies {\n    compile 'net.sectorsieteg:avatars:1.0.0'\n}\n```\n\n## How to Use\n\nInside the layout, you only needs a ImageView in order to show the avatar.\n\n``` xml\n    \u003cImageView\n        android:id=\"@+id/avatar\"\n        android:layout_height=\"fill_parent\"\n        android:layout_width=\"fill_parent\"/\u003e\n```\n\nThe AvatarDrawableFactory will abstract you about how the avatars are built. We will be able to create a rounded or a\nsquared avatar from this entry point.\n\nFor the squared avatars depending of the number of images passed to the factory, a composition for one, two, three or four\nwill be created. Returning the specific implementation for that case.\n\nThere are this types of compositions:\n\n* RoundedAvatarDrawable\n* BorderedRoundedAvatarDrawable\n* SquaredAvatarDrawable\n* DoubleSquaredAvatarDrawable\n* TripleSquaredAvatarDrawable\n* QuadrupleSquaredAvatarDrawable\n\n``` java\nBitmapFactory.Options options = new BitmapFactory.Options();\noptions.inMutable = false;\nBitmap avatar = BitmapFactory.decodeResource(getResources(), R.drawable.avatar, options);\n\nAvatarDrawableFactory avatarFactory = new AvatarDrawableFactory(getResources());\n\nDrawable avatarDrawable = avatarFactory.getSquaredAvatarDrawable(avatar, avatar);\nImageView avatarView = (ImageView)rootView.findViewById(R.id.avatar);\navatarView.setImageDrawable(avatarDrawable);\n```\n\n## Contributors\n\n* Evelio Tarazona Cáceres - \u003chttps://gist.github.com/eveliotc/6051367\u003e\n\n## License\n\n    Copyright 2014 Pedro Álvarez Fernández\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","funding_links":[],"categories":["Java","Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPedroafa%2Favatar-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPedroafa%2Favatar-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPedroafa%2Favatar-android/lists"}