Android Slide Show Widget


Source link: https://marvinlabs.github.io/android-slideshow-widget

Android SlideShow Widget

A set of widgets to create smooth slide shows with ease. The slide show components are fully customizable and are not limited to pictures, you can slide whatever you want to (texts, etc.).

Demo

A demo of the widget is worth a thousand words. You can download it for free on Google Play.

Usage

Including the library

The easiest way to get the library included in your project is by using Gradle. Simply add the following line to your dependencies block:

dependencies {

  compile 'com.marvinlabs:android-slideshow-widget:0.4.+@aar' 
}

Of course, you can replace the version number by whichever version you need (you can have a look at this repository's tags to know which is the latest).

Getting a slide show in your fragment/activity

To include a slide show in your layout, simply use the following XML code snippet:

<com.marvinlabs.widget.slideshow.SlideShowView
  android:id="@+id/slideshow"
  android:layout_width="match_parent"
  android:layout_height="match_parent" />

You can then get the SlideShowView using the usual technique:

slideShowView = (SlideShowView) findViewById(R.id.slideshow);

The next step is to create the adapter that will bind your slide data to actual views. This is a process very similar to what you do when working with the ListView widget. In this library, we have a few base adapters to help you create picture slide shows easily from images in your application resources or from images on the Internet. The code would look like that:

adapter = new ResourceBitmapAdapter(this, new int[]{

  R.raw.slide_01, R.raw.slide_02, R.raw.slide_03, R.raw.slide_04
}
);

Once your activity is ready, or inside an event handler like a button click method, you can then start the slideshow:

slideShowView.play();

Customisable components

SlideShowAdapter

This is the key component to bind your slide data with actual view widgets. Have you heard about ListView and Adapter? Well, this is exactly the same concept.

To get you started with picture slide shows, we have created a few useful adapters:

  • ResourceBitmapAdapter will allow you to show a list of application resource drawables
  • RemoteBitmapAdapter will allow you to show a list of images that are loaded from the Internet.

We also have a Picasso plugin library. That provides an adapter that works with Picasso instead of AsyncTasks. To use it, simply add the corresponding dependency using gradle:

dependencies {

  compile 'com.marvinlabs:android-slideshow-widget-picasso-plugin:0.4.+@aar' 
}

SlideTransitionFactory

You want something else than just a fade between slides? Simply implement this interface to return whichever view animator you want.

To make it easy for you, we already have a few default implementations that should cover most of your needs:

  • FadeTransitionFactory if you want your slides to fade out and in
  • SlideAndZoomTransitionFactory if you want your slides to slide ou left and then zoom in
  • NoTransitionFactory if you want your slides to brutally show up

PlayList

You want to change the order of your slides? You need your slides to have a variable duration? Well, that's the interface to implement to change that.

To make it easy for you, we already have a few default implementations that should cover most of your needs:

  • SequentialPlayList will play slides in order with a common default duration
  • RandomPlayList will play slides in a random order with a common default duration

About Vincent & MarvinLabs

I am a freelance developer located in Biarritz, France. You can have a look at my website to get to know me a little better. If you want to follow me, here are some links:

MarvinLabs is my digital studio specialised in native mobile applications and web sites. You can browse our website to get to know us a little better. If you want to get updates about our work, you can also:

Change log

0.5.0 (2014-06-03)

  • [new] making the adapters more generic so that they can easily be used with existing data
  • [new] added a Picasso plugin (an adapter to use Picasso to load remote images)

0.3.0 (2014-06-02)

  • [new] new transition factories
  • [new] playback control function (next, previous, pause, resume)
  • [new] widget can be configured from XML
  • [fix] issue #2

0.2.0 (2014-06-01)

  • [new] a RandomPlayList implementation
  • [new] listener for slide show events
  • [new] listener for slide click event (similar to ListView's item click listener) (Thanks Arasthel)
  • [fix] Some additional inline documentation

0.1.0 (2014-05-31)

  • First release (beta)
  • SlideShowView widget to play a slide show
  • SlideTransitionFactory to customize the transitions between slides (with 2 default implementations)
  • PlayList to customize the order and duration of slides (with 1 default implementations)
  • SlideShowAdapter to bind slide data to actual view widgets (with 2 default implementations)
  • Demo application

Resources

A tiny, fully extensible MVP implementation for Android in pure Java, which goal is to provide common interfaces for tests that need to easily mock Views and Presenters.

An android pagination library.

Excuser is a utility app to rescue yourself from an awkward situation, boring meetings, annoying conversation, meaningless interviews etc.

Just shake your wrist with Andorid Wear and the fake call will ring your phone instantly.

The app allows you to:

  • Specify the intensity of the shake which triggers the incoming call.
  • Specify custom contacts (which are chosen randomly) for the incoming call.

Escape boredom. No need to make boring excuses - Just get Excuser!

VirtualAPK is a powerful yet lightweight plugin framework for Android. It can dynamically load and run an APK file (we call it LoadedPlugin) seamlessly as an installed application. Developers can use any Class, Resources, Activity, Service, Receiver and Provider in LoadedPlugin as if they are registered in app's manifest file.

This is the Android Architecture Components extension library available for Kotlin.

A Library to provide Http post request easily.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes