Vincent Ritter

Gluon update (20181124.1) - Image Modals and new settings

Another day, another update to Gluon. I can't stop working on the app, it's a lot of fun for me and I'm learning heaps of great stuff!

Before I get started, I just want to extend a warm thank you to everyone that has left comments, emailed me and of course for everyone that decided to run the app on their phone. It really means a lot to me, so... Thank You!

Image Modal

In a previous build, released on Thursday, I added an image modal. I didn't say anything, but wanted to test it out in the field. So, now when you tap an image, you will be presented with a nice modal. If a post has multiple images, you'll be able to swipe left or right, zoom in, zoom out, you name it.

It was a bit tricky to get right, as I didn't want to reload any of the images when the modal opened. Another hurdle was to grab the image dimensions, before serving the image. Grabbing these, for some reason, was slow.

What I'm doing now is grab the dimensions and set the returned dimensions in local storage (cache), sorted by their URL. I also add to another local store, to record what URL I stored and when. More on why in a moment. As your timeline loads, and grabs images, it will both cache the image (as it downloads it) and also now sets the dimensions in cache. This is important. When you open the modal I didn't want to grab anything with another round trip over the internet to fetch any of the data again.

Of course, if data is missing, it will try and grab it all fresh.

All of this enables instant image loading when you tap on it, because in essence you already loaded the image in your feed.

Here is a screenshot of the modal, with a colourful image (image by @eli):

I'll be adding swipe to close to this also... didn't have the time just yet.

It was important for me to keep dimension cache to a minimum, as you might have a photo only timeline... after a few months that would be pretty big! To combat that problem I added a check, of the cache, to filter out everything that has been added more than 14 days ago. Granted, it's only a JSON list... but you know. 2 weeks is enough in my mind.

Have a play!

Settings - the beginning

If you have read my other blog posts, you could probably read between the lines that I'm going to add themes to the app. Today, I made the first step to customising the app to your needs. This is more an accessibility feature than a "theme" item, however it clears a path for many options that are applied to the app in real time.

I had to re-write parts of the app, especially the navigator, in order for this to work. I don't want to get too technical though, so I'll spare you. Happy to say that it works though!

With this task complete I was able to add the first user setting to the app: Content Font Size.

I'm happy with this as it proved that it can be done with ease and without a performance hit (on the production app - TestFlight and Android Alpha).

This was a quick addition to the Settings screen, so please excuse me as it still looks really bad. It will get better over time.

Here's how it looks:

Two, not so nice looking, buttons that enable you to increase or decrease to your choosing. The default size is 16 points. The minimum is 8 and there is no maximum. Of course, on top of this, you will also get any dynamic font sizing that you have set on iOS.

Here is another screenshot with bigger text:

The post preview is loaded randomly from the Discover feed. So, make sure you have at least looked at the discover section. I'm sure you did already... I'll make changes to this as I go, of course, and have a fallback to a more generic design if no posts have been found. It'll always grab the data from the post cache, so no round trips around the internet.

You can "Reload" a feed item that you see, just to try out other ones. Some may just contain images, so it'll be quite hard to see any changes.

Any changes you make to the content size will be reflected in real time. I know... something small... but for me that's cool!

Settings are saved locally, so they will always get applied if the app cold boots or does other things. The screens also receive all of the "Theme" data instantly, so changes will be quick.

Anyway, happy to have this working as now I can do more great stuff!

That's it for now.

As always there is a Trello board for up to date info on progress https://trello.com/b/GSIj8AVi and my dedicated section, on my site, about developing the app.

If you're interested in testing you can sign up via the TestFlight public link: https://testflight.apple.com/join/2sbnWuMK , or you can email me gluon@vincentritter.com. If you want to test the alpha build for Android, email me. And of course, you can reply via Micro.blog.

Close