alidiepuit / osmtracker-android

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

Text is cut off when in landscape mode #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use HTC Desire
2. Start OSMTracker
3. Rotate phone to landscape mode

What is the expected output? What do you see instead?
Layout of buttons rotates however the text is obscured in landscape view below 
other buttons overlapping.

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

Make/model of your device, and Android version?
HTC Desire - Telstra Branded

Please provide any additional information below.
Alignment of images and text in landscape view must be modified in order to 
display text correctly.

Original issue reported on code.google.com by michaelw...@gmail.com on 19 Jun 2010 at 10:24

GoogleCodeExporter commented 9 years ago
Hi,

a possible solution would be to have an extra layout for landscape orientation 
in 'res/xml-land-de' which has the row layout 4x3 instead of 3x4. 
The layouts which have 12 buttons work well with this. (tested with Emulator 
and Milestone, German language)
The layouts that have more than 12 icons still have some texts that are not 
shown completely.

I think the standard layout needs to be changed to have a maximum of 12 buttons 
on it. But without loosing some buttons in the standard layout, this could only 
be realized by having "sub-sub-screens", smaller icons or smaller text.
IMHO only sub-sub-screens make sense because the texts and icons are already 
very small.

Perhaps it would be possible to remove voicerec, picture and textnote from the 
pages which have already more than 12 buttons?

Another issue to think about: If using different layouts for landscape / 
portrait the hardcoded label strings should be moved to 
"res/values-de/strings.xml". Otherwise it would be much harder to add a new 
translation.

If there are good ideas on how to change the layout structure, i could try to 
make a patch for this.

best regards
Matthias

PS: Attached is the file from "res/xml-de-land/" i tested with.

Original comment by matthias...@gmail.com on 26 Jul 2010 at 11:02

Attachments:

GoogleCodeExporter commented 9 years ago
That sounds like a well thought out solution. However will this scale to 
different devices with different aspect ratios? Could we possibly use SVG for 
icons which will resize for the space allocated for the button icon?

Original comment by michaelw...@gmail.com on 27 Jul 2010 at 2:45

GoogleCodeExporter commented 9 years ago
Hi,

I'm not sure if SVG is supported in Android, I've never read something about 
SVG in the docs.

But Android has some generalized screen types which could be handled by 
defining different button layouts for different screen types. This should be ok 
for the moment.
But I think issue #52 needs be done before this one here can be solved.

Information about the screen classes:
http://developer.android.com/guide/practices/screens_support.html
http://developer.android.com/resources/dashboard/screens.html

Best regards,
Matthias

Original comment by matthias...@gmail.com on 28 Jul 2010 at 9:01

GoogleCodeExporter commented 9 years ago
I didn't notice that layouts were broken in landscape mode, damn...

A pragmatic solution is to create another layout for landscape orientation as 
suggested by matthias.glaub however it duplicates translations unless labels 
reference strings resources, which I'm not fond of (See issue #52).

Maybe another way would to process the layout file differently depending of the 
orientation: If the phone is in landscape mode, each <row> tag could be treated 
as a column, inverting layout dimension (3x4 -> 4x3) and solving the thing 
without having to write a separate layout file...

Original comment by nguillau...@gmail.com on 1 Aug 2010 at 2:34

GoogleCodeExporter commented 9 years ago
Odd, I can't have the TableRow act as a column when setting orientation 
attribute to "vertical". Too bad as it would be a simple and easy fix...

Original comment by nguillau...@gmail.com on 1 Aug 2010 at 3:22

GoogleCodeExporter commented 9 years ago
Hi,

another solution would be the following:
If in Landscape mode, the icons could be displayed at the left side of the 
button. (see attached screenshot and patch)

perhaps (in a second step) one could make it configurable in 
default_buttons_layout.xml with an attribute like:
iconPos=[auto|top|left|right|buttom]
where auto means that layout will be automaticaly choose the icon position 
depending on screen orientation and top, left, right and bottom will make the 
icon fixed on the specified position.

best regards
Matthias 

Original comment by matthias...@gmail.com on 1 Aug 2010 at 9:36

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

the following patch adds the possibility to define the position of an icon for 
a layout.

example:
<layout name="root" iconpos="left">
will make the icons appear at the left side of the button

<layout name="root" iconpos="right">
will make the icons appear at the left side of the button

<layout name="root" iconpos="top">
will make the icons appear at the top side of the button

<layout name="root" iconpos="bottom">
will make the icons appear at the bottom side of the button

<layout name="root" iconpos="auto">
will make the icons appear at the top of a button when in portrait orientation 
and on the left of a button when in landscape orientation

Additionally i fixed some unescaped ' signs in the values and strings because 
my eclipse always says there are errors in the project if there are unescaped ' 
signs.
And also changed the generation of intent names to reduce the use of methods 
when defining them.

@nguillaumin: could you please check this patch and give some feedback if this 
is ok?

Best regards
Matthias

Original comment by matthias...@gmail.com on 21 Aug 2010 at 2:02

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for your patches, I really appreciate it. I'm currently in deep work to 
support multiple tracks, so I don't want to include patches at the same time 
but I'll definitively have a look when I'm done with multiple tracks (issue 
#54).

Original comment by nguillau...@gmail.com on 21 Aug 2010 at 2:58

GoogleCodeExporter commented 9 years ago
This is a big one. On my G1 where I use the physical keyboard a lot, I'm almost 
always in landscape mode, and need to go into portrait a lot of the time just 
to see what button to click.

I believe that according to the Android developer guidelines, a separate layout 
should be made for Landscape.

But because the strings are hardcoded in the layout (which is also against the 
recommendation), we are in the situation where it would duplicate the number of 
hardcoded strings, which is obviously a bad solution. I believe nguillaumin 
isn't fan of putting the strings in the strings resource file, but I'm afraid 
it's the only viable solution if we want both translations AND useful landscape 
mode... So this issue is pretty much tied to issue #52.

Original comment by emilien.klein on 24 Sep 2010 at 9:00

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I, too, had seen the landscape layout issue and I hacked up a solution of my 
own.
I only realized after I finished that Matthias had submitted a neat solution 
already.

Rather than just throw away my code, I though I'd put it up here in case there 
is anything in it that might be of use. 
The approach leaves the text under the buttons but rearranges the button layout 
by rotating it counter to the rotation of the phone. The attached images show a 
layout where there are a different number of buttons on each row.

Original comment by oshea.p...@gmail.com on 9 Nov 2010 at 9:53

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

i commited the patch of comment#7 to the repository.

@Paul:
does your patch also work on pages that have 12 or 15 icons on it?

best regards
Matthias

Original comment by matthias...@gmail.com on 27 Nov 2010 at 4:26

GoogleCodeExporter commented 9 years ago
 Hi Matthias,

The patch I supplied should work for all layouts. The images I uploaded show 
the worst case scenario where there are different numbers of buttons on each 
row.

However, I think that your patch is neater overall and more faithfully 
preserves the row based structure of the layout XML.

- Paul.

Original comment by oshea.p...@gmail.com on 28 Nov 2010 at 10:58

GoogleCodeExporter commented 9 years ago
Hi Paul,

thanks, i will mark it as fixed now.

best regards
Matthias

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

GoogleCodeExporter commented 9 years ago
Thanks for that ! I just updated the CustomButtonsLayouts wiki page with this 
new attribute.

Original comment by nicolas@guillaumin.me on 29 Nov 2010 at 8:14