Code Monkey home page Code Monkey logo

zoomphotoplace's Introduction

ZoomPhotoPlace


本项目是仿微博及猫眼查看图片的动画效果,使用viewpager查看图片放大,可以报道查看当前回到图片位置

## 图片效果

初始化动画

animationUtils = new AnimationsUtils(container, rlViewPager, viewPager);

触发动画

//第一次点击时传true
animationUtils.getImageLocation(view, true);
//后面进入图片查看器后滑动一张图就传当前itemView和false
animationUtils.getImageLocation(viewHolder.itemView, false);

返回动画

    /**
     * 关闭图片查看器Viewpager
     */
    private void closeViewPager() {
        rlTitle.setVisibility(View.GONE);
        llBottomSave.setVisibility(View.GONE);
        rlViewPager.postDelayed(new Runnable() {
            @Override
            public void run() {
                if (rlViewPager.getVisibility() == View.VISIBLE) {
                    tvBackground.setVisibility(View.GONE);
                    animationUtils.closeAnims();
                }
            }
        }, 500);
    }

触发与返回动画结束监听

//关掉该关的View
animationUtils.setOnAnimationEndListener(new AnimationsUtils.OnAnimationEndListener() {
            @Override
            public void StartAnimationEnd(Animator animation) {
                if (animation != null) {
                    tvBackground.setBackgroundColor(getResources().getColor(R.color.black));
                    tvBackground.setVisibility(View.VISIBLE);
                    tvBackground.postDelayed(new Runnable() {
                        @Override
                        public void run() {
                            rlTitle.setVisibility(View.VISIBLE);
                            llBottomSave.setVisibility(View.VISIBLE);
                        }
                    }, 500);
                }
            }

            @Override
            public void EndAnimationEnd(Animator animation) {
                if (animation != null) {
                    rlTitle.setVisibility(View.GONE);
                    llBottomSave.setVisibility(View.GONE);
                    tvBackground.setVisibility(View.GONE);
                }
            }
        });

zoomphotoplace's People

Contributors

dongliwu520 avatar

Stargazers

liuxing avatar

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.