{"id":13395846,"url":"https://github.com/navasmdc/MaterialDesignLibrary","last_synced_at":"2025-03-13T22:31:03.041Z","repository":{"id":21312375,"uuid":"24628923","full_name":"navasmdc/MaterialDesignLibrary","owner":"navasmdc","description":"This is a library with components of Android L to you use in android 2.2","archived":false,"fork":false,"pushed_at":"2023-05-28T17:32:11.000Z","size":8930,"stargazers_count":8996,"open_issues_count":253,"forks_count":2228,"subscribers_count":502,"default_branch":"master","last_synced_at":"2024-07-31T18:15:57.727Z","etag":null,"topics":["android","material-design"],"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/navasmdc.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}},"created_at":"2014-09-30T07:37:17.000Z","updated_at":"2024-07-31T17:43:27.000Z","dependencies_parsed_at":"2022-07-15T21:48:25.008Z","dependency_job_id":"f22a6037-c9cb-440c-acc7-a01ddf6d2c78","html_url":"https://github.com/navasmdc/MaterialDesignLibrary","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navasmdc%2FMaterialDesignLibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navasmdc%2FMaterialDesignLibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navasmdc%2FMaterialDesignLibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navasmdc%2FMaterialDesignLibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navasmdc","download_url":"https://codeload.github.com/navasmdc/MaterialDesignLibrary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243493329,"owners_count":20299633,"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","material-design"],"created_at":"2024-07-30T18:00:33.801Z","updated_at":"2025-03-13T22:31:02.645Z","avatar_url":"https://github.com/navasmdc.png","language":"Java","readme":"![Material design library logo](images/logo.png)\n\n# Material Design Android Library\n\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.gc.demomaterialdesign\"\u003e\n  \u003cimg alt=\"Android app on Google Play\" src=\"https://developer.android.com/images/brand/en_app_rgb_wo_45.png\" /\u003e\n\u003c/a\u003e\n\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Material%20Design%20Android%20Library-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1156)\n\n* [How to use](#howtouse)\n* [Components](#components)\n    * [Buttons](#buttons)\n        * [Flat Button](#flat-button)\n        * [Rectangle Button](#rectangle-button)\n        * [Float Button](#float-button)\n        * [Float small button](#float-small-button)\n    * [Switches](#switches)\n        * [CheckBox](#checkbox)\n        * [Switch](#switch)\n    * [Progress indicators](#progress-indicators)\n        * [Progress bar circular indeterminate](#progress-bar-circula-rindeterminate)\n        * [Progress bar indeterminate](#progress-bar-indeterminate)\n        * [Progress bar indeterminate determinate](#progress-bar-indeterminate-determinate)\n        * [Progress bar determinate](#progress-bar-determinate)\n        * [Slider](#slider)\n        * [Slider with number indicator](#slider-with-number-indicator)\n* [Widgets](#widgets)\n    * [SnackBar](#snackbar)\n    * [Dialog](#dialog)\n    * [Color selector](#color-selector)\n\n## How to use\n\nIf you want use this library, you only have to download MaterialDesign project, import it into your workspace and add the project as a library in your android project settings.\n\nIf you prefer it, you can use the gradle dependency, you have to add these lines in your build.gradle file:\n\n```xml\nrepositories {\n    jcenter()\n}\n\ndependencies {\n    compile 'com.github.navasmdc:MaterialDesign:1.5@aar'\n}\n```\n\nSome components have custom attributes, if you want use them, you must add this line in your xml file in the first component:\n\n```xml\n\u003cRelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:materialdesign=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    \u003e\n\u003c/RelativeLayout\u003e\n```\n\n\u003eIf you are going to use a ScrollView, it is recommended that you use the CustomScrollView provided in this library to avoid problems with the custom components.\n\u003eTo use this component:\n\u003e```xml\n\u003e\u003ccom.gc.materialdesign.views.ScrollView \n\u003e    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\u003e    xmlns:materialdesign=\"http://schemas.android.com/apk/res-auto\"\n\u003e    android:id=\"@+id/scroll\"\n\u003e    android:layout_width=\"match_parent\"\n\u003e    android:layout_height=\"match_parent\"\u003e\n\u003e\u003c/com.gc.materialdesign.views.ScrollView\u003e\n\u003e```\n\n##Components\n\n####Buttons\n\n######Flat Button\n\n![flat button](images/flat_button.png)\n```xml\n\u003ccom.gc.materialdesign.views.ButtonFlat\n                android:id=\"@+id/buttonflat\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"#1E88E5\"\n                android:text=\"Button\" /\u003e\n```\n\n######Rectangle Button\n\n![rectangle button](images/rectangle_button.png)\n```xml\n\u003ccom.gc.materialdesign.views.ButtonRectangle\n                android:id=\"@+id/button\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"#1E88E5\"\n                android:text=\"Button\" /\u003e\n```\n\n######Float Button\n\n![float button](images/float_button.png)\n\n\u003eIt is recommended to put this component in the right-bottom of the screen. To use this component write this code in your xml file.\n\u003eIf you don`t want to start this component with animation set the animate attribute to false.\n\u003ePut your icon in the icon attribute to set the drawable icon for this component.\n\n```xml\n\u003cRelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:materialdesign=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    \u003e\n    \u003c!-- ... XML CODE --\u003e\n    \u003ccom.gc.materialdesign.views.ButtonFloat\n                android:id=\"@+id/buttonFloat\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignParentRight=\"true\"\n                android:layout_alignParentBottom=\"true\"\n                android:layout_marginRight=\"24dp\"\n                android:background=\"#1E88E5\"\n                materialdesign:animate=\"true\"\n                materialdesign:iconDrawable=\"@drawable/ic_action_new\" /\u003e\n\u003c/RelativeLayout\u003e\n```\n\n######Float small button\n\n![float small button](images/float_small_button.png)\n\n```xml\n\u003ccom.gc.materialdesign.views.ButtonFloatSmall\n                android:id=\"@+id/buttonFloatSmall\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"#1E88E5\"\n                materialdesign:iconDrawable=\"@drawable/ic_action_new\" /\u003e\n```\n\n####Switches\n\n######CheckBox\n![checkbox](images/checkbox.png)\n\n```xml\n\u003ccom.gc.materialdesign.views.CheckBox\n                android:id=\"@+id/checkBox\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"#1E88E5\"\n                materialdesign:check=\"true\" /\u003e\n```\n\n######Switch\n![switch](images/switch.png)\n\n```xml\n\u003ccom.gc.materialdesign.views.Switch\n                android:id=\"@+id/switchView\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"#1E88E5\"\n                materialdesign:check=\"true\" /\u003e\n```\n\n####Progress indicators\n\n######Progress bar circular indeterminate\n![progress bar circular indeterminate](images/progress_bar_circular_indeterminate.png)\n\n```xml\n\u003ccom.gc.materialdesign.views.ProgressBarCircularIndeterminate\n                android:id=\"@+id/progressBarCircularIndeterminate\"\n                android:layout_width=\"32dp\"\n                android:layout_height=\"32dp\"\n                android:background=\"#1E88E5\" /\u003e\n```\n\n######Progress bar indeterminate\n![progress bar indeterminate](images/progress_bar_indeterminate.png)\n\n```xml\n\u003ccom.gc.materialdesign.views.ProgressBarIndeterminate\n                android:id=\"@+id/progressBarIndeterminate\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"#1E88E5\" /\u003e\n```\n\n######Progress bar indeterminate determinate\n![Progress bar indeterminate determinate](images/progress_bar_indeterminate_determinate.png)\n\n\n```xml\n\u003ccom.gc.materialdesign.views.ProgressBarIndeterminateDeterminate\n                android:id=\"@+id/progressBarIndeterminateDeterminate\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"#1E88E5\" /\u003e\n```\n\n\u003eIf you begin progrees, you only have to set progress it\n\u003e\n\u003e```java\n\u003eprogressBarIndeterminateDeterminate.setProgress(progress);\n\u003e```\n\n######Progress bar determinate\n![Progress bar determinate](images/progress_bar_determinate.png)\n\n\n```xml\n\u003ccom.gc.materialdesign.views.ProgressBarDeterminate\n                android:id=\"@+id/progressDeterminate\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"#1E88E5\" /\u003e\n```\n\n\u003eYou can custom max and min progress values with `materialdesign:max=\"50\"` and `materialdesign:min=\"25\"` attributes.\n\n######Slider\n![Slider](images/slider.png)\n\n\n```xml\n\u003ccom.gc.materialdesign.views.Slider\n                android:id=\"@+id/slider\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"#1E88E5\"\n                materialdesign:max=\"50\"\n                materialdesign:min=\"0\"\n                 /\u003e\n```\n\n######Slider with number indicator\n![Slider with number indicator](images/slider_with_number_indicator.png)\n\n\n```xml\n\u003ccom.gc.materialdesign.views.Slider\n                android:id=\"@+id/slider\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"#1E88E5\"\n                materialdesign:max=\"50\"\n                materialdesign:min=\"0\"\n                materialdesign:showNumberIndicator=\"true\"/\u003e\n```\n\n##Widgets\n\n####SnackBar\n\n![Snackbar](images/snackbar.png)\n\n\n```java\nSnackBar snackbar = new SnackBar(Activity activity, String text, String buttonText, View.OnClickListener onClickListener);\nsnackbar.show();\n```\n\n\u003e If you don't want to show the button, put `null` in `buttonText` attribute\n\n####Dialog\n\n![Dialog](images/dialog.png)\n\n```java\nDialog dialog = new Dialog(Context context,String title, String message);\ndialog.show();\n```\n\n\u003eYou can set the accept and cancel button on the event listener or change it's text\n\u003e```java\n\u003e // Set accept click listenner\n\u003edialog.setOnAcceptButtonClickListener(View.OnClickListener onAcceptButtonClickListener);\n\u003e // Set cancel click listenner\n\u003edialog.setOnCancelButtonClickListener(View.OnClickListener onCancelButtonClickListener);\n\u003e // Acces to accept button\n\u003eButtonFlat acceptButton = dialog.getButtonAccept();\n\u003e // Acces to cancel button\n\u003eButtonFlat cancelButton = dialog.getButtonCancel();\n\u003e```\n\n####Color selector\n\n![Color selector](images/color_selector.png)\n\n```java\nColorSelector colorSelector = new ColorSelector(Context context,int intialColor, OnColorSelectedListener onColorSelectedListener);\ncolorSelector.show();\n```\n\n\n\n\n\n","funding_links":[],"categories":["Index `(light-weight pages)`","Java","Uncategorized","Android","MD","Index","Libs","Android应用","\u003ca name=\"Libraries\"\u003eLibraries\u003c/a\u003e","Material Design 设计"],"sub_categories":["Uncategorized","Frameworks","\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget","资源传输下载","Personal Blog"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavasmdc%2FMaterialDesignLibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavasmdc%2FMaterialDesignLibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavasmdc%2FMaterialDesignLibrary/lists"}