All Projects → zhanghai → Materialprogressbar

zhanghai / Materialprogressbar

Licence: apache-2.0
Material Design ProgressBar with consistent appearance

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Materialprogressbar

Progressbutton
Android Progress Button
Stars: ✭ 662 (-69.14%)
Mutual labels:  material-design, progress-bar
Hgcircularslider
A custom reusable circular / progress slider control for iOS application.
Stars: ✭ 2,240 (+4.43%)
Mutual labels:  progress-bar
React Upload Box
A minimal Upload component for React.
Stars: ✭ 169 (-92.12%)
Mutual labels:  progress-bar
React Native Paper Dates
Smooth and fast cross platform Material Design date and time picker for React Native Paper
Stars: ✭ 173 (-91.93%)
Mutual labels:  material-design
Materialdesign2
A beautiful app designed with Material Design 2 using Android X.
Stars: ✭ 170 (-92.07%)
Mutual labels:  material-design
Lkawavecircleprogressbar
一款带有双波浪动画的圆形进度指示器
Stars: ✭ 175 (-91.84%)
Mutual labels:  progress-bar
Materialnavigationview Android
📱 Android Library to implement Rich, Beautiful, Stylish 😍 Material Navigation View for your project with Material Design Guidelines. Easy to use.
Stars: ✭ 168 (-92.17%)
Mutual labels:  material-design
Preact Mdl
💥 A collection of Preact Components that encapsulate Google's Material Design Lite.
Stars: ✭ 179 (-91.66%)
Mutual labels:  material-design
Liquid progress indicator
A liquid progress indicator for Flutter
Stars: ✭ 176 (-91.79%)
Mutual labels:  progress-bar
React Nprogress
⌛️ A React primitive for building slim progress bars.
Stars: ✭ 173 (-91.93%)
Mutual labels:  progress-bar
Kross Hugo
Kross Creative Portfolio Template
Stars: ✭ 172 (-91.98%)
Mutual labels:  material-design
Material Design Guideline
A library for Android developers who want to create layout which follows Google material design principle.
Stars: ✭ 170 (-92.07%)
Mutual labels:  material-design
Morpheus
A Flutter package for easily implementing Material Design navigation transitions.
Stars: ✭ 177 (-91.75%)
Mutual labels:  material-design
Minimal Todo
Material To-Do App
Stars: ✭ 2,051 (-4.38%)
Mutual labels:  material-design
React Ui Roundup
A one-stop-shop for comparing the features of all the best React frameworks. Useful for designers and engineers alike!
Stars: ✭ 177 (-91.75%)
Mutual labels:  material-design
Materialdesign Svg
@mdi/svg Dist for Material Design Icons.
Stars: ✭ 166 (-92.26%)
Mutual labels:  material-design
Material Components Android
Modular and customizable Material Design UI components for Android
Stars: ✭ 13,128 (+512.03%)
Mutual labels:  material-design
Flutter kart
Sample flutter project based on udmey tutorial
Stars: ✭ 174 (-91.89%)
Mutual labels:  material-design
Alive Progress
A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!
Stars: ✭ 2,940 (+37.06%)
Mutual labels:  progress-bar
Colorsheet
A color picker bottom sheet 🌈
Stars: ✭ 179 (-91.66%)
Mutual labels:  material-design

MaterialProgressBar

Icon

Material Design ProgressBar with consistent appearance on Android 4.0+.

Why MaterialProgressBar?

  • Consistent appearance on Android 4.0+.
  • Correct tinting across platforms.
  • Able to remove the intrinsic padding of framework ProgressBar.
  • Able to hide the progress background of framework horizontal ProgressBar.
  • Able to show a determinate circular progress.
  • Used as a drop-in replacement for framework ProgressBar.

Preview

Google Play

Sample APK

Android 4.4.4

Android 4.4.4

Samsung Android 5.0.1 (native implementation fails to tint)

Samsung Android 5.0.1

Android 6.0.1

Android 6.0.1

Integration

Gradle:

implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'

Usage

You can either simply use the MaterialProgressBar widget, or set drawables from this library on a regular ProgressBar.

Using Widget

Simply replace your ProgressBar with MaterialProgressBar, and remember to apply corresponding style and attribute for correct behavior.

For example, to create an indeterminate horizontal MaterialProgressBar:

<me.zhanghai.android.materialprogressbar.MaterialProgressBar
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:indeterminate="true"
    app:mpb_progressStyle="horizontal"
    style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal" />

In 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.

  • Widget.MaterialProgressBar.ProgressBar
  • Widget.MaterialProgressBar.ProgressBar.Horizontal
  • And more size and no-padding variants in styles.xml

Available custom attributes:

  • app:mpb_progressStyle: Style of progress drawable: circular or horizontal. Defaults to circular.
  • 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.
  • app:mpb_useIntrinsicPadding: Whether progress drawable should use its intrinsic padding. Defaults to true.
  • app:mpb_showProgressBackground: Whether progress drawable should show a progress background. Defaults to true for horizontal progress drawable, false otherwise.
  • app:mpb_determinateCircularProgressStyle: Style of determinate circular progress drawable: normal or dynamic. Defaults to normal.

8 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.

For a detailed example, you can refer to the sample app's layout, where you can find examples such as removing progress padding or background.

Using Drawable

Three Material Design drawables are backported to Android 4.0 (API 14), so you can create one and set it directly on your ProgressBar.

For example, to set a IndeterminateHorizontalProgressDrawable on a ProgressBar.

progressBar.setIndeterminateDrawable(new IndeterminateHorizontalProgressDrawable(this));

You will also need to set a style from this library as in the section above.

For example, to define an indeterminate horizontal ProgressBar.

<ProgressBar
            android:id="@+id/indeterminate_horizontal_progress"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:indeterminate="true"
            style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal" />

Don't forget to create and set the drawable as above.

You 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.

If you want to support API level < 18, you'll need to workaround a canvas limitation as in here; Using MaterialProgressBar does this automatically.

For a detailed example, you can refer to the onCreate() method of the old sample's MainActivity and its layout main_activity.xml.

ProGuard

The AAR of this library has already included a ProGuard configuration file to make ObjectAnimator work properly.

Older versions

Neither Support v4 nor AppCompat v7 backported animation API to versions prior to ICS, and the NineOldAndroids library has already been deprecated since people should all be using minSdkVersion="14" now, so versions older than ICS are not supported.

License

Copyright 2015 Hai Zhang

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].