Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Okulus - Droidcon India 2014

Okulus - Droidcon India 2014

Slides for Droidcon India 2014


Vinay S Shenoy

December 04, 2014


  1. okulus - Awesome Image Effects Vinay S Shenoy Android App

    Developer at flipkart.com vinaysshenoy@gmail.com @vinaysshenoy http://github.com/vinaysshenoy
  2. Upcoming trends • Faster and cheaper internet => Richer content

    • Images, Images, Images! • Visual treatment for images can make your app stand out
  3. Prettify images - Most common ways • Circles & Rounded

    corner shapes • Borders • Shadows
  4. Cropping • Various techniques are available when you search •

    But are they the best? • CPU Usage, Memory usage, Overdraw problems arise
  5. What is okulus? • Custom ImageView widget • Comes with

    a bunch of great effects which can be used without any hassle • ZERO Overdraw, NO excess CPU or Memory usage • New effects and features will be added constantly
  6. None
  7. In your Layouts <com.vinaysshenoy.okulus.OkulusImageView android:id="@+id/avatarImage" app:okulus_borderColor=“@color/darkYellow" app:okulus_borderWidth="1dp" app:okulus_fullCircle="true" />

  8. In your Code OkulusImageView imageView = findViewById(R.id.avatarImage); imageView.setImageBitmap(bitmap);

  9. • All of these can be achieved by setting a

    few attributes in your layout XMLs • cornerRadius to set the strength of the rounded corners • borderWidth and borderColor to define image borders • fullCircle to force the image to be drawn with a circular shape • shadowColor, shadowWidth and shadowRadius to configure shadows • touchSelectorEnabled and touchSelectorColor to draw selectors when the View is touched
  10. What does okulus support? • Rounded rectangles • Circles •

    Customizable borders • Shadows • Custom touch selectors
  11. Compatibility • How does it play with Image Loading libraries

    • If your image loading library calls setImageBitmap() to actually set the image, you’re golden • Tested with popular libraries - Picasso, Glide, Volley and UniversalImageLoader • Integration examples are available in the sample application
  12. Limitations • Bitmap needs to resized to the view dimensions

    before getting set • Center Crop, FitXY are fully supported, others are coming soon • Limitations are temporary only!
  13. Awesome! Where do I get it? • Add compile ‘com.vinaysshenoy:okulus:0.9.1@aar’

    to your gradle script • Make a library project for Eclipse • Apache License, Version 2.0
  14. http://okulus.vinaysshenoy.com