Metro. Just a circuit
A week on Habré passion rages on the Yandex.Metro program. I haven’t turned it on for a long time, I decided to look again. And suddenly I caught myself thinking that the application annoys me.
I don’t argue, this is an excellent application for couriers, guests and a certain category of passengers who are comfortable with automatic location, search for stations, calculating travel times, etc.
But the native Muscovites, who travel all their conscious lives by metro from their sleeping areas to work, to visit, to date and to football, approximately know the location of the stations and use the scheme only to refresh their memory and specify where it is better to make a transfer. Everything!
What is happening with Yandex.Metro. I launch the application and the first thing it starts to look for updates. What for? It seems that metro stations do not open every hour, why such a rush. Okay, a couple of seconds passed. Next, the program starts. One careless finger touch and some buttons pop up on the screen: Show on map (???), Station name, From Here, To Here. Recalls the behavior of some sites hung with ads and pop-ups. At the same time, it turns out that they still send something to their servers, taking resources from my device.
Realizing that I use 1% of all the functionality of a good application, I came across several comments by geeks who simply took a picture of the circuit and use it. I remembered that before the advent of Yandex.Metro, and maybe even earlier, on Windows Mobile 5.0, I did the same. I was not satisfied with only one detail - I did not want to look for a metro scheme in the Gallery among the many pictures.
And then I decided to write my simple program with the straightforward name Metro. Just a scheme for Android. The funny thing is, I did not even have to write code for it. Copy paste. About 30 minutes passed from creating the project to placing the application on Google Play.
Converted vector images to PNG. On the Android site, Asset Studio created the icons. I launched the project and placed the icons in the necessary subfolders. Next, I chose a topic without a title to increase usable space.
For placement of pictures in Android, the ImageView component is used. But out of the box, it does not support scaling and gesture processing. But at one time I saved a link to the TouchImageView library in my bookmarks. Yesterday, browsing my bookmarks, I saw a forgotten link and thought that we should study it. Today I decided to check if it fits my application. Library - it was said too loudly. Just copy a class that extends ImageView and paste it into your project.
We place the component in the markup
Everything! Run the program and enjoy. The component from the box supports two-finger touch, double tap and picture movement under the finger. Everything is the same as Yandex.Maps.
I checked on an old Samsung S2, then on a tablet and a new phone. I am completely satisfied. Screenshots are greatly compressed to save, so they are a bit plain-looking.
If someone needs it, the address on Google Play is Metro . Just a scheme .
I don’t provide the source code, any programmer will be able to reproduce my actions independently.
Upd. Habr does not allow to write two articles in a row under the heading "I PR". Therefore, the continuation had to be published on my blog.
Metro Moscow Part Two