matomo-org / matomo-mobile-2

Matomo Mobile 2 App - The official Git repository! Liberating Web Analytics on the go!
https://matomo.org/mobile
Other
104 stars 31 forks source link

Preload graph in low resolution under circumstances #5298

Open tsteur opened 10 years ago

tsteur commented 10 years ago

If battery state is unplugged and battery level is < 20% we could always only load the low resolution.

If network type is mobile and/or if user is on a slow network we could preload the graph in low resolution and once finished load it in higher res if user is still on this screen.

Comparison overview graph (390x150px): Low res (@1x): 2KB High res iPhone 6 Plus (@3x): 16KB High res Android (up to @4x): 23KB and more depending on the phone and even more on tablets

Evolution graph (390x150px): Low res (@1x): 23KB High res iPhone 6 Plus (@3x): 108KB High res Android (up to @4x): 151KB and more depending on the phone and even more on tablets

When loading the graphs in fullscreen the size can easily go > 300KB

mattab commented 10 years ago

wow that's indeed a huge difference. It will make the graphs load many seconds earlier to users. Good idea.

once finished load it in higher res if user is still on this screen

so much win :+1: