Java
Need help with KenBurnsView?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.
gotokatsuya

Description

Slideshow. Android ImageViews are animated by Ken Burns Effect. (Inspired by Heyday)

214 Stars 36 Forks Apache License 2.0 25 Commits 11 Opened issues

Services available

Need anything else?

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 &amp; 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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.