Fixed Orientation change issues

Now library should work well in both portrait and landscape modes. Also
we removed warnings and deprecated methods usage. Applied changes to
demo project.