{"id":13493641,"url":"https://github.com/daniel-stoneuk/material-about-library","last_synced_at":"2025-05-15T07:03:39.841Z","repository":{"id":46118217,"uuid":"77178013","full_name":"daniel-stoneuk/material-about-library","owner":"daniel-stoneuk","description":"Makes it easy to create beautiful about screens for your apps","archived":false,"fork":false,"pushed_at":"2021-11-13T01:17:51.000Z","size":25827,"stargazers_count":1122,"open_issues_count":11,"forks_count":137,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-05-10T21:18:25.354Z","etag":null,"topics":["about","android","card","fragments","library","material"],"latest_commit_sha":null,"homepage":"","language":"Java","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/daniel-stoneuk.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":"2016-12-22T21:47:24.000Z","updated_at":"2025-05-06T01:40:25.000Z","dependencies_parsed_at":"2022-09-24T17:33:47.983Z","dependency_job_id":null,"html_url":"https://github.com/daniel-stoneuk/material-about-library","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-stoneuk%2Fmaterial-about-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-stoneuk%2Fmaterial-about-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-stoneuk%2Fmaterial-about-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-stoneuk%2Fmaterial-about-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniel-stoneuk","download_url":"https://codeload.github.com/daniel-stoneuk/material-about-library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254291961,"owners_count":22046424,"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":["about","android","card","fragments","library","material"],"created_at":"2024-07-31T19:01:17.380Z","updated_at":"2025-05-15T07:03:39.766Z","avatar_url":"https://github.com/daniel-stoneuk.png","language":"Java","funding_links":[],"categories":["Java","关于页面"],"sub_categories":[],"readme":"# material-about-library\n\n[![Release][101]][102] ![Downloads](https://jitpack.io/v/daniel-stoneuk/material-about-library/month.svg) [![GitHub license](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/daniel-stoneuk/material-about-library/master/LICENSE) [![GitHub issues](https://img.shields.io/github/issues/daniel-stoneuk/material-about-library.svg)](https://github.com/daniel-stoneuk/material-about-library/issues)\n\nMakes it easy to create a beautiful about screen for your app. Generates an `Activity` or `Fragment`.\n\nIdea from here: [Heinrich Reimer's open-source-library-request-manager][6]\n\nDesign inspired by [Phonograph](https://github.com/kabouzeid/Phonograph)\n\nIf you use this library in your app, please let me know and I'll add it to the list.\n\n## Demo\n\n\u003ca href='https://play.google.com/store/apps/details?id=com.danielstone.materialaboutlibrarydemo\u0026pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'\u003e\u003cimg alt='Get it on Google Play' src='https://play.google.com/intl/en_gb/badges/images/generic/en_badge_web_generic.png' height=\"60\" /\u003e\u003c/a\u003e\n\n## Screenshots\n\n| Light                          | Dark                           | Custom Cardview Background     |\n| ------------------------------ | ------------------------------ | ------------------------------ |\n| ![Demo App](screenshots/1.png) | ![Demo App](screenshots/2.png) | ![Demo App](screenshots/3.png) |\n\n## Features\n\n- Material design\n- Modular backend\n- Easy to implement\n- Simple but intuitive API\n- Dynamic item support\n\n## Dependency\n\n_material-about-library_ is available on [**jitpack.io**][1].\n\n**Gradle dependency:**\n\n```gradle\nallprojects {\n    repositories {\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n```gradle\ndependencies {\n    implementation 'com.github.daniel-stoneuk:material-about-library:3.1.2'\n}\n```\n\nHelp test `3.2.0` with shared views between adapters (may cause crashes):\n\n```gradle\ndependencies {\n    implementation 'com.github.daniel-stoneuk:material-about-library:3.2.0-rc01'\n}\n```\n\n## Migration\n\nView the migration guide [here](/MIGRATION.md)\n\n## Setup\n\n### Activity\n\nYour `Activity` must extend [`MaterialAboutActivity`][materialaboutactivityjava] and be in your _AndroidManifest.xml_:\n\n```java\npublic class ExampleMaterialAboutActivity extends MaterialAboutActivity {\n\n    @Override\n    @NonNull\n    protected MaterialAboutList getMaterialAboutList(@NonNull Context context) {\n        return new MaterialAboutList.Builder()\n                .build(); // This creates an empty screen, add cards with .addCard()\n    }\n\n    @Override\n    protected CharSequence getActivityTitle() {\n        return getString(R.string.mal_title_about);\n    }\n    \n}\n```\n\nEnsure that the theme extends a `MaterialComponents` theme, and apply primary \u0026 secondary colours:\n\n```xml\n\u003cmanifest ...\u003e\n    \u003capplication ...\u003e\n        \u003cactivity android:name=\".ExampleMaterialAboutActivity\"\n            android:theme=\"@style/AppTheme.MaterialAboutActivity\"/\u003e\n    \u003c/application\u003e\n\u003c/manifest\u003e\n```\n\n```xml\n\u003cstyle name=\"AppTheme.MaterialAboutActivity\" parent=\"Theme.MaterialComponents.DayNight.DarkActionBar\"\u003e\n    \u003citem name=\"colorPrimary\"\u003e@color/colorPrimary\u003c/item\u003e\n    \u003citem name=\"colorPrimaryDark\"\u003e@color/colorPrimaryDark\u003c/item\u003e\n\u003c/style\u003e\n```\n\n### Fragment\n\nYour `Fragment` must extend [`MaterialAboutFragment`][materialaboutfragmentjava].\n\n```java\npublic class ExampleMaterialAboutFragment extends MaterialAboutFragment {\n\n    @Override\n    protected MaterialAboutList getMaterialAboutList(final Context activityContext) {\n        return new MaterialAboutList.Builder()\n                .build(); // This creates an empty screen, add cards with .addCard()\n    }\n\n}\n```\n\nTheming will follow the activity theme.\n\n### Add Cards:\n\nStart building a \"card\" using [`MaterialAboutCard.Builder()`][8]\n\n```java\npublic class ExampleMaterialAboutActivity extends MaterialAboutActivity {\n\n    @Override\n    @NonNull\n    protected MaterialAboutList getMaterialAboutList(@NonNull Context context) {\n        MaterialAboutCard card = new MaterialAboutCard.Builder()\n                // Configure card here\n                .build();\n\n        return new MaterialAboutList.Builder()\n                    .addCard(card)\n                    .build();\n    }\n}\n```\n\nGive the card a title by calling `.title()` on the `MaterialAboutCard.Builder`\n\n```java\nMaterialAboutCard card = new MaterialAboutCard.Builder()\n    .title(\"Author\")\n    .build();\n```\n\n\nEnable elevation and disable the outline to get a more classic design by calling `.outline(false)` on the `MaterialAboutCard.Builder`\n\n```java\nMaterialAboutCard card = new MaterialAboutCard.Builder()\n    .outline(false)\n    .build();\n```\n\n### Add Items to a card:\n\nThere are currently two types of items you can add to a card - [`MaterialAboutTitleItem`][9] and [`MaterialAboutActionItem`][10]. Other types of items are planned, for example \"person\" items which feature buttons to showcase a single person. Feel free to submit a PR or Issue for more item ideas.\n\n- `MaterialAboutActionItem`: Standard item with text, icon and optional subtext.\n- `MaterialAboutTitleItem`: Larger item with large icon (e.g. app icon) and larger text.\n\n[`MaterialAboutTitleItem`][9] is created with [`MaterialAboutTitleItem.Builder()`][9] and lets you specify **text** and an **icon**.\n\n```java\nMaterialAboutCard.Builder cardBuilder = new MaterialAboutCard.Builder();\ncardBuilder.addItem(new MaterialAboutTitleItem.Builder()\n        .text(\"Material About Library\")\n        .icon(R.mipmap.ic_launcher)\n        .build());\n```\n\n[`MaterialAboutActionItem`][10] is created with [`MaterialAboutActionItem.Builder()`][10] and lets you specify **text**, **sub-text**, an **icon** and an **OnClickAction**.\n\n```java\ncardBuilder.addItem(new MaterialAboutActionItem.Builder()\n        .text(\"Version\")\n        .subText(\"1.0.0\")\n        .icon(R.drawable.ic_about_info)\n        .setOnClickAction(new MaterialAboutActionItem.OnClickAction() {\n            @Override\n            public void onClick() {\n                Toast.makeText(ExampleMaterialAboutActivity.this, \"Version Tapped\", Toast.LENGTH_SHORT)\n                        .show();\n            }\n        })\n        .build());\n```\n\n### Return the list:\n\nCreate a [`MaterialAboutList`][11] using [`MaterialAboutList.Builder()`][11], passing in the cards you would like to display.\n\n```java\nMaterialAboutCard card = new MaterialAboutCard.Builder()\n        .title(\"Hey! I'm a card\")\n        .build();\n\nreturn new MaterialAboutList.Builder()\n        .addCard(card)\n        .build();\n```\n\nCheck out a working example in [`Demo.java`][3].\n\n**Tip:** You can either use _Strings_ / _Drawables_ or _Resources_ when creating `MaterialAboutItem`'s\n\n**Tip:** Use [Android-Iconics][iconics] for icons. \"Android-Iconics - Use any icon font, or vector (.svg) as drawable in your application.\"\n\n**Tip:** Use [ConvenienceBuilder][conveniencebuilderjava] to easily create items or OnClickActions.\n\n**Tip:** Customise text colour and card colour in your styles. Example below: \n\n```xml\n\u003cstyle name=\"AppTheme.MaterialAboutActivity.Light.DarkActionBar.CustomCardView\" parent=\"Theme.MaterialComponents.Light.DarkActionBar\"\u003e\n        \u003c!-- Customize your theme here. --\u003e\n        \u003citem name=\"colorPrimary\"\u003e@color/colorPrimary\u003c/item\u003e\n        \u003citem name=\"colorPrimaryDark\"\u003e@color/colorPrimaryDark\u003c/item\u003e\n        \u003citem name=\"android:textColorPrimary\"\u003e#ffffff\u003c/item\u003e\n        \u003citem name=\"android:textColorSecondary\"\u003e#ffffff\u003c/item\u003e\n        \u003citem name=\"colorSurface\"\u003e@color/colorPrimaryDark\u003c/item\u003e\n        \u003citem name=\"colorOnSurface\"\u003e#ffffff\u003c/item\u003e\n    \u003c/style\u003e\n```\n\n### Custom Adapters:\nIt is possible to replace the contents of a card with a custom adapter. If you do this, then none of the items associated with the card will be displayed. Check out the demo app, in which use [LicenseAdapter](https://github.com/yshrsmz/LicenseAdapter) (hence the INTERNET permission).\n\n```java\nMaterialAboutCard.Builder customAdapterCardBuilder = new MaterialAboutCard.Builder();\n// Create list of libraries\nList\u003cLibrary\u003e libraries = new ArrayList\u003c\u003e();\n\n// Add libraries that are hosted on GitHub with an Apache v2 license.\nlibraries.add(Licenses.fromGitHubApacheV2(\"yshrsmz/LicenseAdapter\"));\nlibraries.add(Licenses.fromGitHubApacheV2(\"daniel-stoneuk/material-about-library\"));\n\ncustomAdapterCardBuilder.title(\"Custom Adapter (License Adapter)\");\ncustomAdapterCardBuilder.customAdapter(new LicenseAdapter(libraries));\n});\n```\n\n\n### Dynamic items:\nIt's possible to create dynamic items that either change on tap (or when any other event occurs). There are two examples in the sample application. Simply change the items in the list variable and then call `refreshMaterialAboutList()`. DiffUtil calculates the changes to animate in the RecyclerView.\n\n```java\nfinal MaterialAboutActionItem item = new MaterialAboutActionItem.Builder()\n            .text(\"Dynamic UI\")\n            .subText(subText)\n            .icon(new IconicsDrawable(c)\n                    .icon(CommunityMaterial.Icon.cmd_refresh)\n                    .color(ContextCompat.getColor(c, R.color.mal_color_icon_dark_theme)\n                    ).sizeDp(18))\n            .build();\n    item.setOnClickAction(new MaterialAboutItemOnClickAction() {\n        @Override\n        public void onClick() {\n            item.setSubText(\"Random number: \" + ((int) (Math.random() * 10)));\n            refreshMaterialAboutList();\n        }\n    });\n```\n\n### Custom card and Action layout\nTo get a layout that is similar to the 6th screenshot above simply override the files `mal_material_about_action_item` and `mal_material_about_list_card` by creating new layout resources with the same filename. See [here](https://github.com/daniel-stoneuk/material-about-library/tree/master/app/src/main/res/layout).\n\n## Contributors\n\n- Daniel Stone ([@daniel-stoneuk](https://github.com/daniel-stoneuk))\n- Robert Pösel ([@Robyer](https://github.com/Robyer))\n- Jonas Uekötter ([@ueman](https://github.com/ueman))\n- Rainer Lang ([@Rainer-Lang](https://github.com/rainer-lang))\n- Sebastian Guillen ([@code-schreiber](https://github.com/code-schreiber))\n- and [others](https://github.com/daniel-stoneuk/material-about-library/graphs/contributors)\n\n## Apps using this library\n\n- [Monitor for EnergyHive \u0026 Engage][5]\n- [Crafting Assistant NMS](https://play.google.com/store/apps/details?id=biemann.android.craftingnms)\n- [ComicsDB Client](https://play.google.com/store/apps/details?id=cz.kutner.comicsdbclient.comicsdbclient), code available on [GitHub](https://github.com/tukak/comicsdbclient)\n- [Android About Box](https://github.com/eggheadgames/android-about-box) (library) - an opinionated About Box for Android\n- [Skin Widget for Minecraft](https://play.google.com/store/apps/details?id=com.rabross.android.minecraftskinwidget)\n- [FastHub for GitHub](https://play.google.com/store/apps/details?id=com.fastaccess.github)\n\n## License\n\n```\nCopyright 2016-2020 Daniel Stone\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\n[1]: https://jitpack.io/#daniel-stoneuk/material-about-library\n[2]: http://i.imgur.com/xXWDmLb.png\n[3]: https://github.com/daniel-stoneuk/material-about-library/blob/master/app/src/main/java/com/danielstone/materialaboutlibrarydemo/Demo.java\n[4]: http://i.imgur.com/HEm08Ax.png\n[5]: https://play.google.com/store/apps/details?id=com.danielstone.energyhive\n[6]: https://github.com/HeinrichReimer/open-source-library-request-manager/issues/3\n[8]: https://github.com/daniel-stoneuk/material-about-library/blob/master/library/src/main/java/com/danielstone/materialaboutlibrary/model/MaterialAboutCard.java\n[9]: https://github.com/daniel-stoneuk/material-about-library/blob/master/library/src/main/java/com/danielstone/materialaboutlibrary/model/MaterialAboutTitleItem.java\n[10]: https://github.com/daniel-stoneuk/material-about-library/blob/master/library/src/main/java/com/danielstone/materialaboutlibrary/model/MaterialAboutActionItem.java\n[11]: https://github.com/daniel-stoneuk/material-about-library/blob/master/library/src/main/java/com/danielstone/materialaboutlibrary/model/MaterialAboutList.java\n[101]: https://jitpack.io/v/daniel-stoneuk/material-about-library.svg\n[102]: https://jitpack.io/#daniel-stoneuk/material-about-library\n[conveniencebuilderjava]: https://github.com/daniel-stoneuk/material-about-library/blob/master/library/src/main/java/com/danielstone/materialaboutlibrary/ConvenienceBuilder.java\n[iconics]: https://github.com/mikepenz/Android-Iconics\n[materialaboutactivityjava]: https://github.com/daniel-stoneuk/material-about-library/blob/master/library/src/main/java/com/danielstone/materialaboutlibrary/MaterialAboutActivity.java\n[materialaboutfragmentjava]: https://github.com/daniel-stoneuk/material-about-library/blob/master/app/src/main/java/com/danielstone/materialaboutlibrarydemo/ExampleMaterialAboutFragment.java\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-stoneuk%2Fmaterial-about-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniel-stoneuk%2Fmaterial-about-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-stoneuk%2Fmaterial-about-library/lists"}