{"id":22763968,"url":"https://github.com/andyb129/zigzagrecyclerview","last_synced_at":"2025-07-30T16:13:24.123Z","repository":{"id":57743614,"uuid":"121996534","full_name":"andyb129/ZigzagRecyclerView","owner":"andyb129","description":"A library that gives you a slant on the traditional Grid Recycler View :recycle:","archived":false,"fork":false,"pushed_at":"2020-01-04T23:10:16.000Z","size":4073,"stargazers_count":27,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T22:09:04.163Z","etag":null,"topics":["picasso","recyclerview","slant","zigzag-recycler"],"latest_commit_sha":null,"homepage":"","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/andyb129.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":"2018-02-18T22:26:16.000Z","updated_at":"2024-09-20T17:55:53.000Z","dependencies_parsed_at":"2022-08-26T01:50:34.988Z","dependency_job_id":null,"html_url":"https://github.com/andyb129/ZigzagRecyclerView","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andyb129/ZigzagRecyclerView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyb129%2FZigzagRecyclerView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyb129%2FZigzagRecyclerView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyb129%2FZigzagRecyclerView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyb129%2FZigzagRecyclerView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andyb129","download_url":"https://codeload.github.com/andyb129/ZigzagRecyclerView/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyb129%2FZigzagRecyclerView/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260483188,"owners_count":23016080,"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":["picasso","recyclerview","slant","zigzag-recycler"],"created_at":"2024-12-11T11:13:22.666Z","updated_at":"2025-06-18T03:34:14.760Z","avatar_url":"https://github.com/andyb129.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zigzag Recycler View\n\n[![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-Zigzag%20Recycler%20View-green.svg?style=flat )]( https://android-arsenal.com/details/1/6794 )\n\nA library that gives you a slant on the traditional Grid Recycler View!\n\n* Use a traditional RecyclerView (\u0026 just apply the ZigzagGridRecyclerViewAdapter)\n* Load list of images from your own objects (implement ZigzagImage)\n* Change the background colour of the dividers\n\n\u003cp\u003e\n\u003ca href=\"https://play.google.com/store/apps/details?id=uk.co.barbuzz.zigzagrecyclerview.sample\"\u003e\u003cimg src=\"https://github.com/andyb129/ZigzagRecyclerView/blob/master/screenshots%2Fgoogle_play_badge.png\" height=\"80\" width=\"210\" alt=\"ZigzagRecyclerView\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp\u003e\n\u003cimg src=\"https://github.com/andyb129/ZigzagRecyclerView/blob/master/screenshots%2Fzigzag_recycler_view_anim.gif\" height=\"600\" alt=\"ZigzagRecyclerView\"/\u003e\n\u003c/p\u003e\n  \n\u003c!--![optional caption text](screenshots/zigzag_recycler_view_anim.gif)--\u003e\n\n### Setup\nTo use **Zigzag Recycler View** in your projects, simply add the library as a dependency to your build.\n\n##### Gradle\n```\ndependencies {\n  implementation 'uk.co.barbuzz:zigzagrecyclerview:0.0.3'\n}\n```\n\n##### Maven\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003euk.co.barbuzz.zigzagrecyclerviewadapter\u003c/groupId\u003e\n  \u003cartifactId\u003ezigzagrecyclerview\u003c/artifactId\u003e\n  \u003cversion\u003e0.0.3\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\nAlternatively you can directly import the /library project into your Android Studio project and add it as a dependency in your build.gradle.\n\nThe library is currently configured to be built via Gradle only. It has the following dependencies:\n\n* Support library         - com.android.support:appcompat-v7:26.1.0\n* Recyclerview-v7         - com.android.support:recyclerview-v7:26.1.0\n* Picasso 2.3.2           - com.squareup.picasso:picasso:2.5.2\n* Compiled SDK Version    - Oreo-26\n* Minimum SDK Version     - \u003e= Lollipop-21\n\n### Usage\nFor more detailed code example to use the library, Please refer to the `/sample` app.\n\n**ZigzagGridRecyclerViewAdapter** can be used with a standard RecyclerView. Declare the RecyclerView as normal in your layout XML.\n\n```\n\u003candroid.support.v7.widget.RecyclerView\n        android:id=\"@+id/zigzag_recycler_view\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"/\u003e\n```\n\nMake sure your class in the list that your passing into the RecylerView implements the ZigzagImage interface\n(either returning a value for **getZigzagImageResourceId()** or **getZigzagImageUrl()** depending on how you supply your image data).\n\n**NOTE:** images are loaded by the Picasso library at the moment\n\n```\npublic class SnowImage implements ZigzagImage {\n\n    private int snowImageResourceId;\n\n    public SnowImage(int snowImageResourceId) {\n        this.snowImageResourceId = snowImageResourceId;\n    }\n\n    @Override\n    public String getZigzagImageUrl() {\n        return null;\n    }\n\n    @Override\n    public int getZigzagImageResourceId() {\n        return snowImageResourceId;\n    }\n}\n```\n\nThen initialise the **RecyclerView** \u0026 **ZigzagGridRecyclerViewAdapter** in your activity as below.\n\n```\nLinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);\nZigzagGridRecyclerViewAdapter zigzagGridRecyclerViewAdapter = new ZigzagGridRecyclerViewAdapter(this, imageList, this);\nzigzagGridRecyclerViewAdapter.setBackgroundColourResId(getResources().getColor(R.color.separator));\n\nRecyclerView zigzagRecyclerView = findViewById(R.id.zigzag_recycler_view);\nzigzagRecyclerView.setLayoutManager(linearLayoutManager);\nzigzagRecyclerView.setAdapter(zigzagGridRecyclerViewAdapter);\n```\n\nYou can also **optionally** change the separator colour (defaults to white) or add a placeholder drawable resource for image loading.\n\n```\nzigzagGridRecyclerViewAdapter.setBackgroundColourResId(getResources().getColor(R.color.separator));\n\nzigzagGridRecyclerViewAdapter.setPlaceholderDrawableResId(R.drawable.placeholder_image);\n```\n\nThere is also an ZigzagListOnClickListener that can be implemented to define the behaviour when an image is clicked. Either add it as part of\nthe Adapter constructor (see above) or declare separably as below.\n\n```\nzigzagGridRecyclerViewAdapter.setZigzagListOnClickListener(new ZigzagGridRecyclerViewAdapter.ZigzagListOnClickListener() {\n            @Override\n            public void onZigzagImageClicked(int position, ZigzagImage zigzagImage) {\n                //onClick behaviour here\n            }\n        });\n```\n\n### TODO\n1. Add a optional label to bottom of image\n2. Allow change of the separator width\n\n### Thanks\n\nThis library has been made by using the amazing library 'Oblique' below. So huge thanks to the author which this is based on.\n\n* Oblique by [akshay2211](https://github.com/akshay2211) - [https://github.com/akshay2211/Oblique](https://github.com/akshay2211/Oblique)\n\n\n### Licence\n```\nCopyright (c) 2018 Andy Barber\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyb129%2Fzigzagrecyclerview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandyb129%2Fzigzagrecyclerview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyb129%2Fzigzagrecyclerview/lists"}