🎁 We’re sharing our code

Tom van den Broek
NOS Digital
Published in
2 min readNov 1, 2019

This post is about our first steps in sharing software. Please leave a comment if you have any questions.

About NOS

NOS is an independent public news and sports organization from the Netherlands. We are a broadcaster by origin, and the last few decades we’ve witnessed how news is becoming a digital and mobile service. We have dedicated teams of digital professionals to create these services.

We engineer consumer products that operate on a big scale. As a public company we have to make our journalism available to as many users as possible. This principle can also be applied to the engineering part of our work. As we have a public task, why not share the software as well?

For quite some time we’ve been talking about sharing code. A few weeks ago one our Android engineers pitched the idea to share a specific part of our software.

Pinching, zooming and swiping images on Android

We decided to build an image zooming library in our Android product. We chose to do so because we had requirements that (as far as we know) were not supported by the existing libraries. Like other libraries we wanted to support ‘double tap to zoom’, ‘pinch to zoom’ and moving the image around when zoomed in.

One important requirement was to do a shared element transition from the overview screen to the image detail screen, we couldn’t find a way to do this, because most of the libraries built their own custom view and the Android framework doesn’t quite understand how to do the transition to a custom view properly. We also liked the fact that we could attach the library features to an existing ImageView.

The second requirement was to be able to swipe the image away and go back to the overview screen, so we added that as well.

pinch-to-zoom, double-tap-to-zoom and swipe-to-close features

We recently made this library available on Github. Feel free to check it out.

By sharing more of our work we hope to make our products better and let everyone benefit from our effort.

--

--