Convert Figma logo to code with AI

ozodrukh logoCircularReveal

Lollipop ViewAnimationUtils.createCircularReveal for everyone 4.0+

2,428
391
2,428
26

Top Related Projects

Modular and customizable Material Design UI components for Android

Render After Effects animations natively on Android and iOS, Web, and React Native

A curated list of awesome Android UI/UX libraries

Android Transition animations explanation with examples.

😍 A beautiful, fluid, and extensible dialogs API for Kotlin & Android.

A fluent Android animation library

Quick Overview

CircularReveal is an Android library that provides circular reveal animations for views. It allows developers to create visually appealing transitions and effects by revealing or hiding views in a circular pattern. This library extends the functionality of Android's native circular reveal animation, making it available for older versions of Android and offering additional customization options.

Pros

  • Supports older Android versions (pre-Lollipop)
  • Easy to integrate and use in Android projects
  • Provides smooth and visually appealing animations
  • Offers customization options for animation duration and interpolation

Cons

  • Limited to circular reveal animations only
  • May have performance impact on older devices
  • Not actively maintained (last update was several years ago)
  • Might not be necessary for newer Android versions with built-in circular reveal support

Code Examples

  1. Basic circular reveal animation:
// Reveal a view
CircularReveal.circularReveal(myView, centerX, centerY, startRadius, endRadius)
    .setDuration(1000)
    .start();
  1. Hiding a view with circular animation:
// Hide a view
CircularReveal.circularHide(myView, centerX, centerY, startRadius, endRadius)
    .setDuration(800)
    .setInterpolator(new AccelerateInterpolator())
    .start();
  1. Creating a circular reveal animation for a ViewGroup:
// Reveal all children of a ViewGroup
CircularReveal.createCircularReveal(myViewGroup, centerX, centerY, startRadius, endRadius)
    .setDuration(1200)
    .addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            // Animation completed
        }
    })
    .start();

Getting Started

To use CircularReveal in your Android project:

  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.ozodrukh:CircularReveal:2.1.0'
}
  1. Sync your project, and you're ready to use CircularReveal in your Android app!

Competitor Comparisons

Modular and customizable Material Design UI components for Android

Pros of material-components-android

  • Comprehensive library with a wide range of Material Design components
  • Officially maintained by Google, ensuring regular updates and compatibility
  • Extensive documentation and community support

Cons of material-components-android

  • Larger library size, potentially increasing app size
  • May require more setup and configuration for specific components
  • Learning curve for developers new to Material Design principles

Code Comparison

CircularReveal:

ViewAnimationUtils.createCircularReveal(view, centerX, centerY, startRadius, endRadius)
    .setDuration(duration)
    .start();

material-components-android:

MaterialShapeDrawable shapeDrawable = new MaterialShapeDrawable();
shapeDrawable.setShapeAppearanceModel(
    ShapeAppearanceModel.builder()
        .setAllCornerSizes(cornerSize)
        .build());
view.setBackground(shapeDrawable);

CircularReveal focuses specifically on circular reveal animations, while material-components-android provides a broader set of UI components and customization options. The code examples demonstrate the simplicity of CircularReveal for animations versus the more comprehensive approach of material-components-android for shape customization.

Render After Effects animations natively on Android and iOS, Web, and React Native

Pros of Lottie-Android

  • Supports complex animations created in Adobe After Effects
  • Extensive documentation and community support
  • Cross-platform compatibility (iOS, Android, Web)

Cons of Lottie-Android

  • Larger file size and potentially higher resource usage
  • Steeper learning curve for creating custom animations
  • Requires external tools (Adobe After Effects) for animation creation

Code Comparison

CircularReveal:

ViewAnimationUtils.createCircularReveal(view, centerX, centerY, startRadius, endRadius)
    .setDuration(duration)
    .start();

Lottie-Android:

LottieAnimationView animationView = findViewById(R.id.animation_view);
animationView.setAnimation(R.raw.animation);
animationView.playAnimation();

Summary

CircularReveal focuses on a specific animation effect (circular reveal) and is lightweight, while Lottie-Android offers a more comprehensive animation solution with broader capabilities. CircularReveal is easier to implement for its specific use case, but Lottie-Android provides greater flexibility and complexity in animations at the cost of a steeper learning curve and potentially higher resource usage.

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 additions and community contributions
  • Covers a wide range of UI elements and design patterns

Cons of awesome-android-ui

  • Not a standalone library, requires integration of individual components
  • May lead to dependency bloat if not carefully managed
  • Potential inconsistencies between different libraries in the collection

Code comparison

CircularReveal focuses on a specific animation effect:

ViewAnimationUtils.createCircularReveal(view, centerX, centerY, startRadius, endRadius);

awesome-android-ui doesn't provide direct code examples but links to various libraries. For instance, a ripple effect from one of its linked libraries:

RippleBackground rippleBackground = (RippleBackground)findViewById(R.id.content);
rippleBackground.startRippleAnimation();

Summary

CircularReveal is a specialized library for creating circular reveal animations, while awesome-android-ui is a curated list of various Android UI libraries and components. CircularReveal offers a focused solution for a specific effect, whereas awesome-android-ui provides a broader range of options but requires more effort to integrate and manage multiple dependencies. The choice between them depends on whether you need a specific animation effect or are looking for a comprehensive collection of UI resources.

Android Transition animations explanation with examples.

Pros of Material-Animations

  • Covers a wider range of Material Design animations and transitions
  • Provides more comprehensive examples and use cases
  • Includes animations for shared elements and activity transitions

Cons of Material-Animations

  • May be more complex to implement for simple reveal animations
  • Requires more setup and configuration for basic use cases
  • Potentially higher learning curve for developers new to Material Design

Code Comparison

CircularReveal:

ViewAnimationUtils.createCircularReveal(view, cx, cy, 0, finalRadius)
    .setDuration(1000)
    .start();

Material-Animations:

Transition transition = TransitionInflater.from(this)
    .inflateTransition(R.transition.explode);
getWindow().setExitTransition(transition);
startActivity(intent, ActivityOptions
    .makeSceneTransitionAnimation(this).toBundle());

CircularReveal focuses specifically on circular reveal animations, making it simpler for that particular effect. Material-Animations offers a broader range of animations but requires more setup for individual effects. CircularReveal may be preferable for projects needing only reveal animations, while Material-Animations is better suited for comprehensive Material Design implementations.

😍 A beautiful, fluid, and extensible dialogs API for Kotlin & Android.

Pros of material-dialogs

  • More comprehensive dialog solution with a wide range of customizable options
  • Actively maintained with frequent updates and bug fixes
  • Extensive documentation and community support

Cons of material-dialogs

  • Larger library size, which may impact app size and performance
  • Steeper learning curve due to more complex API and features
  • May require additional dependencies for certain functionalities

Code Comparison

CircularReveal:

ViewAnimationUtils.createCircularReveal(view, cx, cy, 0, finalRadius)
    .setDuration(1000)
    .start();

material-dialogs:

MaterialDialog(this).show {
    title(R.string.dialog_title)
    message(R.string.dialog_message)
    positiveButton(R.string.agree)
    negativeButton(R.string.disagree)
}

Summary

CircularReveal focuses specifically on circular reveal animations, providing a lightweight solution for this particular effect. On the other hand, material-dialogs offers a comprehensive dialog framework with extensive customization options, making it suitable for a wide range of dialog-related tasks in Android applications. While CircularReveal is more specialized and easier to implement for its specific use case, material-dialogs provides a more robust and feature-rich solution for creating various types of dialogs in Material Design style.

A fluent Android animation library

Pros of ViewAnimator

  • Offers a wider range of animation types, including fade, translation, scale, and rotation
  • Provides a fluent API for chaining multiple animations together
  • Supports animating multiple views simultaneously

Cons of ViewAnimator

  • May have a slightly higher learning curve due to its more extensive API
  • Potentially higher overhead for simple reveal animations compared to CircularReveal

Code Comparison

ViewAnimator:

ViewAnimator
    .animate(view1, view2)
        .scale(0f, 1f)
        .rotation(0f, 360f)
        .start()

CircularReveal:

Animator animator = ViewAnimationUtils.createCircularReveal(view, cx, cy, 0, finalRadius);
animator.start();

Key Differences

  • CircularReveal focuses specifically on circular reveal animations, while ViewAnimator offers a broader range of animation types
  • ViewAnimator allows for more complex, chained animations, whereas CircularReveal is more specialized for reveal effects
  • CircularReveal may be more performant for simple reveal animations, while ViewAnimator provides greater flexibility for diverse animation needs

Both libraries have their merits, with CircularReveal excelling in simplicity for reveal animations and ViewAnimator offering more versatility for various animation 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

CircularReveal

Lollipop ViewAnimationUtils.createCircularReveal for everyone 14+

Yotube Video
Circular Reveal

Checout demo application

How to use:

Use regular RevealFrameLayout & RevealLinearLayout don't worry, only target will be clipped :)

<io.codetail.widget.RevealFrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- Put more views here if you want, it's stock frame layout  -->

    <android.support.v7.widget.CardView
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/awesome_card"
        style="@style/CardView"
        app:cardBackgroundColor="@color/material_deep_teal_500"
        app:cardElevation="2dp"
        app:cardPreventCornerOverlap="false"
        app:cardUseCompatPadding="true"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginTop="8dp"
        android:layout_width="300dp"
        android:layout_height="300dp"
        android:layout_gravity="center_horizontal"
        />

</io.codetail.widget.RevealFrameLayout>

    View myView = findView(R.id.awesome_card);

    // get the center for the clipping circle
    int cx = (myView.getLeft() + myView.getRight()) / 2;
    int cy = (myView.getTop() + myView.getBottom()) / 2;

    // get the final radius for the clipping circle
    int dx = Math.max(cx, myView.getWidth() - cx);
    int dy = Math.max(cy, myView.getHeight() - cy);
    float finalRadius = (float) Math.hypot(dx, dy);

    // Android native animator
    Animator animator =
            ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);
    animator.setInterpolator(new AccelerateDecelerateInterpolator());
    animator.setDuration(1500);
    animator.start();

How to add dependency

This library is not released in Maven Central, but instead you can use JitPack

add remote maven url

	repositories {
	    maven {
	        url "https://jitpack.io"
	    }
	}

then add a library dependency

	dependencies {
	    implementation ('com.github.ozodrukh:CircularReveal:2.0.1@aar') {
	        transitive = true;
	    }
	}

License

The MIT License (MIT)

Copyright (c) 2016 Abdullaev Ozodrukh

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.