mode of transport switcher for POIs

Bug #579378 reported by Kieran Fleming
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenSatNav
Fix Released
Medium
Murphy

Bug Description

Currently only available via the text based search, should be available for POI based search too

Revision history for this message
Murphy (murphy2712+launchpad) wrote :

I don't understand, you want to delete the actual listview of POI and replace it by a single selectbox/spinner?
And why not include this POI search in the standard search?

Revision history for this message
Kieran Fleming (kieran-fleming) wrote :

I wasn't thinking like that at all, but now I think including it in the standard search is a good idea! :)
One thing to keep in mind is that the UI still needs to be usable with the soft keyboard taking up nearly half the screen.

Revision history for this message
Murphy (murphy2712+launchpad) wrote :

I'm actually working on this...

Revision history for this message
chris_debian (cjhandrew) wrote :

Murphy wrote:
> I'm actually working on this...

Thanks, Murphy.

Chris.

Revision history for this message
Murphy (murphy2712+launchpad) wrote :

What do you think of that integrated poi search?

I also found a workaround for not hardcoding values for testing spinner's selected values, we need to put 2 arrays in the array.xml resource (and just translations in various strings.xml).
For pois:
<pre>
<string-array name="poi_types">
        <item>@string/atm</item>
        <item>@string/cafe</item>
        <item>@string/cinema</item>
        <item>@string/fuel</item>
        <item>@string/hospital</item>
        <item>@string/hotel</item>
        <item>@string/parking</item>
        <item>@string/police</item>
        <item>@string/pub</item>
        <item>@string/restaurant</item>
    </string-array>
    <string-array name="poi_types_osmvalue">
        <item>atm</item>
        <item>cafe</item>
        <item>cinema</item>
        <item>fuel</item>
        <item>hospital</item>
        <item>hotel</item>
        <item>parking</item>
        <item>police</item>
        <item>pub</item>
        <item>restaurant</item>
    </string-array>
</pre>
For transport:
<pre>
    <string-array name="mode_of_transport_types">
  <item>@string/car</item>
  <item>@string/bicycle</item>
  <item>@string/walking</item>
 </string-array>
 <string-array name="mode_of_transport_types_osmvalue">
  <item>motorcar</item>
  <item>bicycle</item>
  <item>foot</item>
 </string-array>
</pre>

This way, we request the spinner's selected position and then request the same position for the other array for generic value.
The best way could be to access the name in the same array's value but I think it's not possible.

Revision history for this message
Guillaume Rosaire (zerog) wrote :

Just to make sure, you can have localized arrays.xml file in each res/values-* directory (or at least that's what I believe).

i.e, rather than having arrays.xml using strings.xml for translation
<pre>
    <string-array name="mode_of_transport_types">
        <item>@string/car</item>
        <item>@string/bicycle</item>
        <item>@string/walking</item>
    </string-array>
</pre>

you can extend the default res/values/arrays.xml with some translated values in res/values-fr/arrays.xml with
<pre>
    <string-array name="mode_of_transport_types">
        <item>Voiture</item>
        <item>Cycle</item>
        <item>Piéton</item>
    </string-array>
</pre>
(and keep <string-array name="mode_of_transport_types_osmvalue"> in the default not translated values/arrays.xml)

Revision history for this message
Murphy (murphy2712+launchpad) wrote :

Yes, translation works like this, but since these 2 arrays are very, very closely related (any add/change/remove could shift the translations), I prefer to leave these 2 arrays together (I've put a note in comments explaining that) and delegate the translation to strings.xml .

Revision history for this message
Murphy (murphy2712+launchpad) wrote :

Here's the patch file.
I didn't removed SelectPOIActivity.java yet in this patch.

Revision history for this message
Murphy (murphy2712+launchpad) wrote :

Last patch is not correct, prefer this one.

Revision history for this message
Murphy (murphy2712+launchpad) wrote :

oops I've deleted the wrong one.
So here's another patch :)

Revision history for this message
Kieran Fleming (kieran-fleming) wrote :

Sorry Murphy, this one slipped past me. I think the UI is good considering the need to keep it in the top half of the screen. Are you happy for me to commit it?

Revision history for this message
chris_debian (cjhandrew) wrote :

kizza wrote:
> Sorry Murphy, this one slipped past me. I think the UI is good considering the need to keep it in the top half of the screen. Are you happy for me to commit it?

Hopefully! Sounds like a good idea.

Chris.

Revision history for this message
Murphy (murphy2712+launchpad) wrote :

kizza wrote:
> Sorry Murphy, this one slipped past me. I think the UI is good considering the need to keep it in the top half of the screen. Are you happy for me to commit it?

I've updated the patch with recent changes, but I'm not at home now, I will upload it soon.

Revision history for this message
Murphy (murphy2712+launchpad) wrote :

I've updated the patch using last commits,
could you try this apk?

Revision history for this message
chris_debian (cjhandrew) wrote :

Will download now and test. Thanks for doing this.

Chris.

Revision history for this message
Murphy (murphy2712+launchpad) wrote :

Sorry for last release, I forgot to remove the POI menu.
Thanks for testing.

Revision history for this message
chris_debian (cjhandrew) wrote :

This works well for me; anyone else tried it?

Can we consider closing?

Chris.

Revision history for this message
Guillaume Rosaire (zerog) wrote :

patch OpenSatNav-issue9.patch Applied in rev 112

Revision history for this message
chris_debian (cjhandrew) wrote :

ZeroG wrote:
> patch OpenSatNav-issue9.patch Applied in rev 112

Many thanks.

Chris.

Revision history for this message
chris_debian (cjhandrew) wrote :

Downloaded APK 112 and this works well on my G1. Happy to close this issue if nobody has objections.

Good work!

Chris.

Revision history for this message
chris_debian (cjhandrew) wrote :

I'm closing this as it seems to be implemented and working. This can be changed if necessary.

Chris.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.