florent37 / expectanim Goto Github PK
View Code? Open in Web Editor NEWDescribe your animation and run !
License: Apache License 2.0
Describe your animation and run !
License: Apache License 2.0
@OverRide
public Float getCalculatedValueX(View viewToMove) {
if(horizontal) {
final float x = viewCalculator.finalPositionLeftOfView(otherView);
final float myWidth = viewToMove.getWidth() / 2f;
final float hisWidth = viewCalculator.finalWidthOfView(otherView) / 2f;
if (myWidth > hisWidth) {
return x - myWidth + hisWidth;
} else {
return x - hisWidth + myWidth; [HERE]
}
} else return null;
}
does 'return x - hisWidth + myWidth' -> 'return x + hisWidth + myWidth' ?
I think + is right.
Hi there! It's me again ;)
I tried to compile the newest version via the compile statement, but it won't find 1.0.2. Not sure what causes the issue, but it might be due a missing tag or something?
Hello! Your AMAZING libraru doesn't work with crosswalk lite https://crosswalk-project.org/documentation/crosswalk_lite/use_crosswalk_lite.html :( When I remove your library from my gradle list, everuthing start works fine. Can you fix it, please?
Add posibility to make animations as queue
for example now to make animations in queue order I make this:
new ExpectAnim()
.expect(mButtonsView)
.toBe(
Expectations.atItsOriginalPosition()
).toAnimation()
.setDuration(1000)
.setEndListener(new AnimationEndListener() {
@Override
public void onAnimationEnd(ExpectAnim expectAnim) {
new ExpectAnim()
.expect(mPlayerMediaView)
.toBe(
Expectations.visible()
)
.toAnimation()
.setDuration(1000)
.start();
}
}).start();
Please make an builder(maybe like in rxjava) to make it easy for example:
ExpectAnim firstAnim = new ExpectAnim()
.expect(mButtonsView)
.toBe(
Expectations.atItsOriginalPosition()
).toAnimation()
.setDuration(1000);
ExpectAnim secondAnim = new ExpectAnim().expect(mPlayerMediaView)
.toBe(
Expectations.visible()
).toAnimation()
.setDuration(1000);
ExpectAnim commonAnim = firstAnim.concatWith(secondAnim);
OR
ExpectAnim commonAnim = ExpectAnim.concat(firstAnim,secondAnim);
commonAnim.start();
I suggest renaming this:
atHisOriginalPosition()
to this:
atItsOriginalPosition()
In English objects don't have a gender, so using "his" to refer to a layout is not done.
When I use width()
with centerInParent()
or any similar method, the new position does not take in account new width.
So instead of becoming center it is slightly misaligned because it still has old width.
Is this expected outcome or I am the only one getting it?
@florent37 please can you add an option that set the view visibility to GONE when use the
Expectations.alpha(0f) or Expectations.invisible?
This because a view with alpha 0f can be touched and clicked by user and send the onClick or touch events.
Thank you
Error:(178, 13) Failed to resolve: com.github.florent37:expectanim:1.0.2
Show in File
Show in Project Structure dialog
Not an issue but on loading of screen invisible method displays view and then makes it invisible .
Hi there!
I love your library from the first sight. But it might be that there are users that won't be able to correctly install your app via gradle since the gradle compile statement is not correct in the readme.md file.
Instead of using
compile 'com.github.florent37:expectanim:v1.0.1'
the v
is missing and it is stated to use
compile 'com.github.florent37:expectanim:1.0.1'
Keep on the great work!
How to set height between view and parent?
I tried Expectations.height(0)
, but it doesn'r recalculate new height:
.expect(recyclerView)
.toBe(
Expectations.belowOf(contentLayout),Expectations.bottomOfParent(), Expectations.height(0)
)
Sorry for bad english. I have a problem - like in example with scrollView I need to resize my recyclerView list. But, only I can do - is to move it after another view. And it is not fill empty space (in layout xml it has constraints - height="0dp", Top_toBottomOf="animated_view", Bottom_toBottomOf="parent", weight="1"). I can use height method from expectAnim, but it scales, and I need to know new size for view, so, it's not a good variant.
Can you advice me thomething to solve this problem?
once i've added the lib, this message appears.
can you add documentation for the project or at-least for the public methods? I have two layouts in a frame layout with both widths as match_parent. I want to animate top layout to bottom and I achieved it. I want the animated view to have margin 10dp in left and right with width as match_parent. I tried it but can't achieve it. Can you please help.
Hi
1- I want to stop it in the middle of the animation In the same state , But how?
2- I want to finish the animation faster than the time it finishes , But how?
tanks
outOfScreen Invalid in onCreate method ,
Need to delay waiting for the layout to finish loading
Whether more elegant solutions are available ?
Run soon after the flash and then back to the previous interface,My phone is Samsung 6.0 system
I'm not sure what I configure is wrong, but when I check out the project from Github, then run it in Android Emulator and on the real device, the animation runs with huge lag.
AnimationEndListener sometimes becomes null in your lib at the line:
final AnimationEndListener listener = endListenerWeakReference.get();
For example
new ExpectAnim()
.expect(mView)
.toBe(
.atItsOriginalPosition()
).toAnimation()
.setDuration(1000)
.setEndListener(new AnimationEndListener() {
@Override
public void onAnimationEnd(ExpectAnim expectAnim) {
//NB: sometimes AnimationEndListener is null in your lib and the method doesn't work
//do smth
}
}).start();
1.Added Bezier animation to better integrate with material design
2.Built-in interpolator interface
Whether to optimize these two points
How to determinate that Anim is playing?
Please add a method to get state of animation.
For example
ExpectAnim anim;
if (anim.isPlaying()){
//do smth.
}
Please can you add some expectations like translationX, translationY, translationZ?
Getting the following error while using proguard.
Warning:com.github.florent37.expectanim.core.Expectations: can't find referenced class com.github.florent37.expectanim.core.Expectations$GravityIntDef
It can be fixed by adding the below lines in proguard-rules.pro
file
-keep class com.github.florent37.expectanim.*{ *; }
-dontwarn com.github.florent37.expectanim.**
I saw your post on Google plus and found this lib a great resource to use in my future project, I forked and imported in Android Studio, I wanted the result as shown here
the background of user contents is not being resized as shown in first git demo, how can I solve this issue please help...
Warning: com.github.florent37.expectanim.core.Expectations: can't find referenced class com.github.florent37.expectanim.core.Expectations$GravityIntDef
Hi.
Thank you for this great library, it makes writing animations extremely easy and saves a lot of time.
Could you please add some other animations like these ones or help me on how can I implement it?
And the possibility of mixing them together, like fading in a view while playing ZoomIn technique on it.
Again thanks for your great contribution :)
ExpectAnim listener method add removal may be more appropriate?
ExpectAnim Listener 或许加上对应的移除方法更合适
Like this :
public ExpectAnim removeEndListener(AnimationEndListener listener) {
this.endListeners.remove(listener);
return this;
}
public ExpectAnim removeStartListener(AnimationStartListener listener) {
this.startListeners.remove(listener);
return this;
}
I have an activity (which contains the code to enlarge / minimise the layout) with a fragment at the bottom. It works fine with normal views, but if I change the fragment to a google maps fragment, there it will minimise the layout, but won't enlarge the map view at the bottom to fill the remaining space
change xml of activity_scroll from Framlayout to Linerlayout,change layout size when we scroll,and the animation of back is not at original location
for example:
public void exec(){
new ExpectAnim()
.expect(mView)
.toBe(
.visible()
).toAnimation().setNow();
}
if you call exec() twice view will be blinking
exec();
exec();
Add a check for example if (view.alpha!=100)
perform animation
Add Expectations as "setEnabled(boolean enabled)"
new ExpectAnim()
.expect(mPlayerMediaView)
.toBe(
Expectations.enable()
)
.expect(mPlayerMediaView)
.toBe(
Expectations.disable()
)
Currently we can only set Duration. But how to set delay before start?
expectation:
new ExpectAnim()
.expect(mPlayerMediaView)
.toBe(
Expectations.visible()
).toAnimation()
.setDelay(500)//<-----
.setDuration(500)
.addStartListener(new AnimationStartListener() {
@Override
public void onAnimationStart(ExpectAnim expectAnim) {
startTime = System.currentTimeMillis()
}
})
.addEndListener(new AnimationEndListener() {
@Override
public void onAnimationEnd(ExpectAnim expectAnim) {
endTime = System.currentTimeMillis()
}
})
Total time = Delay + Duration = 500+500 = 1000 ms. == endTime - startTime
Can support rotation?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.