alidiepuit / osmtracker-android

Automatically exported from code.google.com/p/osmtracker-android
GNU General Public License v3.0
0 stars 0 forks source link

Remember zoom level #73

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. go to the track view with OSM background enabled
2. zoom in
3. back back
4. go to the track view again -> the zoom level is reset

What is the expected output? What do you see instead?

The zoom level should be kept, but it isn't

What version of the product are you using (See "About" screen)?

0.5.0

Original issue reported on code.google.com by misc2...@danielnaber.de on 2 Oct 2010 at 4:36

GoogleCodeExporter commented 9 years ago

Original comment by nguillau...@gmail.com on 4 Oct 2010 at 3:56

GoogleCodeExporter commented 9 years ago
Don't think this is a duplicate of issue #58
This one has nothing to do with orientation change but usability.

If someone likes to view the OSM background with maximum zoom level, goes back 
to add a new waypoint and again switches to OSM background the zoom level is 
not maximum again. Also if restarting osmtracker the default zoom level is 
shown.

Perhaps we should add an option to the preferences for "default zoomlevel" when 
displaying osm view.

Original comment by matthias...@gmail.com on 4 Oct 2010 at 9:36

GoogleCodeExporter commented 9 years ago
Ahh ok you're right it's not a duplicate, I got it now.

Original comment by nguillau...@gmail.com on 5 Oct 2010 at 2:23

GoogleCodeExporter commented 9 years ago
I'm guessing that the technical issue here is that the map activity is separate 
from the button activity and they do not communicate with each other as the 
user moves from one to the other. 

Perhaps the map activity could store the last zoom level against the relevant 
track in the track table when it is being closed so that it will read that 
value when the activity is created. a null value could prompt the activity to 
use the default zoom or whatever zoom level is specified in the preferences.

Original comment by oshea.p...@gmail.com on 28 Nov 2010 at 11:33

GoogleCodeExporter commented 9 years ago
Hi,

i think this could be handled by adding the zoom level information to the 
savedInstanceState which is available within the onCreate method and can be 
saved within the onSaveInstanceState methid:
http://developer.android.com/reference/android/app/Activity.html#onCreate(androi
d.os.Bundle)
http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceS
tate(android.os.Bundle)

Additionally a standard zoom level should be configurable in the preferences 
for the case that there is no savedInstanceState available.

Saving a zoom level for each track is IMHO not necessary for the moment. This 
could be raised as an additional issue which then could be of Type-Enhancement.

What do you think?

best regards
Matthias

Original comment by matthias...@gmail.com on 29 Nov 2010 at 1:09

GoogleCodeExporter commented 9 years ago
Hi,
If it can be stored in the save instance state, then there is no need to keep 
the zoom level with the track. However, I think that there is already code in 
DisplayTrackMap.java to save the zoom level in onSaveInstanceState() and to 
read it in onCreate(). Unfortunately this does not seem to work in the case 
where we use the back button to go to the button layout and then return to the 
map :-(. It works for orientation changes though.

If there is a way to get this to work then I think that is the best and most 
correct solution.

A user configurable default zoom level is definitely a good idea. I just code 
my preferred zoom level into the code that I push to my phone, but not everyone 
can do that. I agree that it is better to keep the issues separate, multi-part 
issues have a nasty habit of becoming zombies that cannot be killed.

Regards,
Paul.

Original comment by oshea.p...@gmail.com on 29 Nov 2010 at 1:47

GoogleCodeExporter commented 9 years ago
Hi Paul,

i'm sorry, i mixed it up with SharedPreferences. 
http://developer.android.com/guide/topics/data/data-storage.html#pref
There we can store the information about current zoomLevel.

I already committed a patch to svn which fixes this issue.
The zoomLevel now is always set to the last used zoomLevel, even if you 
completely close OSMTracker and start it again with a new track.

best regards
Matthias

Original comment by matthias...@gmail.com on 30 Nov 2010 at 12:30

GoogleCodeExporter commented 9 years ago
Short note for future readers: user configurable default zoom will be discussed 
in issue#95

Original comment by matthias...@gmail.com on 30 Nov 2010 at 1:03