{"id":22449888,"url":"https://github.com/turskyi/viewholderexample","last_synced_at":"2026-04-27T12:05:03.956Z","repository":{"id":133704860,"uuid":"232808137","full_name":"Turskyi/ViewHolderExample","owner":"Turskyi","description":"This project demonstrates the basic usage of a RecyclerView with ViewHolder to display a list of items.","archived":false,"fork":false,"pushed_at":"2024-07-28T20:04:24.000Z","size":1179,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T12:16:30.193Z","etag":null,"topics":["android","educational","kotlin","recyclerview","sample-app","viewholder","xml"],"latest_commit_sha":null,"homepage":"https://github.com/Turskyi/ViewHolderExample","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/Turskyi.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":"2020-01-09T12:51:14.000Z","updated_at":"2024-07-28T20:04:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe6384ae-680f-478b-9f63-3b44e0daefe9","html_url":"https://github.com/Turskyi/ViewHolderExample","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Turskyi/ViewHolderExample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turskyi%2FViewHolderExample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turskyi%2FViewHolderExample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turskyi%2FViewHolderExample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turskyi%2FViewHolderExample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Turskyi","download_url":"https://codeload.github.com/Turskyi/ViewHolderExample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turskyi%2FViewHolderExample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32335342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"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":["android","educational","kotlin","recyclerview","sample-app","viewholder","xml"],"created_at":"2024-12-06T05:12:22.172Z","updated_at":"2026-04-27T12:05:03.929Z","avatar_url":"https://github.com/Turskyi.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct-single.svg)](https://stand-with-ukraine.pp.ua)\n\u003cimg alt=\"GitHub commit activity\" src=\"https://img.shields.io/github/commit-activity/m/Turskyi/ViewHolderExample\"\u003e\n\n# Android RecyclerView Sample\n\nThis project demonstrates the basic usage of a RecyclerView to display a list\nof items. It showcases the following:\n\n- **Creating and setting up a RecyclerView**:\n    - Defining the RecyclerView in your layout XML file.\n    - Finding the RecyclerView reference in your Activity or Fragment.\n    - Setting a LayoutManager (e.g., LinearLayoutManager for vertical or\n      horizontal lists).\n    - Creating and setting an adapter (GreenAdapter in this case).\n- **Implementing a RecyclerView.Adapter**:\n    - Creating a custom adapter class that extends RecyclerView.Adapter.\n    - Defining a ViewHolder to hold references to the views in each list item.\n    - Overriding onCreateViewHolder to inflate the item layout and create\n      ViewHolder instances.\n    - Overriding onBindViewHolder to populate the views in each ViewHolder with\n      data.\n    - Overriding getItemCount to return the total number of items in the list.\n- **Handling item clicks**:\n    - Defining an interface (ListItemClickListener) for click callbacks.\n    - Implementing the interface in your Activity or Fragment.\n    - Setting up click listeners in your ViewHolder.\n    - Triggering the callback in the onClick method of your ViewHolder.\n- **ViewHolder recycling and reuse**:\n  The example visually demonstrates how ViewHolders are recycled by assigning\n  different background colors to each ViewHolder instance. As you scroll,\n  you'll see the colors get reused, illustrating the recycling mechanism.\n  This sample project can be a valuable resource for developers learning to use\n  RecyclerView in their Android applications.\n\n## Contact:\n\nFor any inquiries or suggestions, please open an issue on the GitHub repository\nor reach out to me directly at\n[dmytro@turskyi.com](mailto:dmytro@turskyi.com).\n\n## Screenshot:\n\n\u003c!--suppress CheckImageSize --\u003e\n\u003cimg src=\"screenshots/Screenshot_20240728.png\" width=\"200\"  alt=\"screenshot\"\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturskyi%2Fviewholderexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fturskyi%2Fviewholderexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturskyi%2Fviewholderexample/lists"}