{"id":16489235,"url":"https://github.com/nicbell/material-lists","last_synced_at":"2025-03-21T07:31:31.706Z","repository":{"id":65479043,"uuid":"580043973","full_name":"nicbell/material-lists","owner":"nicbell","description":"An Android XML implementation of Material 3 list items.","archived":false,"fork":false,"pushed_at":"2024-10-07T16:05:15.000Z","size":259,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-12T13:43:27.574Z","etag":null,"topics":["android","android-library","android-ui","kotlin","material","material-design"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nicbell.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-19T15:23:34.000Z","updated_at":"2024-09-16T07:18:45.000Z","dependencies_parsed_at":"2023-11-15T09:31:18.633Z","dependency_job_id":"91bfab16-f5d2-434d-925b-0c9f616bd735","html_url":"https://github.com/nicbell/material-lists","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicbell%2Fmaterial-lists","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicbell%2Fmaterial-lists/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicbell%2Fmaterial-lists/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicbell%2Fmaterial-lists/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicbell","download_url":"https://codeload.github.com/nicbell/material-lists/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221812874,"owners_count":16884716,"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":["android","android-library","android-ui","kotlin","material","material-design"],"created_at":"2024-10-11T13:43:41.322Z","updated_at":"2024-10-28T09:36:21.375Z","avatar_url":"https://github.com/nicbell.png","language":"Kotlin","readme":"# Material Lists\n\n[![Maven Central](https://img.shields.io/maven-central/v/net.nicbell.material-lists/listitem?color=blue)](https://s01.oss.sonatype.org/content/repositories/releases/net/nicbell/material-lists/listitem/)\n[![codecov](https://codecov.io/gh/nicbell/material-lists/branch/main/graph/badge.svg?token=YYJ348RZAF)](https://codecov.io/gh/nicbell/material-lists)\n\nAn Android XML implementation of Material 3 list items.\n\n\u003cimg src=\"https://user-images.githubusercontent.com/151842/208748928-6e299e55-c38f-44f3-874a-05fe192d67c2.gif\" width=\"340\" /\u003e\n\n## 🙋🏽 Why\n\nMaterial lists are available in Jetpack Compose but were never implemented in XML. This is a tiny\nlibrary that aims to provide most examples of this component specified in\nthe [design documentation](https://m3.material.io/components/lists/specs).\n\nI have had to re-implement this layout so many times that I have decided to open-source it.\n\n## 🪜 Setup\n\nInclude the dependency in your project.\n\n```groovy\nimplementation \"net.nicbell.material-lists:listitem:x.x.x\"\n```\n\nIn order to download the dependency please make sure access to the maven repo is configured. \nYou probably already have Maven Central configured; if you don't you will need to add it.\n\n```gradle\nrepositories {\n    //..\n    mavenCentral()\n}\n```\n\n## 🏄🏽 Usage\n\nAdd the `ListItem` component to your layout.\n\n### Attributes\n\nThe following attributes can be changed for a `ListItem`.\n\n| Description                  | Relevant attributes |\n|------------------------------|---------------------|\n| Headline text                | `app:head`          |\n| Supporting text              | `app:supportText`   |\n| Size type - 1, 2 or 3+ lines | `app:sizeType`      |\n| Show divider (default true)  | `app:dividerVisible`   |\n| Divider color                | `app:dividerTint`   |\n\nFor more info about size types see\nthe [design documentation](https://m3.material.io/components/lists/specs).\n\n### Content\n\nLeading and trailing content can be added as child views. A content style is require in order to\nposition the content correctly within the `ListItem`.\n\n| Description              | Style                                  | Required view type                   |\n|--------------------------|----------------------------------------|--------------------------------------|\n| Leading icon             | `MaterialLists.LeadingIcon`            | `AppCompatImageView`                 |\n| Leading image            | `MaterialLists.LeadingImage`           | `AppCompatImageView`                 |\n| Leading video thumbnail  | `MaterialLists.LeadingVideoThumbnail`  | `AppCompatImageView`                 |\n| Leading avatar image     | `MaterialLists.LeadingAvatar`          | `ShapeableImageView`                 |\n| Leading avatar label     | `MaterialLists.LeadingAvatarLabelText` | `MaterialTextView`                   |\n| Leading checkbox         | `MaterialLists.LeadingCheckbox`        | `MaterialCheckBox`                   |\n| Leading radio button     | `MaterialLists.LeadingRadioButton`     | `MaterialRadioButton`                |\n| Trailing icon            | `MaterialLists.TrailingIcon`           | `AppCompatImageView`                 |\n| Trailing checkbox        | `MaterialLists.TrailingCheckbox`       | `MaterialCheckBox`                   |\n| Trailing radio button    | `MaterialLists.TrailingRadioButton`    | `MaterialRadioButton`                |\n| Trailing switch          | `MaterialLists.TrailingSwitch`         | `SwitchMaterial` or `MaterialSwitch` |\n| Trailing supporting text | `MaterialLists.TrailingSupportingText` | `MaterialTextView`                   |\n\n### Example\n\n```xml\n\n\u003cnet.nicbell.materiallists.ListItem \n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\" \n    app:headline=\"Headline\" \n    app:sizeType=\"TWO_LINES\"\n    app:supportText=\"Support text\"\u003e\n\n    \u003candroidx.appcompat.widget.AppCompatImageView \n        style=\"@style/MaterialLists.LeadingIcon\"\n        android:layout_width=\"wrap_content\" \n        android:layout_height=\"wrap_content\"\n        android:src=\"@drawable/ic_outline_person_24\" /\u003e\n\n    \u003ccom.google.android.material.checkbox.MaterialCheckBox\n        style=\"@style/MaterialLists.TrailingCheckbox\" \n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\" /\u003e\n\u003c/net.nicbell.materiallists.ListItem\u003e\n```\n\nWhich will output the following.\n\n\u003cimg src=\"docs/img.png\" width=\"340\" /\u003e\n\n### Material 2 compatibility\n\nThis library was designed to work with `Theme.Material3` themes or themes inheriting from those\nthemes. The reason for this, is that the library leverages some tokens that are only available in\nMaterial 3. If your activities use `Theme.MaterialComponents` themes you can still use the library\nbut you will need to apply a `Theme.Material3` theme to the `ListItem` or one of it's parents in your\nlayout.\n\n### Demo\n\nThere is a demo app included with many examples.\n\n\u003cimg src=\"docs/demo.webp\" width=\"340\" /\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicbell%2Fmaterial-lists","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicbell%2Fmaterial-lists","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicbell%2Fmaterial-lists/lists"}