{"id":13396123,"url":"https://github.com/kanytu/android-parallax-recyclerview","last_synced_at":"2025-05-15T23:07:35.624Z","repository":{"id":22493717,"uuid":"25833129","full_name":"kanytu/android-parallax-recyclerview","owner":"kanytu","description":" An adapter which could be used to achieve a parallax effect on RecyclerView.","archived":false,"fork":false,"pushed_at":"2022-06-05T10:15:14.000Z","size":7332,"stargazers_count":1613,"open_issues_count":24,"forks_count":282,"subscribers_count":59,"default_branch":"master","last_synced_at":"2025-04-08T10:32:59.696Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"vencc/game","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kanytu.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-10-27T18:31:43.000Z","updated_at":"2025-03-27T22:05:17.000Z","dependencies_parsed_at":"2022-08-21T06:00:42.495Z","dependency_job_id":null,"html_url":"https://github.com/kanytu/android-parallax-recyclerview","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanytu%2Fandroid-parallax-recyclerview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanytu%2Fandroid-parallax-recyclerview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanytu%2Fandroid-parallax-recyclerview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanytu%2Fandroid-parallax-recyclerview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kanytu","download_url":"https://codeload.github.com/kanytu/android-parallax-recyclerview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254436948,"owners_count":22070947,"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-07-30T18:00:40.793Z","updated_at":"2025-05-15T23:07:29.785Z","avatar_url":"https://github.com/kanytu.png","language":"Java","funding_links":[],"categories":["Index `(light-weight pages)`","RecyclerView","Index"],"sub_categories":[],"readme":"android-parallax-recycleview\n============================\n\n**Integration**\n====\n\n**Step 1.** Add the JitPack repository to your build file\n\n   \trepositories {\n   \t    maven {\n   \t        url \"https://jitpack.io\"\n   \t    }\n   \t}\n   \t\n**Step 2.** Add the dependency\n\n    dependencies {\n    \tcompile 'com.github.kanytu:android-parallax-recyclerview:v1.7'\n    }\n\n\n\n\n**USAGE**\n\n(Example project - https://github.com/kanytu/example-parallaxrecycler)\n\n\n - Create your object list and pass it to the constructor of `ParallaxRecyclerAdapter`\n\n```java\nList\u003cString\u003e myContent = new ArrayList\u003cString\u003e(); // or another object list\nParallaxRecyclerAdapter\u003cString\u003e adapter = new ParallaxRecyclerAdapter\u003cString\u003e(content) {\n            @Override\n            public void onBindViewHolderImpl(RecyclerView.ViewHolder viewHolder, ParallaxRecyclerAdapter\u003cString\u003e adapter, int i) {\n              // If you're using your custom handler (as you should of course) \n              // you need to cast viewHolder to it.\n              ((MyCustomViewHolder) viewHolder).textView.setText(myContent.get(i)); // your bind holder routine.\n            }\n\n            @Override\n            public RecyclerView.ViewHolder onCreateViewHolderImpl(ViewGroup viewGroup, final ParallaxRecyclerAdapter\u003cString\u003e adapter, int i) {\n              // Here is where you inflate your row and pass it to the constructor of your ViewHolder\n              return new MyCustomViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.myRow, viewGroup, false));\n            }\n\n            @Override\n            public int getItemCountImpl(ParallaxRecyclerAdapter\u003cString\u003e adapter) {\n              // return the content of your array\n              return myContent.size();\n            }\n        };\n```\n\n - Now we set the parallax header. You need to pass the `RecyclerView` too to implement the scroll listeners.\n\n```java\nmyAdapter.setParallaxHeader(LayoutInflater.from(this).inflate(\n    R.layout.myParallaxView, myRecycler, false), myRecyclerView);\n```\n\nThere a few other listeners you can implement:\n\n```java\n// Event triggered when you click on a item of the adapter.\nvoid onClick(View v, int position); \n\n// Event triggered when the parallax is being scrolled.\nvoid onParallaxScroll(float percentage, float offset, View parallax); \n```\n\n**RESULT**\n\n![ParallaxListView](https://raw.githubusercontent.com/kanytu/android-parallax-recycleview/master/screenshots/screenshot.gif)\n\n\n**COOL EFFECTS YOU CAN DO WITH THIS LIBRARY**\n\n - Transparent toolbar effect\n\n```java\n@Override\npublic void onParallaxScroll(float percentage, float offset, View parallax) {\n  Drawable c = mToolbar.getBackground();\n  c.setAlpha(Math.round(percentage * 255));\n  mToolbar.setBackground(c);\n}\n```\n\n![ParallaxListView](https://raw.githubusercontent.com/kanytu/android-parallax-recycleview/master/screenshots/parallaxtoolbar.gif)\n\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-android--parallax--recyclerview-brightgreen.svg?style=flat)](https://android-arsenal.com/details/3/1095)\n\n\n## License\nCopyright (c) 2014 Pedro Oliveira\n\nLicensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanytu%2Fandroid-parallax-recyclerview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkanytu%2Fandroid-parallax-recyclerview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanytu%2Fandroid-parallax-recyclerview/lists"}