• Stars
    star
    396
  • Rank 105,639 (Top 3 %)
  • Language
    Java
  • Created over 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Realtime interpolator editor(Inspired by Facebook Rebound)

RapidInterpolator

A Java library that adjust interpolator dynamicly(Inspired by Facebook Rebound)

As a UI Prototype Designer.The most painful part is compiling.After I finished the code work.I had to wait for about 10 seconds. So I write this for adjust animation's Parameter efficiently.

Example:

Show

Import:

1.Add these into your project.

InterpolatorAnimator.java
InterpolatorConfig.java
InterpolatorConfigRegistry.java
InterpolatorConfigurationView.java 

2.Import them in your MainActivity

import com.martin.interpolator.InterpolatorAnimator;
import com.martin.interpolator.InterpolatorConfig;
import com.martin.interpolator.InterpolatorConfigRegistry;
import com.martin.interpolator.InterpolatorConfigurationView;

Usage:

1.In you layout xml,add this:

<com.martin.interpolator.InterpolatorConfigurationView
    android:id="@+id/interpolator_configurator"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    android:layout_alignParentBottom="true"
    android:layout_alignParentStart="true">
</com.martin.interpolator.InterpolatorConfigurationView>

2.Create a function to set Interpolator Config & add ConfiguratorView

private void interpolatorConfig(){

    //Find InterpolatorConfigurationView in XML
    mInterpolatorConfiguratorView = (InterpolatorConfigurationView) findViewById(R.id.interpolator_configurator);

    //Setting Interpolator Config
    config0 = InterpolatorConfig.fromInterpolatorDurationDelayTime("ElasticEaseInOut",200,100);
    config1 = InterpolatorConfig.fromInterpolatorDurationDelayTime("CubicEaseInOut",300,150);
    config2 = InterpolatorConfig.fromInterpolatorDurationDelayTime("BounceEaseInOut",420,20);
    config3 = InterpolatorConfig.fromInterpolatorDurationDelayTime("DecelerateCubic",230,120);
    config4 = InterpolatorConfig.fromInterpolatorDurationDelayTime("FastOutLinearIn",320,40);
    config5 = InterpolatorConfig.fromInterpolatorDurationDelayTime("CircEaseOut",280,80);
    config6 = InterpolatorConfig.fromInterpolatorDurationDelayTime("AnticipateOvershoot",250,50);
    config7 = InterpolatorConfig.fromInterpolatorDurationDelayTime("FastOutSlowIn",375,200);
    config8 = InterpolatorConfig.fromInterpolatorDurationDelayTime("BackEaseIn",275,150);

    //Add Interpolator Config into ConfigurationView
    InterpolatorConfigRegistry.getInstance().removeAllInterpolatorConfig();
    InterpolatorConfigRegistry.getInstance().addInterpolatorConfig(config0, "Scale_Anim_1");
    InterpolatorConfigRegistry.getInstance().addInterpolatorConfig(config1, "Scale_Anim_2");
    InterpolatorConfigRegistry.getInstance().addInterpolatorConfig(config2, "Scale_Anim_3");
    InterpolatorConfigRegistry.getInstance().addInterpolatorConfig(config3, "Scale_Anim_4");
    InterpolatorConfigRegistry.getInstance().addInterpolatorConfig(config4, "Scale_Anim_5");
    InterpolatorConfigRegistry.getInstance().addInterpolatorConfig(config5, "Scale_Anim_6");
    InterpolatorConfigRegistry.getInstance().addInterpolatorConfig(config6, "Scale_Anim_7");
    InterpolatorConfigRegistry.getInstance().addInterpolatorConfig(config7, "Scale_Anim_8");
    InterpolatorConfigRegistry.getInstance().addInterpolatorConfig(config8, "Scale_Anim_9");

    mInterpolatorConfiguratorView.refreshInterpolatorConfigurations();
    mInterpolatorConfiguratorView.bringToFront();
}

3.Use it directly!

findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {

        mIsOut = !mIsOut;
        float startValue = mIsOut?1f:0f;
        float endValue = mIsOut?0f:1f;

        InterpolatorAnimator animator = new InterpolatorAnimator(view, "translationY", startValue, endValue,config0.interpolator,config0.duration,config0.delayTime);


    }
});

Types of Interpolator

47 different easing interpolators(Which contains native interpolators & interpolators from Easing.net)

"Linear",
"LinearOutSlowIn",
"FastOutLinearIn",
"FastOutSlowIn",
"AccelerateQuad",
"AccelerateCubic",
"AccelerateQuint",
"AccelerateDecelerate",
"DecelerateQuad",
"DecelerateCubic",
"DecelerateQuint",
"Anticipate",
"AnticipateOvershoot",
"Overshoot",
"Bounce",
"Cycle",
"LinearEaseNone",
"SineEaseIn",
"SineEaseOut",
"SineEaseInOut",
"QuadEaseIn",
"QuadEaseOut",
"QuadEaseInOut",
"CubicEaseIn",
"CubicEaseOut",
"CubicEaseInOut",
"QuartEaseIn",
"QuartEaseOut",
"QuartEaseInOut",
"QuintEaseIn",
"QuintEaseOut",
"QuintEaseInOut",
"ExpoEaseIn",
"ExpoEaseOut",
"ExpoEaseInOut",
"CircEaseIn",
"CircEaseOut",
"CircEaseInOut",
"BackEaseIn",
"BackEaseOut",
"BackEaseInOut",
"ElasticEaseIn",
"ElasticEaseOut",
"ElasticEaseInOut",
"BounceEaseIn",
"BounceEaseOut",
"BounceEaseInOut"

Notice

In the latest update,I added a typeface into the project,don't forget to grab it into your project,or it will be crushed...

Thanks

Special thanks to CymChad,he gave me lots of help in java coding.

License

The MIT License (MIT)

Copyright © 2017 MartinRGB

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.

More Repositories

1

Replace-iOS

Simply Implement Zee Young's animation
Objective-C
1,081
star
2

GiftCard-Android

Simply Implement Dribbble's popular shot
Java
850
star
3

MTMaterialDelete

a simple implement of my workmate's animation
Objective-C
816
star
4

MTSwift-Learning

Begin to learn swift,try to make some simple project here(DEPRECATED)
Swift
750
star
5

LearnCube-iOS

An animation practise demo
Objective-C
628
star
6

GiftCard-iOS

Simply Implement dribbble's popular shot.
Objective-C
544
star
7

MTPrivateTrainerAnimation

A simple implement of my design(DEPRECATED)
Swift
281
star
8

Animer

for a better Android Experience
Java
246
star
9

MTGuideline

Some Design Guideline I made.
161
star
10

Animer_Web

website for iOS/Web/Android Native Animation curve visualizing and para converting
JavaScript
147
star
11

MTMusicPlayer

simple implement an AV Player & my workmates Animation(DEPRECATED)
Swift
138
star
12

sketch-smooth-corner-android

A android project explained how to draw sketch smooth corner in android canvas
Java
76
star
13

Figma_Squircles_Approximation

JavaScript
43
star
14

GLES30_ProgrammingGuide_NDK

C with NDK Android GLES Tutorial,forked from https://github.com/danginsburg/opengles3-book
Makefile
43
star
15

TweakIt-Desktop

An Android Debugging Application
JavaScript
38
star
16

upng_tools_for_colleague

Try to build a local application for http://upng.photopea.com/
JavaScript
33
star
17

Droidcon_Shanghai_Keynote

Keynote I used in Droidcon Shanghai
22
star
18

MI_Style_Multitask_Prototype

A prototype simply explained how to make Xiaomi Style Multitask Interaction
Java
21
star
19

LTC_AreaLight_R3F_Component

TypeScript
17
star
20

blog

GL&Anim blog environment
17
star
21

MartinRGB.github.io

My Personal Website
HTML
15
star
22

iOS17_Namedrop_R3F

TypeScript
15
star
23

Material-Motion-Chinese

Material Motion 的在线翻译版本
JavaScript
13
star
24

android-prototype-learning

AndroidPrototypeLearning is my playground for android learning & rapid prototype
Java
11
star
25

Unity3dAndroidLiveWallpaper

Java
11
star
26

Animer_AE

Android/iOS/Web Native Animation Parameters in AE
JavaScript
8
star
27

ThinkingAboutSpring

An exercise
Java
7
star
28

sketch-smooth-corner-web

A web project explained how to draw sketch smooth corner in web
JavaScript
6
star
29

blog_deprecated

My blog,powered by Hexo
6
star
30

FBM_Effect_Optimization_Note

gpu-based effect optimization
4
star
31

30ProjectsOfBlender

I'm Learning Blender for 3D Coding(Unity/Three.js).By learning the theory behind these effect,I can understand how to code interactive effect.
3
star
32

stable_fluid_r3f

React Three Fiber Version
TypeScript
3
star
33

raymarching_sphere_r3f

TypeScript
3
star
34

IBM-Moiton-Chinese

IBM Motion Guideline 的在线翻译版本
JavaScript
3
star
35

AnimatorList_AE

JavaScript
3
star
36

martinrgb

2
star
37

OpenGL_SuperBible_5th_macOS

get a environment of opengl learning(tutorial from spweau_me)
C
2
star
38

android_fourcolor_gradient_forAE

Java
2
star
39

travis_avd_previewer_android

Java
2
star
40

android_frameless_webview_wrapper

An Android app for preview Web-based rapid protoype
JavaScript
2
star
41

UIAnimationTool_Web

A tool for animation design in GUI
JavaScript
2
star
42

android_camera_experiment

Camera Experiment:Face Detection,Take Pictures,Capture Video.
Java
2
star
43

MAKA_H5_Album_Project

HTML
1
star
44

Z490UD-11900K-6600XT-Ventura-Hackintosh

1
star
45

Renderscript_LUT_Filter_Template

Java
1
star
46

OpenGLES20_Game_Dev

a repo for learning tutorials
Java
1
star
47

100ProjectsVulkan

先立个 Flag
C++
1
star
48

Docker-Https-Seafile-Template

Python
1
star
49

AndroidFlingScrollView_AE

an AE project explained How to use FlingAnimation to decay the speed of listview
1
star
50

AndroidRealTimeBlur

Android real-time blur.
C++
1
star
51

UniversalGlass_R3F_Component

an UniversersalGlass React Three Fiber component that contains refraction,reflection,blur properties
TypeScript
1
star
52

RaspberryPi-CM4-eGPU-Guide

C
1
star