AnimatedViewsForm - Android librarie that allows you to easily find and animate child views from one or multiple ViewGroups using their tag, type, visibility and much more.

Overview

ViewsFrom is an android librarie that allows you to easily find and animate child views from one or multiple ViewGroups using their tag, type, visibility and much more. This librairie is Android 14+ compatible.

This library is update for Jaouan's ViewForms Library https://github.com/Jaouan/ViewsFrom

demo

Installation

Gradle

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
	dependencies {
	        implementation 'com.github.MGRagab:AnimatedViewsForm:VERSION'
	}

Usage

Use Views class as entry point, and let the librarie guides you.

First example : Animate all visible views from rootView.

Views.from(rootView)
     .withVisibility(View.VISIBLE)
     .animateWith(context, R.anim.my_awesome_animation)
     .start();

Second example : Show all EditText with tags "example" from two group views.

Views.from(myFirstLinearLayout, mySecondLinearLayout)
     .withType(EditText.class)
     .withTag("example")
     .forEach((view, index, count) -> {
       view.setVisibility(View.VISIBLE);
     });

A bit more complete example that shows what you can do :

// Defines root views of your views finder.
Views.from(groupView1 /*, groupView2, ...*/)

     // Basics filters.
     .withTag("abc" /*, "efg", ...*/)
     .withTagRegex("[a-z]*" /*, "anotherRegex", ...*/)
     .withId(R.id.my_wonderful_id,  /*, R.id.my_another_id, ...*/)
     .withType(TextView.class /*, EditText.class, ...*/)
     .withVisibility(View.GONE /*, View.INVISIBLE, ...*/)

      // Negate "with*" filters by prefixing with "not" method.
      not().withId(R.id.one_more_id /*, R.id.gimme_more_id*/)

      // Custom filter.
     .filteredWith((view) -> {
       return /* your own filter */;
     })

     // Exclude views.
     .excludeView(myView1 /*, myViews2, ... */)

     // Options.
     .includingFromViews()
     .excludingChildsFromFilteredGroupViews()

     // Concate with a new views finder, with its own filters and options.
     .andFrom(group2)
     .withTag("xyz")
     
     // Order views.
     .orderedBy((view1, view2) -> {
       return /* your own comparator */;
     }

     // And animate them all !
     .animateWith(context, R.anim.my_awesome_animation)
     .withDelayBetweenEachChild(250)
     .withViewsVisibilityBeforeAnimation(View.INVISIBLE)
     .withEndAction(() -> {
       Log.i("ViewsFromLibExample", "It's finally over.");
     })
     .start();

You have 3 end points : Find, iterate and animate.

Find

Returns a views list.

Views.from(groupView)
     .find();
Iterate

Iterates all views.

Views.from(groupView)
     .forEach((view, index, count) -> {});
Animate
Views.from(groupView)
     .animateWith(() -> {
       return /* your animation instance */;
     })
     // or
     // .animateWith(context, R.anim.my_awesome_animation)
     .withDelayBetweenEachChild(250)
     .withViewsVisibilityBeforeAnimation(View.INVISIBLE)
     .withEndAction(() -> {})
     .start();

Views animator

If you know which views has to be animated, you can still use ViewsAnimator as below :

new ViewsAnimator(context, viewsIWantToAnimate, R.anim.my_smooth_animation)
     .withDelayBetweenEachChild(250)
     .withViewsVisibilityBeforeAnimation(View.INVISIBLE)
     .withEndAction(() -> {})
     .start();

ViewsAnimator's start() method can be called multiple times if you want.

// First call.
ViewsAnimator viewsAnimator = Views.from(groupView)
     .animateWith(context, R.anim.my_awesome_animation)
     .start();

// Second call.
myButton.setOnClickListener((view) -> {
  viewsAnimator.start();
});

Note

Be aware that when an end point is called, every child views are iterated in order to find which satisfies filters. If your layout is very complex, prefer using multiple little group views instead of one big root view.

License

Apache License Version 2.0

You might also like...
Postman is a reactive One-tap SMS verification library. This library allows the usage of RxJava with The SMS User Consent API
Postman is a reactive One-tap SMS verification library. This library allows the usage of RxJava with The SMS User Consent API

What is Postman? Postman is a reactive One-tap SMS verification library. This library allows the usage of RxJava with The SMS User Consent API Usage P

💳 A quick and easy flip view through which you can create views with two sides like credit cards, poker cards etc.
💳 A quick and easy flip view through which you can create views with two sides like credit cards, poker cards etc.

The article on how this library was created is now published. You can read it on this link here. →. 💳 EasyFlipView Built with ❤︎ by Wajahat Karim and

How to play DASH type content with ExoPlayer? 📺 📱 🎞
How to play DASH type content with ExoPlayer? 📺 📱 🎞

How to use ExoPlayer ▶️ with Kotlin in Android ❓ ExoPlayer is an application level media player for Android. It provides an alternative to Android’s M

Automatically manipulates the duration of animations dependent on view count. Quicksand .. the more you struggle.
Automatically manipulates the duration of animations dependent on view count. Quicksand .. the more you struggle.

QuickSand When showing a really enchanting explanatory animation to your users, but you know that after a while it'll get tedious and would stop users

You can easily access the top of the screen in Android. Like a iPhone 6 & 6 Plus.
You can easily access the top of the screen in Android. Like a iPhone 6 & 6 Plus.

Reachability on Android Easy access on top. Like a iPhone 6 & 6 Plus. demo apk Usage Add dependencies compile 'com.github.sakebook:Reachability:0.2.0@

Implementing multiple list animations in a walk-through series of articles.
Implementing multiple list animations in a walk-through series of articles.

List Animations In Compose This repository is the resource of a series of articles. Each branch represents the final version of a use case that was bu

BaseAnimation network Android animation set, custom controls, nearly 200 kinds of source code! BaseAnimation, if a new version is updated automatically to remind everyone, I hope everyone will contribute their animated XML files or other source, together to create this open source app!
A mix of random small libraries for Kotlin, the smallest reside here until big enough for their own repository.

klutter Random small libraries, usually extensions making other libraries happier. Versions later than 2.x are for JDK 8 and newer only. Maven Depende

Android library which allows you to swipe down from an activity to close it.
Android library which allows you to swipe down from an activity to close it.

Android Sliding Activity Library Easily create activities that can slide vertically on the screen and fit well into the Material Design age. Features

Releases(1.1.1)
Owner
Mohammed Gamal Ragab
Mohammed Gamal Ragab
POC of how you can animate LazyColumn insertions/deletions/moving

Animated LazyColumn/LazyRow POC of how you can animate LazyColumn/LazyRow insertions/deletions/moving Note, this is not production ready or a library,

Roudi Korkis Kanaan 33 Dec 24, 2022
Animated-splash-screen - Animate your Splash Screen using Lottie files.

Animated Splash Screen This small project shows how you can add animation into your android projects or create beautiful looking Splash Screen or Laun

Aashish Ace 0 Jan 2, 2022
Backarrow-animation-example - Animate back arrow to close button in Compose using animated drawables

Animate Back Arrow to Close Icon in Compose This is a simple demo for animated v

Jose Mateo 3 Feb 17, 2022
Android library to showcase/highlight the multiple views on same overlay

MultiLamp MultiLamp is simple and easy to use Android library to showcase/highlight the multiple views on the same overlay with some message. Gradle S

Ujwal Thote 234 Nov 22, 2022
Android library to animate Floating Action Button to Bottom Sheet Dialog and vice-versa

FabulousFilter Show some ❤️ and star the repo to support the project This library is the implementation of filter-concept posted on MaterialUp.com. It

Krupen Ghetiya 2.6k Jan 3, 2023
Animate a strike over any image to indicate on/off states. As seen in the Material Guidelines.

StrikedImageView Animate a strike over any image to indicate on/off states. As seen in the Material Guidelines. Gradle allprojects { repositories

null 9 Sep 21, 2022
Trying to play with Jetpack compose low level animations APIs, which are animate*AsState APIs.

ComposeSimpleAnimation Trying to play with Jetpack compose low level animations APIs, which are animate*AsState APIs that I needed in another project.

Mustafa Ibrahim 39 Dec 10, 2022
[] 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

Gokberk Ergun 516 Nov 25, 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
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