Convert Figma logo to code with AI

yankai-victor logoLoading

Android loading view

1,228
203
1,228
13

Top Related Projects

Delightful, performance-focused pure css loading animations.

19,349

A collection of loading indicators animated with CSS

A collection of loading spinners animated with CSS

3,516

This could take a while

🔮 CSS loading animations made with single element.

Quick Overview

Loading is an Android library that provides customizable loading animations for Android applications. It offers a variety of pre-built loading styles and allows developers to create their own custom loading animations easily.

Pros

  • Wide range of pre-built loading animations
  • Easy to implement and customize
  • Lightweight and efficient
  • Supports both Java and Kotlin

Cons

  • Limited documentation and examples
  • Not actively maintained (last update was in 2018)
  • May not be compatible with the latest Android versions
  • Lacks advanced features like progress indicators

Code Examples

  1. Basic usage:
val loading = Loading(context)
loading.setLoadingColor(Color.WHITE)
loading.show()

This code creates a basic loading animation with white color.

  1. Custom loading style:
val loading = Loading(context)
loading.setLoadingStyle(Loading.STYLE_DOUBLE_BOUNCE)
loading.show()

This example sets a specific loading style (double bounce) before showing the animation.

  1. Customizing size and color:
val loading = Loading(context)
loading.setSize(100)
loading.setLoadingColor(Color.BLUE)
loading.show()

This code creates a loading animation with a custom size and blue color.

Getting Started

To use Loading in your Android project:

  1. Add the JitPack repository to your root build.gradle:
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  1. Add the dependency to your app's build.gradle:
dependencies {
    implementation 'com.github.yankai-victor:Loading:1.0.0'
}
  1. Use the Loading class in your Activity or Fragment:
import com.victor.loading.rotate.Loading

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val loading = Loading(this)
        loading.show()
    }
}

Competitor Comparisons

Delightful, performance-focused pure css loading animations.

Pros of loaders.css

  • More comprehensive collection of loaders (42 different animations)
  • Pure CSS implementation, no JavaScript required
  • Customizable through SASS variables

Cons of loaders.css

  • Larger file size due to more animations
  • Less focused on specific use cases
  • May require more customization for integration

Code Comparison

Loading:

public class AVLoadingIndicatorView extends View {
    // Implementation of a single loading indicator
}

loaders.css:

.loader-inner.ball-pulse > div {
  background-color: #fff;
  width: 15px;
  height: 15px;
  border-radius: 100%;
  margin: 2px;
  animation-fill-mode: both;
}

Summary

Loading is a Java-based Android library focusing on specific loading indicators, while loaders.css is a pure CSS solution offering a wider variety of animations. Loading may be more suitable for Android-specific projects, whereas loaders.css provides greater flexibility for web applications. The choice between the two depends on the target platform and the desired level of customization.

19,349

A collection of loading indicators animated with CSS

Pros of SpinKit

  • More comprehensive collection of loading animations (12 different styles)
  • Better browser compatibility, including support for older versions
  • Minimal and clean CSS-only implementation, reducing dependencies

Cons of SpinKit

  • Less customization options for individual animations
  • Larger file size due to the variety of animations included
  • No built-in JavaScript API for dynamic control of animations

Code Comparison

SpinKit (CSS):

.spinner {
  width: 40px;
  height: 40px;
  background-color: #333;
  margin: 100px auto;
  -webkit-animation: sk-rotateplane 1.2s infinite ease-in-out;
  animation: sk-rotateplane 1.2s infinite ease-in-out;
}

Loading (XML):

<com.victor.loading.rotate.RotateLoading
    android:id="@+id/rotateloading"
    android:layout_width="80dp"
    android:layout_height="80dp"
    app:loading_width="5dp"
    app:loading_color="#ffffff"/>

SpinKit focuses on CSS-based animations for web applications, offering a wide range of pre-built loading indicators. It's easy to implement and works across various browsers. Loading, on the other hand, is specifically designed for Android applications, providing more customization options and a Java API for programmatic control. While SpinKit excels in simplicity and browser support, Loading offers better integration with Android development workflows and more fine-grained control over individual animations.

A collection of loading spinners animated with CSS

Pros of css-loaders

  • Pure CSS implementation, no JavaScript required
  • Lightweight and easy to integrate into existing projects
  • Wide variety of loader styles (8 different options)

Cons of css-loaders

  • Limited customization options for each loader style
  • No built-in functionality for showing/hiding loaders dynamically

Code Comparison

css-loaders:

.loader {
  border: 16px solid #f3f3f3;
  border-top: 16px solid #3498db;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: spin 2s linear infinite;
}

Loading:

public class LoadingView extends View {
    private int mCircleColor;
    private float mCircleRadius;
    private float mCircleX;
    private float mCircleY;
}

css-loaders uses CSS animations to create loading effects, while Loading uses Java to draw and animate custom views. css-loaders is more lightweight and easier to implement, but Loading offers more flexibility and customization options.

css-loaders is ideal for quick integration of simple loading animations, whereas Loading is better suited for projects requiring complex, customizable loading indicators with programmatic control.

3,516

This could take a while

Pros of loading

  • Simpler and more lightweight implementation
  • Focuses on a single, customizable loading animation
  • Easy to integrate into React projects

Cons of loading

  • Limited variety of loading animations
  • Less customization options for appearance
  • Lacks support for non-React projects

Code Comparison

loading:

import React from 'react'
import Loading from 'loading'

const MyComponent = () => (
  <Loading size={32} />
)

Loading:

LoadingView loadingView = new LoadingView(this);
loadingView.setLoadingText("Loading...");
loadingView.show();

Summary

Loading offers a wider range of loading animations and supports multiple platforms, including Android and iOS. It provides more customization options for appearance and behavior. On the other hand, loading is a simpler, React-focused solution that offers a single, customizable loading animation. Loading is more suitable for projects requiring diverse loading indicators across different platforms, while loading is ideal for React applications seeking a lightweight, easy-to-implement loading component.

🔮 CSS loading animations made with single element.

Pros of three-dots

  • Lightweight and focused solely on CSS-based loading animations
  • Offers a wider variety of animation styles (30+) compared to Loading
  • Easier to customize and integrate into existing projects due to its simplicity

Cons of three-dots

  • Limited to dot-based animations, while Loading offers more diverse loading indicators
  • Lacks JavaScript functionality for dynamic control of animations
  • No built-in support for changing colors or sizes of animations

Code Comparison

three-dots:

.dot-elastic {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background-color: #9880ff;
  animation: dot-elastic 1s infinite linear;
}

Loading:

public class AVLoadingIndicatorView extends View {
    private Indicator mIndicator;
    private int mIndicatorColor;
    private boolean mShouldStartAnimationDrawable;
    
    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        drawIndicator(canvas);
    }
}

The code comparison shows that three-dots uses pure CSS for animations, while Loading relies on Java for more complex, customizable indicators. three-dots is simpler to implement but less flexible, whereas Loading offers more control at the cost of increased complexity.

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

Loading

Loading is a poject with kinds of Android loading view.

Yan can see the wiki for more detail.

RotateLoading

RotateLoading

BookLoading

BookLoading

NewtonCradleLoading

NewtonCradleLoading

Usage

gradle

implementation 'com.victor:lib:1.0.4'

Xamarin.Android binding version here

License

Copyright 2015 yankai-victor

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or 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.