You don’t want your apps look and feel boring, do you? Add some bubbles!

Overview

#BubbleAnimationLayout Awesome Header image

Say hello to Bubble Animation Layout for Android by Cleveroad

You don’t want your apps look and feel boring, do you? Add some bubbles! Bubble Animation Layout for Android by Cleveroad is at your service. This component is extremely functional and suits all kinds of apps. It’s more than simple to get your app’s UI stand out and attract attention.

Demo image ####The animation is also available on Bubble Animation Layout for Android on YouTube in HD quality.

It’s easy to add some spice and create something outstanding with Cleveroad Bubble Animation Layout library. Be sure, your app users will appreciate your efforts and imaginative approach.

Awesome

Using

First, add gradle dependency into your build.gradle:

dependencies {
    compile 'com.cleveroad:bubbleanimation-layout:1.0.0'
}

Then you can declare it in you layout file like this:

<com.cleveroad.bubbleanimation.BubbleAnimationLayout
    android:id="@+id/animation_view"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@android:color/darker_gray"
    android:paddingBottom="@dimen/padding_s"
    android:paddingEnd="@dimen/padding_m"
    android:paddingStart="@dimen/padding_m"
    app:bav_animation_color="@color/base_red"
    app:bav_indicator_width="@dimen/indicator_width"
    >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/list_item_size"
        android:background="@android:color/white"
        app:bav_view_type="base_container"
        >
        ...
    </RelativeLayout>
    
    <RelativeLayout
        android:id="@+id/fl_context_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:bav_view_type="context_container"
        >
        ...
    </RelativeLayout>
    
</com.cleveroad.bubbleanimation.BubbleAnimationLayout>

BubbleAnimationLayout can contain only two children. One of them is base container (you can declare it with attribute app:bav_view_type="base_container") and another one is context container (you can declare it with attribute app:bav_view_type="context_container"). Be careful, layout calculates size by base container's layout params

Customization

Setup indicator and bubble animation color

You can change animation color with attribute 'app:bav_animation_color'

<com.cleveroad.bubbleanimation.BubbleAnimationLayout
    ...
    app:bav_animation_color="#b92714"
    >

or

 BubbleAnimationLayout mBalBaseView = ...;
 mBalBaseView.setAnimationColor(Color.YELLOW);

Setup indicator width

You can change indicator width with attribute 'app:bav_indicator_width'

<com.cleveroad.bubbleanimation.BubbleAnimationLayout
    ...
    app:bav_indicator_width="10dp"
    >

or

 BubbleAnimationLayout mBalBaseView = ...;
 mBalBaseView.setIndicatorWidth(30);

Show context container

You can show context container with animation (base container will be hidden)

 BubbleAnimationLayout mBalBaseView = ...;
 View contextView = findViewById(R.id.fl_context_view);
 Animator animator = ObjectAnimator.ofPropertyValuesHolder(contextView, PropertyValuesHolder.ofFloat("alpha", 0.0f, 1.0f))
                    .setDuration(500);
 mBalBaseView.showContextViewWithAnimation(animator);

or without animation

 BubbleAnimationLayout mBalBaseView = ...;
 mBalBaseView.showContextView();

Show base container

For displaying base container with animation call (context container and bubble view will be hidden)

 BubbleAnimationLayout mBalBaseView = ...;
 View contextView = findViewById(R.id.fl_context_view);
 Animator animator = ObjectAnimator.ofPropertyValuesHolder(contextView, PropertyValuesHolder.ofFloat("alpha", 1.0f, 0.0f))
                    .setDuration(500);
 mBalBaseView.showBaseViewWithAnimation(animator);

or without animation

 BubbleAnimationLayout mBalBaseView = ...;
 mBalBaseView.showBaseView();

Show/hide bubble view

You can show bubble view with animation (for handling ending of animation specify BubbleAnimationEndListener)

 BubbleAnimationLayout mBalBaseView = ...;
 mBalBaseView.showBubbleViewWithAnimation(new BubbleAnimationLayout.BubbleAnimationEndListener() {
     @Override
     public void onEndAnimation(boolean isForwardAnimation, Animator animation) {
        //Do something
     }
 });

or without animation

 BubbleAnimationLayout mBalBaseView = ...;
 mBalBaseView.showBubbledView();

For hiding with animation (for handling ending of animation specify BubbleAnimationEndListener) call

 BubbleAnimationLayout mBalBaseView = ...;
 mBalBaseView.hideBubbledViewWithAnimation(new BubbleAnimationLayout.BubbleAnimationEndListener() {
     @Override
     public void onEndAnimation(boolean isForwardAnimation, Animator animation) {
        //Do something
     }
 });

or without animation

 BubbleAnimationLayout mBalBaseView = ...;
 mBalBaseView.hideBubbledView();

Reset view

Call BubbleAnimationLayout#resetView() to reset view to initial state

 BubbleAnimationLayout mBalBaseView = ...;
 mBalBaseView.resetView();

Handling ending of animation

For handling animation's ending declare BubbleAnimationEndListener

 BubbleAnimationLayout mBalBaseView = ...;
 mBalBaseView.addAnimationEndListener(new BubbleAnimationLayout.BubbleAnimationEndListener() {
     @Override
     public void onEndAnimation(boolean isForwardAnimation, Animator animation) {
         //Do something
     }
 });

Usage in the list item

If you call BubbleAnimationLayout#hideBubbledViewWithAnimation(BubbleAnimationEndListener) and scroll animation will show in recycled view. E.g. you can lock scroll while animation will end for resolving this issue.

 private static class NonScrollLinearLayoutManager extends LinearLayoutManager {
 
         private boolean mCanScroll = true;
 
         public NonScrollLinearLayoutManager(Context context) {
             super(context);
         }
 
         @SuppressWarnings("unused")
         public NonScrollLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
             super(context, orientation, reverseLayout);
         }
 
         @SuppressWarnings("unused")
         public NonScrollLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
             super(context, attrs, defStyleAttr, defStyleRes);
         }
 
         @Override
         public boolean canScrollHorizontally() {
             return super.canScrollHorizontally() && mCanScroll;
         }
 
         @Override
         public boolean canScrollVertically() {
             return super.canScrollVertically() && mCanScroll;
         }
 }
 
 {
    ...
    RecyclerView rvUsers = ...;
    rvUsers.setHasFixedSize(true);
    final NonScrollLinearLayoutManager layoutManager = new NonScrollLinearLayoutManager(this);
    rvUsers.setLayoutManager(layoutManager);
    layoutManager.mCanScroll = false;   
    ...
 }

Support

If you have any questions regarding the use of this tutorial, please contact us for support at [email protected] (email subject: «Bubble Animation Layout for Android. Support request.»)
or
Use our contacts:
Cleveroad.com
Facebook account
Twitter account
Google+ account

License

    The MIT License (MIT)

    Copyright (c) 2015-2016 Cleveroad

    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.
You might also like...
💠Metaphor is the library to easily add Material Motion animations
💠Metaphor is the library to easily add Material Motion animations

Metaphor Metaphor is the library to easily add Material Motion animations. Who's using Metaphor? 👉 Check out who's using Metaphor Include in your pro

Add Animatable Material Components in Android Jetpack Compose.  Create jetpack compose animations painless.
Add Animatable Material Components in Android Jetpack Compose. Create jetpack compose animations painless.

AnimatableCompose Add Animatable Material Components in Android Jetpack Compose. Create jetpack compose animation painless. What you can create from M

Road Runner is a library for android which allow you to make your own loading animation using a SVG image
Road Runner is a library for android which allow you to make your own loading animation using a SVG image

Road Runner Road Runner is a library for android which allow you to make your own loading animation using a SVG image Sample video View in Youtube Dem

AppIntroAnimation is a set of code snippets to make cool intro screen for your app with special Image Translation and Transformation animation effects. It is very easy to use and customize without adding third party library integrations.
A Java library that models spring dynamics and adds real world physics to your app.

Rebound About Rebound is a java library that models spring dynamics. Rebound spring models can be used to create animations that feel natural by intro

[] Easily have blurred and transparent background effect on your Android views.
[] Easily have blurred and transparent background effect on your Android views.

##[DEPRECATED] BlurBehind Easily have blurred and transparent background effect on your Android views. Before API level 14 there was a Window flag cal

A Java library that models spring dynamics and adds real world physics to your app.

Rebound About Rebound is a java library that models spring dynamics. Rebound spring models can be used to create animations that feel natural by intro

create your custom themes and change them dynamically with ripple animation
create your custom themes and change them dynamically with ripple animation

Android Animated Theme Manager create your custom themes and change them dynamically with ripple animation Features support java and kotlin projects.

FadingToolbar is an animation library which fades out your footer view in a ScrollView/RecyclerView and fades in a toolbar title
FadingToolbar is an animation library which fades out your footer view in a ScrollView/RecyclerView and fades in a toolbar title

FadingToolbar is an animation library which fades out your footer view in a ScrollView/RecyclerView and fades in a toolbar title (analogue of the LargeTitle animation in iOS)

Owner
Cleveroad
Professional web and mobile development company. Full-cycle IT development!
Cleveroad
Introduction your app to the user , Easy to use and set Items as you want

Introduction App This lib helps to introduce the App-by view page based on Kotlin. Features Easy Set up Items: Title, Describe, Background, Buttons Ap

S.M.Zendehbad 0 May 6, 2022
💪 Rich Android Path. 🤡 Draw as you want. 🎉 Animate much as you can.

?? Rich Android Path. ?? Draw as you want. ?? Animate much as you can. Download sample app: Features Full Animation Control on Paths and VectorDrawabl

Ahmed Tarek 2.3k Dec 20, 2022
An android project presenting some transitions you can use between activities

ActivityTransition An android project presenting some transitions you can use between activities #Integration Add the anim folder to your Android proj

null 260 Nov 29, 2022
This library provides easy ways to add onboarding or pager screens with different animation and indicators.

WalkThroughAndroid Make amazing OnBoarding Screens easily for your app with different colorful animations, fonts, styles, and many more. Customize you

MindInventory 33 Sep 9, 2022
[] An Android library which allows developers to easily add animations to ListView items

DEPRECATED ListViewAnimations is deprecated in favor of new RecyclerView solutions. No new development will be taking place, but the existing versions

Niek Haarman 5.6k Dec 30, 2022
A Toggling Add/Remove button

Cross View Add a CrossView to your layout <cdflynn.android.library.crossview.CrossView android:id="@+id/sample_cross_view" android

Collin Flynn 321 Nov 25, 2022
EtsyBlur is an Android library that allows developers to easily add a glass-like blur effect implemented in the Etsy app.

EtsyBlur EtsyBlur is an Android library that allows developers to easily add a glass-like blur effect implemented in the past Etsy app. Try out the sa

Manabu S. 755 Dec 29, 2022
An easy, flexible way to add a shimmering effect to any view in an Android app.

Shimmer for Android Shimmer is an Android library that provides an easy way to add a shimmer effect to any view in your Android app. It is useful as a

Facebook 5.1k Dec 26, 2022
Easily add slide to dismiss functionality to an Activity

Slidr Easily add slide-to-dismiss functionality to your Activity by calling Slidr.attach(this) in your onCreate(..) method. Usage An example usage: pu

Drew Heavner 2.7k Jan 6, 2023
Library provides an easy way to a add shimmer effect in Android Compose project.

Add a shimmer effect to the layout in Android Compose

Valery 66 Dec 14, 2022