Convert Figma logo to code with AI

nico2sh logomaterialish-progress

A material style progress wheel compatible with 2.3

2,481
463
2,481
22

Top Related Projects

A material style progress wheel compatible with 2.3

Android loading animations

DEPRECATED

A curated list of awesome Android UI/UX libraries

A small Android library allowing you to have a smooth and customizable horizontal or circular indeterminate ProgressBar

Create circular ProgressBar in Android ⭕

Quick Overview

The materialish-progress project is a lightweight, customizable, and highly performant progress indicator library for web applications. It aims to provide a simple and elegant solution for displaying progress bars, spinners, and other loading indicators that adhere to the Material Design guidelines.

Pros

  • Lightweight and Performant: The library is designed to be lightweight and highly performant, ensuring smooth animations and minimal impact on application performance.
  • Customizable: The progress indicators can be easily customized in terms of color, size, and other visual aspects to fit the design of your application.
  • Accessibility-Focused: The library includes features to improve accessibility, such as support for screen readers and keyboard navigation.
  • Cross-Browser Compatibility: The progress indicators work seamlessly across a wide range of modern browsers, ensuring a consistent user experience.

Cons

  • Limited Functionality: The library primarily focuses on providing basic progress indicators, and may not offer advanced features or customization options compared to other progress indicator libraries.
  • Dependency on External Libraries: The library relies on the styled-components library for styling, which may add an additional dependency to your project.
  • Potential Learning Curve: Developers unfamiliar with styled-components may need to spend some time learning the library's syntax and conventions.
  • Lack of Comprehensive Documentation: The project's documentation could be more extensive, making it potentially challenging for new users to get started.

Code Examples

Here are a few examples of how to use the materialish-progress library:

  1. Displaying a Simple Progress Bar:
import { ProgressBar } from 'materialish/progress-bar';

const MyProgressBar = () => {
  return <ProgressBar progress={50} />;
};
  1. Customizing the Progress Bar Color:
import { ProgressBar } from 'materialish/progress-bar';

const MyProgressBar = () => {
  return <ProgressBar progress={75} color="#4CAF50" />;
};
  1. Displaying a Circular Spinner:
import { Spinner } from 'materialish/spinner';

const MySpinner = () => {
  return <Spinner />;
};
  1. Controlling the Spinner Size:
import { Spinner } from 'materialish/spinner';

const MySpinner = () => {
  return <Spinner size={48} />;
};

Getting Started

To get started with the materialish-progress library, follow these steps:

  1. Install the library using your preferred package manager:
npm install materialish
  1. Import the desired progress indicator components and use them in your React application:
import { ProgressBar, Spinner } from 'materialish';

const MyComponent = () => {
  return (
    <div>
      <ProgressBar progress={60} />
      <Spinner size={32} />
    </div>
  );
};
  1. Customize the progress indicators by passing in the appropriate props, such as color, size, and progress.

  2. Refer to the project's documentation for more advanced usage, such as applying custom styles or integrating the progress indicators with your application's state management.

Competitor Comparisons

A material style progress wheel compatible with 2.3

Pros of materialish-progress

  • Identical functionality and features
  • Same implementation and codebase
  • Consistent user experience

Cons of materialish-progress

  • No unique advantages over the other repository
  • Potential confusion due to duplicate repositories
  • Redundant maintenance efforts

Code comparison

Both repositories contain identical code, so a comparison is not applicable. Here's a sample of the shared code:

public class MaterialProgressBar extends ProgressBar {
    private static final int PROGRESS_START_MAX = 1000;
    private static final int PROGRESS_END_MAX = 100;
    private static final int DEFAULT_PROGRESS_DURATION = 1000;
    private static final int DEFAULT_CIRCLE_DURATION = 1000;
    private static final int DEFAULT_MINIMUM_ANGLE = 0;
    private static final int DEFAULT_MAXIMUM_ANGLE = 360;
    private static final int DEFAULT_STROKE_WIDTH = 4;

Summary

The comparison between materialish-progress and materialish-progress reveals that they are identical repositories. This situation doesn't provide any distinct advantages or disadvantages between the two, as they share the same codebase, functionality, and features. The existence of duplicate repositories may lead to confusion for users and developers, and it results in unnecessary duplication of maintenance efforts.

Android loading animations

Pros of Android-SpinKit

  • Offers a wider variety of animation styles (12 different types)
  • Provides more customization options for each animation
  • Includes a demo app for easy visualization of different styles

Cons of Android-SpinKit

  • Larger library size due to more animation options
  • May require more setup and configuration for specific animations
  • Some animations might be considered too flashy for certain app designs

Code Comparison

materialish-progress:

ProgressBar progressBar = (ProgressBar) findViewById(R.id.progress);
progressBar.setIndeterminateDrawable(new MaterialProgressDrawable(this, progressBar));

Android-SpinKit:

ProgressBar progressBar = (ProgressBar) findViewById(R.id.spin_kit);
SpinKitView spinKitView = new SpinKitView(this);
Sprite doubleBounce = new DoubleBounce();
spinKitView.setIndeterminateDrawable(doubleBounce);

Both libraries offer easy implementation, but Android-SpinKit requires an additional step to set the specific animation style. materialish-progress focuses on a single, material design-inspired progress indicator, while Android-SpinKit provides more variety and customization options. The choice between the two depends on the specific needs of the project, with materialish-progress being simpler and more focused, and Android-SpinKit offering more flexibility and visual options.

DEPRECATED

Pros of AVLoadingIndicatorView

  • Offers a wider variety of loading indicator styles (26 different types)
  • Provides smooth animations and customizable colors
  • Supports both determinate and indeterminate progress indicators

Cons of AVLoadingIndicatorView

  • Limited to Android platform, while materialish-progress supports both Android and iOS
  • May have a larger footprint due to the numerous indicator styles
  • Less focused on Material Design principles compared to materialish-progress

Code Comparison

AVLoadingIndicatorView:

AVLoadingIndicatorView avi = findViewById(R.id.avi);
avi.setIndicator("BallPulseIndicator");
avi.show();

materialish-progress:

ProgressBar progressBar = findViewById(R.id.progress);
progressBar.setIndeterminate(true);
progressBar.setVisibility(View.VISIBLE);

Both libraries offer simple implementation, but AVLoadingIndicatorView provides more options for customization in terms of indicator styles. materialish-progress focuses on providing a Material Design-compliant progress indicator with fewer options but potentially easier integration for projects adhering strictly to Material Design guidelines.

A curated list of awesome Android UI/UX libraries

Pros of awesome-android-ui

  • Comprehensive collection of UI libraries and components
  • Regularly updated with new contributions from the community
  • Covers a wide range of UI elements and design patterns

Cons of awesome-android-ui

  • Not a standalone library, requires additional implementation
  • May overwhelm developers with too many options
  • Potential inconsistency in quality across different libraries

Code comparison

materialish-progress:

MaterialProgressBar progressBar = new MaterialProgressBar(context);
progressBar.setIndeterminate(true);
progressBar.setProgressStyle(MaterialProgressBar.STYLE_HORIZONTAL);

awesome-android-ui (example using one of its listed libraries):

CircleProgressBar circleProgressBar = new CircleProgressBar(context);
circleProgressBar.setProgress(75);
circleProgressBar.setProgressBarColor(Color.BLUE);

Summary

materialish-progress is a focused library providing a specific progress bar implementation, while awesome-android-ui is a curated list of various UI libraries and components. materialish-progress offers a more straightforward implementation for developers seeking a material design progress bar, whereas awesome-android-ui provides a broader range of options but requires more research and integration effort. The choice between the two depends on the project's specific needs and the developer's preference for a targeted solution versus a comprehensive resource.

A small Android library allowing you to have a smooth and customizable horizontal or circular indeterminate ProgressBar

Pros of SmoothProgressBar

  • More customization options for animation styles and colors
  • Supports both horizontal and circular progress indicators
  • Better performance for complex animations

Cons of SmoothProgressBar

  • Larger library size due to additional features
  • Steeper learning curve for advanced customizations

Code Comparison

SmoothProgressBar:

SmoothProgressBar progressBar = findViewById(R.id.progressBar);
progressBar.setProgressiveStartSpeed(2);
progressBar.setProgressiveStopSpeed(3.4f);
progressBar.setColors(new int[]{Color.RED, Color.BLUE, Color.GREEN});

Materialish-Progress:

ProgressView progressView = findViewById(R.id.progressView);
progressView.setIndeterminate(true);
progressView.setColor(Color.BLUE);

Both libraries offer progress bar implementations for Android applications, but they differ in their approach and feature set. SmoothProgressBar provides more advanced customization options and animation styles, making it suitable for projects requiring complex progress indicators. However, this comes at the cost of a larger library size and potentially more complex implementation.

Materialish-Progress, on the other hand, offers a simpler API with fewer customization options, making it easier to implement for basic use cases. It has a smaller footprint and may be more suitable for projects where a straightforward progress indicator is sufficient.

The code comparison demonstrates the difference in complexity between the two libraries, with SmoothProgressBar requiring more lines of code for advanced customizations, while Materialish-Progress offers a more concise implementation for basic functionality.

Create circular ProgressBar in Android ⭕

Pros of CircularProgressBar

  • More customization options for the progress bar appearance
  • Supports both determinate and indeterminate progress modes
  • Includes animation options for smoother visual transitions

Cons of CircularProgressBar

  • Limited to circular progress bars only
  • May have a steeper learning curve due to more configuration options
  • Lacks some Material Design-specific features

Code Comparison

CircularProgressBar:

CircularProgressBar(context).apply {
    progress = 25
    progressMax = 100
    progressBarColor = Color.BLUE
    backgroundProgressBarColor = Color.GRAY
}

materialish-progress:

MaterialProgressBar progressBar = new MaterialProgressBar(context);
progressBar.setIndeterminate(true);
progressBar.setProgressStyle(MaterialProgressBar.STYLE_CIRCULAR);

Summary

CircularProgressBar offers more customization options and animation features, making it suitable for projects requiring detailed control over circular progress bars. However, it's limited to circular shapes and may be more complex to implement. materialish-progress provides a simpler API with Material Design-specific styles, but offers less customization. The choice between the two depends on the specific project requirements and design preferences.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

![](https://img.shields.io/badge/Methods and size-106 | 12 KB-e91e63.svg)

Material-ish Progress

A material style progress wheel compatible with 2.3

Try the demo app on Google Play:

Get it on Google Play

I needed to keep a consistent (or as close as possible) look in an app across all Android Versions. The progress wheel is quite cool in Lollipop, and pretty horrible on Gingerbread.

So I created this. This view uses Progress Wheel as a base, but has been almost completely rewritten (the original view uses handlers for updating the wheel).

This implementation tries to follow as close as possible the guidelines for the circular progress as described here.

This is how it looks in indeterminate mode (the spinSpeed here is 0.64 which is the default, look below how to change it):

spinning wheel

And in determinate mode (here the spinSpeed is set to 0.333):

spinning wheel

You can also have a linear determinate progress mode if you don't like the animation.

Download

You can copy the ProgressWheel.java (in the library module) and the attrs.xml content into your project. Or you can get the binaries from Maven central by adding in your build.gradle dependencies:

compile 'com.pnikosis:materialish-progress:1.7'

Usage

You can create your own progress wheel in xml like this (remeber to add xmlns:wheel="http://schemas.android.com/apk/res-auto"):

<com.pnikosis.materialishprogress.ProgressWheel
        android:id="@+id/progress_wheel"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        wheel:matProg_barColor="#5588FF"
        wheel:matProg_progressIndeterminate="true" />

Or in code:

ProgressWheel wheel = new ProgressWheel(context);
wheel.setBarColor(Color.BLUE);
...

Callback

Use setCallback(ProgressCallback) to assign a callback that will be called each time the progress changes. This way you can update a value on the progress alongside with the progress animation, or execute an action once the progress reaches a certain value. in the indeterminatge wheel, the callback is called with a value of -1.0f every time the animation cycle finishes (when the wheel shrinks back to its smaller size).

Indeterminate wheel

For making the wheel indeterminate, just call the spin() method. If you set a progress value, the wheel will stop spinning.

You have two methods for setting the progress:

progressWheel.setProgress(float value)

Sets the value, and the wheel will smoothly animate to that value. The speed of the animation is defined by the spinSpeed (can be set with setSpinSpeed, which number is the number of full turns per second)

progressWheel.setInstantProgress(float value)

Sets the value, and the wheel will instantly move to that value.

You can change other wheel properties such as the progress bar color, the wheel's background or the wheel's size and width.

Fill radius

In case you want the spinning wheel to fill the whole layout instead of having a fixed size, you can use matProg_fillRadius.

<com.pnikosis.materialishprogress.ProgressWheel
        android:id="@+id/progress_wheel"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        wheel:matProg_barColor="#5588FF"
        wheel:matProg_progressIndeterminate="true"
        wheel:matProg_fillRadius="true" />

This way, the wheel will be as big as the parent layout. Be warned though, if the parentlayout is not square, the wheel will become an oval since the wheel will always adapt to fill the parent view.

Other options

In the xml definition, besides the fillRadius property, you can set:

  • matProg_progressIndeterminate: boolean, if you want the wheel to spin right away.
  • matProg_barColor: color, sets the small bar's color (the spinning bar in the indeterminate wheel, or the progress bar)
  • matProg_barWidth: dimension, the width of the spinning bar
  • matProg_rimColor: color, the wheel's border color
  • matProg_rimWidth: dimension, the wheel's width (not the bar)
  • matProg_spinSpeed: float, the base speed for the bar in indeterminate mode, and the animation speed when setting a value on progress. The speed is in full turns per second, this means that if you set speed as 1.0, means that the bar will take one second to do a full turn.
  • matProg_barSpinCycleTime: integer, the time in milliseconds the indeterminate progress animation takes to complete (extending and shrinking the bar while spinning)
  • matProg_circleRadius: dimension, the radius of the progress wheel, it will be ignored if you set fillRadius to true
  • matProg_fillRadius: boolean, set to true if you want the progress wheel to fill the whole layout
  • matProg_linearProgress: boolean, set to true if you want a linear animation on the determinate progress (instead of the interpolated default one).

Versions

  • 1.0 Initial release
  • 1.1 The default speed is closer to the default progress wheel in Lollipop. Removed unused icons.
  • 1.2 Interpolated determinate progress, a new option to set a linear progress (which was the default before)
  • 1.3 Added a prefix to the attributes to avoid collisions, new callback called when the progress changes in the determinate wheel.
  • 1.4 Improved callback, now receives a value which is rounded to two decimals
  • 1.5 Callback is called with a value of -1.0f in the indeterminate wheel every time the animation cycle finishes, updated Gradle and support libraries
  • 1.7 Animations are disabled when the system preferences have disabled animations

License

Copyright 2014 Nico Hormazábal

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.