CircularTools


Source link: https://github.com/AutSoft/CircularTools

CircularTools

Circle based animations for Android (min. API 11)

Currently implemented:

Reveal:YouTube Transform:YouTube Radial reaction:YouTube

Sample

Demo in the source and releases

Note

Limitations

For reveal and transform:

  • it will never use the native ViewAnimationUtils.createCircularReveal method
  • currently there is an issue: views with elevation cannot be animated correctly on Lollipop and above.
    • workaround A: set the LayerType of the target (or source) view to LayerType.SOFTWARE
    • workaround B: wrap your target or (source) view with a simple layout, without elevation, and animate that. Demo reveal uses this method.
  • hardware acceleration cannot be used in every situation. See table below:
API 11-17 API 18+
Reveal Software Hardware
Transform Software Hardware

For radial reaction

  • only one reaction can be animated at the same time, in the same RadialReactionParent
  • only one layout implemented yet: a LinearLayout.
  • once an affectedView is reached, it will be removed from the list in the RadialReactionParent. If you want to animate multiple times, you have to add the views again. See demo for details.

Usage

For reveal and transform you have to wrap your animated views with a CircularFrameLayout.

<hu.aut.utillib.circular.widget.CircularFrameLayout

android:id="@+id/simple_reveal"

android:layout_width="match_parent"

android:layout_height="match_parent">

 <!-- Put any child views here if you want, it's stock FrameLayout  -->  </hu.aut.utillib.circular.widget.CircularFrameLayout>

Transform:

//myTargetView & mySourceView are children in the CircularFrameLayout float finalRadius = CircularAnimationUtils.hypo(width, height);
  //getCenter computes from 2 view: One is touched, and one will be animated, but you can use anything for center int[] center = CircularAnimationUtils.getCenter(fab, myTargetView);
  animator = CircularAnimationUtils.createCircularTransform(myTargetView, mySourceView, center[0], center[1], 0F, finalRadius);
 animator.setInterpolator(new AccelerateDecelerateInterpolator());
 animator.setDuration(1500);
 animator.start();
 

Reveal:

//myView is a child in the CircularFrameLayout float finalRadius = CircularAnimationUtils.hypo(width, height);
  //getCenter computes from 2 view: One is touched, and one will be animated, but you can use anything for center int[] center = CircularAnimationUtils.getCenter(fab, myView);
  animator = CircularAnimationUtils.createCircularReveal(myView, center[0], center[1], 0, finalRadius);
 animator.setInterpolator(new AccelerateDecelerateInterpolator());
 animator.setDuration(1500);
 animator.start();

 

For radial reaction you have to wrap your views -that are affected by the radial reaction- with a RadialReactionParent.

  • Wrap your view
  • Add a listener to it (this listener will be notified when the invisible circle reaches an affected view)
  • Add views to the parent's watchlist by calling addAffectedView(View v)
  • Create animation and start it
  • Get notified when the radial reaction's invisible circle reaches one of the affected view
<hu.aut.utillib.circular.widget.RadialReactionLinearLayout

android:id="@+id/reaction_parent"
  android:layout_width="match_parent"
  android:layout_height="match_parent">
<FrameLayout
android:id="@+id/child_1"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_alignParentTop="true"
android:layout_margin="10dp"
android:background="@color/material_deep_teal_500"
android:visibility="invisible" />

<!-- Put any child views here if you want, it's stock LinearLayout -->  </hu.aut.utillib.circular.widget.RadialReactionLinearLayout>

Radial reaction:

reactionParent = (RadialReactionParent) view.findViewById(R.id.reaction_parent);
 reactionParent.addListener(this);
  //add views reactionParent.addAffectedView(child1);
  ObjectAnimator animator = CircularAnimationUtils.createRadialReaction(reactionParent, fab, "action");
 animator.setInterpolator(new AccelerateDecelerateInterpolator());
 animator.setDuration(1500);
 animator.start();
  ...

@Override
  public void onRadialReaction(View affectedView, String action) {
  //Do what you want with the view
 
  
}
 

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 {

 compile 'com.github.AutSoft:CircularTools:1.1.0'  
}

License

The MIT License (MIT)  Copyright (c) 2015 AutSoft Kft.  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. 

Resources

FFmpeg-Android-Java:

  • FFmpeg for Android compiled with x264, libass, fontconfig, freetype and fribidi
  • Supports Android L

Supported Architecture:

  • armv7
  • armv7-neon
  • x86

Shape Image View provides a set of custom shaped android imageview components, and a framework to define more shapes. Implements both shader and bitmap mask based image views.

Toast-like alert pattern for Android inspired by the Google Material Design Spec

Features:

  • Set message text and optionally duration
  • Shows only one message at a time
  • Can have action item (e.g. undo, refresh, etc.)
  • Swipe down to dismiss all notifications as per documentation
  • Backwards compatible to 2.3.x

QuickUtils is a development library for the Android platform. It is intended to make application development easier and consistent through your applications.

Android library project for selecting/capturing multiple images from the device.

Features:

  • Allows taking pictures from camera as well.
  • Multi-selection of images from gallery.
  • Ability to select/capture images upto a specified limit.
  • Preview thumbnails of selected images.
  • No dependency.

It's Gradle Plug-in for Android Play-store Publisher API.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes