{"id":19260897,"url":"https://github.com/evant/itemtouchhelperclearviewissue","last_synced_at":"2026-06-10T20:31:16.598Z","repository":{"id":33245551,"uuid":"36889905","full_name":"evant/ItemTouchHelperClearViewIssue","owner":"evant","description":"Issue with using ItemTouchHelper and an ItemDecoration","archived":false,"fork":false,"pushed_at":"2020-06-14T22:48:50.000Z","size":78,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-23T18:32:16.837Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/evant.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}},"created_at":"2015-06-04T19:07:09.000Z","updated_at":"2015-06-04T19:07:37.000Z","dependencies_parsed_at":"2022-08-17T22:45:31.920Z","dependency_job_id":null,"html_url":"https://github.com/evant/ItemTouchHelperClearViewIssue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/evant/ItemTouchHelperClearViewIssue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2FItemTouchHelperClearViewIssue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2FItemTouchHelperClearViewIssue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2FItemTouchHelperClearViewIssue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2FItemTouchHelperClearViewIssue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evant","download_url":"https://codeload.github.com/evant/ItemTouchHelperClearViewIssue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2FItemTouchHelperClearViewIssue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34170162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-09T19:23:22.941Z","updated_at":"2026-06-10T20:31:16.582Z","avatar_url":"https://github.com/evant.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ItemTouchHelperClearViewIssue\nIssue with using ItemTouchHelper and an ItemDecoration\n\nSwipe away items from the top to the bottom, you'll see that they aren't acutally removed from the view hierarchy, (the trash can will still be there). If you comment out the line which adds an ItemDecoration, it works correctly.\n\n## Solution\n\nAs suggested in the [issue](https://code.google.com/p/android/issues/detail?id=175798) `invalidateItemDecorations()` needs to be called after the item is removed, because the ItemDecoration is based on the item's positions in the list.\n\n```java\n@Override\npublic void onSwiped(RecyclerView.ViewHolder viewHolder, int state) {\n    ...\n    viewHolder.itemView.post(new Runnable() {\n        @Override\n        public void run() {\n            recyclerView.invalidateItemDecorations();\n        }\n    });\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevant%2Fitemtouchhelperclearviewissue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevant%2Fitemtouchhelperclearviewissue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevant%2Fitemtouchhelperclearviewissue/lists"}