{"id":3466,"url":"https://github.com/zhanghai/MaterialProgressBar","last_synced_at":"2025-08-03T19:31:29.627Z","repository":{"id":33338255,"uuid":"36983055","full_name":"zhanghai/MaterialProgressBar","owner":"zhanghai","description":"Material Design ProgressBar with consistent appearance","archived":false,"fork":false,"pushed_at":"2020-07-03T20:09:32.000Z","size":4101,"stargazers_count":2217,"open_issues_count":6,"forks_count":278,"subscribers_count":66,"default_branch":"master","last_synced_at":"2024-11-30T13:04:15.237Z","etag":null,"topics":["android","android-library","material-design","progress-bar"],"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/zhanghai.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":"2015-06-06T14:31:56.000Z","updated_at":"2024-11-21T21:53:08.000Z","dependencies_parsed_at":"2022-07-12T16:10:27.997Z","dependency_job_id":null,"html_url":"https://github.com/zhanghai/MaterialProgressBar","commit_stats":null,"previous_names":["dreamingincodezh/materialprogressbar"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghai%2FMaterialProgressBar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghai%2FMaterialProgressBar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghai%2FMaterialProgressBar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghai%2FMaterialProgressBar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhanghai","download_url":"https://codeload.github.com/zhanghai/MaterialProgressBar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228561530,"owners_count":17937171,"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","material-design","progress-bar"],"created_at":"2024-01-05T20:16:42.308Z","updated_at":"2024-12-07T04:31:28.749Z","avatar_url":"https://github.com/zhanghai.png","language":"Java","funding_links":[],"categories":["Library","Java","Libraries"],"sub_categories":["GUI"],"readme":"# MaterialProgressBar\n\n![Icon](sample/src/main/launcher_icon-web.png)\n\nMaterial Design `ProgressBar` with consistent appearance on Android 4.0+.\n\n## Why MaterialProgressBar?\n\n- Consistent appearance on Android 4.0+.\n- Correct tinting across platforms.\n- Able to remove the intrinsic padding of framework `ProgressBar`.\n- Able to hide the progress background of framework horizontal `ProgressBar`.\n- Able to show a determinate circular progress.\n- Used as a drop-in replacement for framework `ProgressBar`.\n\n## Preview\n\n\u003ca href=\"https://play.google.com/store/apps/details?id=me.zhanghai.android.materialprogressbar.sample\" target=\"_blank\"\u003e\u003cimg alt=\"Google Play\" height=\"90\" src=\"https://play.google.com/intl/en_US/badges/images/generic/en_badge_web_generic.png\"/\u003e\u003c/a\u003e\n\n[Sample APK](//github.com/zhanghai/MaterialProgressBar/releases/download/v1.6.1/sample-release.apk)\n\nAndroid 4.4.4\n\n![Android 4.4.4](screenshot/android_4_4_4.png)\n\nSamsung Android 5.0.1 (native implementation fails to tint)\n\n![Samsung Android 5.0.1](screenshot/android_5_0_1_samsung.png)\n\nAndroid 6.0.1\n\n![Android 6.0.1](screenshot/android_6_0_1.png)\n\n## Integration\n\nGradle:\n\n```gradle\nimplementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'\n```\n\n## Usage\n\nYou can either simply use the [`MaterialProgressBar`](library/src/main/java/me/zhanghai/android/materialprogressbar/MaterialProgressBar.java) widget, or set drawables from this library on a regular `ProgressBar`.\n\n### Using Widget\n\nSimply replace your `ProgressBar` with `MaterialProgressBar`, and remember to apply corresponding style and attribute for correct behavior.\n\nFor example, to create an indeterminate horizontal `MaterialProgressBar`:\n\n```xml\n\u003cme.zhanghai.android.materialprogressbar.MaterialProgressBar\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    android:indeterminate=\"true\"\n    app:mpb_progressStyle=\"horizontal\"\n    style=\"@style/Widget.MaterialProgressBar.ProgressBar.Horizontal\" /\u003e\n```\n\nIn order to make your `ProgressBar` take the correct and consistent size on all versions, you will always need to use one of the styles from this library. The trick inside it is `android:minWidth`, `android:maxWidth` (and height) that controls the drawable size.\n\n- `Widget.MaterialProgressBar.ProgressBar`\n- `Widget.MaterialProgressBar.ProgressBar.Horizontal`\n- And more size and no-padding variants in [styles.xml](library/src/main/res/values/styles.xml)\n\nAvailable custom attributes:\n\n- `app:mpb_progressStyle`: Style of progress drawable: `circular` or `horizontal`. Defaults to `circular`.\n- `app:mpb_setBothDrawables`: Whether both determinate and indeterminate drawables should be set on this progress bar. Defaults to `false` (for performance). Should be set to `true` if you want to use both of the backported determinate and indeterminate drawables.\n- `app:mpb_useIntrinsicPadding`: Whether progress drawable should use its intrinsic padding. Defaults to `true`.\n- `app:mpb_showProgressBackground`: Whether progress drawable should show a progress background. Defaults to `true` for horizontal progress drawable, `false` otherwise.\n- `app:mpb_determinateCircularProgressStyle`: Style of determinate circular progress drawable: normal or dynamic. Defaults to `normal`.\n\n8 tint-related attributes such as `app:mpb_progressTint` and `app:mpb_progressTintMode` are also supported so that they can control the tinting of progress drawables. The default tint color is `?colorControlActivated`, and the default tint mode is `src_in`.\n\nFor a detailed example, you can refer to the [sample app's layout](//github.com/zhanghai/MaterialProgressBar/blob/master/sample/src/main/res/layout/main_activity.xml), where you can find examples such as removing progress padding or background.\n\n### Using Drawable\n\nThree Material Design drawables are backported to Android 4.0 (API 14), so you can create one and set it directly on your `ProgressBar`.\n\n- [`HorizontalProgressDrawable`](library/src/main/java/me/zhanghai/android/materialprogressbar/HorizontalProgressDrawable.java)\n- [`IndeterminateHorizontalProgressDrawable`](library/src/main/java/me/zhanghai/android/materialprogressbar/IndeterminateHorizontalProgressDrawable.java)\n- [`CircularProgressDrawable`](library/src/main/java/me/zhanghai/android/materialprogressbar/CircularProgressDrawable.java)\n- [`IndeterminateCircularProgressDrawable`](library/src/main/java/me/zhanghai/android/materialprogressbar/IndeterminateCircularProgressDrawable.java)\n\nFor example, to set a `IndeterminateHorizontalProgressDrawable` on a `ProgressBar`.\n\n```java\nprogressBar.setIndeterminateDrawable(new IndeterminateHorizontalProgressDrawable(this));\n```\n\nYou will also need to set a style from this library as in the section above.\n\nFor example, to define an indeterminate horizontal `ProgressBar`.\n\n```xml\n\u003cProgressBar\n            android:id=\"@+id/indeterminate_horizontal_progress\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:indeterminate=\"true\"\n            style=\"@style/Widget.MaterialProgressBar.ProgressBar.Horizontal\" /\u003e\n```\n\nDon't forget to create and set the drawable as above.\n\nYou can also customize the behavior of these drawables by calling `setShowBackground()` and `setUseIntrinsicPadding()`. Tint-related methods `setTint()`, `setTintList()` and `setTintMode()` are also backported so that you can use them directly, but remember to take these drawables as their actual type or `TintableDrawable` because VM won't be able to find these methods on `Drawable` for legacy platforms.\n\nIf you want to support API level \u003c 18, you'll need to workaround a canvas limitation as in [here](https://github.com/zhanghai/MaterialProgressBar/blob/0eee874b6fbd109eda2be01b7887647e589dcd9d/library/src/main/java/me/zhanghai/android/materialprogressbar/MaterialProgressBar.java#L122); Using `MaterialProgressBar` does this automatically.\n\nFor a detailed example, you can refer to the `onCreate()` method of the old sample's [`MainActivity`](//github.com/zhanghai/MaterialProgressBar/blob/7529ea854a04207fcbf768aa574110e49c511867/sample/src/main/java/me/zhanghai/android/materialprogressbar/sample/MainActivity.java) and its layout [main_activity.xml](//github.com/zhanghai/MaterialProgressBar/blob/7529ea854a04207fcbf768aa574110e49c511867/sample/src/main/res/layout/main_activity.xml).\n\n## ProGuard\n\nThe AAR of this library has already included a ProGuard configuration file to make `ObjectAnimator` work properly.\n\n## Older versions\n\nNeither Support v4 nor AppCompat v7 backported animation API to versions prior to ICS, and the [NineOldAndroids](https://github.com/JakeWharton/NineOldAndroids/) library has already been deprecated since people should all be using `minSdkVersion=\"14\"` now, so versions older than ICS are not supported.\n\n## License\n\n    Copyright 2015 Hai Zhang\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhanghai%2FMaterialProgressBar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhanghai%2FMaterialProgressBar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhanghai%2FMaterialProgressBar/lists"}