{"id":13537716,"url":"https://github.com/dexafree/MaterialList","last_synced_at":"2025-04-02T04:31:18.041Z","repository":{"id":18887784,"uuid":"22105564","full_name":"dexafree/MaterialList","owner":"dexafree","description":"An Android library aimed to get the beautiful CardViews that Google shows at its official design specifications","archived":false,"fork":false,"pushed_at":"2020-07-06T07:09:30.000Z","size":5012,"stargazers_count":1607,"open_issues_count":53,"forks_count":380,"subscribers_count":100,"default_branch":"master","last_synced_at":"2024-10-29T17:49:50.459Z","etag":null,"topics":[],"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/dexafree.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2014-07-22T13:45:54.000Z","updated_at":"2024-07-10T06:29:03.000Z","dependencies_parsed_at":"2022-09-01T16:40:09.674Z","dependency_job_id":null,"html_url":"https://github.com/dexafree/MaterialList","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dexafree%2FMaterialList","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dexafree%2FMaterialList/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dexafree%2FMaterialList/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dexafree%2FMaterialList/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dexafree","download_url":"https://codeload.github.com/dexafree/MaterialList/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246413229,"owners_count":20773053,"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-08-01T09:01:02.696Z","updated_at":"2025-04-02T04:31:18.022Z","avatar_url":"https://github.com/dexafree.png","language":"Java","readme":"# MaterialList [![Build Status](https://travis-ci.org/dexafree/MaterialList.svg?branch=master)](https://travis-ci.org/dexafree/MaterialList) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.dexafree/materiallist/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/com.github.dexafree/materiallist) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-MaterialList-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1161)\n\n## Discontinued\n\nThis library will not receive any updates, as I do not have the time or knowledge to improve it.\n\nIf anyone forks it and wants to mantain it, please let me know and I will add a link to the mantained version.\n\n-----\n\n\u003e ### Warning!\n\u003e MaterialList v3 changes the way Cards are built, and its API is not backwards compatible.\n\u003e Read the changes and learn how to build your cards in the Wiki.\n\u003e \n\u003e Also the v3 version should be considered experimental\n\nMaterialList is an Android library created to help all Android developers get the beautiful CardViews that Google shows at its [official design specifications](http://www.google.com/design/spec/components/cards.html#cards-usage).\n\nProvided as a RecyclerView extension, it can receive a list of Cards (stored in a CardList, provided by the library) and show them accordingly to the android style and design patterns.\n\nIt also has been developed while keeping extensibility in mind, which means that you are able to create your own card layouts and add them to the CardList without any pain (see examples below).\n\n## Cards provided\nThese are the cards that the library offers by default:\n\n[\u003cimg src=\"http://i.imgur.com/f5LLorA.png\" alt=\"SmallImageCard\" width=\"300px\"\u003e](https://github.com/dexafree/MaterialList/wiki/SmallImageCard)\n[\u003cimg src=\"http://i.imgur.com/ENxUGAw.png\" alt=\"BasicImageButtonsCard\" width=\"300px\"\u003e](https://github.com/dexafree/MaterialList/wiki/BasicImageButtonsCard)\n[\u003cimg src=\"http://i.imgur.com/yW7uBNy.png\" alt=\"BigImageCard\" width=\"300px\"\u003e](https://github.com/dexafree/MaterialList/wiki/BigImageCard)\n[\u003cimg src=\"http://i.imgur.com/vr4vP6o.png\" alt=\"BigImageButtonsCard\" width=\"300px\"\u003e](https://github.com/dexafree/MaterialList/wiki/BigImageButtonsCard)\n[\u003cimg src=\"http://i.imgur.com/19xt1FX.png\" alt=\"BasicButtonsCard\" width=\"300px\"\u003e](https://github.com/dexafree/MaterialList/wiki/BasicButtonsCard)\n[\u003cimg src=\"http://i.imgur.com/ZGPmfaf.jpg\" alt=\"WelcomeCard\" width=\"300px\"\u003e](https://github.com/dexafree/MaterialList/wiki/WelcomeCard)\n[\u003cimg src=\"http://i.imgur.com/iR7xmbG.jpg\" alt=\"BasicListCard\" width=\"300px\"\u003e](https://github.com/dexafree/MaterialList/wiki/BasicListCard)\n\nFor further documentation, you can [check the Wiki page](https://github.com/dexafree/MaterialList/wiki/).\n\n## How to use\n\nThe MaterialListView is based on a RecyclerView. It acts just as a normal ListView, but offering options for interacting with your cards. It can display the cards in a single or multiple columns.\n\n### 1. Step: Declare a MaterialListView in your layout\n\n```xml\n\u003cRelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n    android:paddingRight=\"@dimen/activity_horizontal_margin\"\n    android:paddingTop=\"@dimen/activity_vertical_margin\"\n    android:paddingBottom=\"@dimen/activity_vertical_margin\"\u003e\n\n    \u003ccom.dexafree.materialList.view.MaterialListView\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"fill_parent\"\n        android:id=\"@+id/material_listview\"/\u003e\n\n\u003c/RelativeLayout\u003e\n```\n\nThere are also some additional attributes to define the column count of the MaterialListView. Therefore you need\n\n```xml\nxmlns:app=\"http://schemas.android.com/apk/res-auto\"\n```\n\nYou can use the **column_count** attribute for using a fixed column count in portrait and landscape mode.\n\n```xml\n    app:column_count=\"1\"\n```\n\nOr you can use the **column_count_portrait** and **column_count_landscape** attributes.\n\n```xml\n    app:column_count_portrait=\"1\"\n    app:column_count_landscape=\"2\"\n```\n\n### 2. Step: Find your MaterialListView in code\n\n```java\nMaterialListView mListView = (MaterialListView) findViewById(R.id.material_listview);\n```\n\n### 3. Step: Add Cards to the MaterialListView\n\n```java\nCard card = new Card.Builder(this)\n                            .setTag(\"BASIC_IMAGE_BUTTONS_CARD\")\n                            .withProvider(BasicImageButtonsCardProvider.class)\n                            .setTitle(\"I'm new\")\n                            .setDescription(\"I've been generated on runtime!\")\n                            .setDrawable(R.drawable.dog)\n                            .endConfig()\n                            .build()\n\nmListView.getAdapter.add(card);\n```\n\nThere are also some Cards that may show a Divider between the content and the buttons. For further reference, [read the Wiki page](https://github.com/dexafree/MaterialList/wiki/Dividers)\n\n## Clicking the cards\nAs the project was migrated from `ListView` to `RecyclerView`, it did not offer the native `OnItemClickListener` / `OnItemLongClickListener` methods that can be accessed from ListView.\n\nSince version 2.4.0, you can add your listeners\n\n```java\nmListView.addOnItemTouchListener(new RecyclerItemClickListener.OnItemClickListener() {\n\n    @Override\n    public void onItemClick(Card card, int position) {\n        Log.d(\"CARD_TYPE\", card.getTag().toString());\n    }\n\n    @Override\n    public void onItemLongClick(Card card, int position) {\n        Log.d(\"LONG_CLICK\", card.getTag().toString());\n    }\n});\n```\n\nCheck also the **Recovering data from the cards** section in order to be able to recover the Card's content\n\n## Dismissing the cards\nOne of the features I've always loved is the SwipeToDismiss gesture.\nMaterialList brings you this feature, and in order to set a callback to the dismissing action, you only need to create your own OnDismissCallback:\n\n```java\nmListView.setOnDismissCallback(new OnDismissCallback() {\n    @Override\n    public void onDismiss(Card card, int position) {\n        // Do whatever you want here\n    }\n});\n```\nYou will also be able to decide if a card should be dismissible or not, just by calling `card.setDismissible(true)`.\n\nCheck also the **Recovering data from the cards** section in order to be able to recover the Card's content\n\n\n## Recovering data from the cards\nYou can check [the Wiki page in order to get more information about the tag system](https://github.com/dexafree/MaterialList/wiki/Recovering-data-from-the-Cards).\n\n\n## Animations\nSince version 2.0, MaterialList provides animations, in order to enhance cards apparitions.\n\nYou can implement them just by calling the [setItemAnimator(RecyclerView.ItemAnimator animator)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html#setItemAnimator(android.support.v7.widget.RecyclerView.ItemAnimator) \"Android Developer Documentation\") method.\n\nThere also exists an extensive [animation library for the RecyclerView from wasabeef](https://github.com/wasabeef/recyclerview-animators).\n\n## Extensibility\nMaterialList was created with extensibility in mind, so it makes things easy for you if you want to create your own Cards.\n\nFor learning how to do it, [check the Wiki page](https://github.com/dexafree/MaterialList/wiki/Create-your-own-Cards)\n\n## Compatibility\nMaterialList is compatible with Android 2.3+\n\n## How to use\nIn order to use MaterialList, you can either clone the project and import it as a module, or you can add this line to your build.gradle script:\n\n```groovy\ndependencies {\n    ...\n    compile 'com.github.dexafree:materiallist:3.2.2'\n}\n```\n\n## Sample\nYou can clone the project and compile it yourself (it includes a sample), or you can check it out already compiled at Google Play\n\n[![Google Play](http://developer.android.com/images/brand/en_generic_rgb_wo_45.png)](https://play.google.com/store/apps/details?id=com.dexafree.materiallistviewexample)\n\n\u003e Notice that it might not be the last version\n\n## Collaborations\n* [Fabio Hellmann](https://github.com/FHellmann): Great pull request that added MaterialStaggeredGridView, animations, and refactored a lot of code. Thank you very much, really! Also ported MaterialListView from ListView to RecyclerView.\n* [Ricardo Romero](https://github.com/RicardoRB): Integrating Picasso to the library\n\n## Credits\n* Jake Wharton: [SwipeToDismissNOA](https://github.com/JakeWharton/SwipeToDismissNOA)\n* Romain Guy: The sand picture provided as example was taken from one of his projects\n\n## License\n\nMaterialList is licensed under MIT License, which means that is Open Source and free to use and modify, you just have to.\n\n```\nThe MIT License (MIT)\n\nCopyright (c) 2014 Dexafree\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","funding_links":[],"categories":["Java","Libs","\u003ca name=\"Showcase\"\u003eShowcase\u003c/a\u003e"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget","Personal Blog"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdexafree%2FMaterialList","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdexafree%2FMaterialList","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdexafree%2FMaterialList/lists"}