{"id":20392786,"url":"https://github.com/g3th/drawable-comparison","last_synced_at":"2026-04-17T22:01:54.647Z","repository":{"id":208924340,"uuid":"722802952","full_name":"g3th/Drawable-Comparison","owner":"g3th","description":"Comparing two drawable resources inside an ImageView by tag.","archived":false,"fork":false,"pushed_at":"2023-11-24T02:04:06.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-15T10:27:13.329Z","etag":null,"topics":["android","app-development","databinding","drawable","imageview","kotlin","viewbinding"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/g3th.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-24T01:51:15.000Z","updated_at":"2023-11-24T02:04:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"4e6670e2-91d2-4439-b734-721b5eb476a5","html_url":"https://github.com/g3th/Drawable-Comparison","commit_stats":null,"previous_names":["g3th/drawable-comparison"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g3th%2FDrawable-Comparison","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g3th%2FDrawable-Comparison/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g3th%2FDrawable-Comparison/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g3th%2FDrawable-Comparison/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/g3th","download_url":"https://codeload.github.com/g3th/Drawable-Comparison/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241942055,"owners_count":20046231,"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","app-development","databinding","drawable","imageview","kotlin","viewbinding"],"created_at":"2024-11-15T03:45:58.634Z","updated_at":"2025-12-04T09:04:24.058Z","avatar_url":"https://github.com/g3th.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Drawable Comparison\n## Comparing Drawables in Android By Tags\n\nFor some app development or in particular projects, a comparison between drawables inside an ImageView or similar View might be needed. Such a case might be a drag-and-drop operation which needs to match two images for a game. Another case, might look if an ImageView contains a blank/placeholder image, and replace it with an image of choice in specific cases.\n\nThe easiest method I have found personally is tag usage. Swapping tags, and comparing them will be much easier than using something like:\n\n``` binding.image.drawable.constantState```\n\nor\n\n```binding.image.drawable.toBitmap()```\n\nand similar methods. I have not had much success with the above, and found the most effective method was the one mentioned.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg3th%2Fdrawable-comparison","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fg3th%2Fdrawable-comparison","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg3th%2Fdrawable-comparison/lists"}