Giter Site home page Giter Site logo

multilemon / kenburnsview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gotokatsuya/kenburnsview

0.0 0.0 0.0 131.03 MB

Slideshow. Android ImageViews are animated by Ken Burns Effect. (Inspired by Heyday) Fork from https://github.com/gotokatsuya

License: Apache License 2.0

Java 100.00%

kenburnsview's Introduction

KenBurnsView

Android ImageViews are animated by Ken Burns Effect.

Demo

Demo

How to use

private void initializeKenBurnsView(){
    // KenBurnsView
    final KenBurnsView kenBurnsView = (KenBurnsView) findViewById(R.id.ken_burns_view);
    // kenBurnsView.setScaleType(ImageView.ScaleType.CENTER_CROP);

    // File path, or a uri or url
    List<String> urls = Arrays.asList(SampleImages.IMAGES_URL);
    kenBurnsView.loadStrings(urls);

    // ResourceID
    //List<Integer> resourceIDs = Arrays.asList(SampleImages.IMAGES_RESOURCE);
    //kenBurnsView.loadResourceIDs(resourceIDs);

    // MIX (url & id)
    //List<Object> mixingList = Arrays.asList(SampleImages.IMAGES_MIX);
    //kenBurnsView.loadMixing(mixingList);

    // LoopViewListener
    LoopViewPager.LoopViewPagerListener listener = new LoopViewPager.LoopViewPagerListener() {
        @Override
        public View OnInstantiateItem(int page) {
            TextView counterText = new TextView(getApplicationContext());
            counterText.setText(String.valueOf(page));
            return counterText;
        }

        @Override
        public void onPageScroll(int position, float positionOffset, int positionOffsetPixels) {
        }

        @Override
        public void onPageSelected(int position) {
            kenBurnsView.forceSelected(position);
        }

        @Override
        public void onPageScrollChanged(int page) {
        }
    };

    // LoopView
    LoopViewPager loopViewPager = new LoopViewPager(this, urls.size(), listener);

    //LoopViewPager loopViewPager = new LoopViewPager(this, resourceIDs.size(), listener);

    //LoopViewPager loopViewPager = new LoopViewPager(this, mixingList.size(), listener);


    FrameLayout viewPagerFrame = (FrameLayout) findViewById(R.id.view_pager_frame);
    viewPagerFrame.addView(loopViewPager);

    kenBurnsView.setPager(loopViewPager);
}

You should check sample code.

Gradle

repositories {
    jcenter()
}

dependencies {
    compile 'com.github.goka.kenburnsview:library:1.0.3'
}

Develop

1.0.4

Easy to use

Released

1.0.3

Delete unneeded resources.

1.0.2

Fix initializing size.

1.0.1

Enable to load images from res. Enable to mix. (Enable to load images from url & res)

iOS

CPKenburnsSlideshowView

Detail Demo Movie

youtube

Library

Thanks for Glide

kenburnsview's People

Contributors

gotokatsuya avatar yuyakaido 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.