Convert Figma logo to code with AI

dodola logoMetaballLoading

A 2d metaball loading

1,526
299
1,526
3

Top Related Projects

Android loading animations

DEPRECATED

A curated list of awesome Android UI/UX libraries

a simple loadingview for android with animation

高仿新版58 加载动画

Some beautiful android loading drawable, can be combined with any view as the LoadingView or the ProgressBar. Besides, some Drawable can customize the loading progress too.

Quick Overview

MetaballLoading is an Android library that provides a customizable loading animation using metaballs. It offers a visually appealing and smooth loading effect that can be easily integrated into Android applications. The library is inspired by the metaball loading animation concept and implements it using OpenGL ES.

Pros

  • Unique and visually attractive loading animation
  • Customizable appearance with various parameters
  • Smooth performance using OpenGL ES
  • Easy integration into Android projects

Cons

  • Limited to Android platform only
  • Requires OpenGL ES support
  • May have a learning curve for developers unfamiliar with OpenGL
  • Limited documentation and examples

Code Examples

  1. Basic usage:
val metaballView = MetaballView(context)
layout.addView(metaballView)
metaballView.start()
  1. Customizing appearance:
metaballView.apply {
    setMetaballNumber(5)
    setMetaballSize(50f)
    setMetaballMaxDistance(200f)
    setMetaballColor(Color.BLUE)
}
  1. Stopping the animation:
metaballView.stop()

Getting Started

  1. Add the JitPack repository to your project's build.gradle:
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  1. Add the dependency to your app's build.gradle:
dependencies {
    implementation 'com.github.dodola:MetaballLoading:1.0.1'
}
  1. Add the MetaballView to your layout XML or create it programmatically:
<com.dodola.metaball.MetaballView
    android:id="@+id/metaballView"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
  1. Start the animation in your activity or fragment:
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    val metaballView = findViewById<MetaballView>(R.id.metaballView)
    metaballView.start()
}

Competitor Comparisons

Android loading animations

Pros of Android-SpinKit

  • Offers a wider variety of loading animations (over 30 styles)
  • Provides easier customization options for colors and sizes
  • Has better documentation and usage examples

Cons of Android-SpinKit

  • Larger library size due to more animation options
  • May have a slightly higher performance overhead for complex animations
  • Less focused on a specific animation style (MetaballLoading specializes in metaball effects)

Code Comparison

MetaballLoading:

MetaballView metaballView = findViewById(R.id.metaball);
metaballView.setPaintMode(MetaballView.PaintMode.STROKE);
metaballView.setColor(Color.WHITE);
metaballView.start();

Android-SpinKit:

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

Both libraries offer easy-to-use APIs for implementing loading animations in Android applications. MetaballLoading focuses specifically on metaball-style animations, while Android-SpinKit provides a broader range of animation styles. The choice between the two depends on the specific animation requirements and the desired level of customization for your project.

DEPRECATED

Pros of AVLoadingIndicatorView

  • Offers a wider variety of loading animations (29 different styles)
  • Provides easier customization options for colors and sizes
  • Has better documentation and usage examples

Cons of AVLoadingIndicatorView

  • Larger library size due to the number of animations
  • May have higher memory usage when multiple indicators are used simultaneously
  • Less focus on a specific, unique animation style

Code Comparison

MetaballLoading:

MetaballView metaballView = new MetaballView(this);
metaballView.setPaintMode(MetaballView.PaintMode.STROKE);
metaballView.setColor(Color.WHITE);
metaballView.start();

AVLoadingIndicatorView:

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

Both libraries offer simple implementation, but AVLoadingIndicatorView provides more options for customization and animation styles. MetaballLoading focuses on a specific, visually appealing metaball animation, while AVLoadingIndicatorView offers a broader range of loading indicators suitable for various use cases.

A curated list of awesome Android UI/UX libraries

Pros of awesome-android-ui

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

Cons of awesome-android-ui

  • Not a standalone library, requires additional implementation
  • May overwhelm developers with too many options
  • Lacks specific focus on loading animations

Code comparison

MetaballLoading:

mMetaballView = (MetaballView) findViewById(R.id.metaball);
mMetaballView.setPaintMode(MetaballView.PaintMode.STROKE);
mMetaballView.setColor(Color.WHITE);
mMetaballView.setMoveRange(-1);

awesome-android-ui: No direct code comparison available as it's a curated list, not a library.

Summary

MetaballLoading is a specific loading animation library, while awesome-android-ui is a comprehensive collection of Android UI/UX resources. MetaballLoading offers a unique, customizable loading animation, whereas awesome-android-ui provides a wide range of UI components and libraries for various purposes. Developers looking for a specific loading animation might prefer MetaballLoading, while those seeking inspiration or a variety of UI options would benefit from awesome-android-ui.

a simple loadingview for android with animation

Pros of LoadingView

  • Offers a wider variety of loading animations and styles
  • Provides more customization options for colors, sizes, and shapes
  • Includes additional utility views like progress bars and rating stars

Cons of LoadingView

  • May have a larger footprint and impact on app performance due to more complex animations
  • Potentially steeper learning curve with more options and configurations to manage
  • Less focused on a specific animation style compared to MetaballLoading's metaball effect

Code Comparison

MetaballLoading:

mMetaballView = new MetaballView(this);
mMetaballView.setPaintMode(MetaballView.PaintMode.STROKE);
mMetaballView.setColor(Color.WHITE);
mMetaballView.setMetaballSize(20);

LoadingView:

LVCircularRing loadingView = new LVCircularRing(this);
loadingView.setViewColor(Color.rgb(255, 59, 48));
loadingView.setRoundColor(Color.WHITE);
loadingView.setBarWidth(8);
loadingView.startAnim();

Both repositories provide Android loading animations, but LoadingView offers a broader range of options and styles. MetaballLoading focuses specifically on the metaball effect, potentially offering a more polished implementation of that particular animation. LoadingView's versatility comes at the cost of increased complexity, while MetaballLoading provides a simpler, more focused solution for developers seeking the metaball effect.

高仿新版58 加载动画

Pros of android-shapeLoadingView

  • Offers multiple shape options (circle, rectangle, triangle) for loading animation
  • Includes a text label option below the loading animation
  • Provides easy customization of colors and animation speed

Cons of android-shapeLoadingView

  • Limited to predefined shapes, less fluid than MetaballLoading's liquid-like animation
  • May have higher performance overhead due to shape transformations
  • Less visually unique compared to MetaballLoading's distinctive style

Code Comparison

MetaballLoading:

val metaballView = MetaballView(context)
metaballView.setColor(Color.RED)
metaballView.start()

android-shapeLoadingView:

ShapeLoadingDialog shapeLoadingDialog = new ShapeLoadingDialog(context);
shapeLoadingDialog.setLoadingText("Loading...");
shapeLoadingDialog.show();

Both libraries offer simple implementation, but android-shapeLoadingView provides more built-in options for customization in its dialog setup. MetaballLoading focuses on a specific animation style with minimal configuration.

The choice between these libraries depends on the desired visual effect and level of customization needed. MetaballLoading offers a unique, fluid animation, while android-shapeLoadingView provides more traditional loading indicators with shape variations.

Some beautiful android loading drawable, can be combined with any view as the LoadingView or the ProgressBar. Besides, some Drawable can customize the loading progress too.

Pros of LoadingDrawable

  • More diverse loading animations, including circular, gear, and water drop styles
  • Better customization options for colors, sizes, and animation speeds
  • Smoother animations with hardware acceleration support

Cons of LoadingDrawable

  • Larger codebase, potentially leading to increased app size
  • Steeper learning curve due to more complex implementation
  • May have higher performance overhead for simpler loading scenarios

Code Comparison

MetaballLoading:

MetaballView metaballView = findViewById(R.id.metaball);
metaballView.setPaintMode(MetaballView.PaintMode.FILL);
metaballView.setColor(Color.RED);
metaballView.start();

LoadingDrawable:

LoadingView loadingView = findViewById(R.id.loading_view);
CircularJumpLoadingRenderer renderer = new CircularJumpLoadingRenderer(this);
renderer.setColors(new int[]{Color.RED, Color.GREEN, Color.BLUE});
loadingView.setLoadingRenderer(renderer);

Both libraries offer Android loading animations, but LoadingDrawable provides more variety and customization options at the cost of increased complexity. MetaballLoading focuses on a specific metaball effect, making it simpler to implement for that particular style. Choose based on your project's specific needs and complexity requirements.

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

MetaballLoading

A 2d metaball loading


##ScreenShot

GIF example

##Update

###1. 增加了调试模式,可以调整参数看看对图形的影响

GIF example

License

The MIT License (MIT)

Copyright (c) 2015 dodola

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.