Giter VIP home page Giter VIP logo

expectanim's Issues

sameCenterHorizontalAs not work

@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.

Version 1.0.2 found on jitpack

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?

Add posibility to make animations in queue order

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();

Suggest using neutral pronoun

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.

Width() with centerInParent() gets wrong

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?

Add Visibility GONE when alpha is 0f

@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

Visibility of view

Not an issue but on loading of screen invisible method displays view and then makes it invisible .

Gradle instruction readme.md fix

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?

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)
            )

How to autoresize view, sticked to another moved view?

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?

Documentation & margins

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.

stop and end animation

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

Flash

Run soon after the flash and then back to the previous interface,My phone is Samsung 6.0 system

Huge lag running the project

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 and onAnimationEnd is never called

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();

Add Expectations

Please can you add some expectations like translationX, translationY, translationZ?

Suggest adding proguard rules to readme

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.**

the background of user contents is not being resized

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

[gif

on my device I got this
some

the background of user contents is not being resized as shown in first git demo, how can I solve this issue please help...

What about proguard?

Warning: com.github.florent37.expectanim.core.Expectations: can't find referenced class com.github.florent37.expectanim.core.Expectations$GravityIntDef

Support other/mix animations

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 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;
    }

Does it work with Google Maps and ViewPager?

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
Screen Shot 2019-03-19 at 6 50 38 PM

Use it in other viewGrroup

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

Views are blinking if call visible twice

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 method .setDelay(long period /*ms*/) for ExpectAnim

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 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.