Tuesday, August 19, 2014

LibreOffice on Android #2 - Draw and Impress documents

I am continuing working on LibreOffice on Android and now I had achieved a next milestone - support for Draw and Impress documents.

After some painful debugging experience, where an unavailable service in the Android build prevented the documents to be successfully opened, I finally managed to get a slide rendered on screen:
Impress slide rendered in the LibreOffice Android viewer
Draw and Impress documents share most of the code so if you get one working then you most likely get the other for free:
Draw page in LibreOffice Android viewer
Draw and Impress documents differ a little bit from Writer documents, as they are a collection of document parts - slides and pages (and in case of Calc - sheets). To be able to show different parts of the document I implemented a sidebar (using Android's DrawerLayout) which shows all available parts in a list. Clicking on a part in the list re-renders that part on the screen. The sidebar is hidden and can be activated using a left-to-right swipe on the left side of the screen. When activated it looks like this:
Sidebar to switch between slides/pages
In the future the static icons will be replaced with actual thumbnails of pages.

Additional to this I have worked on increasing the performance of tile rendering by auditing the life cycle of tiles and removing corner case bugs. There was a particular bug that removed corner tiles and right after that rendered the same (now missing) tiles for every redraw call (inconsistency in determining which tiles are still valid). Interestingly the impact on the performance was not so big as I thought. I am still not happy with the speed of tile rendering especially when faster scrolling a page.

All the work so far is summed up in this video.

Thanks again goes to Smoose for continuing the sponsoring of LibreOffice on Android work and my employer Collabora to make this project possible.

Tomaž